ReactOS  0.4.13-dev-651-g5dbc677
cmi.c
Go to the documentation of this file.
1 /*
2  * ReactOS kernel
3  * Copyright (C) 2006 ReactOS Team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 /*
20  * COPYRIGHT: See COPYING in the top level directory
21  * PROJECT: ReactOS hive maker
22  * FILE: tools/mkhive/cmi.c
23  * PURPOSE: Registry file manipulation routines
24  * PROGRAMMERS: Hervé Poussineau
25  * Hermès Bélusca-Maïto
26  */
27 
28 /* INCLUDES *****************************************************************/
29 
30 #define NDEBUG
31 #include "mkhive.h"
32 
33 /* FUNCTIONS ****************************************************************/
34 
35 PVOID
36 NTAPI
38  IN SIZE_T Size,
39  IN BOOLEAN Paged,
40  IN ULONG Tag)
41 {
42  return (PVOID)malloc((size_t)Size);
43 }
44 
45 VOID
46 NTAPI
48  IN PVOID Ptr,
49  IN ULONG Quota)
50 {
51  free(Ptr);
52 }
53 
54 static BOOLEAN
55 NTAPI
57  IN PHHIVE RegistryHive,
58  IN ULONG FileType,
62 {
63  PCMHIVE CmHive = (PCMHIVE)RegistryHive;
65  if (fseek(File, *FileOffset, SEEK_SET) != 0)
66  return FALSE;
67 
68  return (fread(Buffer, 1, BufferLength, File) == BufferLength);
69 }
70 
71 static BOOLEAN
72 NTAPI
74  IN PHHIVE RegistryHive,
75  IN ULONG FileType,
77  IN PVOID Buffer,
79 {
80  PCMHIVE CmHive = (PCMHIVE)RegistryHive;
82  if (fseek(File, *FileOffset, SEEK_SET) != 0)
83  return FALSE;
84 
85  return (fwrite(Buffer, 1, BufferLength, File) == BufferLength);
86 }
87 
88 static BOOLEAN
89 NTAPI
91  IN PHHIVE RegistryHive,
92  IN ULONG FileType,
94  IN ULONG OldFileSize)
95 {
96  DPRINT1("CmpFileSetSize() unimplemented\n");
97  return FALSE;
98 }
99 
100 static BOOLEAN
101 NTAPI
103  IN PHHIVE RegistryHive,
104  IN ULONG FileType,
106  ULONG Length)
107 {
108  PCMHIVE CmHive = (PCMHIVE)RegistryHive;
110  return (fflush(File) == 0);
111 }
112 
113 NTSTATUS
115  IN OUT PCMHIVE Hive,
116  IN PCWSTR Name)
117 {
119 
120  RtlZeroMemory(Hive, sizeof(*Hive));
121 
122  DPRINT("Hive 0x%p\n", Hive);
123 
124  Status = HvInitialize(&Hive->Hive,
125  HINIT_CREATE,
128  0,
129  CmpAllocate,
130  CmpFree,
132  CmpFileWrite,
133  CmpFileRead,
134  CmpFileFlush,
135  1,
136  NULL);
137  if (!NT_SUCCESS(Status))
138  {
139  return Status;
140  }
141 
142  // HACK: See the HACK from r31253
143  if (!CmCreateRootNode(&Hive->Hive, Name))
144  {
145  HvFree(&Hive->Hive);
147  }
148 
149  /* Add the new hive to the hive list */
151  &Hive->HiveList);
152 
153  return STATUS_SUCCESS;
154 }
155 
156 NTSTATUS
158  IN PHHIVE Hive,
161  IN ULONG DescriptorLength)
162 {
163  HCELL_INDEX SecurityCell;
165  PCM_KEY_SECURITY Security;
166 
167  Node = (PCM_KEY_NODE)HvGetCell(Hive, Cell);
168  SecurityCell = HvAllocateCell(Hive,
170  DescriptorLength,
171  Stable,
172  HCELL_NIL);
173  if (SecurityCell == HCELL_NIL)
174  {
175  HvReleaseCell(Hive, Cell);
177  }
178 
179  Node->Security = SecurityCell;
180  Security = (PCM_KEY_SECURITY)HvGetCell(Hive, SecurityCell);
182  Security->ReferenceCount = 1;
183  Security->DescriptorLength = DescriptorLength;
184 
185  RtlMoveMemory(&Security->Descriptor,
186  Descriptor,
187  DescriptorLength);
188 
189  Security->Flink = Security->Blink = SecurityCell;
190 
191  HvReleaseCell(Hive, SecurityCell);
192  HvReleaseCell(Hive, Cell);
193 
194  return STATUS_SUCCESS;
195 }
196 
197 static NTSTATUS
199  IN PCMHIVE RegistryHive,
200  IN HCELL_INDEX ParentKeyCellOffset,
202  IN BOOLEAN VolatileKey,
203  OUT HCELL_INDEX* pNKBOffset)
204 {
205  HCELL_INDEX NKBOffset;
206  PCM_KEY_NODE NewKeyCell;
209 
210  /* Skip leading path separator if present */
211  if (SubKeyName->Buffer[0] == OBJ_NAME_PATH_SEPARATOR)
212  {
213  KeyName.Buffer = &SubKeyName->Buffer[1];
214  KeyName.Length = KeyName.MaximumLength = SubKeyName->Length - sizeof(WCHAR);
215  }
216  else
217  {
218  KeyName = *SubKeyName;
219  }
220 
221  Storage = (VolatileKey ? Volatile : Stable);
222 
223  NKBOffset = HvAllocateCell(&RegistryHive->Hive,
225  CmpNameSize(&RegistryHive->Hive, &KeyName),
226  Storage,
227  HCELL_NIL);
228  if (NKBOffset == HCELL_NIL)
229  {
231  }
232 
233  NewKeyCell = (PCM_KEY_NODE)HvGetCell(&RegistryHive->Hive, NKBOffset);
234  if (NewKeyCell == NULL)
235  {
236  HvFreeCell(&RegistryHive->Hive, NKBOffset);
238  }
239 
240  NewKeyCell->Signature = CM_KEY_NODE_SIGNATURE;
241  NewKeyCell->Flags = (VolatileKey ? KEY_IS_VOLATILE : 0);
242  KeQuerySystemTime(&NewKeyCell->LastWriteTime);
243  NewKeyCell->Parent = ParentKeyCellOffset;
244  NewKeyCell->SubKeyCounts[Stable] = 0;
245  NewKeyCell->SubKeyCounts[Volatile] = 0;
246  NewKeyCell->SubKeyLists[Stable] = HCELL_NIL;
247  NewKeyCell->SubKeyLists[Volatile] = HCELL_NIL;
248  NewKeyCell->ValueList.Count = 0;
249  NewKeyCell->ValueList.List = HCELL_NIL;
250  NewKeyCell->Security = HCELL_NIL;
251  NewKeyCell->Class = HCELL_NIL;
252  NewKeyCell->ClassLength = 0;
253  NewKeyCell->MaxNameLen = 0;
254  NewKeyCell->MaxClassLen = 0;
255  NewKeyCell->MaxValueNameLen = 0;
256  NewKeyCell->MaxValueDataLen = 0;
257  NewKeyCell->NameLength = CmpCopyName(&RegistryHive->Hive, NewKeyCell->Name, &KeyName);
258  if (NewKeyCell->NameLength < KeyName.Length) NewKeyCell->Flags |= KEY_COMP_NAME;
259 
260  /* Inherit the security from the parent */
261  if (ParentKeyCellOffset == HCELL_NIL)
262  {
263  // We are in fact creating a root key.
264  // This is not handled there, but when we
265  // call CmCreateRootNode instead.
266  ASSERT(FALSE);
267  }
268  else
269  {
270  /* Get the parent node */
271  PCM_KEY_NODE ParentKeyCell;
272  ParentKeyCell = (PCM_KEY_NODE)HvGetCell(&RegistryHive->Hive, ParentKeyCellOffset);
273 
274  if (ParentKeyCell)
275  {
276  /* Inherit the security block of the parent */
277  NewKeyCell->Security = ParentKeyCell->Security;
278  if (NewKeyCell->Security != HCELL_NIL)
279  {
280  PCM_KEY_SECURITY Security;
281  Security = (PCM_KEY_SECURITY)HvGetCell(&RegistryHive->Hive, NewKeyCell->Security);
282  ++Security->ReferenceCount;
283  HvReleaseCell(&RegistryHive->Hive, NewKeyCell->Security);
284  }
285 
286  HvReleaseCell(&RegistryHive->Hive, ParentKeyCellOffset);
287  }
288  }
289 
290  HvReleaseCell(&RegistryHive->Hive, NKBOffset);
291 
292  *pNKBOffset = NKBOffset;
293  return STATUS_SUCCESS;
294 }
295 
296 NTSTATUS
298  IN PCMHIVE RegistryHive,
299  IN HCELL_INDEX ParentKeyCellOffset,
301  IN BOOLEAN VolatileKey,
302  OUT HCELL_INDEX *pBlockOffset)
303 {
304  PCM_KEY_NODE ParentKeyCell;
305  HCELL_INDEX NKBOffset;
307 
308  /* Create the new key */
309  Status = CmiCreateSubKey(RegistryHive, ParentKeyCellOffset, SubKeyName, VolatileKey, &NKBOffset);
310  if (!NT_SUCCESS(Status))
311  return Status;
312 
313  /* Mark the parent cell as dirty */
314  HvMarkCellDirty(&RegistryHive->Hive, ParentKeyCellOffset, FALSE);
315 
316  if (!CmpAddSubKey(&RegistryHive->Hive, ParentKeyCellOffset, NKBOffset))
317  {
318  /* FIXME: delete newly created cell */
319  // CmpFreeKeyByCell(&RegistryHive->Hive, NewCell /*NKBOffset*/, FALSE);
320  ASSERT(FALSE);
321  return STATUS_UNSUCCESSFUL;
322  }
323 
324  /* Get the parent node */
325  ParentKeyCell = (PCM_KEY_NODE)HvGetCell(&RegistryHive->Hive, ParentKeyCellOffset);
326  if (!ParentKeyCell)
327  {
328  /* FIXME: delete newly created cell */
329  return STATUS_UNSUCCESSFUL;
330  }
331  VERIFY_KEY_CELL(ParentKeyCell);
332 
333  /* Update the timestamp */
334  KeQuerySystemTime(&ParentKeyCell->LastWriteTime);
335 
336  /* Check if we need to update name maximum, update it if so */
337  if (ParentKeyCell->MaxNameLen < SubKeyName->Length)
338  ParentKeyCell->MaxNameLen = SubKeyName->Length;
339 
340  /* Release the cell */
341  HvReleaseCell(&RegistryHive->Hive, ParentKeyCellOffset);
342 
343  *pBlockOffset = NKBOffset;
344  return STATUS_SUCCESS;
345 }
346 
347 NTSTATUS
349  IN PCMHIVE RegistryHive,
351  IN ULONG ChildIndex,
353  OUT PCM_KEY_VALUE *pValueCell,
354  OUT HCELL_INDEX *pValueCellOffset)
355 {
358  PCM_KEY_VALUE NewValueCell;
359  HCELL_INDEX NewValueCellOffset;
360 
361  Storage = (Parent->Flags & KEY_IS_VOLATILE) ? Volatile : Stable;
362 
363  NewValueCellOffset = HvAllocateCell(&RegistryHive->Hive,
365  CmpNameSize(&RegistryHive->Hive, (PUNICODE_STRING)ValueName),
366  Storage,
367  HCELL_NIL);
368  if (NewValueCellOffset == HCELL_NIL)
369  {
371  }
372 
373  NewValueCell = (PCM_KEY_VALUE)HvGetCell(&RegistryHive->Hive, NewValueCellOffset);
374  if (NewValueCell == NULL)
375  {
376  HvFreeCell(&RegistryHive->Hive, NewValueCellOffset);
378  }
379 
380  NewValueCell->Signature = CM_KEY_VALUE_SIGNATURE;
381  NewValueCell->NameLength = CmpCopyName(&RegistryHive->Hive,
382  NewValueCell->Name,
384 
385  /* Check for compressed name */
386  if (NewValueCell->NameLength < ValueName->Length)
387  {
388  /* This is a compressed name */
389  NewValueCell->Flags = VALUE_COMP_NAME;
390  }
391  else
392  {
393  /* No flags to set */
394  NewValueCell->Flags = 0;
395  }
396 
397  NewValueCell->Type = 0;
398  NewValueCell->DataLength = 0;
399  NewValueCell->Data = HCELL_NIL;
400 
401  HvMarkCellDirty(&RegistryHive->Hive, NewValueCellOffset, FALSE);
402 
403  /* Check if we already have a value list */
404  if (Parent->ValueList.Count)
405  {
406  /* Then make sure it's valid and dirty it */
407  ASSERT(Parent->ValueList.List != HCELL_NIL);
408  HvMarkCellDirty(&RegistryHive->Hive, Parent->ValueList.List, FALSE);
409  }
410 
411  /* Add this value cell to the child list */
412  Status = CmpAddValueToList(&RegistryHive->Hive,
413  NewValueCellOffset,
414  ChildIndex,
415  Storage,
416  &Parent->ValueList);
417 
418  /* If we failed, free the entire cell, including the data */
419  if (!NT_SUCCESS(Status))
420  {
421  /* Overwrite the status with a known one */
422  CmpFreeValue(&RegistryHive->Hive, NewValueCellOffset);
424  }
425  else
426  {
427  *pValueCell = NewValueCell;
428  *pValueCellOffset = NewValueCellOffset;
430  }
431 
432  return Status;
433 }
#define KeQuerySystemTime(t)
Definition: env_spec_w32.h:570
#define CM_KEY_VALUE_SIGNATURE
Definition: cmdata.h:24
#define KEY_COMP_NAME
Definition: cmdata.h:35
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING KeyName
Definition: ndis.h:4711
HCELL_INDEX Data
Definition: cmdata.h:127
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define IN
Definition: typedefs.h:38
struct _CMHIVE * PCMHIVE
WCHAR Name[ANYSIZE_ARRAY]
Definition: cmdata.h:116
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
HCELL_INDEX List
Definition: cmdata.h:75
BOOLEAN NTAPI CmpAddSubKey(IN PHHIVE Hive, IN HCELL_INDEX Parent, IN HCELL_INDEX Child)
Definition: cmindex.c:1467
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ PNDIS_STRING SubKeyName
Definition: ndis.h:4723
USHORT Flags
Definition: cmdata.h:129
static BOOLEAN NTAPI CmpFileRead(IN PHHIVE RegistryHive, IN ULONG FileType, IN PULONG FileOffset, OUT PVOID Buffer, IN SIZE_T BufferLength)
Definition: cmi.c:56
#define CM_KEY_SECURITY_SIGNATURE
Definition: cmdata.h:23
ULONG MaxValueNameLen
Definition: cmdata.h:111
#define CM_KEY_NODE_SIGNATURE
Definition: cmdata.h:21
USHORT ClassLength
Definition: cmdata.h:115
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
unsigned char * PUCHAR
Definition: retypes.h:3
#define free
Definition: debug_ros.c:5
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
LIST_ENTRY CmiHiveListHead
Definition: registry.c:385
#define HvReleaseCell(h, c)
Definition: cmlib.h:390
LONG NTSTATUS
Definition: precomp.h:26
#define KEY_IS_VOLATILE
Definition: cmdata.h:30
#define HCELL_NIL
Definition: hivedata.h:85
HCELL_INDEX Flink
Definition: cmdata.h:141
#define VERIFY_KEY_CELL(key)
Definition: cmi.h:29
static NTSTATUS CmiCreateSubKey(IN PCMHIVE RegistryHive, IN HCELL_INDEX ParentKeyCellOffset, IN PCUNICODE_STRING SubKeyName, IN BOOLEAN VolatileKey, OUT HCELL_INDEX *pNKBOffset)
Definition: cmi.c:198
SECURITY_DESCRIPTOR_RELATIVE Descriptor
Definition: cmdata.h:145
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
#define InsertTailList(ListHead, Entry)
_Check_return_opt_ _CRTIMP size_t __cdecl fwrite(_In_reads_bytes_(_Size *_Count) const void *_Str, _In_ size_t _Size, _In_ size_t _Count, _Inout_ FILE *_File)
USHORT NameLength
Definition: cmdata.h:114
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
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
struct _CM_KEY_SECURITY * PCM_KEY_SECURITY
ULONG DataLength
Definition: cmdata.h:126
ULONG MaxNameLen
Definition: cmdata.h:109
_In_ PUNICODE_STRING ValueName
Definition: cmfuncs.h:264
BOOLEAN NTAPI CmpFreeValue(IN PHHIVE Hive, IN HCELL_INDEX Cell)
Definition: cmvalue.c:73
HCELL_INDEX Class
Definition: cmdata.h:108
NTSTATUS CmiAddValueKey(IN PCMHIVE RegistryHive, IN PCM_KEY_NODE Parent, IN ULONG ChildIndex, IN PCUNICODE_STRING ValueName, OUT PCM_KEY_VALUE *pValueCell, OUT HCELL_INDEX *pValueCellOffset)
Definition: cmi.c:348
_Check_return_opt_ _CRTIMP size_t __cdecl fread(_Out_writes_bytes_(_ElementSize *_Count) void *_DstBuf, _In_ size_t _ElementSize, _In_ size_t _Count, _Inout_ FILE *_File)
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
USHORT NameLength
Definition: cmdata.h:125
NTSTATUS CmiCreateSecurityKey(IN PHHIVE Hive, IN HCELL_INDEX Cell, IN PUCHAR Descriptor, IN ULONG DescriptorLength)
Definition: cmi.c:157
_In_ ULONG BufferLength
Definition: usbdlib.h:225
#define OBJ_NAME_PATH_SEPARATOR
Definition: arcname_tests.c:25
union node Node
Definition: types.h:1255
PVOID CMAPI HvGetCell(PHHIVE RegistryHive, HCELL_INDEX CellOffset)
Definition: hivecell.c:67
static BOOLEAN NTAPI CmpFileFlush(IN PHHIVE RegistryHive, IN ULONG FileType, PLARGE_INTEGER FileOffset, ULONG Length)
Definition: cmi.c:102
WCHAR Name[ANYSIZE_ARRAY]
Definition: cmdata.h:131
HANDLE FileHandles[HFILE_TYPE_MAX]
Definition: cm.h:394
HCELL_INDEX SubKeyLists[HTYPE_COUNT]
Definition: cmdata.h:102
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
struct _CM_KEY_NODE * PCM_KEY_NODE
_Check_return_opt_ _CRTIMP int __cdecl fseek(_Inout_ FILE *_File, _In_ long _Offset, _In_ int _Origin)
void DPRINT(...)
Definition: polytest.cpp:61
VOID CMAPI HvFree(PHHIVE RegistryHive)
Definition: hiveinit.c:623
Definition: bufpool.h:45
BOOLEAN CMAPI CmCreateRootNode(PHHIVE Hive, PCWSTR Name)
Definition: cminit.c:17
ULONG ReferenceCount
Definition: cmdata.h:143
CHILD_LIST ValueList
Definition: cmdata.h:103
#define SEEK_SET
Definition: jmemansi.c:26
USHORT NTAPI CmpCopyName(IN PHHIVE Hive, OUT PWCHAR Destination, IN PUNICODE_STRING Source)
Definition: cmname.c:21
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define HINIT_CREATE
Definition: hivedata.h:13
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
HCELL_INDEX Parent
Definition: cmdata.h:96
ULONG HCELL_INDEX
Definition: hivedata.h:80
#define VALUE_COMP_NAME
Definition: cmdata.h:44
ULONG SubKeyCounts[HTYPE_COUNT]
Definition: cmdata.h:97
VOID NTAPI CmpFree(IN PVOID Ptr, IN ULONG Quota)
Definition: cmi.c:47
USHORT Signature
Definition: cmdata.h:92
Definition: bzip2.c:1694
BOOLEAN CMAPI HvMarkCellDirty(PHHIVE RegistryHive, HCELL_INDEX CellOffset, BOOLEAN HoldingLock)
Definition: hivecell.c:100
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
USHORT Signature
Definition: cmdata.h:124
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
VOID CMAPI HvFreeCell(PHHIVE RegistryHive, HCELL_INDEX CellOffset)
Definition: hivecell.c:441
USHORT NTAPI CmpNameSize(IN PHHIVE Hive, IN PUNICODE_STRING Name)
Definition: cmname.c:74
_Must_inspect_result_ _Out_ PLARGE_INTEGER FileSize
Definition: fsrtlfuncs.h:108
LARGE_INTEGER LastWriteTime
Definition: cmdata.h:94
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
ULONG DescriptorLength
Definition: cmdata.h:144
ULONG Count
Definition: cmdata.h:74
Status
Definition: gdiplustypes.h:24
static BOOLEAN NTAPI CmpFileSetSize(IN PHHIVE RegistryHive, IN ULONG FileType, IN ULONG FileSize, IN ULONG OldFileSize)
Definition: cmi.c:90
HCELL_INDEX Security
Definition: cmdata.h:107
ULONG_PTR SIZE_T
Definition: typedefs.h:78
static BOOLEAN NTAPI CmpFileWrite(IN PHHIVE RegistryHive, IN ULONG FileType, IN PULONG FileOffset, IN PVOID Buffer, IN SIZE_T BufferLength)
Definition: cmi.c:73
#define HFILE_TYPE_PRIMARY
Definition: hivedata.h:33
ULONG MaxClassLen
Definition: cmdata.h:110
_Check_return_opt_ _CRTIMP int __cdecl fflush(_Inout_opt_ FILE *_File)
struct _CM_KEY_VALUE * PCM_KEY_VALUE
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
ULONG Type
Definition: cmdata.h:128
HSTORAGE_TYPE
Definition: hivedata.h:100
static PCMHIVE CmHive
Definition: registry.c:28
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
unsigned int * PULONG
Definition: retypes.h:1
NTSTATUS CmiInitializeHive(IN OUT PCMHIVE Hive, IN PCWSTR Name)
Definition: cmi.c:114
#define HIVE_NOLAZYFLUSH
Definition: hivedata.h:24
ULONG MaxValueDataLen
Definition: cmdata.h:112
#define DPRINT1
Definition: precomp.h:8
IN ULONG IN ULONG Tag
Definition: evtlib.h:159
#define OUT
Definition: typedefs.h:39
USHORT Signature
Definition: cmdata.h:139
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define malloc
Definition: debug_ros.c:4
Definition: File.h:15
return STATUS_SUCCESS
Definition: btrfs.c:2777
NTSTATUS CmiAddSubKey(IN PCMHIVE RegistryHive, IN HCELL_INDEX ParentKeyCellOffset, IN PCUNICODE_STRING SubKeyName, IN BOOLEAN VolatileKey, OUT HCELL_INDEX *pBlockOffset)
Definition: cmi.c:297
PVOID NTAPI CmpAllocate(IN SIZE_T Size, IN BOOLEAN Paged, IN ULONG Tag)
Definition: cmi.c:37
static IStorage Storage
Definition: ole2.c:3548
HCELL_INDEX Blink
Definition: cmdata.h:142
Definition: cm.h:391
USHORT Flags
Definition: cmdata.h:93
Definition: dlist.c:348
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PSTORAGE_DESCRIPTOR_HEADER * Descriptor
Definition: classpnp.h:966