static PCMHIVE CmHive;
static PCM_KEY_NODE RootKeyNode;
-static FRLDRHKEY CurrentControlSetKey;
+static HKEY CurrentControlSetKey;
BOOLEAN
RegImportBinaryHive(
_In_ BOOLEAN LastKnownGood)
{
WCHAR ControlSetKeyName[80];
- FRLDRHKEY SelectKey;
- FRLDRHKEY SystemKey;
+ HKEY SelectKey;
+ HKEY SystemKey;
ULONG CurrentSet = 0;
ULONG DefaultSet = 0;
ULONG LastKnownGoodSet = 0;
LONG
RegEnumKey(
- _In_ FRLDRHKEY Key,
+ _In_ HKEY Key,
_In_ ULONG Index,
_Out_ PWCHAR Name,
_Inout_ ULONG* NameSize,
- _Out_opt_ FRLDRHKEY *SubKey)
+ _Out_opt_ PHKEY SubKey)
{
PHHIVE Hive = &CmHive->Hive;
PCM_KEY_NODE KeyNode, SubKeyNode;
if (SubKey != NULL)
{
- *SubKey = (FRLDRHKEY)SubKeyNode;
+ *SubKey = (HKEY)SubKeyNode;
}
TRACE("RegEnumKey done -> %u, '%.*s'\n", *NameSize, *NameSize, Name);
LONG
RegOpenKey(
- _In_ FRLDRHKEY ParentKey,
+ _In_ HKEY ParentKey,
_In_z_ PCWSTR KeyName,
- _Out_ PFRLDRHKEY Key)
+ _Out_ PHKEY Key)
{
UNICODE_STRING RemainingPath, SubKeyName;
UNICODE_STRING CurrentControlSet = RTL_CONSTANT_STRING(L"CurrentControlSet");
}
TRACE("RegOpenKey done\n");
- *Key = (FRLDRHKEY)KeyNode;
+ *Key = (HKEY)KeyNode;
return ERROR_SUCCESS;
}
if (DataSize != NULL)
{
/* Get the data length */
- DataLength = ValueCell->DataLength & REG_DATA_SIZE_MASK;
+ DataLength = ValueCell->DataLength & ~CM_KEY_VALUE_SPECIAL_SIZE;
/* Does the caller want the data? */
if ((Data != NULL) && (*DataSize != 0))
{
/* Check where the data is stored */
if ((DataLength <= sizeof(HCELL_INDEX)) &&
- (ValueCell->DataLength & REG_DATA_IN_OFFSET))
+ (ValueCell->DataLength & CM_KEY_VALUE_SPECIAL_SIZE))
{
/* The data member contains the data */
RtlCopyMemory(Data,
LONG
RegQueryValue(
- _In_ FRLDRHKEY Key,
+ _In_ HKEY Key,
_In_z_ PCWSTR ValueName,
_Out_opt_ ULONG* Type,
_Out_opt_ PUCHAR Data,
LONG
RegEnumValue(
- _In_ FRLDRHKEY Key,
+ _In_ HKEY Key,
_In_ ULONG Index,
_Out_ PWCHAR ValueName,
_Inout_ ULONG* NameSize,
#ifndef __REGISTRY_H
#define __REGISTRY_H
-#define TAG_REG_NAME 'NgeR'
-#define TAG_REG_KEY 'KgeR'
-#define TAG_REG_KEY_DATA 'DgeR'
-#define TAG_REG_VALUE 'VgeR'
-
-typedef struct _REG_KEY
-{
- LIST_ENTRY KeyList;
- LIST_ENTRY SubKeyList;
- LIST_ENTRY ValueList;
-
- ULONG SubKeyCount;
- ULONG ValueCount;
-
- ULONG NameSize;
- PWCHAR Name;
-
- /* Default data */
- ULONG DataType;
- ULONG DataSize;
- PCHAR Data;
-} KEY, *FRLDRHKEY, **PFRLDRHKEY;
-
-
-typedef struct _REG_VALUE
-{
- LIST_ENTRY ValueList;
-
- /* Value name */
- ULONG NameSize;
- PWCHAR Name;
-
- /* Value data */
- ULONG DataType;
- ULONG DataSize;
- PCHAR Data;
-} VALUE, *PVALUE;
+typedef HANDLE HKEY, *PHKEY;
VOID
RegInitializeRegistry(VOID);
LONG
RegEnumKey(
- _In_ FRLDRHKEY Key,
+ _In_ HKEY Key,
_In_ ULONG Index,
_Out_ PWCHAR Name,
_Inout_ ULONG* NameSize,
- _Out_opt_ FRLDRHKEY *SubKey);
+ _Out_opt_ PHKEY SubKey);
LONG
-RegOpenKey(FRLDRHKEY ParentKey,
+RegOpenKey(HKEY ParentKey,
PCWSTR KeyName,
- PFRLDRHKEY Key);
+ PHKEY Key);
LONG
-RegSetValue(FRLDRHKEY Key,
+RegSetValue(HKEY Key,
PCWSTR ValueName,
ULONG Type,
PCSTR Data,
ULONG DataSize);
LONG
-RegQueryValue(FRLDRHKEY Key,
+RegQueryValue(HKEY Key,
PCWSTR ValueName,
ULONG* Type,
PUCHAR Data,
ULONG* DataSize);
LONG
-RegDeleteValue(FRLDRHKEY Key,
- PCWSTR ValueName);
-
-LONG
-RegEnumValue(FRLDRHKEY Key,
+RegEnumValue(HKEY Key,
ULONG Index,
PWCHAR ValueName,
ULONG* NameSize,
PUCHAR Data,
ULONG* DataSize);
-ULONG
-RegGetSubKeyCount (FRLDRHKEY Key);
-
-ULONG
-RegGetValueCount (FRLDRHKEY Key);
-
-
BOOLEAN
-RegImportBinaryHive (PCHAR ChunkBase,
+RegImportBinaryHive(PCHAR ChunkBase,
ULONG ChunkSize);
-BOOLEAN
-RegExportBinaryHive (PCWSTR KeyName,
- PCHAR ChunkBase,
- ULONG* ChunkSize);
-
-
#endif /* __REGISTRY_H */
/* EOF */