Use a standard header instead of redefining size_t.
[reactos.git] / reactos / ntoskrnl / cm / cm.h
1 #ifndef __INCLUDE_CM_H
2 #define __INCLUDE_CM_H
3
4 #ifdef DBG
5 #define CHECKED 1
6 #else
7 #define CHECKED 0
8 #endif
9
10 #define REG_ROOT_KEY_NAME L"\\Registry"
11 #define REG_MACHINE_KEY_NAME L"\\Registry\\Machine"
12 #define REG_HARDWARE_KEY_NAME L"\\Registry\\Machine\\HARDWARE"
13 #define REG_DESCRIPTION_KEY_NAME L"\\Registry\\Machine\\HARDWARE\\DESCRIPTION"
14 #define REG_DEVICEMAP_KEY_NAME L"\\Registry\\Machine\\HARDWARE\\DEVICEMAP"
15 #define REG_RESOURCEMAP_KEY_NAME L"\\Registry\\Machine\\HARDWARE\\RESOURCEMAP"
16 #define REG_CLASSES_KEY_NAME L"\\Registry\\Machine\\Software\\Classes"
17 #define REG_SYSTEM_KEY_NAME L"\\Registry\\Machine\\SYSTEM"
18 #define REG_SOFTWARE_KEY_NAME L"\\Registry\\Machine\\SOFTWARE"
19 #define REG_SAM_KEY_NAME L"\\Registry\\Machine\\SAM"
20 #define REG_SEC_KEY_NAME L"\\Registry\\Machine\\SECURITY"
21 #define REG_USER_KEY_NAME L"\\Registry\\User"
22 #define REG_DEFAULT_USER_KEY_NAME L"\\Registry\\User\\.Default"
23 #define REG_CURRENT_USER_KEY_NAME L"\\Registry\\User\\CurrentUser"
24
25 #define SYSTEM_REG_FILE L"\\SystemRoot\\System32\\Config\\SYSTEM"
26 #define SYSTEM_LOG_FILE L"\\SystemRoot\\System32\\Config\\SYSTEM.log"
27 #define SOFTWARE_REG_FILE L"\\SystemRoot\\System32\\Config\\SOFTWARE"
28 #define DEFAULT_USER_REG_FILE L"\\SystemRoot\\System32\\Config\\DEFAULT"
29 #define SAM_REG_FILE L"\\SystemRoot\\System32\\Config\\SAM"
30 #define SEC_REG_FILE L"\\SystemRoot\\System32\\Config\\SECURITY"
31
32 #define REG_SYSTEM_FILE_NAME L"\\system"
33 #define REG_SOFTWARE_FILE_NAME L"\\software"
34 #define REG_DEFAULT_USER_FILE_NAME L"\\default"
35 #define REG_SAM_FILE_NAME L"\\sam"
36 #define REG_SEC_FILE_NAME L"\\security"
37
38 #define REG_BLOCK_SIZE 4096
39 #define REG_HBIN_DATA_OFFSET 32
40 #define REG_INIT_BLOCK_LIST_SIZE 32
41 #define REG_INIT_HASH_TABLE_SIZE 3
42 #define REG_EXTEND_HASH_TABLE_SIZE 4
43 #define REG_VALUE_LIST_CELL_MULTIPLE 4
44
45 #define REG_HIVE_ID 0x66676572
46 #define REG_BIN_ID 0x6e696268
47 #define REG_KEY_CELL_ID 0x6b6e
48 #define REG_HASH_TABLE_CELL_ID 0x666c
49 #define REG_VALUE_CELL_ID 0x6b76
50 #define REG_SECURITY_CELL_ID 0x6b73
51
52
53 // BLOCK_OFFSET = offset in file after header block
54 typedef ULONG BLOCK_OFFSET, *PBLOCK_OFFSET;
55
56 #include <pshpack1.h>
57
58 /* header for registry hive file : */
59 typedef struct _HIVE_HEADER
60 {
61 /* Hive identifier "regf" (0x66676572) */
62 ULONG BlockId;
63
64 /* Update counter */
65 ULONG UpdateCounter1;
66
67 /* Update counter */
68 ULONG UpdateCounter2;
69
70 /* When this hive file was last modified */
71 LARGE_INTEGER DateModified;
72
73 /* Registry format version ? (1?) */
74 ULONG Unused3;
75
76 /* Registry format version ? (3?) */
77 ULONG Unused4;
78
79 /* Registry format version ? (0?) */
80 ULONG Unused5;
81
82 /* Registry format version ? (1?) */
83 ULONG Unused6;
84
85 /* Offset into file from the byte after the end of the base block.
86 If the hive is volatile, this is the actual pointer to the KEY_CELL */
87 BLOCK_OFFSET RootKeyOffset;
88
89 /* Size of each hive block ? */
90 ULONG BlockSize;
91
92 /* (1?) */
93 ULONG Unused7;
94
95 /* Name of hive file */
96 WCHAR FileName[64];
97
98 /* ? */
99 ULONG Unused8[83];
100
101 /* Checksum of first 0x200 bytes */
102 ULONG Checksum;
103 } HIVE_HEADER, *PHIVE_HEADER;
104
105 typedef struct _BIN_HEADER
106 {
107 /* Bin identifier "hbin" (0x6E696268) */
108 ULONG HeaderId;
109
110 /* Block offset of this bin */
111 BLOCK_OFFSET BinOffset;
112
113 /* Size in bytes, multiple of the block size (4KB) */
114 ULONG BinSize;
115
116 /* ? */
117 ULONG Unused1;
118
119 /* When this bin was last modified */
120 LARGE_INTEGER DateModified;
121
122 /* ? */
123 ULONG Unused2;
124 } HBIN, *PHBIN;
125
126 typedef struct _CELL_HEADER
127 {
128 /* <0 if used, >0 if free */
129 LONG CellSize;
130 } CELL_HEADER, *PCELL_HEADER;
131
132 typedef struct _KEY_CELL
133 {
134 /* Size of this cell */
135 LONG CellSize;
136
137 /* Key cell identifier "kn" (0x6b6e) */
138 USHORT Id;
139
140 /* Flags */
141 USHORT Flags;
142
143 /* Time of last flush */
144 LARGE_INTEGER LastWriteTime;
145
146 /* ? */
147 ULONG UnUsed1;
148
149 /* Block offset of parent key cell */
150 BLOCK_OFFSET ParentKeyOffset;
151
152 /* Count of sub keys for the key in this key cell */
153 ULONG NumberOfSubKeys;
154
155 /* ? */
156 ULONG UnUsed2;
157
158 /* Block offset of has table for FIXME: subkeys/values? */
159 BLOCK_OFFSET HashTableOffset;
160
161 /* ? */
162 ULONG UnUsed3;
163
164 /* Count of values contained in this key cell */
165 ULONG NumberOfValues;
166
167 /* Block offset of VALUE_LIST_CELL */
168 BLOCK_OFFSET ValueListOffset;
169
170 /* Block offset of security cell */
171 BLOCK_OFFSET SecurityKeyOffset;
172
173 /* Block offset of registry key class */
174 BLOCK_OFFSET ClassNameOffset;
175
176 /* ? */
177 ULONG Unused4[5];
178
179 /* Size in bytes of key name */
180 USHORT NameSize;
181
182 /* Size of class name in bytes */
183 USHORT ClassSize;
184
185 /* Name of key (not zero terminated) */
186 UCHAR Name[0];
187 } KEY_CELL, *PKEY_CELL;
188
189 /* KEY_CELL.Flags constants */
190 #define REG_KEY_ROOT_CELL 0x0C
191 #define REG_KEY_LINK_CELL 0x10
192 #define REG_KEY_NAME_PACKED 0x20
193
194 /*
195 * Hash record
196 *
197 * HashValue:
198 * packed name: four letters of value's name
199 * otherwise: Zero!
200 */
201 typedef struct _HASH_RECORD
202 {
203 BLOCK_OFFSET KeyOffset;
204 ULONG HashValue;
205 } HASH_RECORD, *PHASH_RECORD;
206
207 typedef struct _HASH_TABLE_CELL
208 {
209 LONG CellSize;
210 USHORT Id;
211 USHORT HashTableSize;
212 HASH_RECORD Table[0];
213 } HASH_TABLE_CELL, *PHASH_TABLE_CELL;
214
215
216 typedef struct _VALUE_LIST_CELL
217 {
218 LONG CellSize;
219 BLOCK_OFFSET ValueOffset[0];
220 } VALUE_LIST_CELL, *PVALUE_LIST_CELL;
221
222 typedef struct _VALUE_CELL
223 {
224 LONG CellSize;
225 USHORT Id; // "kv"
226 USHORT NameSize; // length of Name
227 ULONG DataSize; // length of datas in the cell pointed by DataOffset
228 BLOCK_OFFSET DataOffset;// datas are here if high bit of DataSize is set
229 ULONG DataType;
230 USHORT Flags;
231 USHORT Unused1;
232 UCHAR Name[0]; /* warning : not zero terminated */
233 } VALUE_CELL, *PVALUE_CELL;
234
235 /* VALUE_CELL.Flags constants */
236 #define REG_VALUE_NAME_PACKED 0x0001
237
238 /* VALUE_CELL.DataSize mask constants */
239 #define REG_DATA_SIZE_MASK 0x7FFFFFFF
240 #define REG_DATA_IN_OFFSET 0x80000000
241
242
243 typedef struct _SECURITY_CELL
244 {
245 LONG CellSize;
246 USHORT Id; // "sk"
247 USHORT Reserved;
248 BLOCK_OFFSET PrevSecurityCell;
249 BLOCK_OFFSET NextSecurityCell;
250 ULONG RefCount;
251 ULONG SdSize;
252 UCHAR Data[0];
253 } SECURITY_CELL, *PSECURITY_CELL;
254
255
256 typedef struct _DATA_CELL
257 {
258 LONG CellSize;
259 UCHAR Data[0];
260 } DATA_CELL, *PDATA_CELL;
261
262 #include <poppack.h>
263
264
265 typedef struct _BLOCK_LIST_ENTRY
266 {
267 PHBIN Bin;
268 PVOID Block;
269 } BLOCK_LIST_ENTRY, *PBLOCK_LIST_ENTRY;
270
271
272 typedef struct _REGISTRY_HIVE
273 {
274 LIST_ENTRY HiveList;
275 ULONG Flags;
276 UNICODE_STRING HiveFileName;
277 UNICODE_STRING LogFileName;
278 ULONG FileSize;
279 PHIVE_HEADER HiveHeader;
280 ULONG UpdateCounter;
281 ULONG BlockListSize;
282 PBLOCK_LIST_ENTRY BlockList;
283 ULONG FreeListSize;
284 ULONG FreeListMax;
285 PCELL_HEADER *FreeList;
286 BLOCK_OFFSET *FreeListOffset;
287
288 PSECURITY_CELL RootSecurityCell;
289
290 PULONG BitmapBuffer;
291 RTL_BITMAP DirtyBitMap;
292 BOOLEAN HiveDirty;
293 } REGISTRY_HIVE, *PREGISTRY_HIVE;
294
295 /* REGISTRY_HIVE.Flags constants */
296 /* When set, the hive uses pointers instead of offsets. */
297 #define HIVE_POINTER 0x00000001
298
299 /* When set, the hive is not backed by a file.
300 Therefore, it can not be flushed to disk. */
301 #define HIVE_NO_FILE 0x00000002
302
303 /* When set, a modified (dirty) hive is not synchronized automatically.
304 Explicit synchronization (save/flush) works. */
305 #define HIVE_NO_SYNCH 0x00000004
306
307 #define IsPointerHive(Hive) ((Hive)->Flags & HIVE_POINTER)
308 #define IsNoFileHive(Hive) ((Hive)->Flags & HIVE_NO_FILE)
309 #define IsNoSynchHive(Hive) ((Hive)->Flags & HIVE_NO_SYNCH)
310
311
312 #define IsFreeCell(Cell)(Cell->CellSize >= 0)
313 #define IsUsedCell(Cell)(Cell->CellSize < 0)
314
315
316 /* KEY_OBJECT.Flags */
317
318 /* When set, the key is scheduled for deletion, and all
319 attempts to access the key must not succeed */
320 #define KO_MARKED_FOR_DELETE 0x00000001
321
322
323 /* Type defining the Object Manager Key Object */
324 typedef struct _KEY_OBJECT
325 {
326 /* Fields used by the Object Manager */
327 CSHORT Type;
328 CSHORT Size;
329
330 /* Key flags */
331 ULONG Flags;
332
333 /* Key name */
334 UNICODE_STRING Name;
335
336 /* Registry hive the key belongs to */
337 PREGISTRY_HIVE RegistryHive;
338
339 /* Block offset of the key cell this key belongs in */
340 BLOCK_OFFSET KeyCellOffset;
341
342 /* KEY_CELL this key belong in */
343 PKEY_CELL KeyCell;
344
345 /* Link to the parent KEY_OBJECT for this key */
346 struct _KEY_OBJECT *ParentKey;
347
348 /* Subkeys loaded in SubKeys */
349 ULONG NumberOfSubKeys;
350
351 /* Space allocated in SubKeys */
352 ULONG SizeOfSubKeys;
353
354 /* List of subkeys loaded */
355 struct _KEY_OBJECT **SubKeys;
356
357 /* List entry into the global key object list */
358 LIST_ENTRY ListEntry;
359
360 /* Time stamp for the last access by the parse routine */
361 ULONG TimeStamp;
362 } KEY_OBJECT, *PKEY_OBJECT;
363
364 /* Bits 31-22 (top 10 bits) of the cell index is the directory index */
365 #define CmiDirectoryIndex(CellIndex)(CellIndex & 0xffc000000)
366 /* Bits 21-12 (middle 10 bits) of the cell index is the table index */
367 #define CmiTableIndex(Cellndex)(CellIndex & 0x003ff000)
368 /* Bits 11-0 (bottom 12 bits) of the cell index is the byte offset */
369 #define CmiByteOffset(Cellndex)(CellIndex & 0x00000fff)
370
371
372 extern BOOLEAN CmiDoVerify;
373 extern PREGISTRY_HIVE CmiVolatileHive;
374 extern POBJECT_TYPE CmiKeyType;
375 extern KSPIN_LOCK CmiKeyListLock;
376
377 extern LIST_ENTRY CmiHiveListHead;
378
379 extern ERESOURCE CmiRegistryLock;
380
381
382 /* Registry Callback Function */
383 typedef NTSTATUS (STDCALL *PEX_CALLBACK_FUNCTION ) (
384 IN PVOID CallbackContext,
385 IN REG_NOTIFY_CLASS Argument1,
386 IN PVOID Argument2
387 );
388
389 typedef struct _REGISTRY_CALLBACK
390 {
391 LIST_ENTRY ListEntry;
392 EX_RUNDOWN_REF RundownRef;
393 PEX_CALLBACK_FUNCTION Function;
394 PVOID Context;
395 LARGE_INTEGER Cookie;
396 BOOLEAN PendingDelete;
397 } REGISTRY_CALLBACK, *PREGISTRY_CALLBACK;
398
399 NTSTATUS
400 CmiCallRegisteredCallbacks(IN REG_NOTIFY_CLASS Argument1,
401 IN PVOID Argument2);
402
403 VOID
404 CmiVerifyBinHeader(PHBIN BinHeader);
405 VOID
406 CmiVerifyKeyCell(PKEY_CELL KeyCell);
407 VOID
408 CmiVerifyRootKeyCell(PKEY_CELL RootKeyCell);
409 VOID
410 CmiVerifyKeyObject(PKEY_OBJECT KeyObject);
411 VOID
412 CmiVerifyRegistryHive(PREGISTRY_HIVE RegistryHive);
413
414 #ifdef DBG
415 #define VERIFY_BIN_HEADER CmiVerifyBinHeader
416 #define VERIFY_KEY_CELL CmiVerifyKeyCell
417 #define VERIFY_ROOT_KEY_CELL CmiVerifyRootKeyCell
418 #define VERIFY_VALUE_CELL CmiVerifyValueCell
419 #define VERIFY_VALUE_LIST_CELL CmiVerifyValueListCell
420 #define VERIFY_KEY_OBJECT CmiVerifyKeyObject
421 #define VERIFY_REGISTRY_HIVE CmiVerifyRegistryHive
422 #else
423 #define VERIFY_BIN_HEADER(x)
424 #define VERIFY_KEY_CELL(x)
425 #define VERIFY_ROOT_KEY_CELL(x)
426 #define VERIFY_VALUE_CELL(x)
427 #define VERIFY_VALUE_LIST_CELL(x)
428 #define VERIFY_KEY_OBJECT(x)
429 #define VERIFY_REGISTRY_HIVE(x)
430 #endif
431
432 NTSTATUS STDCALL
433 CmRegisterCallback(IN PEX_CALLBACK_FUNCTION Function,
434 IN PVOID Context,
435 IN OUT PLARGE_INTEGER Cookie
436 );
437
438 NTSTATUS STDCALL
439 CmUnRegisterCallback(IN LARGE_INTEGER Cookie);
440
441 NTSTATUS STDCALL
442 CmiObjectParse(IN PVOID ParsedObject,
443 OUT PVOID *NextObject,
444 IN PUNICODE_STRING FullPath,
445 IN OUT PWSTR *Path,
446 IN ULONG Attribute);
447
448 VOID STDCALL
449 CmiObjectDelete(PVOID DeletedObject);
450
451 NTSTATUS STDCALL
452 CmiObjectSecurity(PVOID ObjectBody,
453 SECURITY_OPERATION_CODE OperationCode,
454 SECURITY_INFORMATION SecurityInformation,
455 PSECURITY_DESCRIPTOR SecurityDescriptor,
456 PULONG BufferLength,
457 PSECURITY_DESCRIPTOR *OldSecurityDescriptor,
458 POOL_TYPE PoolType,
459 PGENERIC_MAPPING GenericMapping);
460
461 NTSTATUS STDCALL
462 CmiObjectQueryName (PVOID ObjectBody,
463 POBJECT_NAME_INFORMATION ObjectNameInfo,
464 ULONG Length,
465 PULONG ReturnLength);
466
467 NTSTATUS
468 CmiImportHiveBins(PREGISTRY_HIVE Hive,
469 PUCHAR ChunkPtr);
470
471 VOID
472 CmiFreeHiveBins(PREGISTRY_HIVE Hive);
473
474 NTSTATUS
475 CmiCreateHiveFreeCellList(PREGISTRY_HIVE Hive);
476
477 VOID
478 CmiFreeHiveFreeCellList(PREGISTRY_HIVE Hive);
479
480 NTSTATUS
481 CmiCreateHiveBitmap(PREGISTRY_HIVE Hive);
482
483
484 VOID
485 CmiAddKeyToList(IN PKEY_OBJECT ParentKey,
486 IN PKEY_OBJECT NewKey);
487
488 NTSTATUS
489 CmiRemoveKeyFromList(IN PKEY_OBJECT NewKey);
490
491 NTSTATUS
492 CmiScanKeyList(IN PKEY_OBJECT Parent,
493 IN PUNICODE_STRING KeyName,
494 IN ULONG Attributes,
495 PKEY_OBJECT* ReturnedObject);
496
497 NTSTATUS
498 CmiCreateVolatileHive(PREGISTRY_HIVE *RegistryHive);
499
500 NTSTATUS
501 CmiLoadHive(POBJECT_ATTRIBUTES KeyObjectAttributes,
502 PUNICODE_STRING FileName,
503 ULONG Flags);
504
505 NTSTATUS
506 CmiRemoveRegistryHive(PREGISTRY_HIVE RegistryHive);
507
508 NTSTATUS
509 CmiFlushRegistryHive(PREGISTRY_HIVE RegistryHive);
510
511 ULONG
512 CmiGetNumberOfSubKeys(PKEY_OBJECT KeyObject);
513
514 ULONG
515 CmiGetMaxNameLength(IN PKEY_OBJECT KeyObject);
516
517 ULONG
518 CmiGetMaxClassLength(IN PKEY_OBJECT KeyObject);
519
520 ULONG
521 CmiGetMaxValueNameLength(IN PREGISTRY_HIVE RegistryHive,
522 IN PKEY_CELL KeyCell);
523
524 ULONG
525 CmiGetMaxValueDataLength(IN PREGISTRY_HIVE RegistryHive,
526 IN PKEY_CELL KeyCell);
527
528 NTSTATUS
529 CmiScanForSubKey(IN PREGISTRY_HIVE RegistryHive,
530 IN PKEY_CELL KeyCell,
531 OUT PKEY_CELL *SubKeyCell,
532 OUT BLOCK_OFFSET *BlockOffset,
533 IN PUNICODE_STRING KeyName,
534 IN ACCESS_MASK DesiredAccess,
535 IN ULONG Attributes);
536
537 NTSTATUS
538 CmiAddSubKey(IN PREGISTRY_HIVE RegistryHive,
539 IN PKEY_OBJECT ParentKey,
540 OUT PKEY_OBJECT SubKey,
541 IN PUNICODE_STRING SubKeyName,
542 IN ULONG TitleIndex,
543 IN PUNICODE_STRING Class,
544 IN ULONG CreateOptions);
545
546 NTSTATUS
547 CmiRemoveSubKey(IN PREGISTRY_HIVE RegistryHive,
548 IN PKEY_OBJECT Parent,
549 IN PKEY_OBJECT SubKey);
550
551 NTSTATUS
552 CmiScanKeyForValue(IN PREGISTRY_HIVE RegistryHive,
553 IN PKEY_CELL KeyCell,
554 IN PUNICODE_STRING ValueName,
555 OUT PVALUE_CELL *ValueCell,
556 OUT BLOCK_OFFSET *VBOffset);
557
558 NTSTATUS
559 CmiGetValueFromKeyByIndex(IN PREGISTRY_HIVE RegistryHive,
560 IN PKEY_CELL KeyCell,
561 IN ULONG Index,
562 OUT PVALUE_CELL *ValueCell);
563
564 NTSTATUS
565 CmiAddValueToKey(IN PREGISTRY_HIVE RegistryHive,
566 IN PKEY_CELL KeyCell,
567 IN BLOCK_OFFSET KeyCellOffset,
568 IN PUNICODE_STRING ValueName,
569 OUT PVALUE_CELL *pValueCell,
570 OUT BLOCK_OFFSET *pValueCellOffset);
571
572 NTSTATUS
573 CmiDeleteValueFromKey(IN PREGISTRY_HIVE RegistryHive,
574 IN PKEY_CELL KeyCell,
575 IN BLOCK_OFFSET KeyCellOffset,
576 IN PUNICODE_STRING ValueName);
577
578 NTSTATUS
579 CmiAllocateHashTableCell(IN PREGISTRY_HIVE RegistryHive,
580 OUT PHASH_TABLE_CELL *HashBlock,
581 OUT BLOCK_OFFSET *HBOffset,
582 IN ULONG HashTableSize);
583
584 PKEY_CELL
585 CmiGetKeyFromHashByIndex(PREGISTRY_HIVE RegistryHive,
586 PHASH_TABLE_CELL HashBlock,
587 ULONG Index);
588
589 NTSTATUS
590 CmiAddKeyToHashTable(PREGISTRY_HIVE RegistryHive,
591 PHASH_TABLE_CELL HashCell,
592 BLOCK_OFFSET HashCellOffset,
593 PKEY_CELL NewKeyCell,
594 BLOCK_OFFSET NKBOffset);
595
596 NTSTATUS
597 CmiRemoveKeyFromHashTable(PREGISTRY_HIVE RegistryHive,
598 PHASH_TABLE_CELL HashBlock,
599 BLOCK_OFFSET NKBOffset);
600
601 NTSTATUS
602 CmiAllocateValueCell(IN PREGISTRY_HIVE RegistryHive,
603 OUT PVALUE_CELL *ValueCell,
604 OUT BLOCK_OFFSET *VBOffset,
605 IN PUNICODE_STRING ValueName);
606
607 NTSTATUS
608 CmiDestroyValueCell(PREGISTRY_HIVE RegistryHive,
609 PVALUE_CELL ValueCell,
610 BLOCK_OFFSET VBOffset);
611
612 NTSTATUS
613 CmiAllocateCell(PREGISTRY_HIVE RegistryHive,
614 LONG CellSize,
615 PVOID *Cell,
616 BLOCK_OFFSET *CellOffset);
617
618 NTSTATUS
619 CmiDestroyCell(PREGISTRY_HIVE RegistryHive,
620 PVOID Cell,
621 BLOCK_OFFSET CellOffset);
622
623 PHBIN
624 CmiGetBin (PREGISTRY_HIVE RegistryHive,
625 BLOCK_OFFSET CellOffset);
626
627 PVOID
628 CmiGetCell (PREGISTRY_HIVE RegistryHive,
629 BLOCK_OFFSET CellOffset,
630 OUT PHBIN *Bin);
631
632 VOID
633 CmiMarkBlockDirty(PREGISTRY_HIVE RegistryHive,
634 BLOCK_OFFSET BlockOffset);
635
636 VOID
637 CmiMarkBinDirty(PREGISTRY_HIVE RegistryHive,
638 BLOCK_OFFSET BinOffset);
639
640 NTSTATUS
641 CmiAddFree(PREGISTRY_HIVE RegistryHive,
642 PCELL_HEADER FreeBlock,
643 BLOCK_OFFSET FreeOffset,
644 BOOLEAN MergeFreeBlocks);
645
646 NTSTATUS
647 CmiConnectHive(POBJECT_ATTRIBUTES KeyObjectAttributes,
648 PREGISTRY_HIVE RegistryHive);
649
650 NTSTATUS
651 CmiDisconnectHive (POBJECT_ATTRIBUTES KeyObjectAttributes,
652 PREGISTRY_HIVE *RegistryHive);
653
654 NTSTATUS
655 CmiInitHives(BOOLEAN SetupBoot);
656
657 ULONG
658 CmiGetPackedNameLength(IN PUNICODE_STRING Name,
659 OUT PBOOLEAN Packable);
660
661 BOOLEAN
662 CmiComparePackedNames(IN PUNICODE_STRING Name,
663 IN PUCHAR NameBuffer,
664 IN USHORT NameBufferSize,
665 IN BOOLEAN NamePacked);
666
667 VOID
668 CmiCopyPackedName(PWCHAR NameBuffer,
669 PUCHAR PackedNameBuffer,
670 ULONG PackedNameSize);
671
672 BOOLEAN
673 CmiCompareHash(PUNICODE_STRING KeyName,
674 PCHAR HashString);
675
676 BOOLEAN
677 CmiCompareHashI(PUNICODE_STRING KeyName,
678 PCHAR HashString);
679
680 BOOLEAN
681 CmiCompareKeyNames(PUNICODE_STRING KeyName,
682 PKEY_CELL KeyCell);
683
684 BOOLEAN
685 CmiCompareKeyNamesI(PUNICODE_STRING KeyName,
686 PKEY_CELL KeyCell);
687
688
689 VOID
690 CmiSyncHives(VOID);
691
692
693 NTSTATUS
694 CmiCreateTempHive(PREGISTRY_HIVE *RegistryHive);
695
696 NTSTATUS
697 CmiCopyKey (PREGISTRY_HIVE DstHive,
698 PKEY_CELL DstKeyCell,
699 PREGISTRY_HIVE SrcHive,
700 PKEY_CELL SrcKeyCell);
701
702 NTSTATUS
703 CmiSaveTempHive (PREGISTRY_HIVE Hive,
704 HANDLE FileHandle);
705
706 #endif /*__INCLUDE_CM_H*/