From 9e6cbffcd8bea12c2c6b0562c16ab79bbfc6427a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 14 Jan 2016 20:00:18 +0000 Subject: [PATCH] [FREELDR] - 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 --- .../boot/freeldr/freeldr/windows/registry.c | 26 +++---- .../boot/freeldr/freeldr/windows/registry.h | 71 +++---------------- reactos/boot/freeldr/freeldr/windows/winldr.c | 2 +- .../boot/freeldr/freeldr/windows/wlregistry.c | 4 +- 4 files changed, 25 insertions(+), 78 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/windows/registry.c b/reactos/boot/freeldr/freeldr/windows/registry.c index 251c9296248..0438deb1704 100644 --- a/reactos/boot/freeldr/freeldr/windows/registry.c +++ b/reactos/boot/freeldr/freeldr/windows/registry.c @@ -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, diff --git a/reactos/boot/freeldr/freeldr/windows/registry.h b/reactos/boot/freeldr/freeldr/windows/registry.h index 83aae68b5c3..25b18d79425 100644 --- a/reactos/boot/freeldr/freeldr/windows/registry.h +++ b/reactos/boot/freeldr/freeldr/windows/registry.h @@ -21,43 +21,7 @@ #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 */ diff --git a/reactos/boot/freeldr/freeldr/windows/winldr.c b/reactos/boot/freeldr/freeldr/windows/winldr.c index f1946536faf..51cb1367df6 100644 --- a/reactos/boot/freeldr/freeldr/windows/winldr.c +++ b/reactos/boot/freeldr/freeldr/windows/winldr.c @@ -411,7 +411,7 @@ USHORT WinLdrDetectVersion(VOID) { LONG rc; - FRLDRHKEY hKey; + HKEY hKey; rc = RegOpenKey( NULL, diff --git a/reactos/boot/freeldr/freeldr/windows/wlregistry.c b/reactos/boot/freeldr/freeldr/windows/wlregistry.c index f2afd2af5fe..8fbfb4574fd 100644 --- a/reactos/boot/freeldr/freeldr/windows/wlregistry.c +++ b/reactos/boot/freeldr/freeldr/windows/wlregistry.c @@ -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];