[HIVEBCD]:
authorAlex Ionescu <aionescu@gmail.com>
Mon, 5 Oct 2015 07:22:11 +0000 (07:22 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Mon, 5 Oct 2015 07:22:11 +0000 (07:22 +0000)
- The Objects key is in the root, not under Description.
[MKHIVE]:
- Make it *actually* build a BCD hive. It was doing nothing before, because it turns out that irrespective of what appear to be dynamic, command-line driven behavior modes, all of mkhive's logic is deeply tied together through C-level changes and knowledge. (for example, that's why calling it with a single .inf, it still wants to build 6 hives for you). There were also some copy/pasta bugs in the BCD handling code, now fixed.

svn path=/trunk/; revision=69453

reactos/boot/bootdata/hivebcd.inf
reactos/tools/mkhive/mkhive.c
reactos/tools/mkhive/reginf.c
reactos/tools/mkhive/registry.c
reactos/tools/mkhive/registry.h

index 42178b2..9de29e7 100644 (file)
@@ -3,9 +3,9 @@ Signature = "$ReactOS$"
 
 [AddReg]
 
-HKLM,"BCD00000000\Description\Control","System",0x00010003,1
-HKLM,"BCD00000000\Description\Control","TreatAtSystem",0x00010003,1
-HKLM,"BCD00000000\Description\Control","KeyName",2,"BCD00000000"
-HKLM,"BCD00000000\Description\Objects",,0x00000012
+BCD,"BCD00000000\Description\Control","System",0x00010003,1
+BCD,"BCD00000000\Description\Control","TreatAtSystem",0x00010003,1
+BCD,"BCD00000000\Description\Control","KeyName",2,"BCD00000000"
+BCD,"BCD00000000\Objects",,0x00000012
 
 ; EOF
index cc53312..e647e6a 100644 (file)
@@ -146,7 +146,7 @@ int main (int argc, char *argv[])
     convert_path (FileName, argv[1]);
     strcat (FileName, DIR_SEPARATOR_STRING);
     strcat (FileName, "BCD");
-    if (!ExportBinaryHive (FileName, &SystemHive))
+    if (!ExportBinaryHive (FileName, &BcdHive))
     {
         return 1;
     }
index e18af4b..0a09fc7 100644 (file)
@@ -53,11 +53,13 @@ static const WCHAR HKCU[] = {'H','K','C','U',0};
 static const WCHAR HKLM[] = {'H','K','L','M',0};
 static const WCHAR HKU[] = {'H','K','U',0};
 static const WCHAR HKR[] = {'H','K','R',0};
+static const WCHAR BCD[] = {'B','C','D',0};
 
 static const WCHAR HKCRPath[] = {'\\','R','e','g','i','s','t','r','y','\\','M','a','c','h','i','n','e','\\','S','O','F','T','W','A','R','E','\\','C','l','a','s','s','e','s','\\',0};
 static const WCHAR HKCUPath[] = {'\\','R','e','g','i','s','t','r','y','\\','U','s','e','r','\\','.','D','E','F','A','U','L','T','\\',0};
 static const WCHAR HKLMPath[] = {'\\','R','e','g','i','s','t','r','y','\\','M','a','c','h','i','n','e','\\',0};
 static const WCHAR HKUPath[] = {'\\','R','e','g','i','s','t','r','y','\\','U','s','e','r','\\',0};
+static const WCHAR BCDPath[] = {'\\','R','e','g','i','s','t','r','y','\\','M','a','c','h','i','n','e','\\',0};
 
 static const WCHAR AddReg[] = {'A','d','d','R','e','g',0};
 static const WCHAR DelReg[] = {'D','e','l','R','e','g',0};
@@ -91,6 +93,12 @@ GetRootKey (PWCHAR Name)
         return TRUE;
     }
 
+    if (!strcmpiW (Name, BCD))
+    {
+        strcpyW (Name, BCDPath);
+        return TRUE;
+    }
+
 #if 0
     if (!strcmpiW (Name, HKR))
         return FALSE;
index 9afd25c..7174ebd 100644 (file)
@@ -47,6 +47,7 @@ CMHIVE SamHive;      /* \Registry\Machine\SAM */
 CMHIVE SecurityHive; /* \Registry\Machine\SECURITY */
 CMHIVE SoftwareHive; /* \Registry\Machine\SOFTWARE */
 CMHIVE SystemHive;   /* \Registry\Machine\SYSTEM */
+CMHIVE BcdHive;      /* \Registry\Machine\BCD00000000 */
 
 static PMEMKEY
 CreateInMemoryStructure(
@@ -552,6 +553,11 @@ RegInitializeRegistry(VOID)
                     &SoftwareHive,
                     L"Registry\\Machine\\SOFTWARE");
 
+    /* Create BCD key */
+    ConnectRegistry(NULL,
+                    &BcdHive,
+                    L"Registry\\Machine\\BCD00000000");
+
     /* Create SYSTEM key */
     ConnectRegistry(NULL,
                     &SystemHive,
index d49d2a7..2f758e6 100644 (file)
@@ -30,6 +30,7 @@ extern CMHIVE SamHive;      /* \Registry\Machine\SAM */
 extern CMHIVE SecurityHive; /* \Registry\Machine\SECURITY */
 extern CMHIVE SoftwareHive; /* \Registry\Machine\SOFTWARE */
 extern CMHIVE SystemHive;   /* \Registry\Machine\SYSTEM */
+extern CMHIVE BcdHive;      /* \Registry\Machine\BCD00000000 */
 
 #define ERROR_SUCCESS                    0L
 #define ERROR_UNSUCCESSFUL               1L