https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e79e7bf53c491f8c2dce064746feffdec72cb7b2

commit e79e7bf53c491f8c2dce064746feffdec72cb7b2
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Tue Jul 30 02:11:26 2019 +0200
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Sun Aug 4 17:47:03 2019 +0200

    [FREELDR] Unload freeldr.ini file before booting.
---
 boot/freeldr/freeldr/bootmgr.c      |  1 +
 boot/freeldr/freeldr/linuxboot.c    |  1 +
 boot/freeldr/freeldr/miscboot.c     |  3 +++
 boot/freeldr/freeldr/ntldr/winldr.c | 13 +++++++------
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/boot/freeldr/freeldr/bootmgr.c b/boot/freeldr/freeldr/bootmgr.c
index 69b7d98359c..5df8182c901 100644
--- a/boot/freeldr/freeldr/bootmgr.c
+++ b/boot/freeldr/freeldr/bootmgr.c
@@ -280,5 +280,6 @@ VOID RunLoader(VOID)
 
 Reboot:
     UiUnInitialize("Rebooting...");
+    IniCleanup();
     return;
 }
diff --git a/boot/freeldr/freeldr/linuxboot.c b/boot/freeldr/freeldr/linuxboot.c
index 23258941eb8..d59ae161801 100644
--- a/boot/freeldr/freeldr/linuxboot.c
+++ b/boot/freeldr/freeldr/linuxboot.c
@@ -164,6 +164,7 @@ LoadAndBootLinux(IN OperatingSystemItem* OperatingSystem,
     RtlCopyMemory((PVOID)0x99000, LinuxCommandLine, LinuxCommandLineSize);
 
     UiUnInitialize("Booting Linux...");
+    IniCleanup();
 
     DiskStopFloppyMotor();
 
diff --git a/boot/freeldr/freeldr/miscboot.c b/boot/freeldr/freeldr/miscboot.c
index 50f68e9afc5..4ad2daa90c6 100644
--- a/boot/freeldr/freeldr/miscboot.c
+++ b/boot/freeldr/freeldr/miscboot.c
@@ -73,6 +73,7 @@ LoadAndBootBootSector(IN OperatingSystemItem* OperatingSystem,
     }
 
     UiUnInitialize("Booting...");
+    IniCleanup();
 
     /*
      * Don't stop the floppy drive motor when we
@@ -148,6 +149,7 @@ LoadAndBootPartition(IN OperatingSystemItem* 
OperatingSystem,
     }
 
     UiUnInitialize("Booting...");
+    IniCleanup();
 
     /*
      * Don't stop the floppy drive motor when we
@@ -206,6 +208,7 @@ LoadAndBootDrive(IN OperatingSystemItem* OperatingSystem,
     }
 
     UiUnInitialize("Booting...");
+    IniCleanup();
 
     /*
      * Don't stop the floppy drive motor when we
diff --git a/boot/freeldr/freeldr/ntldr/winldr.c 
b/boot/freeldr/freeldr/ntldr/winldr.c
index 1127f2e88c7..c9bdd84b0ea 100644
--- a/boot/freeldr/freeldr/ntldr/winldr.c
+++ b/boot/freeldr/freeldr/ntldr/winldr.c
@@ -103,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);
 
@@ -136,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);
 
@@ -784,6 +784,7 @@ LoadAndBootWindowsCommon(
     PLDR_DATA_TABLE_ENTRY KernelDTE;
     KERNEL_ENTRY_POINT KiSystemStartup;
     LPCSTR SystemRoot;
+
     TRACE("LoadAndBootWindowsCommon()\n");
 
 #ifdef _M_IX86
@@ -820,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,
@@ -834,9 +838,6 @@ LoadAndBootWindowsCommon(
     /* "Stop all motors", change videomode */
     MachPrepareForReactOS();
 
-    /* Cleanup ini file */
-    IniCleanup();
-
     /* Debugging... */
     //DumpMemoryAllocMap();
 

Reply via email to