[NTOSKRNL/USERINIT/WIN32K]
[reactos.git] / reactos / ntoskrnl / include / internal / cm.h
1 /*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/cm/cm.h
5 * PURPOSE: Internal header for the Configuration Manager
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8 #define _CM_
9 #include "cmlib.h"
10
11 //
12 // Define this if you want debugging support
13 //
14 #define _CM_DEBUG_ 0x00
15
16 //
17 // These define the Debug Masks Supported
18 //
19 #define CM_HANDLE_DEBUG 0x01
20 #define CM_NAMESPACE_DEBUG 0x02
21 #define CM_SECURITY_DEBUG 0x04
22 #define CM_REFERENCE_DEBUG 0x08
23 #define CM_CALLBACK_DEBUG 0x10
24
25 //
26 // Debug/Tracing support
27 //
28 #if _CM_DEBUG_
29 #ifdef NEW_DEBUG_SYSTEM_IMPLEMENTED // enable when Debug Filters are implemented
30 #define CMTRACE DbgPrintEx
31 #else
32 #define CMTRACE(x, ...) \
33 if (x & CmpTraceLevel) DbgPrint(__VA_ARGS__)
34 #endif
35 #else
36 #define CMTRACE(x, ...) DPRINT(__VA_ARGS__)
37 #endif
38
39 //
40 // Hack since bigkeys are not yet supported
41 //
42 #define ASSERT_VALUE_BIG(h, s) \
43 ASSERTMSG("Big keys not supported!", !CmpIsKeyValueBig(h, s));
44
45 //
46 // CM_KEY_CONTROL_BLOCK Signatures
47 //
48 #define CM_KCB_SIGNATURE 'bKmC'
49 #define CM_KCB_INVALID_SIGNATURE '4FmC'
50
51 //
52 // CM_KEY_CONTROL_BLOCK Flags
53 //
54 #define CM_KCB_NO_SUBKEY 0x01
55 #define CM_KCB_SUBKEY_ONE 0x02
56 #define CM_KCB_SUBKEY_HINT 0x04
57 #define CM_KCB_SYM_LINK_FOUND 0x08
58 #define CM_KCB_KEY_NON_EXIST 0x10
59 #define CM_KCB_NO_DELAY_CLOSE 0x20
60 #define CM_KCB_INVALID_CACHED_INFO 0x40
61 #define CM_KCB_READ_ONLY_KEY 0x80
62
63 //
64 // CM_KEY_VALUE Types
65 //
66 #define CM_KEY_VALUE_SMALL 0x4
67 #define CM_KEY_VALUE_BIG 0x3FD8
68 #define CM_KEY_VALUE_SPECIAL_SIZE 0x80000000
69
70 //
71 // Number of various lists and hashes
72 //
73 #define CMP_SECURITY_HASH_LISTS 64
74 #define CMP_MAX_CALLBACKS 100
75
76 //
77 // Hashing Constants
78 //
79 #define CMP_HASH_IRRATIONAL 314159269
80 #define CMP_HASH_PRIME 1000000007
81
82 //
83 // CmpCreateKeyControlBlock Flags
84 //
85 #define CMP_CREATE_FAKE_KCB 0x1
86 #define CMP_LOCK_HASHES_FOR_KCB 0x2
87
88 //
89 // CmpDoCreate and CmpDoOpen flags
90 //
91 #define CMP_CREATE_KCB_KCB_LOCKED 0x2
92 #define CMP_OPEN_KCB_NO_CREATE 0x4
93
94 //
95 // EnlistKeyBodyWithKCB Flags
96 //
97 #define CMP_ENLIST_KCB_LOCKED_SHARED 0x1
98 #define CMP_ENLIST_KCB_LOCKED_EXCLUSIVE 0x2
99
100 //
101 // Unload Flags
102 //
103 #define CMP_UNLOCK_KCB_LOCKED 0x1
104 #define CMP_UNLOCK_REGISTRY_LOCKED 0x2
105
106 //
107 // Maximum size of Value Cache
108 //
109 #define MAXIMUM_CACHED_DATA 2 * PAGE_SIZE
110
111 //
112 // Hives to load on startup
113 //
114 #define CM_NUMBER_OF_MACHINE_HIVES 6
115
116 //
117 // Number of items that can fit inside an Allocation Page
118 //
119 #define CM_KCBS_PER_PAGE \
120 ((PAGE_SIZE - FIELD_OFFSET(CM_ALLOC_PAGE, AllocPage)) / sizeof(CM_KEY_CONTROL_BLOCK))
121 #define CM_DELAYS_PER_PAGE \
122 ((PAGE_SIZE - FIELD_OFFSET(CM_ALLOC_PAGE, AllocPage)) / sizeof(CM_DELAY_ALLOC))
123
124 //
125 // Value Search Results
126 //
127 typedef enum _VALUE_SEARCH_RETURN_TYPE
128 {
129 SearchSuccess,
130 SearchNeedExclusiveLock,
131 SearchFail
132 } VALUE_SEARCH_RETURN_TYPE;
133
134 //
135 // Key Hash
136 //
137 typedef struct _CM_KEY_HASH
138 {
139 ULONG ConvKey;
140 struct _CM_KEY_HASH *NextHash;
141 PHHIVE KeyHive;
142 HCELL_INDEX KeyCell;
143 } CM_KEY_HASH, *PCM_KEY_HASH;
144
145 //
146 // Key Hash Table Entry
147 //
148 typedef struct _CM_KEY_HASH_TABLE_ENTRY
149 {
150 EX_PUSH_LOCK Lock;
151 PKTHREAD Owner;
152 PCM_KEY_HASH Entry;
153 } CM_KEY_HASH_TABLE_ENTRY, *PCM_KEY_HASH_TABLE_ENTRY;
154
155 //
156 // Name Hash
157 //
158 typedef struct _CM_NAME_HASH
159 {
160 ULONG ConvKey;
161 struct _CM_NAME_HASH *NextHash;
162 USHORT NameLength;
163 WCHAR Name[ANYSIZE_ARRAY];
164 } CM_NAME_HASH, *PCM_NAME_HASH;
165
166 //
167 // Name Hash Table Entry
168 //
169 typedef struct _CM_NAME_HASH_TABLE_ENTRY
170 {
171 EX_PUSH_LOCK Lock;
172 PCM_NAME_HASH Entry;
173 } CM_NAME_HASH_TABLE_ENTRY, *PCM_NAME_HASH_TABLE_ENTRY;
174
175 //
176 // Key Security Cache
177 //
178 typedef struct _CM_KEY_SECURITY_CACHE
179 {
180 HCELL_INDEX Cell;
181 ULONG ConvKey;
182 LIST_ENTRY List;
183 ULONG DescriptorLength;
184 SECURITY_DESCRIPTOR_RELATIVE Descriptor;
185 } CM_KEY_SECURITY_CACHE, *PCM_KEY_SECURITY_CACHE;
186
187 //
188 // Key Security Cache Entry
189 //
190 typedef struct _CM_KEY_SECURITY_CACHE_ENTRY
191 {
192 HCELL_INDEX Cell;
193 PCM_KEY_SECURITY_CACHE CachedSecurity;
194 } CM_KEY_SECURITY_CACHE_ENTRY, *PCM_KEY_SECURITY_CACHE_ENTRY;
195
196 //
197 // Cached Child List
198 //
199 typedef struct _CACHED_CHILD_LIST
200 {
201 ULONG Count;
202 union
203 {
204 ULONG ValueList;
205 struct _CM_KEY_CONTROL_BLOCK *RealKcb;
206 };
207 } CACHED_CHILD_LIST, *PCACHED_CHILD_LIST;
208
209 //
210 // Index Hint Block
211 //
212 typedef struct _CM_INDEX_HINT_BLOCK
213 {
214 ULONG Count;
215 ULONG HashKey[ANYSIZE_ARRAY];
216 } CM_INDEX_HINT_BLOCK, *PCM_INDEX_HINT_BLOCK;
217
218 //
219 // Key Body
220 //
221 typedef struct _CM_KEY_BODY
222 {
223 ULONG Type;
224 struct _CM_KEY_CONTROL_BLOCK *KeyControlBlock;
225 struct _CM_NOTIFY_BLOCK *NotifyBlock;
226 HANDLE ProcessID;
227 LIST_ENTRY KeyBodyList;
228 } CM_KEY_BODY, *PCM_KEY_BODY;
229
230 //
231 // Name Control Block (NCB)
232 //
233 typedef struct _CM_NAME_CONTROL_BLOCK
234 {
235 BOOLEAN Compressed;
236 USHORT RefCount;
237 union
238 {
239 CM_NAME_HASH NameHash;
240 struct
241 {
242 ULONG ConvKey;
243 PCM_KEY_HASH NextHash;
244 USHORT NameLength;
245 WCHAR Name[ANYSIZE_ARRAY];
246 };
247 };
248 } CM_NAME_CONTROL_BLOCK, *PCM_NAME_CONTROL_BLOCK;
249
250 //
251 // Key Control Block (KCB)
252 //
253 typedef struct _CM_KEY_CONTROL_BLOCK
254 {
255 ULONG Signature;
256 USHORT RefCount;
257 USHORT Flags;
258 struct
259 {
260 ULONG ExtFlags:8;
261 ULONG PrivateAlloc:1;
262 ULONG Delete:1;
263 ULONG DelayedCloseIndex:12;
264 ULONG TotalLevels:10;
265 };
266 union
267 {
268 CM_KEY_HASH KeyHash;
269 struct
270 {
271 ULONG ConvKey;
272 PCM_KEY_HASH NextHash;
273 PHHIVE KeyHive;
274 HCELL_INDEX KeyCell;
275 };
276 };
277 struct _CM_KEY_CONTROL_BLOCK *ParentKcb;
278 PCM_NAME_CONTROL_BLOCK NameBlock;
279 PCM_KEY_SECURITY_CACHE CachedSecurity;
280 CACHED_CHILD_LIST ValueCache;
281 union
282 {
283 PCM_INDEX_HINT_BLOCK IndexHint;
284 ULONG HashKey;
285 ULONG SubKeyCount;
286 };
287 union
288 {
289 LIST_ENTRY KeyBodyListHead;
290 LIST_ENTRY FreeListEntry;
291 };
292 PCM_KEY_BODY KeyBodyArray[4];
293 PVOID DelayCloseEntry;
294 LARGE_INTEGER KcbLastWriteTime;
295 USHORT KcbMaxNameLen;
296 USHORT KcbMaxValueNameLen;
297 ULONG KcbMaxValueDataLen;
298 ULONG InDelayClose;
299 } CM_KEY_CONTROL_BLOCK, *PCM_KEY_CONTROL_BLOCK;
300
301 //
302 // Notify Block
303 //
304 typedef struct _CM_NOTIFY_BLOCK
305 {
306 LIST_ENTRY HiveList;
307 LIST_ENTRY PostList;
308 PCM_KEY_CONTROL_BLOCK KeyControlBlock;
309 PCM_KEY_BODY KeyBody;
310 ULONG Filter:29;
311 ULONG WatchTree:30;
312 ULONG NotifyPending:31;
313 } CM_NOTIFY_BLOCK, *PCM_NOTIFY_BLOCK;
314
315 //
316 // Re-map Block
317 //
318 typedef struct _CM_CELL_REMAP_BLOCK
319 {
320 HCELL_INDEX OldCell;
321 HCELL_INDEX NewCell;
322 } CM_CELL_REMAP_BLOCK, *PCM_CELL_REMAP_BLOCK;
323
324 //
325 // Allocation Page
326 //
327 typedef struct _CM_ALLOC_PAGE
328 {
329 ULONG FreeCount;
330 ULONG Reserved;
331 PVOID AllocPage;
332 } CM_ALLOC_PAGE, *PCM_ALLOC_PAGE;
333
334 //
335 // Allocation Page Entry
336 //
337 typedef struct _CM_DELAY_ALLOC
338 {
339 LIST_ENTRY ListEntry;
340 PCM_KEY_CONTROL_BLOCK Kcb;
341 } CM_DELAY_ALLOC, *PCM_DELAY_ALLOC;
342
343 //
344 // Delayed Close Entry
345 //
346 typedef struct _CM_DELAYED_CLOSE_ENTRY
347 {
348 LIST_ENTRY DelayedLRUList;
349 PCM_KEY_CONTROL_BLOCK KeyControlBlock;
350 } CM_DELAYED_CLOSE_ENTRY, *PCM_DELAYED_CLOSE_ENTRY;
351
352 //
353 // Delayed KCB Dereference Entry
354 //
355 typedef struct _CM_DELAY_DEREF_KCB_ITEM
356 {
357 LIST_ENTRY ListEntry;
358 PCM_KEY_CONTROL_BLOCK Kcb;
359 } CM_DELAY_DEREF_KCB_ITEM, *PCM_DELAY_DEREF_KCB_ITEM;
360
361 //
362 // Use Count Log and Entry
363 //
364 typedef struct _CM_USE_COUNT_LOG_ENTRY
365 {
366 HCELL_INDEX Cell;
367 PVOID Stack[7];
368 } CM_USE_COUNT_LOG_ENTRY, *PCM_USE_COUNT_LOG_ENTRY;
369
370 typedef struct _CM_USE_COUNT_LOG
371 {
372 USHORT Next;
373 USHORT Size;
374 CM_USE_COUNT_LOG_ENTRY Log[32];
375 } CM_USE_COUNT_LOG, *PCM_USE_COUNT_LOG;
376
377 //
378 // Configuration Manager Hive Structure
379 //
380 typedef struct _CMHIVE
381 {
382 HHIVE Hive;
383 HANDLE FileHandles[HFILE_TYPE_MAX];
384 LIST_ENTRY NotifyList;
385 LIST_ENTRY HiveList;
386 EX_PUSH_LOCK HiveLock;
387 PKTHREAD HiveLockOwner;
388 PKGUARDED_MUTEX ViewLock;
389 PKTHREAD ViewLockOwner;
390 EX_PUSH_LOCK WriterLock;
391 PKTHREAD WriterLockOwner;
392 PERESOURCE FlusherLock;
393 EX_PUSH_LOCK SecurityLock;
394 PKTHREAD HiveSecurityLockOwner;
395 LIST_ENTRY LRUViewListHead;
396 LIST_ENTRY PinViewListHead;
397 PFILE_OBJECT FileObject;
398 UNICODE_STRING FileFullPath;
399 UNICODE_STRING FileUserName;
400 USHORT MappedViews;
401 USHORT PinnedViews;
402 ULONG UseCount;
403 ULONG SecurityCount;
404 ULONG SecurityCacheSize;
405 LONG SecurityHitHint;
406 PCM_KEY_SECURITY_CACHE_ENTRY SecurityCache;
407 LIST_ENTRY SecurityHash[CMP_SECURITY_HASH_LISTS];
408 PKEVENT UnloadEvent;
409 PCM_KEY_CONTROL_BLOCK RootKcb;
410 BOOLEAN Frozen;
411 PWORK_QUEUE_ITEM UnloadWorkItem;
412 BOOLEAN GrowOnlyMode;
413 ULONG GrowOffset;
414 LIST_ENTRY KcbConvertListHead;
415 LIST_ENTRY KnodeConvertListHead;
416 PCM_CELL_REMAP_BLOCK CellRemapArray;
417 CM_USE_COUNT_LOG UseCountLog;
418 CM_USE_COUNT_LOG LockHiveLog;
419 ULONG Flags;
420 LIST_ENTRY TrustClassEntry;
421 ULONG FlushCount;
422 BOOLEAN HiveIsLoading;
423 PKTHREAD CreatorOwner;
424 } CMHIVE, *PCMHIVE;
425
426 //
427 // Cached Value Index
428 //
429 typedef struct _CM_CACHED_VALUE_INDEX
430 {
431 HCELL_INDEX CellIndex;
432 union
433 {
434 CELL_DATA CellData;
435 ULONG_PTR List[ANYSIZE_ARRAY];
436 } Data;
437 } CM_CACHED_VALUE_INDEX, *PCM_CACHED_VALUE_INDEX;
438
439 //
440 // Cached Value
441 //
442 typedef struct _CM_CACHED_VALUE
443 {
444 USHORT DataCacheType;
445 USHORT ValueKeySize;
446 ULONG HashKey;
447 CM_KEY_VALUE KeyValue;
448 } CM_CACHED_VALUE, *PCM_CACHED_VALUE;
449
450 //
451 // Hive List Entry
452 //
453 typedef struct _HIVE_LIST_ENTRY
454 {
455 PWSTR Name;
456 PWSTR BaseName;
457 PCMHIVE CmHive;
458 ULONG HHiveFlags;
459 ULONG CmHiveFlags;
460 PCMHIVE CmHive2;
461 BOOLEAN ThreadFinished;
462 BOOLEAN ThreadStarted;
463 BOOLEAN Allocate;
464 } HIVE_LIST_ENTRY, *PHIVE_LIST_ENTRY;
465
466 //
467 // Parse context for Key Object
468 //
469 typedef struct _CM_PARSE_CONTEXT
470 {
471 ULONG TitleIndex;
472 UNICODE_STRING Class;
473 ULONG CreateOptions;
474 ULONG Disposition;
475 CM_KEY_REFERENCE ChildHive;
476 HANDLE PredefinedHandle;
477 BOOLEAN CreateLink;
478 BOOLEAN CreateOperation;
479 PCMHIVE OriginatingPoint;
480 } CM_PARSE_CONTEXT, *PCM_PARSE_CONTEXT;
481
482 //
483 // MultiFunction Adapter Recognizer Structure
484 //
485 typedef struct _CMP_MF_TYPE
486 {
487 PCHAR Identifier;
488 USHORT InterfaceType;
489 USHORT Count;
490 } CMP_MF_TYPE, *PCMP_MF_TYPE;
491
492 //
493 // System Control Vector
494 //
495 typedef struct _CM_SYSTEM_CONTROL_VECTOR
496 {
497 PWCHAR KeyPath;
498 PWCHAR ValueName;
499 PVOID Buffer;
500 PULONG BufferLength;
501 PULONG Type;
502 } CM_SYSTEM_CONTROL_VECTOR, *PCM_SYSTEM_CONTROL_VECTOR;
503
504 //
505 // Structure for CmpQueryValueDataFromCache
506 //
507 typedef struct _KEY_VALUE_INFORMATION
508 {
509 union
510 {
511 KEY_VALUE_BASIC_INFORMATION KeyValueBasicInformation;
512 KEY_VALUE_FULL_INFORMATION KeyValueFullInformation;
513 KEY_VALUE_PARTIAL_INFORMATION KeyValuePartialInformation;
514 KEY_VALUE_PARTIAL_INFORMATION_ALIGN64 KeyValuePartialInformationAlign64;
515 };
516 } KEY_VALUE_INFORMATION, *PKEY_VALUE_INFORMATION;
517
518 typedef struct _KEY_INFORMATION
519 {
520 union
521 {
522 KEY_BASIC_INFORMATION KeyBasicInformation;
523 KEY_FULL_INFORMATION KeyFullInformation;
524 KEY_NODE_INFORMATION KeyNodeInformation;
525 };
526 } KEY_INFORMATION, *PKEY_INFORMATION;
527
528 ///////////////////////////////////////////////////////////////////////////////
529 //
530 // BUGBUG Old Hive Stuff for Temporary Support
531 //
532 NTSTATUS CmiCallRegisteredCallbacks(IN REG_NOTIFY_CLASS Argument1, IN PVOID Argument2);
533 ///////////////////////////////////////////////////////////////////////////////
534
535 //
536 // Mapped View Hive Functions
537 //
538 VOID
539 NTAPI
540 CmpInitHiveViewList(
541 IN PCMHIVE Hive
542 );
543
544 //
545 // Security Cache Functions
546 //
547 VOID
548 NTAPI
549 CmpInitSecurityCache(
550 IN PCMHIVE Hive
551 );
552
553 //
554 // Value Cache Functions
555 //
556 VALUE_SEARCH_RETURN_TYPE
557 NTAPI
558 CmpFindValueByNameFromCache(
559 IN PCM_KEY_CONTROL_BLOCK Kcb,
560 IN PCUNICODE_STRING Name,
561 OUT PCM_CACHED_VALUE **CachedValue,
562 OUT ULONG *Index,
563 OUT PCM_KEY_VALUE *Value,
564 OUT BOOLEAN *ValueIsCached,
565 OUT PHCELL_INDEX CellToRelease
566 );
567
568 VALUE_SEARCH_RETURN_TYPE
569 NTAPI
570 CmpQueryKeyValueData(
571 IN PCM_KEY_CONTROL_BLOCK Kcb,
572 IN PCM_CACHED_VALUE *CachedValue,
573 IN PCM_KEY_VALUE ValueKey,
574 IN BOOLEAN ValueIsCached,
575 IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
576 IN PVOID KeyValueInformation,
577 IN ULONG Length,
578 OUT PULONG ResultLength,
579 OUT PNTSTATUS Status
580 );
581
582 VALUE_SEARCH_RETURN_TYPE
583 NTAPI
584 CmpGetValueListFromCache(
585 IN PCM_KEY_CONTROL_BLOCK Kcb,
586 OUT PCELL_DATA *CellData,
587 OUT BOOLEAN *IndexIsCached,
588 OUT PHCELL_INDEX ValueListToRelease
589 );
590
591 VALUE_SEARCH_RETURN_TYPE
592 NTAPI
593 CmpGetValueKeyFromCache(
594 IN PCM_KEY_CONTROL_BLOCK Kcb,
595 IN PCELL_DATA CellData,
596 IN ULONG Index,
597 OUT PCM_CACHED_VALUE **CachedValue,
598 OUT PCM_KEY_VALUE *Value,
599 IN BOOLEAN IndexIsCached,
600 OUT BOOLEAN *ValueIsCached,
601 OUT PHCELL_INDEX CellToRelease
602 );
603
604 VALUE_SEARCH_RETURN_TYPE
605 NTAPI
606 CmpCompareNewValueDataAgainstKCBCache(
607 IN PCM_KEY_CONTROL_BLOCK Kcb,
608 IN PUNICODE_STRING ValueName,
609 IN ULONG Type,
610 IN PVOID Data,
611 IN ULONG DataSize
612 );
613
614 //
615 // Registry Validation Functions
616 //
617 ULONG
618 NTAPI
619 CmCheckRegistry(
620 IN PCMHIVE Hive,
621 IN ULONG Flags
622 );
623
624 //
625 // Hive List Routines
626 //
627 NTSTATUS
628 NTAPI
629 CmpAddToHiveFileList(
630 IN PCMHIVE Hive
631 );
632
633 //
634 // Quota Routines
635 //
636 VOID
637 NTAPI
638 CmpSetGlobalQuotaAllowed(
639 VOID
640 );
641
642 //
643 // Notification Routines
644 //
645 VOID
646 NTAPI
647 CmpReportNotify(
648 IN PCM_KEY_CONTROL_BLOCK Kcb,
649 IN PHHIVE Hive,
650 IN HCELL_INDEX Cell,
651 IN ULONG Filter
652 );
653
654 VOID
655 NTAPI
656 CmpFlushNotify(
657 IN PCM_KEY_BODY KeyBody,
658 IN BOOLEAN LockHeld
659 );
660
661 VOID
662 NTAPI
663 CmpInitCallback(
664 VOID
665 );
666
667 //
668 // KCB Cache/Delay Routines
669 //
670 VOID
671 NTAPI
672 CmpInitializeCache(
673 VOID
674 );
675
676 VOID
677 NTAPI
678 CmpInitCmPrivateDelayAlloc(
679 VOID
680 );
681
682 VOID
683 NTAPI
684 CmpInitCmPrivateAlloc(
685 VOID
686 );
687
688 VOID
689 NTAPI
690 CmpInitDelayDerefKCBEngine(
691 VOID
692 );
693
694 //
695 // Key Object Routines
696 //
697 VOID
698 NTAPI
699 CmpCloseKeyObject(
700 IN PEPROCESS Process OPTIONAL,
701 IN PVOID Object,
702 IN ACCESS_MASK GrantedAccess,
703 IN ULONG ProcessHandleCount,
704 IN ULONG SystemHandleCount
705 );
706
707 VOID
708 NTAPI
709 CmpDeleteKeyObject(
710 IN PVOID Object
711 );
712
713 NTSTATUS
714 NTAPI
715 CmpParseKey(
716 IN PVOID ParseObject,
717 IN PVOID ObjectType,
718 IN OUT PACCESS_STATE AccessState,
719 IN KPROCESSOR_MODE AccessMode,
720 IN ULONG Attributes,
721 IN OUT PUNICODE_STRING CompleteName,
722 IN OUT PUNICODE_STRING RemainingName,
723 IN OUT PVOID Context OPTIONAL,
724 IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL,
725 OUT PVOID *Object
726 );
727
728 NTSTATUS
729 NTAPI
730 CmpSecurityMethod(
731 IN PVOID Object,
732 IN SECURITY_OPERATION_CODE OperationType,
733 IN PSECURITY_INFORMATION SecurityInformation,
734 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
735 IN OUT PULONG CapturedLength,
736 IN OUT PSECURITY_DESCRIPTOR *ObjectSecurityDescriptor,
737 IN POOL_TYPE PoolType,
738 IN PGENERIC_MAPPING GenericMapping
739 );
740
741 NTSTATUS
742 NTAPI
743 CmpQueryKeyName(
744 IN PVOID Object,
745 IN BOOLEAN HasObjectName,
746 OUT POBJECT_NAME_INFORMATION ObjectNameInfo,
747 IN ULONG Length,
748 OUT PULONG ReturnLength,
749 IN KPROCESSOR_MODE AccessMode
750 );
751
752 //
753 // Hive Routines
754 //
755 NTSTATUS
756 NTAPI
757 CmpInitializeHive(
758 OUT PCMHIVE *CmHive,
759 IN ULONG Operation,
760 IN ULONG Flags,
761 IN ULONG FileType,
762 IN PVOID HiveData OPTIONAL,
763 IN HANDLE Primary,
764 IN HANDLE Log,
765 IN HANDLE External,
766 IN PCUNICODE_STRING FileName OPTIONAL,
767 IN ULONG CheckFlags
768 );
769
770 PSECURITY_DESCRIPTOR
771 NTAPI
772 CmpHiveRootSecurityDescriptor(
773 VOID
774 );
775
776 NTSTATUS
777 NTAPI
778 CmpLinkHiveToMaster(
779 IN PUNICODE_STRING LinkName,
780 IN HANDLE RootDirectory,
781 IN PCMHIVE CmHive,
782 IN BOOLEAN Allocate,
783 IN PSECURITY_DESCRIPTOR SecurityDescriptor
784 );
785
786 NTSTATUS
787 NTAPI
788 CmpOpenHiveFiles(
789 IN PCUNICODE_STRING BaseName,
790 IN PCWSTR Extension OPTIONAL,
791 IN PHANDLE Primary,
792 IN PHANDLE Log,
793 IN PULONG PrimaryDisposition,
794 IN PULONG LogDisposition,
795 IN BOOLEAN CreateAllowed,
796 IN BOOLEAN MarkAsSystemHive,
797 IN BOOLEAN NoBuffering,
798 OUT PULONG ClusterSize OPTIONAL
799 );
800
801 NTSTATUS
802 NTAPI
803 CmpInitHiveFromFile(
804 IN PCUNICODE_STRING HiveName,
805 IN ULONG HiveFlags,
806 OUT PCMHIVE *Hive,
807 IN OUT PBOOLEAN New,
808 IN ULONG CheckFlags
809 );
810
811 VOID
812 NTAPI
813 CmpInitializeHiveList(
814 IN USHORT Flag
815 );
816
817 //
818 // Registry Utility Functions
819 //
820 BOOLEAN
821 NTAPI
822 CmpTestRegistryLockExclusive(
823 VOID
824 );
825
826 BOOLEAN
827 NTAPI
828 CmpTestRegistryLock(
829 VOID
830 );
831
832 VOID
833 NTAPI
834 CmpLockRegistryExclusive(
835 VOID
836 );
837
838 VOID
839 NTAPI
840 CmpLockRegistry(
841 VOID
842 );
843
844 VOID
845 NTAPI
846 CmpUnlockRegistry(
847 VOID
848 );
849
850 VOID
851 NTAPI
852 CmpLockHiveFlusherExclusive(
853 IN PCMHIVE Hive
854 );
855
856 VOID
857 NTAPI
858 CmpLockHiveFlusherShared(
859 IN PCMHIVE Hive
860 );
861
862 BOOLEAN
863 NTAPI
864 CmpTestHiveFlusherLockExclusive(
865 IN PCMHIVE Hive
866 );
867
868 BOOLEAN
869 NTAPI
870 CmpTestHiveFlusherLockShared(
871 IN PCMHIVE Hive
872 );
873
874 VOID
875 NTAPI
876 CmpUnlockHiveFlusher(
877 IN PCMHIVE Hive
878 );
879
880 //
881 // Delay Functions
882 //
883 PVOID
884 NTAPI
885 CmpAllocateDelayItem(
886 VOID
887 );
888
889 VOID
890 NTAPI
891 CmpFreeDelayItem(
892 PVOID Entry
893 );
894
895 VOID
896 NTAPI
897 CmpDelayDerefKeyControlBlock(
898 IN PCM_KEY_CONTROL_BLOCK Kcb
899 );
900
901 VOID
902 NTAPI
903 CmpAddToDelayedClose(
904 IN PCM_KEY_CONTROL_BLOCK Kcb,
905 IN BOOLEAN LockHeldExclusively
906 );
907
908 VOID
909 NTAPI
910 CmpArmDelayedCloseTimer(
911 VOID
912 );
913
914 VOID
915 NTAPI
916 CmpRemoveFromDelayedClose(IN PCM_KEY_CONTROL_BLOCK Kcb);
917
918 VOID
919 NTAPI
920 CmpInitializeDelayedCloseTable(
921 VOID
922 );
923
924 //
925 // KCB Functions
926 //
927 PCM_KEY_CONTROL_BLOCK
928 NTAPI
929 CmpCreateKeyControlBlock(
930 IN PHHIVE Hive,
931 IN HCELL_INDEX Index,
932 IN PCM_KEY_NODE Node,
933 IN PCM_KEY_CONTROL_BLOCK Parent,
934 IN ULONG Flags,
935 IN PUNICODE_STRING KeyName
936 );
937
938 PCM_KEY_CONTROL_BLOCK
939 NTAPI
940 CmpAllocateKeyControlBlock(
941 VOID
942 );
943
944 VOID
945 NTAPI
946 CmpFreeKeyControlBlock(
947 IN PCM_KEY_CONTROL_BLOCK Kcb
948 );
949
950 VOID
951 NTAPI
952 CmpRemoveKeyControlBlock(
953 IN PCM_KEY_CONTROL_BLOCK Kcb
954 );
955
956 VOID
957 NTAPI
958 CmpCleanUpKcbValueCache(
959 IN PCM_KEY_CONTROL_BLOCK Kcb
960 );
961
962 VOID
963 NTAPI
964 CmpCleanUpKcbCacheWithLock(
965 IN PCM_KEY_CONTROL_BLOCK Kcb,
966 IN BOOLEAN LockHeldExclusively
967 );
968
969 VOID
970 NTAPI
971 CmpCleanUpSubKeyInfo(
972 IN PCM_KEY_CONTROL_BLOCK Kcb
973 );
974
975 PUNICODE_STRING
976 NTAPI
977 CmpConstructName(
978 IN PCM_KEY_CONTROL_BLOCK Kcb
979 );
980
981 BOOLEAN
982 NTAPI
983 CmpReferenceKeyControlBlock(
984 IN PCM_KEY_CONTROL_BLOCK Kcb
985 );
986
987 VOID
988 NTAPI
989 CmpDereferenceKeyControlBlockWithLock(
990 IN PCM_KEY_CONTROL_BLOCK Kcb,
991 IN BOOLEAN LockHeldExclusively
992 );
993
994 VOID
995 NTAPI
996 CmpDereferenceKeyControlBlock(
997 IN PCM_KEY_CONTROL_BLOCK Kcb
998 );
999
1000 VOID
1001 NTAPI
1002 EnlistKeyBodyWithKCB(
1003 IN PCM_KEY_BODY KeyObject,
1004 IN ULONG Flags
1005 );
1006
1007 VOID
1008 NTAPI
1009 DelistKeyBodyFromKCB(
1010 IN PCM_KEY_BODY KeyBody,
1011 IN BOOLEAN LockHeld
1012 );
1013
1014 NTSTATUS
1015 NTAPI
1016 CmpFreeKeyByCell(
1017 IN PHHIVE Hive,
1018 IN HCELL_INDEX Cell,
1019 IN BOOLEAN Unlink
1020 );
1021
1022 VOID
1023 NTAPI
1024 CmpAcquireTwoKcbLocksExclusiveByKey(
1025 IN ULONG ConvKey1,
1026 IN ULONG ConvKey2
1027 );
1028
1029 VOID
1030 NTAPI
1031 CmpReleaseTwoKcbLockByKey(
1032 IN ULONG ConvKey1,
1033 IN ULONG ConvKey2
1034 );
1035
1036 VOID
1037 NTAPI
1038 CmpFlushNotifiesOnKeyBodyList(
1039 IN PCM_KEY_CONTROL_BLOCK Kcb,
1040 IN BOOLEAN LockHeld
1041 );
1042
1043 //
1044 // Name Functions
1045 //
1046 LONG
1047 NTAPI
1048 CmpCompareCompressedName(
1049 IN PCUNICODE_STRING SearchName,
1050 IN PWCHAR CompressedName,
1051 IN ULONG NameLength
1052 );
1053
1054 USHORT
1055 NTAPI
1056 CmpNameSize(
1057 IN PHHIVE Hive,
1058 IN PUNICODE_STRING Name
1059 );
1060
1061 USHORT
1062 NTAPI
1063 CmpCompressedNameSize(
1064 IN PWCHAR Name,
1065 IN ULONG Length
1066 );
1067
1068 VOID
1069 NTAPI
1070 CmpCopyCompressedName(
1071 IN PWCHAR Destination,
1072 IN ULONG DestinationLength,
1073 IN PWCHAR Source,
1074 IN ULONG SourceLength
1075 );
1076
1077 USHORT
1078 NTAPI
1079 CmpCopyName(
1080 IN PHHIVE Hive,
1081 IN PWCHAR Destination,
1082 IN PUNICODE_STRING Source
1083 );
1084
1085 BOOLEAN
1086 NTAPI
1087 CmpFindNameInList(
1088 IN PHHIVE Hive,
1089 IN PCHILD_LIST ChildList,
1090 IN PUNICODE_STRING Name,
1091 IN PULONG ChildIndex,
1092 IN PHCELL_INDEX CellIndex
1093 );
1094
1095 //
1096 // Parse Routines
1097 //
1098 BOOLEAN
1099 NTAPI
1100 CmpGetNextName(
1101 IN OUT PUNICODE_STRING RemainingName,
1102 OUT PUNICODE_STRING NextName,
1103 OUT PBOOLEAN LastName
1104 );
1105
1106 //
1107 // Command Routines (Flush, Open, Close, Init);
1108 //
1109 BOOLEAN
1110 NTAPI
1111 CmpDoFlushAll(
1112 IN BOOLEAN ForceFlush
1113 );
1114
1115 VOID
1116 NTAPI
1117 CmpShutdownWorkers(
1118 VOID
1119 );
1120
1121 VOID
1122 NTAPI
1123 CmpCmdInit(
1124 IN BOOLEAN SetupBoot
1125 );
1126
1127 NTSTATUS
1128 NTAPI
1129 CmpCmdHiveOpen(
1130 IN POBJECT_ATTRIBUTES FileAttributes,
1131 IN PSECURITY_CLIENT_CONTEXT ImpersonationContext,
1132 IN OUT PBOOLEAN Allocate,
1133 OUT PCMHIVE *NewHive,
1134 IN ULONG CheckFlags
1135 );
1136
1137 VOID
1138 NTAPI
1139 CmpLazyFlush(
1140 VOID
1141 );
1142
1143 //
1144 // Open/Create Routines
1145 //
1146 NTSTATUS
1147 NTAPI
1148 CmpDoCreate(
1149 IN PHHIVE Hive,
1150 IN HCELL_INDEX Cell,
1151 IN PACCESS_STATE AccessState,
1152 IN PUNICODE_STRING Name,
1153 IN KPROCESSOR_MODE AccessMode,
1154 IN PCM_PARSE_CONTEXT Context,
1155 IN PCM_KEY_CONTROL_BLOCK ParentKcb,
1156 OUT PVOID *Object
1157 );
1158
1159 NTSTATUS
1160 NTAPI
1161 CmpCreateLinkNode(
1162 IN PHHIVE Hive,
1163 IN HCELL_INDEX Cell,
1164 IN PACCESS_STATE AccessState,
1165 IN UNICODE_STRING Name,
1166 IN KPROCESSOR_MODE AccessMode,
1167 IN ULONG CreateOptions,
1168 IN PCM_PARSE_CONTEXT Context,
1169 IN PCM_KEY_CONTROL_BLOCK ParentKcb,
1170 OUT PVOID *Object
1171 );
1172
1173 //
1174 // Cell Index Routines
1175 //
1176
1177 HCELL_INDEX
1178 NTAPI
1179 CmpFindSubKeyByName(
1180 IN PHHIVE Hive,
1181 IN PCM_KEY_NODE Parent,
1182 IN PCUNICODE_STRING SearchName
1183 );
1184
1185 HCELL_INDEX
1186 NTAPI
1187 CmpFindSubKeyByNumber(
1188 IN PHHIVE Hive,
1189 IN PCM_KEY_NODE Node,
1190 IN ULONG Number
1191 );
1192
1193 ULONG
1194 NTAPI
1195 CmpComputeHashKey(
1196 IN ULONG Hash,
1197 IN PCUNICODE_STRING Name,
1198 IN BOOLEAN AllowSeparators
1199 );
1200
1201 BOOLEAN
1202 NTAPI
1203 CmpAddSubKey(
1204 IN PHHIVE Hive,
1205 IN HCELL_INDEX Parent,
1206 IN HCELL_INDEX Child
1207 );
1208
1209 BOOLEAN
1210 NTAPI
1211 CmpRemoveSubKey(
1212 IN PHHIVE Hive,
1213 IN HCELL_INDEX ParentKey,
1214 IN HCELL_INDEX TargetKey
1215 );
1216
1217 BOOLEAN
1218 NTAPI
1219 CmpMarkIndexDirty(
1220 IN PHHIVE Hive,
1221 HCELL_INDEX ParentKey,
1222 HCELL_INDEX TargetKey
1223 );
1224
1225 //
1226 // Cell Value Routines
1227 //
1228 HCELL_INDEX
1229 NTAPI
1230 CmpFindValueByName(
1231 IN PHHIVE Hive,
1232 IN PCM_KEY_NODE KeyNode,
1233 IN PUNICODE_STRING Name
1234 );
1235
1236 PCELL_DATA
1237 NTAPI
1238 CmpValueToData(
1239 IN PHHIVE Hive,
1240 IN PCM_KEY_VALUE Value,
1241 OUT PULONG Length
1242 );
1243
1244 NTSTATUS
1245 NTAPI
1246 CmpSetValueDataNew(
1247 IN PHHIVE Hive,
1248 IN PVOID Data,
1249 IN ULONG DataSize,
1250 IN ULONG StorageType,
1251 IN HCELL_INDEX ValueCell,
1252 OUT PHCELL_INDEX DataCell
1253 );
1254
1255 NTSTATUS
1256 NTAPI
1257 CmpAddValueToList(
1258 IN PHHIVE Hive,
1259 IN HCELL_INDEX ValueCell,
1260 IN ULONG Index,
1261 IN ULONG Type,
1262 IN OUT PCHILD_LIST ChildList
1263 );
1264
1265 BOOLEAN
1266 NTAPI
1267 CmpFreeValue(
1268 IN PHHIVE Hive,
1269 IN HCELL_INDEX Cell
1270 );
1271
1272 BOOLEAN
1273 NTAPI
1274 CmpMarkValueDataDirty(
1275 IN PHHIVE Hive,
1276 IN PCM_KEY_VALUE Value
1277 );
1278
1279 BOOLEAN
1280 NTAPI
1281 CmpFreeValueData(
1282 IN PHHIVE Hive,
1283 IN HCELL_INDEX DataCell,
1284 IN ULONG DataLength
1285 );
1286
1287 NTSTATUS
1288 NTAPI
1289 CmpRemoveValueFromList(
1290 IN PHHIVE Hive,
1291 IN ULONG Index,
1292 IN OUT PCHILD_LIST ChildList
1293 );
1294
1295 BOOLEAN
1296 NTAPI
1297 CmpGetValueData(
1298 IN PHHIVE Hive,
1299 IN PCM_KEY_VALUE Value,
1300 IN PULONG Length,
1301 OUT PVOID *Buffer,
1302 OUT PBOOLEAN BufferAllocated,
1303 OUT PHCELL_INDEX CellToRelease
1304 );
1305
1306 //
1307 // Boot Routines
1308 //
1309 HCELL_INDEX
1310 NTAPI
1311 CmpFindControlSet(
1312 IN PHHIVE SystemHive,
1313 IN HCELL_INDEX RootCell,
1314 IN PUNICODE_STRING SelectKeyName,
1315 OUT PBOOLEAN AutoSelect
1316 );
1317
1318 VOID
1319 NTAPI
1320 CmGetSystemControlValues(
1321 IN PVOID SystemHiveData,
1322 IN PCM_SYSTEM_CONTROL_VECTOR ControlVector
1323 );
1324
1325
1326 //
1327 // Hardware Configuration Routines
1328 //
1329 NTSTATUS
1330 NTAPI
1331 CmpInitializeRegistryNode(
1332 IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
1333 IN HANDLE NodeHandle,
1334 OUT PHANDLE NewHandle,
1335 IN INTERFACE_TYPE InterfaceType,
1336 IN ULONG BusNumber,
1337 IN PUSHORT DeviceIndexTable
1338 );
1339
1340 NTSTATUS
1341 NTAPI
1342 CmpInitializeMachineDependentConfiguration(
1343 IN PLOADER_PARAMETER_BLOCK LoaderBlock
1344 );
1345
1346 NTSTATUS
1347 NTAPI
1348 CmpInitializeHardwareConfiguration(
1349 IN PLOADER_PARAMETER_BLOCK LoaderBlock
1350 );
1351
1352 //
1353 // Wrapper Routines
1354 //
1355 NTSTATUS
1356 NTAPI
1357 CmpCreateEvent(
1358 IN EVENT_TYPE EventType,
1359 OUT PHANDLE EventHandle,
1360 OUT PKEVENT *Event
1361 );
1362
1363 PVOID
1364 NTAPI
1365 CmpAllocate(
1366 IN SIZE_T Size,
1367 IN BOOLEAN Paged,
1368 IN ULONG Tag
1369 );
1370
1371 VOID
1372 NTAPI
1373 CmpFree(
1374 IN PVOID Ptr,
1375 IN ULONG Quota
1376 );
1377
1378 BOOLEAN
1379 NTAPI
1380 CmpFileRead(
1381 IN PHHIVE RegistryHive,
1382 IN ULONG FileType,
1383 IN OUT PULONG FileOffset,
1384 OUT PVOID Buffer,
1385 IN SIZE_T BufferLength
1386 );
1387
1388 BOOLEAN
1389 NTAPI
1390 CmpFileWrite(
1391 IN PHHIVE RegistryHive,
1392 IN ULONG FileType,
1393 IN OUT PULONG FileOffset,
1394 IN PVOID Buffer,
1395 IN SIZE_T BufferLength
1396 );
1397
1398 BOOLEAN
1399 NTAPI
1400 CmpFileSetSize(
1401 IN PHHIVE RegistryHive,
1402 IN ULONG FileType,
1403 IN ULONG FileSize,
1404 IN ULONG OldFileSize
1405 );
1406
1407 BOOLEAN
1408 NTAPI
1409 CmpFileFlush(
1410 IN PHHIVE RegistryHive,
1411 IN ULONG FileType,
1412 IN OUT PLARGE_INTEGER FileOffset,
1413 IN ULONG Length
1414 );
1415
1416 //
1417 // Configuration Manager side of Registry System Calls
1418 //
1419 NTSTATUS
1420 NTAPI
1421 CmEnumerateValueKey(
1422 IN PCM_KEY_CONTROL_BLOCK Kcb,
1423 IN ULONG Index,
1424 IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
1425 IN PVOID KeyValueInformation,
1426 IN ULONG Length,
1427 IN PULONG ResultLength);
1428
1429 NTSTATUS
1430 NTAPI
1431 CmSetValueKey(
1432 IN PCM_KEY_CONTROL_BLOCK Kcb,
1433 IN PUNICODE_STRING ValueName,
1434 IN ULONG Type,
1435 IN PVOID Data,
1436 IN ULONG DataSize);
1437
1438 NTSTATUS
1439 NTAPI
1440 CmQueryKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
1441 IN KEY_INFORMATION_CLASS KeyInformationClass,
1442 IN PVOID KeyInformation,
1443 IN ULONG Length,
1444 IN PULONG ResultLength
1445 );
1446
1447 NTSTATUS
1448 NTAPI
1449 CmEnumerateKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
1450 IN ULONG Index,
1451 IN KEY_INFORMATION_CLASS KeyInformationClass,
1452 IN PVOID KeyInformation,
1453 IN ULONG Length,
1454 IN PULONG ResultLength
1455 );
1456
1457 NTSTATUS
1458 NTAPI
1459 CmDeleteKey(
1460 IN PCM_KEY_BODY KeyBody
1461 );
1462
1463 NTSTATUS
1464 NTAPI
1465 CmFlushKey(
1466 IN PCM_KEY_CONTROL_BLOCK Kcb,
1467 IN BOOLEAN EclusiveLock
1468 );
1469
1470 NTSTATUS
1471 NTAPI
1472 CmDeleteValueKey(
1473 IN PCM_KEY_CONTROL_BLOCK Kcb,
1474 IN UNICODE_STRING ValueName
1475 );
1476
1477 NTSTATUS
1478 NTAPI
1479 CmQueryValueKey(
1480 IN PCM_KEY_CONTROL_BLOCK Kcb,
1481 IN UNICODE_STRING ValueName,
1482 IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
1483 IN PVOID KeyValueInformation,
1484 IN ULONG Length,
1485 IN PULONG ResultLength
1486 );
1487
1488 NTSTATUS
1489 NTAPI
1490 CmLoadKey(
1491 IN POBJECT_ATTRIBUTES TargetKey,
1492 IN POBJECT_ATTRIBUTES SourceFile,
1493 IN ULONG Flags,
1494 IN PCM_KEY_BODY KeyBody
1495 );
1496
1497 NTSTATUS
1498 NTAPI
1499 CmUnloadKey(
1500 IN PCM_KEY_CONTROL_BLOCK Kcb,
1501 IN ULONG Flags
1502 );
1503
1504 ULONG
1505 NTAPI
1506 CmCountOpenSubKeys(
1507 IN PCM_KEY_CONTROL_BLOCK RootKcb,
1508 IN BOOLEAN RemoveEmptyCacheEntries
1509 );
1510
1511 //
1512 // Startup and Shutdown
1513 //
1514 BOOLEAN
1515 NTAPI
1516 CmInitSystem1(
1517 VOID
1518 );
1519
1520 VOID
1521 NTAPI
1522 CmShutdownSystem(
1523 VOID
1524 );
1525
1526 VOID
1527 NTAPI
1528 CmSetLazyFlushState(
1529 IN BOOLEAN Enable
1530 );
1531
1532 VOID
1533 NTAPI
1534 CmpSetVersionData(
1535 VOID
1536 );
1537
1538 //
1539 // Driver List Routines
1540 //
1541 PUNICODE_STRING*
1542 NTAPI
1543 CmGetSystemDriverList(
1544 VOID
1545 );
1546
1547 BOOLEAN
1548 NTAPI
1549 CmpFindDrivers(
1550 IN PHHIVE Hive,
1551 IN HCELL_INDEX ControlSet,
1552 IN SERVICE_LOAD_TYPE LoadType,
1553 IN PWSTR BootFileSystem OPTIONAL,
1554 IN PLIST_ENTRY DriverListHead
1555 );
1556
1557
1558 BOOLEAN
1559 NTAPI
1560 CmpSortDriverList(
1561 IN PHHIVE Hive,
1562 IN HCELL_INDEX ControlSet,
1563 IN PLIST_ENTRY DriverListHead
1564 );
1565
1566 BOOLEAN
1567 NTAPI
1568 CmpResolveDriverDependencies(
1569 IN PLIST_ENTRY DriverListHead
1570 );
1571
1572 BOOLEAN
1573 NTAPI
1574 CmpIsSafe(
1575 IN PHHIVE Hive,
1576 IN HCELL_INDEX SafeBootCell,
1577 IN HCELL_INDEX DriverCell);
1578
1579 //
1580 // Global variables accessible from all of Cm
1581 //
1582 extern ULONG CmpTraceLevel;
1583 extern BOOLEAN CmpSpecialBootCondition;
1584 extern BOOLEAN CmpFlushOnLockRelease;
1585 extern BOOLEAN CmpShareSystemHives;
1586 extern BOOLEAN CmpMiniNTBoot;
1587 extern EX_PUSH_LOCK CmpHiveListHeadLock, CmpLoadHiveLock;
1588 extern LIST_ENTRY CmpHiveListHead;
1589 extern POBJECT_TYPE CmpKeyObjectType;
1590 extern ERESOURCE CmpRegistryLock;
1591 extern PCM_KEY_HASH_TABLE_ENTRY CmpCacheTable;
1592 extern PCM_NAME_HASH_TABLE_ENTRY CmpNameCacheTable;
1593 extern KGUARDED_MUTEX CmpDelayedCloseTableLock;
1594 extern CMHIVE CmControlHive;
1595 extern WCHAR CmDefaultLanguageId[];
1596 extern ULONG CmDefaultLanguageIdLength;
1597 extern ULONG CmDefaultLanguageIdType;
1598 extern WCHAR CmInstallUILanguageId[];
1599 extern ULONG CmInstallUILanguageIdLength;
1600 extern ULONG CmInstallUILanguageIdType;
1601 extern ULONG CmNtGlobalFlag;
1602 extern LANGID PsInstallUILanguageId;
1603 extern LANGID PsDefaultUILanguageId;
1604 extern CM_SYSTEM_CONTROL_VECTOR CmControlVector[];
1605 extern ULONG CmpConfigurationAreaSize;
1606 extern PCM_FULL_RESOURCE_DESCRIPTOR CmpConfigurationData;
1607 extern UNICODE_STRING CmTypeName[];
1608 extern UNICODE_STRING CmClassName[];
1609 extern CMP_MF_TYPE CmpMultifunctionTypes[];
1610 extern USHORT CmpUnknownBusCount;
1611 extern ULONG CmpTypeCount[MaximumType + 1];
1612 extern HIVE_LIST_ENTRY CmpMachineHiveList[];
1613 extern UNICODE_STRING CmSymbolicLinkValueName;
1614 extern UNICODE_STRING CmpSystemStartOptions;
1615 extern UNICODE_STRING CmpLoadOptions;
1616 extern BOOLEAN CmSelfHeal;
1617 extern BOOLEAN CmpSelfHeal;
1618 extern ULONG CmpBootType;
1619 extern HANDLE CmpRegistryRootHandle;
1620 extern BOOLEAN ExpInTextModeSetup;
1621 extern BOOLEAN InitIsWinPEMode;
1622 extern ULONG CmpHashTableSize;
1623 extern ULONG CmpDelayedCloseSize, CmpDelayedCloseIndex;
1624 extern BOOLEAN CmpNoWrite;
1625 extern BOOLEAN CmpForceForceFlush;
1626 extern BOOLEAN CmpWasSetupBoot;
1627 extern BOOLEAN CmpProfileLoaded;
1628 extern PCMHIVE CmiVolatileHive;
1629 extern LIST_ENTRY CmiKeyObjectListHead;
1630 extern BOOLEAN CmpHoldLazyFlush;
1631
1632 //
1633 // Inlined functions
1634 //
1635 #include "cm_x.h"