[FREELDR] Fix boot timeout regression on AMD64 (#7281)

Initialize the BootMgrInfo struct globally, so the TimeOut value is guaranteed to be negative when no Multiboot cmdline is provided. This could happen when BootMain is called with a NULL pointer:
https://git.reactos.org/?p=reactos.git;a=blob;f=boot/freeldr/freeldr/arch/amd64/entry.S;hb=163f3407c8fa93ce06773fdf9fc53064506bd05e#l73
so CmdLine == NULL and LoadSettings is called with NULL, thus the CmdLineParse isn't run.

Fixes boot timeout regression introduced in commit 7bee32d237 which occured only on AMD64 builds.
This commit is contained in:
Adam Słaboń 2024-09-01 08:54:28 +00:00 committed by GitHub
parent 06024c97fe
commit e168d60bc5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,7 +15,7 @@
static CCHAR DebugString[256];
static CCHAR DefaultOs[256];
BOOTMGRINFO BootMgrInfo = {0};
BOOTMGRINFO BootMgrInfo = {NULL, NULL, -1, 0};
/* FUNCTIONS ******************************************************************/
@ -26,12 +26,6 @@ CmdLineParse(
PCHAR End, Setting;
ULONG_PTR Length, Offset = 0;
/* Set defaults */
BootMgrInfo.DebugString = NULL;
BootMgrInfo.DefaultOs = NULL;
BootMgrInfo.TimeOut = -1;
// BootMgrInfo.FrLdrSection = 0;
/*
* Get the debug string, in the following format:
* "debug=option1=XXX;option2=YYY;..."