[FREELDR]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Thu, 14 Jan 2016 20:00:18 +0000 (20:00 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Thu, 14 Jan 2016 20:00:18 +0000 (20:00 +0000)
- Since the registry handling rewrite of Timo in r61595 all the freeldr-specific registry structures got deprecated. Remove them, as well as few other prototypes of non-existing functions.
- Use the CMLIB registry flags instead of some (already-removed) flags --> fix build.

svn path=/trunk/; revision=70594

reactos/boot/freeldr/freeldr/windows/registry.c
reactos/boot/freeldr/freeldr/windows/registry.h
reactos/boot/freeldr/freeldr/windows/winldr.c
reactos/boot/freeldr/freeldr/windows/wlregistry.c

index 251c929..0438deb 100644 (file)
@@ -27,7 +27,7 @@ DBG_DEFAULT_CHANNEL(REGISTRY);
 
 static PCMHIVE CmHive;
 static PCM_KEY_NODE RootKeyNode;
-static FRLDRHKEY CurrentControlSetKey;
+static HKEY CurrentControlSetKey;
 
 BOOLEAN
 RegImportBinaryHive(
@@ -77,8 +77,8 @@ RegInitCurrentControlSet(
     _In_ BOOLEAN LastKnownGood)
 {
     WCHAR ControlSetKeyName[80];
-    FRLDRHKEY SelectKey;
-    FRLDRHKEY SystemKey;
+    HKEY SelectKey;
+    HKEY SystemKey;
     ULONG CurrentSet = 0;
     ULONG DefaultSet = 0;
     ULONG LastKnownGoodSet = 0;
@@ -261,11 +261,11 @@ RegpFindSubkeyInIndex(
 
 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;
@@ -307,7 +307,7 @@ RegEnumKey(
 
     if (SubKey != NULL)
     {
-        *SubKey = (FRLDRHKEY)SubKeyNode;
+        *SubKey = (HKEY)SubKeyNode;
     }
 
     TRACE("RegEnumKey done -> %u, '%.*s'\n", *NameSize, *NameSize, Name);
@@ -316,9 +316,9 @@ RegEnumKey(
 
 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");
@@ -420,7 +420,7 @@ RegOpenKey(
     }
 
     TRACE("RegOpenKey done\n");
-    *Key = (FRLDRHKEY)KeyNode;
+    *Key = (HKEY)KeyNode;
     return ERROR_SUCCESS;
 }
 
@@ -445,14 +445,14 @@ RepGetValueData(
     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,
@@ -477,7 +477,7 @@ RepGetValueData(
 
 LONG
 RegQueryValue(
-    _In_ FRLDRHKEY Key,
+    _In_ HKEY Key,
     _In_z_ PCWSTR ValueName,
     _Out_opt_ ULONG* Type,
     _Out_opt_ PUCHAR Data,
@@ -532,7 +532,7 @@ RegQueryValue(
 
 LONG
 RegEnumValue(
-    _In_ FRLDRHKEY Key,
+    _In_ HKEY Key,
     _In_ ULONG Index,
     _Out_ PWCHAR ValueName,
     _Inout_ ULONG* NameSize,
index 83aae68..25b18d7 100644 (file)
 #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);
@@ -67,37 +31,33 @@ RegInitCurrentControlSet(BOOLEAN LastKnownGood);
 
 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,
@@ -105,23 +65,10 @@ RegEnumValue(FRLDRHKEY Key,
          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 */
index f194653..51cb136 100644 (file)
@@ -411,7 +411,7 @@ USHORT
 WinLdrDetectVersion(VOID)
 {
     LONG rc;
-    FRLDRHKEY hKey;
+    HKEY hKey;
 
     rc = RegOpenKey(
         NULL,
index f2afd2a..8fbfb45 100644 (file)
@@ -196,7 +196,7 @@ WinLdrGetNLSNames(LPSTR AnsiName,
                   LPSTR LangName)
 {
     LONG rc = ERROR_SUCCESS;
-    FRLDRHKEY hKey;
+    HKEY hKey;
     WCHAR szIdBuffer[80];
     WCHAR NameBuffer[80];
     ULONG BufferSize;
@@ -446,7 +446,7 @@ WinLdrScanRegistry(IN OUT PLIST_ENTRY BootDriverListHead,
                    IN LPCSTR DirectoryPath)
 {
     LONG rc = 0;
-    FRLDRHKEY hGroupKey, hOrderKey, hServiceKey, hDriverKey;
+    HKEY hGroupKey, hOrderKey, hServiceKey, hDriverKey;
     LPWSTR GroupNameBuffer;
     WCHAR ServiceName[256];
     ULONG OrderList[128];