ReactOS  0.4.13-dev-249-gcba1a2f
registry.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef HANDLE HKEY
 
typedef HANDLEPHKEY
 

Functions

LONG RegInitCurrentControlSet (BOOLEAN LastKnownGood)
 
LONG RegEnumKey (_In_ HKEY Key, _In_ ULONG Index, _Out_ PWCHAR Name, _Inout_ ULONG *NameSize, _Out_opt_ PHKEY SubKey)
 
LONG RegOpenKey (HKEY ParentKey, PCWSTR KeyName, PHKEY Key)
 
LONG RegQueryValue (HKEY Key, PCWSTR ValueName, ULONG *Type, PUCHAR Data, ULONG *DataSize)
 
LONG RegEnumValue (HKEY Key, ULONG Index, PWCHAR ValueName, ULONG *NameSize, ULONG *Type, PUCHAR Data, ULONG *DataSize)
 
BOOLEAN RegImportBinaryHive (PVOID ChunkBase, ULONG ChunkSize)
 

Typedef Documentation

◆ HKEY

typedef HANDLE HKEY

Definition at line 24 of file registry.h.

◆ PHKEY

typedef HANDLE * PHKEY

Definition at line 24 of file registry.h.

Function Documentation

◆ RegEnumKey()

LONG RegEnumKey ( _In_ HKEY  Key,
_In_ ULONG  Index,
_Out_ PWCHAR  Name,
_Inout_ ULONG NameSize,
_Out_opt_ PHKEY  SubKey 
)

Definition at line 224 of file registry.c.

230 {
231  PHHIVE Hive = &CmHive->Hive;
232  PCM_KEY_NODE KeyNode, SubKeyNode;
233  HCELL_INDEX CellIndex;
234  USHORT NameLength;
235 
236  TRACE("RegEnumKey(%p, %lu, %p, %p->%u)\n",
237  Key, Index, Name, NameSize, NameSize ? *NameSize : 0);
238 
239  /* Get the key node */
240  KeyNode = (PCM_KEY_NODE)Key;
242 
243  CellIndex = CmpFindSubKeyByNumber(Hive, KeyNode, Index);
244  if (CellIndex == HCELL_NIL)
245  {
246  TRACE("RegEnumKey index out of bounds (%d) in key (%.*s)\n",
247  Index, KeyNode->NameLength, KeyNode->Name);
248  return ERROR_NO_MORE_ITEMS;
249  }
250 
251  /* Get the value cell */
252  SubKeyNode = (PCM_KEY_NODE)HvGetCell(Hive, CellIndex);
253  ASSERT(SubKeyNode != NULL);
254  ASSERT(SubKeyNode->Signature == CM_KEY_NODE_SIGNATURE);
255 
256  if (SubKeyNode->Flags & KEY_COMP_NAME)
257  {
258  NameLength = CmpCompressedNameSize(SubKeyNode->Name, SubKeyNode->NameLength);
259 
260  /* Compressed name */
262  *NameSize,
263  SubKeyNode->Name,
264  SubKeyNode->NameLength);
265  }
266  else
267  {
268  NameLength = SubKeyNode->NameLength;
269 
270  /* Normal name */
271  RtlCopyMemory(Name, SubKeyNode->Name,
272  min(*NameSize, SubKeyNode->NameLength));
273  }
274 
275  if (*NameSize >= NameLength + sizeof(WCHAR))
276  {
277  Name[NameLength / sizeof(WCHAR)] = UNICODE_NULL;
278  }
279 
280  *NameSize = NameLength + sizeof(WCHAR);
281 
282  HvReleaseCell(Hive, CellIndex);
283 
284  if (SubKey != NULL)
285  *SubKey = (HKEY)SubKeyNode;
286 
287  TRACE("RegEnumKey done -> %u, '%.*S'\n", *NameSize, *NameSize, Name);
288  return ERROR_SUCCESS;
289 }
#define KEY_COMP_NAME
Definition: cmdata.h:35
WCHAR Name[ANYSIZE_ARRAY]
Definition: cmdata.h:116
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:95
#define CM_KEY_NODE_SIGNATURE
Definition: cmdata.h:21
#define HvReleaseCell(h, c)
Definition: cmlib.h:390
HCELL_INDEX NTAPI CmpFindSubKeyByNumber(IN PHHIVE Hive, IN PCM_KEY_NODE Node, IN ULONG Number)
Definition: cmindex.c:600
#define HCELL_NIL
Definition: hivedata.h:85
USHORT NameLength
Definition: cmdata.h:114
#define UNICODE_NULL
VOID NTAPI CmpCopyCompressedName(OUT PWCHAR Destination, IN ULONG DestinationLength, IN PWCHAR Source, IN ULONG SourceLength)
Definition: cmname.c:56
PVOID CMAPI HvGetCell(PHHIVE RegistryHive, HCELL_INDEX CellOffset)
Definition: hivecell.c:67
smooth NULL
Definition: ftsmooth.c:416
struct _CM_KEY_NODE * PCM_KEY_NODE
HHIVE Hive
Definition: cm.h:393
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
ULONG HCELL_INDEX
Definition: hivedata.h:80
USHORT Signature
Definition: cmdata.h:92
static const UCHAR Index[8]
Definition: usbohci.c:18
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
unsigned short USHORT
Definition: pedump.c:61
static PCMHIVE CmHive
Definition: registry.c:28
#define min(a, b)
Definition: monoChain.cc:55
static const char HKEY
Definition: registry.c:45
USHORT NTAPI CmpCompressedNameSize(IN PWCHAR Name, IN ULONG Length)
Definition: cmname.c:95
USHORT Flags
Definition: cmdata.h:93

◆ RegEnumValue()

◆ RegImportBinaryHive()

BOOLEAN RegImportBinaryHive ( PVOID  ChunkBase,
ULONG  ChunkSize 
)

◆ RegInitCurrentControlSet()

LONG RegInitCurrentControlSet ( BOOLEAN  LastKnownGood)

◆ RegOpenKey()

LONG RegOpenKey ( HKEY  ParentKey,
PCWSTR  KeyName,
PHKEY  Key 
)

◆ RegQueryValue()

LONG RegQueryValue ( HKEY  Key,
PCWSTR  ValueName,
ULONG Type,
PUCHAR  Data,
ULONG DataSize 
)