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