From f57d3a98b7955210861ee91733176e9c3843c8bb Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Fri, 25 Sep 2009 09:28:37 +0000 Subject: [PATCH] [winldr] - Load and use debug boot options if built with DBG (mimics old reactos setupldr behaviour). svn path=/trunk/; revision=43142 --- .../boot/freeldr/freeldr/windows/setupldr2.c | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/windows/setupldr2.c b/reactos/boot/freeldr/freeldr/windows/setupldr2.c index e4e27319a98..d449edd8c76 100644 --- a/reactos/boot/freeldr/freeldr/windows/setupldr2.c +++ b/reactos/boot/freeldr/freeldr/windows/setupldr2.c @@ -157,7 +157,7 @@ VOID LoadReactOSSetup2(VOID) CHAR SystemPath[512], SearchPath[512]; CHAR FileName[512]; CHAR BootPath[512]; - LPCSTR BootOptions; + LPCSTR LoadOptions, DbgOptions, BootOptions; PVOID NtosBase = NULL, HalBase = NULL, KdComBase = NULL; BOOLEAN Status; ULONG i, ErrorLine; @@ -204,7 +204,7 @@ VOID LoadReactOSSetup2(VOID) } } - /* Load options */ + /* Get Load options - debug and non-debug */ if (!InfFindFirstLine(InfHandle, "SetupData", "OsLoadOptions", @@ -214,12 +214,30 @@ VOID LoadReactOSSetup2(VOID) return; } - if (!InfGetDataField (&InfContext, 1, &BootOptions)) + if (!InfGetDataField (&InfContext, 1, &LoadOptions)) { printf("Failed to get load options\n"); return; } + BootOptions = LoadOptions; + +#if DBG + /* Get debug load options and use them */ + if (InfFindFirstLine(InfHandle, + "SetupData", + "DbgOsLoadOptions", + &InfContext)) + { + if (!InfGetDataField(&InfContext, 1, &DbgOptions)) + DbgOptions = ""; + else + BootOptions = DbgOptions; + } +#endif + + DPRINTM(DPRINT_WINDOWS,"BootOptions: '%s'\n", BootOptions); + SetupUiInitialize(); UiDrawStatusText(""); UiDrawStatusText("Detecting Hardware...");