[USB]
[reactos.git] / reactos / ntoskrnl / config / cmdata.c
1 /*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/config/cmdata.c
5 * PURPOSE: Configuration Manager - Global Configuration Data
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8
9 /* INCLUDES ******************************************************************/
10
11 #include "ntoskrnl.h"
12 #define NDEBUG
13 #include "debug.h"
14 #include "./../mm/ARM3/miarm.h"
15
16 /* GLOBALS *******************************************************************/
17
18 ULONG DummyData;
19 ULONG CmNtGlobalFlag;
20 extern ULONG MmProductType;
21
22 WCHAR CmDefaultLanguageId[12];
23 ULONG CmDefaultLanguageIdLength = sizeof(CmDefaultLanguageId);
24 ULONG CmDefaultLanguageIdType;
25
26 WCHAR CmInstallUILanguageId[12];
27 ULONG CmInstallUILanguageIdLength = sizeof(CmInstallUILanguageId);
28 ULONG CmInstallUILanguageIdType;
29
30 WCHAR CmSuiteBuffer[128];
31 ULONG CmSuiteBufferLength = sizeof(CmSuiteBuffer);
32 ULONG CmSuiteBufferType;
33
34 CMHIVE CmControlHive;
35
36 ULONG CmpConfigurationAreaSize = PAGE_SIZE * 4;
37 PCM_FULL_RESOURCE_DESCRIPTOR CmpConfigurationData;
38
39 EX_PUSH_LOCK CmpHiveListHeadLock, CmpLoadHiveLock;
40
41 HIVE_LIST_ENTRY CmpMachineHiveList[] =
42 {
43 { L"HARDWARE", L"MACHINE\\", NULL, HIVE_VOLATILE , 0 , NULL, FALSE, FALSE, FALSE},
44 { L"SECURITY", L"MACHINE\\", NULL, 0 , 0 , NULL, FALSE, FALSE, FALSE},
45 { L"SOFTWARE", L"MACHINE\\", NULL, 0 , 0 , NULL, FALSE, FALSE, FALSE},
46 { L"SYSTEM", L"MACHINE\\", NULL, 0 , 0 , NULL, FALSE, FALSE, FALSE},
47 { L"DEFAULT", L"USER\\.DEFAULT", NULL, 0 , 0 , NULL, FALSE, FALSE, FALSE},
48 { L"SAM", L"MACHINE\\", NULL, HIVE_NOLAZYFLUSH , 0 , NULL, FALSE, FALSE, FALSE},
49 { NULL, NULL, 0, 0 , 0 , NULL, FALSE, FALSE, FALSE}
50 };
51
52 UNICODE_STRING CmSymbolicLinkValueName =
53 RTL_CONSTANT_STRING(L"SymbolicLinkValue");
54
55 UNICODE_STRING CmpLoadOptions;
56
57 BOOLEAN CmpShareSystemHives;
58 BOOLEAN CmSelfHeal = TRUE;
59 BOOLEAN CmpSelfHeal = TRUE;
60 BOOLEAN CmpMiniNTBoot;
61 ULONG CmpBootType;
62
63 USHORT CmpUnknownBusCount;
64 ULONG CmpTypeCount[MaximumType + 1];
65
66 HANDLE CmpRegistryRootHandle;
67
68 INIT_FUNCTION UNICODE_STRING CmClassName[MaximumClass + 1] =
69 {
70 RTL_CONSTANT_STRING(L"System"),
71 RTL_CONSTANT_STRING(L"Processor"),
72 RTL_CONSTANT_STRING(L"Cache"),
73 RTL_CONSTANT_STRING(L"Adapter"),
74 RTL_CONSTANT_STRING(L"Controller"),
75 RTL_CONSTANT_STRING(L"Peripheral"),
76 RTL_CONSTANT_STRING(L"MemoryClass"),
77 RTL_CONSTANT_STRING(L"Undefined")
78 };
79
80 INIT_FUNCTION UNICODE_STRING CmTypeName[MaximumType + 1] =
81 {
82 RTL_CONSTANT_STRING(L"System"),
83 RTL_CONSTANT_STRING(L"CentralProcessor"),
84 RTL_CONSTANT_STRING(L"FloatingPointProcessor"),
85 RTL_CONSTANT_STRING(L"PrimaryICache"),
86 RTL_CONSTANT_STRING(L"PrimaryDCache"),
87 RTL_CONSTANT_STRING(L"SecondaryICache"),
88 RTL_CONSTANT_STRING(L"SecondaryDCache"),
89 RTL_CONSTANT_STRING(L"SecondaryCache"),
90 RTL_CONSTANT_STRING(L"EisaAdapter"),
91 RTL_CONSTANT_STRING(L"TcAdapter"),
92 RTL_CONSTANT_STRING(L"ScsiAdapter"),
93 RTL_CONSTANT_STRING(L"DtiAdapter"),
94 RTL_CONSTANT_STRING(L"MultifunctionAdapter"),
95 RTL_CONSTANT_STRING(L"DiskController"),
96 RTL_CONSTANT_STRING(L"TapeController"),
97 RTL_CONSTANT_STRING(L"CdRomController"),
98 RTL_CONSTANT_STRING(L"WormController"),
99 RTL_CONSTANT_STRING(L"SerialController"),
100 RTL_CONSTANT_STRING(L"NetworkController"),
101 RTL_CONSTANT_STRING(L"DisplayController"),
102 RTL_CONSTANT_STRING(L"ParallelController"),
103 RTL_CONSTANT_STRING(L"PointerController"),
104 RTL_CONSTANT_STRING(L"KeyboardController"),
105 RTL_CONSTANT_STRING(L"AudioController"),
106 RTL_CONSTANT_STRING(L"OtherController"),
107 RTL_CONSTANT_STRING(L"DiskPeripheral"),
108 RTL_CONSTANT_STRING(L"FloppyDiskPeripheral"),
109 RTL_CONSTANT_STRING(L"TapePeripheral"),
110 RTL_CONSTANT_STRING(L"ModemPeripheral"),
111 RTL_CONSTANT_STRING(L"MonitorPeripheral"),
112 RTL_CONSTANT_STRING(L"PrinterPeripheral"),
113 RTL_CONSTANT_STRING(L"PointerPeripheral"),
114 RTL_CONSTANT_STRING(L"KeyboardPeripheral"),
115 RTL_CONSTANT_STRING(L"TerminalPeripheral"),
116 RTL_CONSTANT_STRING(L"OtherPeripheral"),
117 RTL_CONSTANT_STRING(L"LinePeripheral"),
118 RTL_CONSTANT_STRING(L"NetworkPeripheral"),
119 RTL_CONSTANT_STRING(L"SystemMemory"),
120 RTL_CONSTANT_STRING(L"DockingInformation"),
121 RTL_CONSTANT_STRING(L"RealModeIrqRoutingTable"),
122 RTL_CONSTANT_STRING(L"RealModePCIEnumeration"),
123 RTL_CONSTANT_STRING(L"Undefined")
124 };
125
126 INIT_FUNCTION CMP_MF_TYPE CmpMultifunctionTypes[] =
127 {
128 {"ISA", Isa, 0},
129 {"MCA", MicroChannel, 0},
130 {"PCI", PCIBus, 0},
131 {"VME", VMEBus, 0},
132 {"PCMCIA", PCMCIABus, 0},
133 {"CBUS", CBus, 0},
134 {"MPIPI", MPIBus, 0},
135 {"MPSA", MPSABus, 0},
136 {NULL, Internal, 0}
137 };
138
139 INIT_FUNCTION CM_SYSTEM_CONTROL_VECTOR CmControlVector[] =
140 {
141 {
142 L"Session Manager",
143 L"ProtectionMode",
144 &DummyData,
145 NULL,
146 NULL
147 },
148
149 {
150 L"Session Manager",
151 L"ObjectSecurityMode",
152 &DummyData,
153 NULL,
154 NULL
155 },
156
157 {
158 L"Session Manager",
159 L"LUIDDeviceMapsDisabled",
160 &DummyData,
161 NULL,
162 NULL
163 },
164
165 {
166 L"LSA",
167 L"AuditBaseDirectories",
168 &DummyData,
169 NULL,
170 NULL
171 },
172
173 {
174 L"LSA",
175 L"AuditBaseObjects",
176 &DummyData,
177 NULL,
178 NULL
179 },
180
181 {
182 L"LSA\\audit",
183 L"ProcessAccessesToAudit",
184 &DummyData,
185 NULL,
186 NULL
187 },
188
189 {
190 L"TimeZoneInformation",
191 L"ActiveTimeBias",
192 &DummyData,
193 NULL,
194 NULL
195 },
196
197 {
198 L"TimeZoneInformation",
199 L"Bias",
200 &DummyData,
201 NULL,
202 NULL
203 },
204
205 {
206 L"TimeZoneInformation",
207 L"RealTimeIsUniversal",
208 &DummyData,
209 NULL,
210 NULL
211 },
212
213 {
214 L"Session Manager",
215 L"GlobalFlag",
216 &CmNtGlobalFlag,
217 NULL,
218 NULL
219 },
220
221 {
222 L"Session Manager\\Memory Management",
223 L"PagedPoolQuota",
224 &DummyData,
225 NULL,
226 NULL
227 },
228
229 {
230 L"Session Manager\\Memory Management",
231 L"NonPagedPoolQuota",
232 &DummyData,
233 NULL,
234 NULL
235 },
236
237 {
238 L"Session Manager\\Memory Management",
239 L"PagingFileQuota",
240 &DummyData,
241 NULL,
242 NULL
243 },
244
245 {
246 L"Session Manager\\Memory Management",
247 L"AllocationPreference",
248 &DummyData,
249 NULL,
250 NULL
251 },
252
253 {
254 L"Session Manager\\Memory Management",
255 L"DynamicMemory",
256 &MmDynamicPfn,
257 NULL,
258 NULL
259 },
260
261 {
262 L"Session Manager\\Memory Management",
263 L"Mirroring",
264 &MmMirroring,
265 NULL,
266 NULL
267 },
268
269 {
270 L"Session Manager\\Memory Management",
271 L"SystemViewSize",
272 &DummyData,
273 NULL,
274 NULL
275 },
276
277 {
278 L"Session Manager\\Memory Management",
279 L"SessionImageSize",
280 &DummyData,
281 NULL,
282 NULL
283 },
284
285 {
286 L"Session Manager\\Memory Management",
287 L"SessionPoolSize",
288 &DummyData,
289 NULL,
290 NULL
291 },
292
293 {
294 L"Session Manager\\Memory Management",
295 L"PoolUsageMaximum",
296 &MmConsumedPoolPercentage,
297 NULL,
298 NULL
299 },
300
301 {
302 L"Session Manager\\Memory Management",
303 L"MapAllocationFragment",
304 &MmAllocationFragment,
305 NULL,
306 NULL
307 },
308
309 {
310 L"Session Manager\\Memory Management",
311 L"PagedPoolSize",
312 &MmSizeOfPagedPoolInBytes,
313 NULL,
314 NULL
315 },
316
317 {
318 L"Session Manager\\Memory Management",
319 L"NonPagedPoolSize",
320 &MmSizeOfNonPagedPoolInBytes,
321 NULL,
322 NULL
323 },
324
325 {
326 L"Session Manager\\Memory Management",
327 L"NonPagedPoolMaximumPercent",
328 &DummyData,
329 NULL,
330 NULL
331 },
332
333 {
334 L"Session Manager\\Memory Management",
335 L"LargeSystemCache",
336 &MmLargeSystemCache,
337 NULL,
338 NULL
339 },
340
341 {
342 L"Session Manager\\Memory Management",
343 L"LargeStackSize",
344 &DummyData,
345 NULL,
346 NULL
347 },
348
349 {
350 L"Session Manager\\Memory Management",
351 L"SystemPages",
352 &MmNumberOfSystemPtes,
353 NULL,
354 NULL
355 },
356
357 {
358 L"Session Manager\\Memory Management",
359 L"LowMemoryThreshold",
360 &MmLowMemoryThreshold,
361 NULL,
362 NULL
363 },
364
365 {
366 L"Session Manager\\Memory Management",
367 L"HighMemoryThreshold",
368 &MmHighMemoryThreshold,
369 NULL,
370 NULL
371 },
372
373 {
374 L"Session Manager\\Memory Management",
375 L"DisablePagingExecutive",
376 &MmDisablePagingExecutive,
377 NULL,
378 NULL
379 },
380
381 {
382 L"Session Manager\\Memory Management",
383 L"ModifiedPageLife",
384 &DummyData,
385 NULL,
386 NULL
387 },
388
389 {
390 L"Session Manager\\Memory Management",
391 L"SecondLevelDataCache",
392 &MmSecondaryColors,
393 NULL,
394 NULL
395 },
396
397 {
398 L"Session Manager\\Memory Management",
399 L"ClearPageFileAtShutdown",
400 &MmZeroPageFile,
401 NULL,
402 NULL
403 },
404
405 {
406 L"Session Manager\\Memory Management",
407 L"PoolTagSmallTableSize",
408 &DummyData,
409 NULL,
410 NULL
411 },
412
413 {
414 L"Session Manager\\Memory Management",
415 L"PoolTagBigTableSize",
416 &DummyData,
417 NULL,
418 NULL
419 },
420
421 {
422 L"Session Manager\\Memory Management",
423 L"PoolTag",
424 &DummyData,
425 NULL,
426 NULL
427 },
428
429 {
430 L"Session Manager\\Memory Management",
431 L"PoolTagOverruns",
432 &DummyData,
433 NULL,
434 NULL
435 },
436
437 {
438 L"Session Manager\\Memory Management",
439 L"SnapUnloads",
440 &DummyData,
441 NULL,
442 NULL
443 },
444
445 {
446 L"Session Manager\\Memory Management",
447 L"ProtectNonPagedPool",
448 &MmProtectFreedNonPagedPool,
449 NULL,
450 NULL
451 },
452
453 {
454 L"Session Manager\\Memory Management",
455 L"TrackLockedPages",
456 &MmTrackLockedPages,
457 NULL,
458 NULL
459 },
460
461 {
462 L"Session Manager\\Memory Management",
463 L"TrackPtes",
464 &MmTrackPtes,
465 NULL,
466 NULL
467 },
468
469 {
470 L"Session Manager\\Memory Management",
471 L"VerifyDrivers",
472 MmVerifyDriverBuffer,
473 &MmVerifyDriverBufferLength,
474 &MmVerifyDriverBufferType
475 },
476
477 {
478 L"Session Manager\\Memory Management",
479 L"VerifyDriverLevel",
480 &MmVerifyDriverLevel,
481 NULL,
482 NULL
483 },
484
485 {
486 L"Session Manager\\Memory Management",
487 L"VerifyMode",
488 &DummyData,
489 NULL,
490 NULL
491 },
492
493 {
494 L"Session Manager\\Memory Management",
495 L"LargePageMinimum",
496 &DummyData,
497 NULL,
498 NULL
499 },
500
501 {
502 L"Session Manager\\Memory Management",
503 L"EnforceWriteProtection",
504 &MmEnforceWriteProtection,
505 NULL,
506 NULL
507 },
508
509 {
510 L"Session Manager\\Memory Management",
511 L"MakeLowMemory",
512 &MmMakeLowMemory,
513 NULL,
514 NULL
515 },
516
517 {
518 L"Session Manager\\Memory Management",
519 L"WriteWatch",
520 &DummyData,
521 NULL,
522 NULL
523 },
524
525 {
526 L"Session Manager\\Executive",
527 L"AdditionalCriticalWorkerThreads",
528 &DummyData,
529 NULL,
530 NULL
531 },
532
533 {
534 L"Session Manager\\Executive",
535 L"AdditionalDelayedWorkerThreads",
536 &DummyData,
537 NULL,
538 NULL
539 },
540
541 {
542 L"Session Manager\\Executive",
543 L"PriorityQuantumMatrix",
544 &DummyData,
545 &DummyData,
546 NULL
547 },
548
549 {
550 L"Session Manager\\Kernel",
551 L"DpcQueueDepth",
552 &DummyData,
553 NULL,
554 NULL
555 },
556
557 {
558 L"Session Manager\\Kernel",
559 L"MinimumDpcRate",
560 &DummyData,
561 NULL,
562 NULL
563 },
564
565 {
566 L"Session Manager\\Kernel",
567 L"AdjustDpcThreshold",
568 &DummyData,
569 NULL,
570 NULL
571 },
572
573 {
574 L"Session Manager\\Kernel",
575 L"IdealDpcRate",
576 &DummyData,
577 NULL,
578 NULL
579 },
580
581 {
582 L"Session Manager\\I/O System",
583 L"CountOperations",
584 &DummyData,
585 NULL,
586 NULL
587 },
588
589 {
590 L"Session Manager\\I/O System",
591 L"LargeIrpStackLocations",
592 &DummyData,
593 NULL,
594 NULL
595 },
596
597 {
598 L"Session Manager\\I/O System",
599 L"IoVerifierLevel",
600 &DummyData,
601 NULL,
602 NULL
603 },
604
605 {
606 L"Session Manager",
607 L"ResourceTimeoutCount",
608 &DummyData,
609 NULL,
610 NULL
611 },
612
613 {
614 L"Session Manager",
615 L"CriticalSectionTimeout",
616 &DummyData,
617 NULL,
618 NULL
619 },
620
621 {
622 L"Session Manager",
623 L"HeapSegmentReserve",
624 &DummyData,
625 NULL,
626 NULL
627 },
628
629 {
630 L"Session Manager",
631 L"HeapSegmentCommit",
632 &DummyData,
633 NULL,
634 NULL
635 },
636
637 {
638 L"Session Manager",
639 L"HeapDeCommitTotalFreeThreshold",
640 &DummyData,
641 NULL,
642 NULL
643 },
644
645 {
646 L"Session Manager",
647 L"HeapDeCommitFreeBlockThreshold",
648 &DummyData,
649 NULL,
650 NULL
651 },
652
653 {
654 L"ProductOptions",
655 L"ProductType",
656 &MmProductType,
657 NULL,
658 NULL
659 },
660
661 {
662 L"Terminal Server",
663 L"TSEnabled",
664 &DummyData,
665 NULL,
666 NULL
667 },
668
669 {
670 L"Terminal Server",
671 L"TSAppCompat",
672 &DummyData,
673 NULL,
674 NULL
675 },
676
677
678 {
679 L"ProductOptions",
680 L"ProductSuite",
681 CmSuiteBuffer,
682 &CmSuiteBufferLength,
683 &CmSuiteBufferType
684 },
685
686 {
687 L"Windows",
688 L"CSDVersion",
689 &CmNtCSDVersion,
690 NULL,
691 NULL
692 },
693
694 {
695 L"Nls\\Language",
696 L"Default",
697 CmDefaultLanguageId,
698 &CmDefaultLanguageIdLength,
699 &CmDefaultLanguageIdType
700 },
701
702 {
703 L"Nls\\Language",
704 L"InstallLanguage",
705 CmInstallUILanguageId,
706 &CmInstallUILanguageIdLength,
707 &CmInstallUILanguageIdType
708 },
709
710 {
711 L"\0\0",
712 L"RegistrySizeLimit",
713 &DummyData,
714 &DummyData,
715 &DummyData
716 },
717
718 {
719 L"Session Manager",
720 L"ForceNpxEmulation",
721 &DummyData,
722 NULL,
723 NULL
724 },
725
726 {
727 L"Session Manager",
728 L"PowerPolicySimulate",
729 &DummyData,
730 NULL,
731 NULL
732 },
733
734 {
735 L"Session Manager\\Executive",
736 L"MaxTimeSeparationBeforeCorrect",
737 &DummyData,
738 NULL,
739 NULL
740 },
741
742 {
743 L"Windows",
744 L"ShutdownTime",
745 &DummyData,
746 &DummyData,
747 NULL
748 },
749
750 {
751 L"PriorityControl",
752 L"Win32PrioritySeparation",
753 &DummyData,
754 NULL,
755 NULL
756 },
757
758 {
759 L"Session Manager",
760 L"EnableTimerWatchdog",
761 &DummyData,
762 NULL,
763 NULL
764 },
765
766 {
767 L"Session Manager",
768 L"Debugger Retries",
769 &KdpContext.KdpDefaultRetries,
770 NULL,
771 NULL
772 },
773
774 {
775 L"Session Manager\\Debug Print Filter",
776 L"WIN2000",
777 &Kd_WIN2000_Mask,
778 NULL,
779 NULL
780 },
781
782 /* TODO: Add the other masks */
783
784 {
785 L"WMI",
786 L"MaxEventSize",
787 &DummyData,
788 NULL,
789 NULL
790 },
791
792 {
793 L"WMI\\Trace",
794 L"UsePerformanceClock",
795 &DummyData,
796 NULL,
797 NULL
798 },
799
800 {
801 L"WMI\\Trace",
802 L"TraceAlignment",
803 &DummyData,
804 NULL,
805 NULL
806 },
807
808 {
809 NULL,
810 NULL,
811 NULL,
812 NULL,
813 NULL
814 }
815 };