[FREELDR] Unload freeldr.ini file before booting.
[reactos.git] / boot / freeldr / freeldr / ntldr / winldr.c
index b110156..c9bdd84 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include <freeldr.h>
+#include "winldr.h"
 #include "registry.h"
 
 #include <ndk/ldrtypes.h>
@@ -102,12 +103,12 @@ WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock,
     TRACE("SystemRoot: %s\n", SystemRoot);
     TRACE("Options: %s\n", Options);
 
-    /* Fill Arc BootDevice */
+    /* Fill ARC BootDevice */
     LoaderBlock->ArcBootDeviceName = WinLdrSystemBlock->ArcBootDeviceName;
     strncpy(LoaderBlock->ArcBootDeviceName, ArcBoot, MAX_PATH);
     LoaderBlock->ArcBootDeviceName = PaToVa(LoaderBlock->ArcBootDeviceName);
 
-    /* Fill Arc HalDevice, it matches ArcBoot path */
+    /* Fill ARC HalDevice, it matches ArcBoot path */
     LoaderBlock->ArcHalDeviceName = WinLdrSystemBlock->ArcBootDeviceName;
     LoaderBlock->ArcHalDeviceName = PaToVa(LoaderBlock->ArcHalDeviceName);
 
@@ -135,7 +136,7 @@ WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock,
 
     LoaderBlock->LoadOptions = PaToVa(LoaderBlock->LoadOptions);
 
-    /* Arc devices */
+    /* ARC devices */
     LoaderBlock->ArcDiskInformation = &WinLdrSystemBlock->ArcDiskInformation;
     InitializeListHead(&LoaderBlock->ArcDiskInformation->DiskSignatureListHead);
 
@@ -150,9 +151,8 @@ WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock,
         /* Copy the data over */
         RtlCopyMemory(ArcDiskSig, &reactos_arc_disk_info[i], sizeof(ARC_DISK_SIGNATURE_EX));
 
-        /* Set the ARC Name pointer and mark the partition table as valid */
+        /* Set the ARC Name pointer */
         ArcDiskSig->DiskSignature.ArcName = PaToVa(ArcDiskSig->ArcName);
-        ArcDiskSig->DiskSignature.ValidPartitionTable = TRUE;
 
         /* Insert into the list */
         InsertTailList(&LoaderBlock->ArcDiskInformation->DiskSignatureListHead,
@@ -358,6 +358,7 @@ WinLdrLoadModule(PCSTR ModuleName,
     //CHAR ProgressString[256];
 
     /* Inform user we are loading files */
+    //UiDrawBackdrop();
     //sprintf(ProgressString, "Loading %s...", FileName);
     //UiDrawProgressBarCenter(1, 100, ProgressString);
 
@@ -749,7 +750,7 @@ LoadAndBootWindows(IN OperatingSystemItem* OperatingSystem,
     /* Load the system hive */
     UiDrawBackdrop();
     UiDrawProgressBarCenter(15, 100, "Loading system hive...");
-    Success = WinLdrInitSystemHive(LoaderBlock, BootPath);
+    Success = WinLdrInitSystemHive(LoaderBlock, BootPath, FALSE);
     TRACE("SYSTEM hive %s\n", (Success ? "loaded" : "not loaded"));
     /* Bail out if failure */
     if (!Success)
@@ -783,6 +784,7 @@ LoadAndBootWindowsCommon(
     PLDR_DATA_TABLE_ENTRY KernelDTE;
     KERNEL_ENTRY_POINT KiSystemStartup;
     LPCSTR SystemRoot;
+
     TRACE("LoadAndBootWindowsCommon()\n");
 
 #ifdef _M_IX86
@@ -819,6 +821,9 @@ LoadAndBootWindowsCommon(
     Success = WinLdrLoadBootDrivers(LoaderBlock, BootPath);
     TRACE("Boot drivers loading %s\n", Success ? "successful" : "failed");
 
+    /* Cleanup ini file */
+    IniCleanup();
+
     /* Initialize Phase 1 - no drivers loading anymore */
     WinLdrInitializePhase1(LoaderBlock,
                            BootOptions,
@@ -831,10 +836,7 @@ LoadAndBootWindowsCommon(
     LoaderBlockVA = PaToVa(LoaderBlock);
 
     /* "Stop all motors", change videomode */
-    MachPrepareForReactOS(Setup);
-
-    /* Cleanup ini file */
-    IniCleanup();
+    MachPrepareForReactOS();
 
     /* Debugging... */
     //DumpMemoryAllocMap();