From 75623bb1fa810216ea747c8f5314aa92046902e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 8 Aug 2019 23:06:33 +0200 Subject: [PATCH] [FREELDR] Fix erroneous change from d05be0da regarding RAMDISK loading in SETUPLDR. Restore the correct position of (optional) RAMDISK loading code, before attempting to open txtsetup.sif since the bootcd ISO might be the RAMDISK. --- boot/freeldr/freeldr/ntldr/setupldr.c | 36 +++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/boot/freeldr/freeldr/ntldr/setupldr.c b/boot/freeldr/freeldr/ntldr/setupldr.c index 98b66e82f95..5342a1b0c55 100644 --- a/boot/freeldr/freeldr/ntldr/setupldr.c +++ b/boot/freeldr/freeldr/ntldr/setupldr.c @@ -238,6 +238,24 @@ LoadReactOSSetup( TRACE("BootOptions: '%s'\n", BootOptions2); + /* Check if a ramdisk file was given */ + File = strstr(BootOptions2, "/RDPATH="); + if (File) + { + /* Copy the file name and everything else after it */ + RtlStringCbCopyA(FileName, sizeof(FileName), File + 8); + + /* Null-terminate */ + *strstr(FileName, " ") = ANSI_NULL; + + /* Load the ramdisk */ + if (!RamDiskLoadVirtualFile(FileName)) + { + UiMessageBox("Failed to load RAM disk file %s", FileName); + return ENOENT; + } + } + /* Check if we booted from floppy */ BootFromFloppy = strstr(BootPath, "fdisk") != NULL; @@ -293,24 +311,6 @@ LoadReactOSSetup( TRACE("BootOptions: '%s'\n", BootOptions); - /* Check if a ramdisk file was given */ - File = strstr(BootOptions2, "/RDPATH="); - if (File) - { - /* Copy the file name and everything else after it */ - RtlStringCbCopyA(FileName, sizeof(FileName), File + 8); - - /* Null-terminate */ - *strstr(FileName, " ") = ANSI_NULL; - - /* Load the ramdisk */ - if (!RamDiskLoadVirtualFile(FileName)) - { - UiMessageBox("Failed to load RAM disk file %s", FileName); - return ENOENT; - } - } - /* Allocate and minimalist-initialize LPB */ AllocateAndInitLPB(&LoaderBlock);