ReactOS  0.4.12-dev-934-g9a4676f
cmlib.h
Go to the documentation of this file.
1 /*
2  * PROJECT: Registry manipulation library
3  * LICENSE: GPL - See COPYING in the top level directory
4  * COPYRIGHT: Copyright 2005 Filip Navara <navaraf@reactos.org>
5  * Copyright 2001 - 2005 Eric Kohl
6  */
7 
8 #ifndef _CMLIB_H_
9 #define _CMLIB_H_
10 
11 //
12 // Debug support switch
13 //
14 #define _CMLIB_DEBUG_ 1
15 
16 #ifdef CMLIB_HOST
17  #include <typedefs.h>
18  #include <stdio.h>
19  #include <string.h>
20 
21  // NTDDI_xxx versions we allude to in the library (see psdk/sdkddkver.h)
22  #define NTDDI_WS03SP4 0x05020400
23  #define NTDDI_WIN6 0x06000000
24  #define NTDDI_LONGHORN NTDDI_WIN6
25  #define NTDDI_VISTA NTDDI_WIN6
26  #define NTDDI_WIN7 0x06010000
27 
28  #define NTDDI_VERSION NTDDI_WS03SP4 // This is the ReactOS NT kernel version
29 
30  /* C_ASSERT Definition */
31  #define C_ASSERT(expr) extern char (*c_assert(void)) [(expr) ? 1 : -1]
32 
33  #ifdef _WIN32
34  #define strncasecmp _strnicmp
35  #define strcasecmp _stricmp
36  #endif // _WIN32
37 
38  #if (!defined(_MSC_VER) || (_MSC_VER < 1500))
39  #define _In_
40  #define _Out_
41  #define _Inout_
42  #define _In_opt_
43  #define _In_range_(x, y)
44  #endif
45 
46  #define __drv_aliasesMem
47 
48  #ifndef min
49  #define min(a, b) (((a) < (b)) ? (a) : (b))
50  #endif
51 
52  // #ifndef max
53  // #define max(a, b) (((a) > (b)) ? (a) : (b))
54  // #endif
55 
56  // Definitions copied from <ntstatus.h>
57  // We only want to include host headers, so we define them manually
58  #define STATUS_SUCCESS ((NTSTATUS)0x00000000)
59  #define STATUS_NOT_IMPLEMENTED ((NTSTATUS)0xC0000002)
60  #define STATUS_NO_MEMORY ((NTSTATUS)0xC0000017)
61  #define STATUS_INSUFFICIENT_RESOURCES ((NTSTATUS)0xC000009A)
62  #define STATUS_REGISTRY_CORRUPT ((NTSTATUS)0xC000014C)
63  #define STATUS_NOT_REGISTRY_FILE ((NTSTATUS)0xC000015C)
64  #define STATUS_REGISTRY_RECOVERED ((NTSTATUS)0x40000009)
65 
66  #define REG_OPTION_VOLATILE 1
67  #define OBJ_CASE_INSENSITIVE 0x00000040L
68  #define USHORT_MAX USHRT_MAX
69 
70  #define OBJ_NAME_PATH_SEPARATOR ((WCHAR)L'\\')
71  #define UNICODE_NULL ((WCHAR)0)
72 
73  VOID NTAPI
77 
78  LONG NTAPI
80  IN PCUNICODE_STRING String1,
83 
84  VOID
85  NTAPI
87  IN ULONG BugCheckCode,
88  IN ULONG_PTR BugCheckParameter1,
89  IN ULONG_PTR BugCheckParameter2,
90  IN ULONG_PTR BugCheckParameter3,
91  IN ULONG_PTR BugCheckParameter4);
92 
93  VOID NTAPI
95  OUT PLARGE_INTEGER CurrentTime);
96 
97  WCHAR NTAPI
99  IN WCHAR Source);
100 
101  VOID NTAPI
103  IN PRTL_BITMAP BitMapHeader,
104  IN PULONG BitMapBuffer,
105  IN ULONG SizeOfBitMap);
106 
107  ULONG NTAPI
109  IN PRTL_BITMAP BitMapHeader,
111  IN ULONG HintIndex);
112 
113  VOID NTAPI
114  RtlSetBits(
115  IN PRTL_BITMAP BitMapHeader,
117  IN ULONG NumberToSet);
118 
119  VOID NTAPI
121  IN PRTL_BITMAP BitMapHeader);
122 
123  #define RtlCheckBit(BMH,BP) (((((PLONG)(BMH)->Buffer)[(BP) / 32]) >> ((BP) % 32)) & 0x1)
124  #define UNREFERENCED_PARAMETER(P) {(P)=(P);}
125 
126  #define PKTHREAD PVOID
127  #define PKGUARDED_MUTEX PVOID
128  #define PERESOURCE PVOID
129  #define PFILE_OBJECT PVOID
130  #define PKEVENT PVOID
131  #define PWORK_QUEUE_ITEM PVOID
132  #define EX_PUSH_LOCK PULONG_PTR
133 
134  // Definitions copied from <ntifs.h>
135  // We only want to include host headers, so we define them manually
136 
138 
139  typedef struct _SECURITY_DESCRIPTOR_RELATIVE
140  {
141  UCHAR Revision;
142  UCHAR Sbz1;
144  ULONG Owner;
145  ULONG Group;
146  ULONG Sacl;
147  ULONG Dacl;
149 
150  #define CMLTRACE(x, ...)
151  #undef PAGED_CODE
152  #define PAGED_CODE()
153  #define REGISTRY_ERROR ((ULONG)0x00000051L)
154 #else
155  //
156  // Debug/Tracing support
157  //
158  #if _CMLIB_DEBUG_
159  #ifdef NEW_DEBUG_SYSTEM_IMPLEMENTED // enable when Debug Filters are implemented
160  #define CMLTRACE DbgPrintEx
161  #else
162  #define CMLTRACE(x, ...) \
163  if (x & CmlibTraceLevel) DbgPrint(__VA_ARGS__)
164  #endif
165  #else
166  #define CMLTRACE(x, ...) DPRINT(__VA_ARGS__)
167  #endif
168 
169  #include <ntdef.h>
170  #include <ntifs.h>
171  #include <bugcodes.h>
172  #undef PAGED_CODE
173  #define PAGED_CODE()
174 
175  /* Prevent inclusion of Windows headers through <wine/unicode.h> */
176  #define _WINDEF_
177  #define _WINBASE_
178  #define _WINNLS_
179 #endif
180 
181 
182 //
183 // These define the Debug Masks Supported
184 //
185 #define CMLIB_HCELL_DEBUG 0x01
186 
187 #ifndef ROUND_UP
188 #define ROUND_UP(a,b) ((((a)+(b)-1)/(b))*(b))
189 #define ROUND_DOWN(a,b) (((a)/(b))*(b))
190 #endif
191 
192 //
193 // PAGE_SIZE definition
194 //
195 #ifndef PAGE_SIZE
196 #if defined(TARGET_i386) || defined(TARGET_amd64) || defined(TARGET_arm)
197 #define PAGE_SIZE 0x1000
198 #else
199 #error Local PAGE_SIZE definition required when built as host
200 #endif
201 #endif
202 
203 #define TAG_CM ' MC'
204 #define TAG_KCB 'bkMC'
205 #define TAG_CMHIVE 'vHMC'
206 #define TAG_CMSD 'DSMC'
207 
208 #define CMAPI NTAPI
209 
210 #include <wine/unicode.h>
211 #include <wchar.h>
212 #include "hivedata.h"
213 #include "cmdata.h"
214 
215 #if defined(_TYPEDEFS_HOST_H) || defined(__FREELDR_H) // || defined(_BLDR_)
216 
217 #define PCM_KEY_SECURITY_CACHE_ENTRY PVOID
218 #define PCM_KEY_CONTROL_BLOCK PVOID
219 #define PCM_CELL_REMAP_BLOCK PVOID
220 
221 // See also ntoskrnl/include/internal/cm.h
222 #define CMP_SECURITY_HASH_LISTS 64
223 
224 // #endif // Commented out until one finds a way to properly include
225  // this header in freeldr and in ntoskrnl.
226 
227 //
228 // Use Count Log and Entry
229 //
230 typedef struct _CM_USE_COUNT_LOG_ENTRY
231 {
233  PVOID Stack[7];
235 
236 typedef struct _CM_USE_COUNT_LOG
237 {
238  USHORT Next;
239  USHORT Size;
242 
243 //
244 // Configuration Manager Hive Structure
245 //
246 typedef struct _CMHIVE
247 {
248  HHIVE Hive;
268  ULONG UseCount;
276  BOOLEAN Frozen;
285  ULONG Flags;
290 } CMHIVE, *PCMHIVE;
291 
292 #endif // See comment above
293 
294 typedef struct _HV_HIVE_CELL_PAIR
295 {
299 
300 #define STATIC_CELL_PAIR_COUNT 4
301 typedef struct _HV_TRACK_CELL_REF
302 {
309 
310 extern ULONG CmlibTraceLevel;
311 
312 //
313 // Hack since bigkeys are not yet supported
314 //
315 #define ASSERT_VALUE_BIG(h, s) \
316  ASSERTMSG("Big keys not supported!\n", !CmpIsKeyValueBig(h, s));
317 
318 //
319 // Returns whether or not this is a small valued key
320 //
321 static inline
322 BOOLEAN
324  IN ULONG Length)
325 {
326  /* Check if the length has the special size value */
328  {
329  /* It does, so this is a small key: return the real length */
330  *RealLength = Length - CM_KEY_VALUE_SPECIAL_SIZE;
331  return TRUE;
332  }
333 
334  /* This is not a small key, return the length we read */
335  *RealLength = Length;
336  return FALSE;
337 }
338 
339 //
340 // Returns whether or not this is a big valued key
341 //
342 static inline
343 BOOLEAN
345  IN ULONG Length)
346 {
347  /* Check if the hive is XP Beta 1 or newer */
348  if (Hive->Version >= HSYS_WHISTLER_BETA1)
349  {
350  /* Check if the key length is valid for a big value key */
352  {
353  /* Yes, this value is big */
354  return TRUE;
355  }
356  }
357 
358  /* Not a big value key */
359  return FALSE;
360 }
361 
362 /*
363  * Public Hive functions.
364  */
367  PHHIVE RegistryHive,
368  ULONG OperationType,
369  ULONG HiveFlags,
370  ULONG FileType,
371  PVOID HiveData OPTIONAL,
374  PFILE_SET_SIZE_ROUTINE FileSetSize,
375  PFILE_WRITE_ROUTINE FileWrite,
376  PFILE_READ_ROUTINE FileRead,
377  PFILE_FLUSH_ROUTINE FileFlush,
378  ULONG Cluster OPTIONAL,
380 
381 VOID CMAPI
382 HvFree(
383  PHHIVE RegistryHive);
384 
385 PVOID CMAPI
386 HvGetCell(
387  PHHIVE RegistryHive,
388  HCELL_INDEX CellOffset);
389 
390 #define HvReleaseCell(h, c) \
391 do { \
392  if ((h)->ReleaseCellRoutine) \
393  (h)->ReleaseCellRoutine(h, c); \
394 } while(0)
395 
396 LONG CMAPI
398  PHHIVE RegistryHive,
399  PVOID Cell);
400 
403  PHHIVE RegistryHive,
404  ULONG Size,
406  IN HCELL_INDEX Vicinity);
407 
410  IN PHHIVE RegistryHive,
411  IN HCELL_INDEX CellIndex
412 );
413 
416  PHHIVE RegistryHive,
417  HCELL_INDEX CellOffset,
418  ULONG Size);
419 
420 VOID CMAPI
421 HvFreeCell(
422  PHHIVE RegistryHive,
423  HCELL_INDEX CellOffset);
424 
427  PHHIVE RegistryHive,
428  HCELL_INDEX CellOffset,
429  BOOLEAN HoldingLock);
430 
433  IN PHHIVE Hive,
435 );
436 
437 BOOLEAN
438 CMAPI
440  IN PHHIVE RegistryHive
441 );
442 
444 HvSyncHive(
445  PHHIVE RegistryHive);
446 
449  PHHIVE RegistryHive);
450 
451 BOOLEAN
452 CMAPI
454  IN OUT PHV_TRACK_CELL_REF CellRef,
455  IN PHHIVE Hive,
457 );
458 
459 VOID
460 CMAPI
462  IN OUT PHV_TRACK_CELL_REF CellRef
463 );
464 
465 /*
466  * Private functions.
467  */
468 
469 PHBIN CMAPI
470 HvpAddBin(
471  PHHIVE RegistryHive,
472  ULONG Size,
474 
477  PHHIVE Hive);
478 
479 ULONG CMAPI
481  PHBASE_BLOCK HiveHeader);
482 
483 
484 /* Old-style Public "Cmlib" functions */
485 
488  PHHIVE Hive,
489  PCWSTR Name);
490 
491 VOID CMAPI
493  PHHIVE RegistryHive);
494 
495 
496 /* NT-style Public Cm functions */
497 
498 //
499 // Cell Index Routines
500 //
502 NTAPI
504  IN PHHIVE Hive,
506  IN PCUNICODE_STRING SearchName
507 );
508 
510 NTAPI
512  IN PHHIVE Hive,
514  IN ULONG Number
515 );
516 
517 ULONG
518 NTAPI
520  IN ULONG Hash,
522  IN BOOLEAN AllowSeparators
523 );
524 
525 BOOLEAN
526 NTAPI
528  IN PHHIVE Hive,
531 );
532 
533 BOOLEAN
534 NTAPI
536  IN PHHIVE Hive,
537  IN HCELL_INDEX ParentKey,
538  IN HCELL_INDEX TargetKey
539 );
540 
541 BOOLEAN
542 NTAPI
544  IN PHHIVE Hive,
545  HCELL_INDEX ParentKey,
546  HCELL_INDEX TargetKey
547 );
548 
549 
550 //
551 // Name Functions
552 //
553 LONG
554 NTAPI
556  IN PCUNICODE_STRING SearchName,
557  IN PWCHAR CompressedName,
558  IN ULONG NameLength
559 );
560 
561 USHORT
562 NTAPI
564  IN PHHIVE Hive,
566 );
567 
568 USHORT
569 NTAPI
571  IN PWCHAR Name,
572  IN ULONG Length
573 );
574 
575 USHORT
576 NTAPI
578  IN PHHIVE Hive,
581 );
582 
583 VOID
584 NTAPI
587  IN ULONG DestinationLength,
588  IN PWCHAR Source,
589  IN ULONG SourceLength
590 );
591 
592 BOOLEAN
593 NTAPI
595  IN PHHIVE Hive,
596  IN PCHILD_LIST ChildList,
598  OUT PULONG ChildIndex OPTIONAL,
599  OUT PHCELL_INDEX CellIndex
600 );
601 
602 
603 //
604 // Cell Value Routines
605 //
607 NTAPI
609  IN PHHIVE Hive,
610  IN PCM_KEY_NODE KeyNode,
612 );
613 
615 NTAPI
617  IN PHHIVE Hive,
620 );
621 
622 NTSTATUS
623 NTAPI
625  IN PHHIVE Hive,
626  IN PVOID Data,
627  IN ULONG DataSize,
628  IN HSTORAGE_TYPE StorageType,
629  IN HCELL_INDEX ValueCell,
630  OUT PHCELL_INDEX DataCell
631 );
632 
633 NTSTATUS
634 NTAPI
636  IN PHHIVE Hive,
637  IN HCELL_INDEX ValueCell,
638  IN ULONG Index,
639  IN HSTORAGE_TYPE StorageType,
640  IN OUT PCHILD_LIST ChildList
641 );
642 
643 BOOLEAN
644 NTAPI
646  IN PHHIVE Hive,
648 );
649 
650 BOOLEAN
651 NTAPI
653  IN PHHIVE Hive,
655 );
656 
657 BOOLEAN
658 NTAPI
660  IN PHHIVE Hive,
661  IN HCELL_INDEX DataCell,
663 );
664 
665 NTSTATUS
666 NTAPI
668  IN PHHIVE Hive,
669  IN ULONG Index,
670  IN OUT PCHILD_LIST ChildList
671 );
672 
673 BOOLEAN
674 NTAPI
676  IN PHHIVE Hive,
678  OUT PULONG Length,
679  OUT PVOID *Buffer,
680  OUT PBOOLEAN BufferAllocated,
681  OUT PHCELL_INDEX CellToRelease
682 );
683 
684 NTSTATUS
685 NTAPI
687  IN PHHIVE SourceHive,
688  IN PCHILD_LIST SrcValueList,
689  IN PHHIVE DestinationHive,
690  IN OUT PCHILD_LIST DestValueList,
691  IN HSTORAGE_TYPE StorageType
692 );
693 
694 NTSTATUS
695 NTAPI
697  IN PHHIVE Hive,
700 );
701 
702 VOID
703 NTAPI
705  IN PHHIVE Hive,
706  IN HCELL_INDEX SecurityCell
707 );
708 
709 VOID
710 NTAPI
712  IN PHHIVE Hive,
714 );
715 
716 /******************************************************************************/
717 
718 /* To be implemented by the user of this library */
719 PVOID
720 NTAPI
722  IN SIZE_T Size,
723  IN BOOLEAN Paged,
724  IN ULONG Tag
725 );
726 
727 VOID
728 NTAPI
729 CmpFree(
730  IN PVOID Ptr,
731  IN ULONG Quota
732 );
733 
734 #endif /* _CMLIB_H_ */
#define KeQuerySystemTime(t)
Definition: env_spec_w32.h:570
PKGUARDED_MUTEX ViewLock
Definition: cm.h:399
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2327
static int Hash(const char *)
Definition: reader.c:2257
BOOLEAN CMAPI HvIsCellDirty(IN PHHIVE Hive, IN HCELL_INDEX Cell)
Definition: hivecell.c:126
LIST_ENTRY TrustClassEntry
Definition: cm.h:431
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define IN
Definition: typedefs.h:38
struct _CMHIVE * PCMHIVE
#define TRUE
Definition: types.h:120
PWORK_QUEUE_ITEM UnloadWorkItem
Definition: cm.h:422
NTSYSAPI void WINAPI RtlInitializeBitMap(PRTL_BITMAP, PULONG, ULONG)
PHBIN CMAPI HvpAddBin(PHHIVE RegistryHive, ULONG Size, HSTORAGE_TYPE Storage)
Definition: hivebin.c:12
struct _CM_USE_COUNT_LOG * PCM_USE_COUNT_LOG
VOID NTAPI CmpFree(IN PVOID Ptr, IN ULONG Quota)
Definition: registry.c:47
WORD * PSECURITY_DESCRIPTOR_CONTROL
Definition: lsa.idl:37
PVOID Stack[7]
Definition: cm.h:378
BOOLEAN(CMAPI * PFILE_SET_SIZE_ROUTINE)(struct _HHIVE *RegistryHive, ULONG FileType, ULONG FileSize, ULONG OldfileSize)
Definition: hivedata.h:241
ULONG NTAPI CmpComputeHashKey(IN ULONG Hash, IN PCUNICODE_STRING Name, IN BOOLEAN AllowSeparators)
Definition: cmindex.c:460
BOOLEAN CMAPI HvIsCellAllocated(IN PHHIVE RegistryHive, IN HCELL_INDEX CellIndex)
Definition: hivecell.c:43
LONG SecurityHitHint
Definition: cm.h:416
HCELL_INDEX CMAPI HvReallocateCell(PHHIVE RegistryHive, HCELL_INDEX CellOffset, ULONG Size)
Definition: hivecell.c:394
ULONG CMAPI HvpHiveHeaderChecksum(PHBASE_BLOCK HiveHeader)
Definition: hivesum.c:17
LIST_ENTRY NotifyList
Definition: cm.h:395
CM_USE_COUNT_LOG_ENTRY Log[32]
Definition: cm.h:385
NTSTATUS CMAPI HvInitialize(PHHIVE RegistryHive, ULONG OperationType, ULONG HiveFlags, ULONG FileType, PVOID HiveData OPTIONAL, PALLOCATE_ROUTINE Allocate, PFREE_ROUTINE Free, PFILE_SET_SIZE_ROUTINE FileSetSize, PFILE_WRITE_ROUTINE FileWrite, PFILE_READ_ROUTINE FileRead, PFILE_FLUSH_ROUTINE FileFlush, ULONG Cluster OPTIONAL, PCUNICODE_STRING FileName OPTIONAL)
Definition: hiveinit.c:522
NTSTATUS NTAPI CmpFreeKeyByCell(IN PHHIVE Hive, IN HCELL_INDEX Cell, IN BOOLEAN Unlink)
Definition: cmkeydel.c:159
BOOLEAN NTAPI CmpGetValueData(IN PHHIVE Hive, IN PCM_KEY_VALUE Value, OUT PULONG Length, OUT PVOID *Buffer, OUT PBOOLEAN BufferAllocated, OUT PHCELL_INDEX CellToRelease)
Definition: cmvalue.c:125
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
ULONG SecurityCount
Definition: cm.h:414
USHORT Count
Definition: cmlib.h:303
PVOID NTAPI CmpAllocate(IN SIZE_T Size, IN BOOLEAN Paged, IN ULONG Tag)
Definition: registry.c:34
USHORT StaticCount
Definition: cmlib.h:307
LONG NTSTATUS
Definition: precomp.h:26
VOID NTAPI CmpFreeSecurityDescriptor(IN PHHIVE Hive, IN HCELL_INDEX Cell)
Definition: cmse.c:65
#define STATIC_CELL_PAIR_COUNT
Definition: cmlib.h:300
HCELL_INDEX NTAPI CmpFindSubKeyByNumber(IN PHHIVE Hive, IN PCM_KEY_NODE Node, IN ULONG Number)
Definition: cmindex.c:600
BOOLEAN Frozen
Definition: cm.h:421
CM_USE_COUNT_LOG UseCountLog
Definition: cm.h:428
BOOLEAN NTAPI CmpFindNameInList(IN PHHIVE Hive, IN PCHILD_LIST ChildList, IN PUNICODE_STRING Name, OUT PULONG ChildIndex OPTIONAL, OUT PHCELL_INDEX CellIndex)
Definition: cmname.c:149
VOID CMAPI HvReleaseFreeCellRefArray(IN OUT PHV_TRACK_CELL_REF CellRef)
Definition: hivecell.c:607
ULONG Flags
Definition: cm.h:430
ULONG FlushCount
Definition: cm.h:432
HCELL_INDEX CMAPI HvAllocateCell(PHHIVE RegistryHive, ULONG Size, HSTORAGE_TYPE Storage, IN HCELL_INDEX Vicinity)
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:716
ULONG CmlibTraceLevel
Definition: cminit.c:12
EX_PUSH_LOCK SecurityLock
Definition: cm.h:404
uint16_t * PWCHAR
Definition: typedefs.h:54
#define CM_KEY_VALUE_SPECIAL_SIZE
Definition: cm.h:73
NTSTATUS CMAPI HvpCreateHiveFreeCellList(PHHIVE Hive)
Definition: hivecell.c:279
static int Unlink(const char **args)
Definition: vfdcmd.c:2549
PKTHREAD HiveLockOwner
Definition: cm.h:398
USHORT PinnedViews
Definition: cm.h:412
NTSYSAPI WCHAR NTAPI RtlUpcaseUnicodeChar(WCHAR Source)
NTSTATUS NTAPI CmpRemoveValueFromList(IN PHHIVE Hive, IN ULONG Index, IN OUT PCHILD_LIST ChildList)
Definition: cmvalue.c:320
_In_opt_ PALLOCATE_FUNCTION Allocate
Definition: exfuncs.h:656
BOOLEAN NTAPI CmpAddSubKey(IN PHHIVE Hive, IN HCELL_INDEX Parent, IN HCELL_INDEX Child)
Definition: cmindex.c:1467
NTSTATUS NTAPI CmpAddValueToList(IN PHHIVE Hive, IN HCELL_INDEX ValueCell, IN ULONG Index, IN HSTORAGE_TYPE StorageType, IN OUT PCHILD_LIST ChildList)
Definition: cmvalue.c:207
_In_ ULONG _In_ ULONG HintIndex
Definition: rtlfuncs.h:609
#define CMAPI
Definition: cmlib.h:208
#define CMP_SECURITY_HASH_LISTS
Definition: cm.h:78
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:656
UNICODE_STRING FileUserName
Definition: cm.h:410
uint32_t ULONG_PTR
Definition: typedefs.h:63
BOOLEAN NTAPI CmpFreeValue(IN PHHIVE Hive, IN HCELL_INDEX Cell)
Definition: cmvalue.c:73
ERESOURCE * PERESOURCE
Definition: env_spec_w32.h:595
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
_In_ ULONG NumberToFind
Definition: rtlfuncs.h:609
BOOLEAN(CMAPI * PFILE_READ_ROUTINE)(struct _HHIVE *RegistryHive, ULONG FileType, PULONG FileOffset, PVOID Buffer, SIZE_T BufferLength)
Definition: hivedata.h:223
BOOLEAN(CMAPI * PFILE_FLUSH_ROUTINE)(struct _HHIVE *RegistryHive, ULONG FileType, PLARGE_INTEGER FileOffset, ULONG Length)
Definition: hivedata.h:249
long LONG
Definition: pedump.c:60
_In_ const STRING _In_ BOOLEAN CaseInSensitive
Definition: rtlfuncs.h:2276
WORD SECURITY_DESCRIPTOR_CONTROL
Definition: lsa.idl:37
VOID NTAPI CmpCopyCompressedName(OUT PWCHAR Destination, IN ULONG DestinationLength, IN PWCHAR Source, IN ULONG SourceLength)
Definition: cmname.c:56
struct _HV_HIVE_CELL_PAIR * PHV_HIVE_CELL_PAIR
PCM_KEY_CONTROL_BLOCK RootKcb
Definition: cm.h:420
PVOID CMAPI HvGetCell(PHHIVE RegistryHive, HCELL_INDEX CellOffset)
Definition: hivecell.c:67
ULONG GrowOffset
Definition: cm.h:424
struct _SECURITY_DESCRIPTOR_RELATIVE * PISECURITY_DESCRIPTOR_RELATIVE
HANDLE FileHandles[HFILE_TYPE_MAX]
Definition: cm.h:394
BOOLEAN CMAPI HvWriteHive(PHHIVE RegistryHive)
Definition: hivewrt.c:285
static BOOLEAN CmpIsKeyValueSmall(OUT PULONG RealLength, IN ULONG Length)
Definition: cmlib.h:323
HCELL_INDEX Cell
Definition: cm.h:377
unsigned char BOOLEAN
UNICODE_STRING FileFullPath
Definition: cm.h:409
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1869
ULONG SecurityCacheSize
Definition: cm.h:415
ULONG * PHCELL_INDEX
Definition: hivedata.h:80
HHIVE Hive
Definition: cm.h:393
VOID CMAPI HvFree(PHHIVE RegistryHive)
Definition: hiveinit.c:623
Definition: bufpool.h:45
#define HFILE_TYPE_MAX
Definition: hivedata.h:36
struct _HV_HIVE_CELL_PAIR HV_HIVE_CELL_PAIR
NTSYSAPI void WINAPI RtlClearAllBits(PRTL_BITMAP)
HV_HIVE_CELL_PAIR StaticArray[STATIC_CELL_PAIR_COUNT]
Definition: cmlib.h:306
PCELL_DATA NTAPI CmpValueToData(IN PHHIVE Hive, IN PCM_KEY_VALUE Value, OUT PULONG Length)
Definition: cmvalue.c:167
NTSTATUS NTAPI CmpSetValueDataNew(IN PHHIVE Hive, IN PVOID Data, IN ULONG DataSize, IN HSTORAGE_TYPE StorageType, IN HCELL_INDEX ValueCell, OUT PHCELL_INDEX DataCell)
Definition: cmvalue.c:289
struct _CM_USE_COUNT_LOG CM_USE_COUNT_LOG
BOOLEAN HiveIsLoading
Definition: cm.h:433
HCELL_INDEX NTAPI CmpFindValueByName(IN PHHIVE Hive, IN PCM_KEY_NODE KeyNode, IN PUNICODE_STRING Name)
Definition: cmvalue.c:99
USHORT NTAPI CmpCopyName(IN PHHIVE Hive, OUT PWCHAR Destination, IN PUNICODE_STRING Source)
Definition: cmname.c:21
BOOLEAN CMAPI CmCreateRootNode(PHHIVE Hive, PCWSTR Name)
Definition: cminit.c:17
__wchar_t WCHAR
Definition: xmlstorage.h:180
ULONG HCELL_INDEX
Definition: hivedata.h:80
BOOLEAN(CMAPI * PFILE_WRITE_ROUTINE)(struct _HHIVE *RegistryHive, ULONG FileType, PULONG FileOffset, PVOID Buffer, SIZE_T BufferLength)
Definition: hivedata.h:232
Definition: bzip2.c:1694
struct _CM_USE_COUNT_LOG_ENTRY CM_USE_COUNT_LOG_ENTRY
struct _CMHIVE CMHIVE
EX_PUSH_LOCK HiveLock
Definition: cm.h:397
Definition: cm.h:195
static const UCHAR Index[8]
Definition: usbohci.c:18
USHORT Next
Definition: cm.h:383
VOID(CMAPI * PFREE_ROUTINE)(PVOID Ptr, ULONG Quota)
Definition: hivedata.h:217
BOOLEAN CMAPI HvMarkCellDirty(PHHIVE RegistryHive, HCELL_INDEX CellOffset, BOOLEAN HoldingLock)
Definition: hivecell.c:100
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2875
NTSTATUS NTAPI CmpCopyKeyValueList(IN PHHIVE SourceHive, IN PCHILD_LIST SrcValueList, IN PHHIVE DestinationHive, IN OUT PCHILD_LIST DestValueList, IN HSTORAGE_TYPE StorageType)
Definition: cmvalue.c:521
PERESOURCE FlusherLock
Definition: cm.h:403
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
* PFILE_OBJECT
Definition: iotypes.h:1954
Definition: cm.h:375
LIST_ENTRY HiveList
Definition: cm.h:396
BOOLEAN CMAPI HvSyncHive(PHHIVE RegistryHive)
Definition: hivewrt.c:243
VOID CMAPI HvFreeCell(PHHIVE RegistryHive, HCELL_INDEX CellOffset)
Definition: hivecell.c:441
BOOLEAN CMAPI HvTrackCellRef(IN OUT PHV_TRACK_CELL_REF CellRef, IN PHHIVE Hive, IN HCELL_INDEX Cell)
Definition: hivecell.c:527
HCELL_INDEX Cell
Definition: cmlib.h:297
unsigned char UCHAR
Definition: xmlstorage.h:181
char * PBOOLEAN
Definition: retypes.h:11
LONG CMAPI HvGetCellSize(PHHIVE RegistryHive, PVOID Cell)
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1869
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
Definition: string_lib.cpp:31
USHORT Size
Definition: cm.h:384
LIST_ENTRY LRUViewListHead
Definition: cm.h:406
USHORT NTAPI CmpNameSize(IN PHHIVE Hive, IN PUNICODE_STRING Name)
Definition: cmname.c:74
EX_PUSH_LOCK WriterLock
Definition: cm.h:401
USHORT MappedViews
Definition: cm.h:411
NTSYSAPI ULONG WINAPI RtlFindSetBits(PCRTL_BITMAP, ULONG, ULONG)
Definition: typedefs.h:117
struct _SECURITY_DESCRIPTOR_RELATIVE SECURITY_DESCRIPTOR_RELATIVE
PKTHREAD ViewLockOwner
Definition: cm.h:400
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
_In_ ULONG StartingIndex
Definition: rtlfuncs.h:395
_In_opt_ PENTER_STATE_SYSTEM_HANDLER _In_opt_ PVOID _In_ LONG _In_opt_ LONG volatile * Number
Definition: ntpoapi.h:204
PKTHREAD WriterLockOwner
Definition: cm.h:402
ULONG UseCount
Definition: cm.h:413
PFILE_OBJECT FileObject
Definition: cm.h:408
struct _HV_TRACK_CELL_REF * PHV_TRACK_CELL_REF
LIST_ENTRY KnodeConvertListHead
Definition: cm.h:426
ULONG_PTR SIZE_T
Definition: typedefs.h:78
struct _CM_USE_COUNT_LOG_ENTRY * PCM_USE_COUNT_LOG_ENTRY
PCM_CELL_REMAP_BLOCK CellRemapArray
Definition: cm.h:427
PKTHREAD CreatorOwner
Definition: cm.h:434
struct _HV_TRACK_CELL_REF HV_TRACK_CELL_REF
SECURITY_DESCRIPTOR_CONTROL Control
Definition: setypes.h:785
unsigned short USHORT
Definition: pedump.c:61
LONG NTAPI CmpCompareCompressedName(IN PCUNICODE_STRING SearchName, IN PWCHAR CompressedName, IN ULONG NameLength)
Definition: cmname.c:109
HSTORAGE_TYPE
Definition: hivedata.h:100
#define CM_KEY_VALUE_BIG
Definition: cm.h:72
VOID NTAPI CmpRemoveSecurityCellList(IN PHHIVE Hive, IN HCELL_INDEX SecurityCell)
Definition: cmse.c:19
unsigned int * PULONG
Definition: retypes.h:1
HCELL_INDEX NTAPI CmpFindSubKeyByName(IN PHHIVE Hive, IN PCM_KEY_NODE Parent, IN PCUNICODE_STRING SearchName)
Definition: cmindex.c:683
PKTHREAD HiveSecurityLockOwner
Definition: cm.h:405
LIST_ENTRY PinViewListHead
Definition: cm.h:407
PKEVENT UnloadEvent
Definition: cm.h:419
static BOOLEAN CmpIsKeyValueBig(IN PHHIVE Hive, IN ULONG Length)
Definition: cmlib.h:344
CM_USE_COUNT_LOG LockHiveLog
Definition: cm.h:429
IN ULONG IN ULONG Tag
Definition: evtlib.h:159
BOOLEAN NTAPI CmpMarkIndexDirty(IN PHHIVE Hive, HCELL_INDEX ParentKey, HCELL_INDEX TargetKey)
_In_ const STRING * String2
Definition: rtlfuncs.h:2245
PVOID(CMAPI * PALLOCATE_ROUTINE)(SIZE_T Size, BOOLEAN Paged, ULONG Tag)
Definition: hivedata.h:210
#define HSYS_WHISTLER_BETA1
Definition: hivedata.h:59
#define OUT
Definition: typedefs.h:39
PCM_KEY_SECURITY_CACHE_ENTRY SecurityCache
Definition: cm.h:417
BOOLEAN NTAPI CmpRemoveSubKey(IN PHHIVE Hive, IN HCELL_INDEX ParentKey, IN HCELL_INDEX TargetKey)
Definition: cmindex.c:1696
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE Child
Definition: acpixf.h:716
VOID CMAPI CmPrepareHive(PHHIVE RegistryHive)
Definition: cminit.c:135
NTSYSAPI void WINAPI RtlSetBits(PRTL_BITMAP, ULONG, ULONG)
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3149
BOOLEAN NTAPI CmpFreeValueData(IN PHHIVE Hive, IN HCELL_INDEX DataCell, IN ULONG DataLength)
Definition: cmvalue.c:44
_Must_inspect_result_ _Out_writes_to_ DataLength PHIDP_DATA _Inout_ PULONG DataLength
Definition: hidpi.h:333
LIST_ENTRY SecurityHash[CMP_SECURITY_HASH_LISTS]
Definition: cm.h:418
USHORT NTAPI CmpCompressedNameSize(IN PWCHAR Name, IN ULONG Length)
Definition: cmname.c:95
static IStorage Storage
Definition: ole2.c:3548
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4733
LIST_ENTRY KcbConvertListHead
Definition: cm.h:425
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
Definition: rtlcompat.c:107
Definition: cm.h:391
PHV_HIVE_CELL_PAIR CellArray
Definition: cmlib.h:305
Definition: dlist.c:348
BOOLEAN CMAPI HvHiveWillShrink(IN PHHIVE RegistryHive)
Definition: hivewrt.c:277
BOOLEAN NTAPI CmpMarkValueDataDirty(IN PHHIVE Hive, IN PCM_KEY_VALUE Value)
Definition: cmvalue.c:19
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
BOOLEAN GrowOnlyMode
Definition: cm.h:423