From 5a29ec2659081b1d68e90228cf166e9dac43a985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 16 Jan 2016 23:54:45 +0000 Subject: [PATCH] [CMLIB] - One less hardcoded number. - Minor code formatting. [NTOS] - Minor code formatting (cmvalche.c). - The key-node timestamp can usually be retrieved without using another temporary value. - The security descriptor copy allocated for the hive can be freed after it was assigned to it. [MKHIVE] - Minor formatting of the source headers. - Update the list of registry value types; add another error code (to be used later on). - Remove now unused "ntoskrnl.h" header. CORE-10793 svn path=/trunk/; revision=70601 --- reactos/lib/cmlib/cmindex.c | 49 +++++++++++++++--------------- reactos/lib/cmlib/cmname.c | 20 ++++++------ reactos/lib/cmlib/cmvalue.c | 13 +++++--- reactos/lib/cmlib/hivewrt.c | 6 ++-- reactos/ntoskrnl/config/cmparse.c | 11 ++++--- reactos/ntoskrnl/config/cmsysini.c | 13 +++----- reactos/ntoskrnl/config/cmvalche.c | 18 +++++------ reactos/tools/mkhive/binhive.c | 3 +- reactos/tools/mkhive/binhive.h | 3 +- reactos/tools/mkhive/ntoskrnl.h | 14 --------- reactos/tools/mkhive/reginf.c | 3 +- reactos/tools/mkhive/reginf.h | 3 +- reactos/tools/mkhive/registry.h | 30 ++++++++++-------- 13 files changed, 90 insertions(+), 96 deletions(-) delete mode 100644 reactos/tools/mkhive/ntoskrnl.h diff --git a/reactos/lib/cmlib/cmindex.c b/reactos/lib/cmlib/cmindex.c index 98da1c8802a..618de3f35db 100644 --- a/reactos/lib/cmlib/cmindex.c +++ b/reactos/lib/cmlib/cmindex.c @@ -10,19 +10,19 @@ #include "cmlib.h" #define NDEBUG -#include "debug.h" +#include /* GLOBALS *******************************************************************/ -ULONG CmpMaxFastIndexPerHblock = - (HBLOCK_SIZE - (sizeof(HBIN) + - sizeof(HCELL) + - FIELD_OFFSET(CM_KEY_FAST_INDEX, List))) / sizeof(CM_INDEX); +#define INVALID_INDEX 0x80000000 -ULONG CmpMaxIndexPerHblock = - (HBLOCK_SIZE - (sizeof(HBIN) + - sizeof(HCELL) + - FIELD_OFFSET(CM_KEY_INDEX, List))) / sizeof(HCELL_INDEX) - 1; +#define CmpMaxFastIndexPerHblock \ + ((HBLOCK_SIZE - (sizeof(HBIN) + sizeof(HCELL) + \ + FIELD_OFFSET(CM_KEY_FAST_INDEX, List))) / sizeof(CM_INDEX)) + +#define CmpMaxIndexPerHblock \ + ((HBLOCK_SIZE - (sizeof(HBIN) + sizeof(HCELL) + \ + FIELD_OFFSET(CM_KEY_INDEX, List))) / sizeof(HCELL_INDEX) - 1) /* FUNCTIONS *****************************************************************/ @@ -232,7 +232,7 @@ CmpFindSubKeyInRoot(IN PHHIVE Hive, { Big: /* This was some sort of special key */ - ReturnIndex = 0x80000000; + ReturnIndex = INVALID_INDEX; goto ReturnFailure; } @@ -262,7 +262,7 @@ Big: /* Check if we found it */ if (!Result) { - /* We got lucky...return it */ + /* We got lucky... return it */ *SubKey = LeafCell; ReturnIndex = Low; goto Return; @@ -389,7 +389,7 @@ CmpFindSubKeyInLeaf(IN PHHIVE Hive, { /* Fail with special value */ *SubKey = HCELL_NIL; - return 0x80000000; + return INVALID_INDEX; } /* Check if we got lucky and found it */ @@ -425,7 +425,7 @@ CmpFindSubKeyInLeaf(IN PHHIVE Hive, { /* Fail with special value */ *SubKey = HCELL_NIL; - return 0x80000000; + return INVALID_INDEX; } /* Check if we got lucky and found it */ @@ -448,7 +448,7 @@ CmpFindSubKeyInLeaf(IN PHHIVE Hive, { /* Fail with special value */ *SubKey = HCELL_NIL; - return 0x80000000; + return INVALID_INDEX; } /* Return the high */ @@ -625,8 +625,7 @@ CmpFindSubKeyByNumber(IN PHHIVE Hive, if (Number < Node->SubKeyCounts[Volatile]) { /* Get the actual key index */ - Index = (PCM_KEY_INDEX)HvGetCell(Hive, - Node->SubKeyLists[Volatile]); + Index = (PCM_KEY_INDEX)HvGetCell(Hive, Node->SubKeyLists[Volatile]); if (!Index) return HCELL_NIL; /* Do a search inside it */ @@ -717,7 +716,7 @@ CmpFindSubKeyByName(IN PHHIVE Hive, HvReleaseCell(Hive, CellToRelease); /* Make sure we found something valid */ - if (Found & 0x80000000) break; + if (Found & INVALID_INDEX) break; /* Get the new Index Root and set the new cell to be released */ if (SubKey == HCELL_NIL) continue; @@ -744,7 +743,7 @@ CmpFindSubKeyByName(IN PHHIVE Hive, HvReleaseCell(Hive, CellToRelease); /* Make sure we found a valid index */ - if (Found & 0x80000000) break; + if (Found & INVALID_INDEX) break; } else { @@ -856,7 +855,7 @@ CmpMarkIndexDirty(IN PHHIVE Hive, { /* Get the child inside the root */ Result = CmpFindSubKeyInRoot(Hive, Index, &SearchName, &Child); - if (Result & 0x80000000) goto Quickie; + if (Result & INVALID_INDEX) goto Quickie; if (Child == HCELL_NIL) continue; /* We found it, mark the cell dirty */ @@ -886,7 +885,7 @@ CmpMarkIndexDirty(IN PHHIVE Hive, /* Find the child in the leaf */ Result = CmpFindSubKeyInLeaf(Hive, Index, &SearchName, &Child); - if (Result & 0x80000000) goto Quickie; + if (Result & INVALID_INDEX) goto Quickie; if (Child != HCELL_NIL) { /* We found it, free the name now */ @@ -1004,7 +1003,7 @@ CmpAddToLeaf(IN PHHIVE Hive, /* Find the insertion point for our entry */ i = CmpFindSubKeyInLeaf(Hive, Leaf, Name, &Child); - if (i & 0x80000000) return HCELL_NIL; + if (i & INVALID_INDEX) return HCELL_NIL; ASSERT(Child == HCELL_NIL); /* Check if we're not last */ @@ -1299,7 +1298,7 @@ CmpSelectLeaf(IN PHHIVE Hive, SubKeyIndex = CmpFindSubKeyInRoot(Hive, IndexKey, Name, &LeafCell); /* Make sure we found something valid */ - if (SubKeyIndex & 0x80000000) return HCELL_NIL; + if (SubKeyIndex & INVALID_INDEX) return HCELL_NIL; /* Try to fit it into the LeafCell, if it was found */ if (LeafCell != HCELL_NIL) @@ -1705,7 +1704,7 @@ CmpRemoveSubKey(IN PHHIVE Hive, HCELL_INDEX RootCell = HCELL_NIL, LeafCell, ChildCell; PCM_KEY_INDEX Root = NULL, Leaf; PCM_KEY_FAST_INDEX Child; - ULONG Storage, RootIndex = 0x80000000, LeafIndex; + ULONG Storage, RootIndex = INVALID_INDEX, LeafIndex; BOOLEAN Result = FALSE; HCELL_INDEX CellToRelease1 = HCELL_NIL, CellToRelease2 = HCELL_NIL; @@ -1784,7 +1783,7 @@ CmpRemoveSubKey(IN PHHIVE Hive, { /* Find the child inside the root */ RootIndex = CmpFindSubKeyInRoot(Hive, Leaf, &SearchName, &ChildCell); - if (RootIndex & 0x80000000) goto Exit; + if (RootIndex & INVALID_INDEX) goto Exit; ASSERT(ChildCell != FALSE); /* The root cell is now this leaf */ @@ -1807,7 +1806,7 @@ CmpRemoveSubKey(IN PHHIVE Hive, /* Now get the child in the leaf */ LeafIndex = CmpFindSubKeyInLeaf(Hive, Leaf, &SearchName, &ChildCell); - if (LeafIndex & 0x80000000) goto Exit; + if (LeafIndex & INVALID_INDEX) goto Exit; ASSERT(ChildCell != HCELL_NIL); /* Decrement key counts and check if this was the last leaf entry */ diff --git a/reactos/lib/cmlib/cmname.c b/reactos/lib/cmlib/cmname.c index 50c5d193894..8dc2e4a5eeb 100644 --- a/reactos/lib/cmlib/cmname.c +++ b/reactos/lib/cmlib/cmname.c @@ -10,7 +10,7 @@ #include "cmlib.h" #define NDEBUG -#include "debug.h" +#include /* GLOBALS *******************************************************************/ @@ -110,8 +110,8 @@ CmpCompareCompressedName(IN PCUNICODE_STRING SearchName, IN PWCHAR CompressedName, IN ULONG NameLength) { - WCHAR *p; - UCHAR *pp; + WCHAR* p; + UCHAR* pp; WCHAR chr1, chr2; USHORT SearchLength; LONG Result; @@ -120,7 +120,7 @@ CmpCompareCompressedName(IN PCUNICODE_STRING SearchName, p = SearchName->Buffer; pp = (PUCHAR)CompressedName; SearchLength = (SearchName->Length / sizeof(WCHAR)); - while ((SearchLength) && (NameLength)) + while (SearchLength > 0 && NameLength > 0) { /* Get the characters */ chr1 = *p++; @@ -149,8 +149,8 @@ NTAPI CmpFindNameInList(IN PHHIVE Hive, IN PCHILD_LIST ChildList, IN PUNICODE_STRING Name, - IN PULONG ChildIndex, - IN PHCELL_INDEX CellIndex) + OUT PULONG ChildIndex, + OUT PHCELL_INDEX CellIndex) { PCELL_DATA CellData; HCELL_INDEX CellToRelease = HCELL_NIL; @@ -199,14 +199,14 @@ CmpFindNameInList(IN PHHIVE Hive, /* Check if it's a compressed value name */ if (KeyValue->Flags & VALUE_COMP_NAME) { - /* Use the compressed name check */ + /* Compare compressed names */ Result = CmpCompareCompressedName(Name, KeyValue->Name, KeyValue->NameLength); } else { - /* Setup the Unicode string */ + /* Compare the Unicode name directly */ SearchName.Length = KeyValue->NameLength; SearchName.MaximumLength = SearchName.Length; SearchName.Buffer = KeyValue->Name; @@ -216,7 +216,7 @@ CmpFindNameInList(IN PHHIVE Hive, /* Check if we found it */ if (!Result) { - /* We did...return info to caller */ + /* We did... return info to caller */ if (ChildIndex) *ChildIndex = i; *CellIndex = CellData->u.KeyList[i]; @@ -235,7 +235,7 @@ CmpFindNameInList(IN PHHIVE Hive, goto Return; } - /* Nothing found...check if the caller wanted more info */ + /* Nothing found... check if the caller wanted more info */ ASSERT(ChildList->Count == 0); if (ChildIndex) *ChildIndex = 0; *CellIndex = HCELL_NIL; diff --git a/reactos/lib/cmlib/cmvalue.c b/reactos/lib/cmlib/cmvalue.c index f0de392347b..0d92e219cbf 100644 --- a/reactos/lib/cmlib/cmvalue.c +++ b/reactos/lib/cmlib/cmvalue.c @@ -109,7 +109,7 @@ CmpFindValueByName(IN PHHIVE Hive, NULL, &CellIndex)) { - /* Santy check */ + /* Sanity check */ ASSERT(CellIndex == HCELL_NIL); } @@ -117,11 +117,14 @@ CmpFindValueByName(IN PHHIVE Hive, return CellIndex; } +/* + * NOTE: This function should support big values, contrary to CmpValueToData. + */ BOOLEAN NTAPI CmpGetValueData(IN PHHIVE Hive, IN PCM_KEY_VALUE Value, - IN PULONG Length, + OUT PULONG Length, OUT PVOID *Buffer, OUT PBOOLEAN BufferAllocated, OUT PHCELL_INDEX CellToRelease) @@ -144,7 +147,7 @@ CmpGetValueData(IN PHHIVE Hive, return TRUE; } - /* Unsupported */ + /* Unsupported at the moment */ ASSERT_VALUE_BIG(Hive, *Length); /* Get the data from the cell */ @@ -156,6 +159,9 @@ CmpGetValueData(IN PHHIVE Hive, return TRUE; } +/* + * NOTE: This function doesn't support big values, contrary to CmpGetValueData. + */ PCELL_DATA NTAPI CmpValueToData(IN PHHIVE Hive, @@ -409,7 +415,6 @@ CmpCopyKeyValueList(IN PHHIVE SourceHive, IN PHHIVE DestinationHive, IN OUT PCHILD_LIST DestValueList, IN HSTORAGE_TYPE StorageType) - { NTSTATUS Status = STATUS_SUCCESS; HCELL_INDEX CellIndex = HCELL_NIL; diff --git a/reactos/lib/cmlib/hivewrt.c b/reactos/lib/cmlib/hivewrt.c index ddd6d448896..ef4ceb001b6 100644 --- a/reactos/lib/cmlib/hivewrt.c +++ b/reactos/lib/cmlib/hivewrt.c @@ -118,10 +118,10 @@ HvpWriteLog( DPRINT("FileFlush failed\n"); } - /* Update second update counter and CheckSum. */ + /* Update second update counter and CheckSum */ RegistryHive->BaseBlock->Sequence2++; RegistryHive->BaseBlock->CheckSum = - HvpHiveHeaderChecksum(RegistryHive->BaseBlock); + HvpHiveHeaderChecksum(RegistryHive->BaseBlock); /* Write hive header again with updated sequence counter. */ FileOffset = 0; @@ -170,7 +170,7 @@ HvpWriteHive( RegistryHive->BaseBlock->Type = HFILE_TYPE_PRIMARY; RegistryHive->BaseBlock->Sequence1++; RegistryHive->BaseBlock->CheckSum = - HvpHiveHeaderChecksum(RegistryHive->BaseBlock); + HvpHiveHeaderChecksum(RegistryHive->BaseBlock); /* Write hive block */ FileOffset = 0; diff --git a/reactos/ntoskrnl/config/cmparse.c b/reactos/ntoskrnl/config/cmparse.c index 4a4177670c4..c4019a0235e 100644 --- a/reactos/ntoskrnl/config/cmparse.c +++ b/reactos/ntoskrnl/config/cmparse.c @@ -219,7 +219,6 @@ CmpDoCreateChild(IN PHHIVE Hive, PCM_KEY_NODE KeyNode; PCELL_DATA CellData; ULONG StorageType; - LARGE_INTEGER SystemTime; PCM_KEY_CONTROL_BLOCK Kcb; PSECURITY_DESCRIPTOR NewDescriptor; @@ -312,8 +311,7 @@ CmpDoCreateChild(IN PHHIVE Hive, /* Fill out the key node */ KeyNode->Signature = CM_KEY_NODE_SIGNATURE; KeyNode->Flags = Flags; - KeQuerySystemTime(&SystemTime); - KeyNode->LastWriteTime = SystemTime; + KeQuerySystemTime(&KeyNode->LastWriteTime); KeyNode->Spare = 0; KeyNode->Parent = ParentCell; KeyNode->SubKeyCounts[Stable] = 0; @@ -378,6 +376,9 @@ CmpDoCreateChild(IN PHHIVE Hive, &CmpKeyObjectType->TypeInfo.GenericMapping); } + /* Now that the security descriptor is copied in the hive, we can free the original */ + SeDeassignSecurity(&NewDescriptor); + Quickie: /* Check if we got here because of failure */ if (!NT_SUCCESS(Status)) @@ -516,7 +517,7 @@ CmpDoCreate(IN PHHIVE Hive, KeyBody->KeyControlBlock->ParentKcb->KcbMaxNameLen = Name->Length; } - /* Check if we need toupdate class length maximum */ + /* Check if we need to update class length maximum */ if (KeyNode->MaxClassLen < ParseContext->Class.Length) { /* Update it */ @@ -925,7 +926,7 @@ CmpCreateLinkNode(IN PHHIVE Hive, KeyBody->KeyControlBlock->ParentKcb->KcbMaxNameLen = Name.Length; } - /* Check if we need toupdate class length maximum */ + /* Check if we need to update class length maximum */ if (KeyNode->MaxClassLen < Context->Class.Length) { /* Update it */ diff --git a/reactos/ntoskrnl/config/cmsysini.c b/reactos/ntoskrnl/config/cmsysini.c index 38c7ba42c16..7703352d17c 100644 --- a/reactos/ntoskrnl/config/cmsysini.c +++ b/reactos/ntoskrnl/config/cmsysini.c @@ -1030,7 +1030,6 @@ CmpCreateRootNode(IN PHHIVE Hive, { UNICODE_STRING KeyName; PCM_KEY_NODE KeyCell; - LARGE_INTEGER SystemTime; PAGED_CODE(); /* Initialize the node name and allocate it */ @@ -1048,10 +1047,9 @@ CmpCreateRootNode(IN PHHIVE Hive, if (!KeyCell) return FALSE; /* Setup the cell */ - KeyCell->Signature = (USHORT)CM_KEY_NODE_SIGNATURE; + KeyCell->Signature = CM_KEY_NODE_SIGNATURE; KeyCell->Flags = KEY_HIVE_ENTRY | KEY_NO_DELETE; - KeQuerySystemTime(&SystemTime); - KeyCell->LastWriteTime = SystemTime; + KeQuerySystemTime(&KeyCell->LastWriteTime); KeyCell->Parent = HCELL_NIL; KeyCell->SubKeyCounts[Stable] = 0; KeyCell->SubKeyCounts[Volatile] = 0; @@ -1068,14 +1066,11 @@ CmpCreateRootNode(IN PHHIVE Hive, KeyCell->MaxValueDataLen = 0; /* Copy the name (this will also set the length) */ - KeyCell->NameLength = CmpCopyName(Hive, (PWCHAR)KeyCell->Name, &KeyName); + KeyCell->NameLength = CmpCopyName(Hive, KeyCell->Name, &KeyName); - /* Check if the name was compressed */ + /* Check if the name was compressed and set the flag if so */ if (KeyCell->NameLength < KeyName.Length) - { - /* Set the flag */ KeyCell->Flags |= KEY_COMP_NAME; - } /* Return success */ HvReleaseCell(Hive, *Index); diff --git a/reactos/ntoskrnl/config/cmvalche.c b/reactos/ntoskrnl/config/cmvalche.c index e82d9d61528..03d6c8bede9 100644 --- a/reactos/ntoskrnl/config/cmvalche.c +++ b/reactos/ntoskrnl/config/cmvalche.c @@ -249,14 +249,14 @@ CmpFindValueByNameFromCache(IN PCM_KEY_CONTROL_BLOCK Kcb, } /* Get the key value for this index */ - SearchResult = CmpGetValueKeyFromCache(Kcb, - CellData, - i, - CachedValue, - Value, - IndexIsCached, - ValueIsCached, - CellToRelease); + SearchResult = CmpGetValueKeyFromCache(Kcb, + CellData, + i, + CachedValue, + Value, + IndexIsCached, + ValueIsCached, + CellToRelease); if (SearchResult != SearchSuccess) { /* We either failed or need the exclusive lock */ @@ -266,7 +266,7 @@ CmpFindValueByNameFromCache(IN PCM_KEY_CONTROL_BLOCK Kcb, } /* Check if the both the index and the value are cached */ - if ((IndexIsCached) && (*ValueIsCached)) + if (IndexIsCached && *ValueIsCached) { /* We don't expect this yet */ ASSERT_VALUE_CACHE(); diff --git a/reactos/tools/mkhive/binhive.c b/reactos/tools/mkhive/binhive.c index 540d1708507..12b14dff800 100644 --- a/reactos/tools/mkhive/binhive.c +++ b/reactos/tools/mkhive/binhive.c @@ -16,7 +16,8 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/* COPYRIGHT: See COPYING in the top level directory +/* + * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS hive maker * FILE: tools/mkhive/binhive.c * PURPOSE: Binary hive export code diff --git a/reactos/tools/mkhive/binhive.h b/reactos/tools/mkhive/binhive.h index f319427bd3a..4e71b485f75 100644 --- a/reactos/tools/mkhive/binhive.h +++ b/reactos/tools/mkhive/binhive.h @@ -16,7 +16,8 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/* COPYRIGHT: See COPYING in the top level directory +/* + * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS hive maker * FILE: tools/mkhive/binhive.h * PURPOSE: Binary hive export code diff --git a/reactos/tools/mkhive/ntoskrnl.h b/reactos/tools/mkhive/ntoskrnl.h deleted file mode 100644 index de4c7c18feb..00000000000 --- a/reactos/tools/mkhive/ntoskrnl.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This header is used together with cmindex.c and cmname.c - */ - -#define NDEBUG -#include "mkhive.h" - -PVOID -NTAPI -CmpAllocate( - IN SIZE_T Size, - IN BOOLEAN Paged, - IN ULONG Tag -); diff --git a/reactos/tools/mkhive/reginf.c b/reactos/tools/mkhive/reginf.c index 0a09fc79a3e..6be3e0f4f5f 100644 --- a/reactos/tools/mkhive/reginf.c +++ b/reactos/tools/mkhive/reginf.c @@ -16,7 +16,8 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/* COPYRIGHT: See COPYING in the top level directory +/* + * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS hive maker * FILE: tools/mkhive/reginf.c * PURPOSE: Inf file import code diff --git a/reactos/tools/mkhive/reginf.h b/reactos/tools/mkhive/reginf.h index f84f6ed464b..e4c9b7fb091 100644 --- a/reactos/tools/mkhive/reginf.h +++ b/reactos/tools/mkhive/reginf.h @@ -16,7 +16,8 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/* COPYRIGHT: See COPYING in the top level directory +/* + * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS hive maker * FILE: tools/mkhive/reginf.h * PURPOSE: Inf file import code diff --git a/reactos/tools/mkhive/registry.h b/reactos/tools/mkhive/registry.h index 2f758e69d0e..0215a319a47 100644 --- a/reactos/tools/mkhive/registry.h +++ b/reactos/tools/mkhive/registry.h @@ -1,4 +1,5 @@ -/* COPYRIGHT: See COPYING in the top level directory +/* + * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS hive maker * FILE: tools/mkhive/registry.h * PURPOSE: Registry code @@ -34,23 +35,26 @@ extern CMHIVE BcdHive; /* \Registry\Machine\BCD00000000 */ #define ERROR_SUCCESS 0L #define ERROR_UNSUCCESSFUL 1L +#define ERROR_FILE_NOT_FOUND 2L #define ERROR_OUTOFMEMORY 14L #define ERROR_INVALID_PARAMETER 87L #define ERROR_MORE_DATA 234L #define ERROR_NO_MORE_ITEMS 259L -#define REG_NONE 0 -#define REG_SZ 1 -#define REG_EXPAND_SZ 2 -#define REG_BINARY 3 -#define REG_DWORD 4 -#define REG_DWORD_BIG_ENDIAN 5 -#define REG_DWORD_LITTLE_ENDIAN 4 -#define REG_LINK 6 -#define REG_MULTI_SZ 7 -#define REG_RESOURCE_LIST 8 -#define REG_FULL_RESOURCE_DESCRIPTOR 9 -#define REG_RESOURCE_REQUIREMENTS_LIST 10 +#define REG_NONE 0 +#define REG_SZ 1 +#define REG_EXPAND_SZ 2 +#define REG_BINARY 3 +#define REG_DWORD 4 +#define REG_DWORD_LITTLE_ENDIAN 4 +#define REG_DWORD_BIG_ENDIAN 5 +#define REG_LINK 6 +#define REG_MULTI_SZ 7 +#define REG_RESOURCE_LIST 8 +#define REG_FULL_RESOURCE_DESCRIPTOR 9 +#define REG_RESOURCE_REQUIREMENTS_LIST 10 +#define REG_QWORD 11 +#define REG_QWORD_LITTLE_ENDIAN 11 VOID RegInitializeRegistry(VOID);