From 7fc926974f213d39d6d559c8f816fea99124d487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 9 Apr 2026 21:11:34 +0200 Subject: [PATCH] [FREELDR:NTLDR] Enable EMS support on all platforms Set the `HeadlessLoaderBlock` for all platforms, since headless support is platform-independent. Addendum to commit ea93b886df. --- boot/freeldr/freeldr/ntldr/headless.c | 2 +- boot/freeldr/freeldr/ntldr/winldr.c | 7 +++---- boot/freeldr/freeldr/ntldr/winldr.h | 2 -- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/boot/freeldr/freeldr/ntldr/headless.c b/boot/freeldr/freeldr/ntldr/headless.c index 4fef28958c5..c7e768a8be7 100644 --- a/boot/freeldr/freeldr/ntldr/headless.c +++ b/boot/freeldr/freeldr/ntldr/headless.c @@ -235,7 +235,7 @@ WinLdrSetupEms( PCSTR Option; /* Start fresh */ - RtlZeroMemory(&LoaderRedirectionInformation, sizeof(HEADLESS_LOADER_BLOCK)); + RtlZeroMemory(&LoaderRedirectionInformation, sizeof(LoaderRedirectionInformation)); LoaderRedirectionInformation.PciDeviceId = PCI_INVALID_VENDORID; /* Use a direction port if one was given, or use ACPI to detect one instead */ diff --git a/boot/freeldr/freeldr/ntldr/winldr.c b/boot/freeldr/freeldr/ntldr/winldr.c index af2a8cbc9f1..7a26e19c842 100644 --- a/boot/freeldr/freeldr/ntldr/winldr.c +++ b/boot/freeldr/freeldr/ntldr/winldr.c @@ -263,17 +263,16 @@ WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock, List_PaToVa(&Extension->BootApplicationPersistentData); } -#ifdef _M_IX86 - /* Set headless block pointer */ + /* Set the headless block pointer */ if (WinLdrTerminalConnected) { Extension->HeadlessLoaderBlock = &WinLdrSystemBlock->HeadlessLoaderBlock; RtlCopyMemory(Extension->HeadlessLoaderBlock, &LoaderRedirectionInformation, - sizeof(HEADLESS_LOADER_BLOCK)); + sizeof(LoaderRedirectionInformation)); Extension->HeadlessLoaderBlock = PaToVa(Extension->HeadlessLoaderBlock); } -#endif + /* Load drivers database */ RtlStringCbCopyA(MiscFiles, sizeof(MiscFiles), BootPath); RtlStringCbCatA(MiscFiles, sizeof(MiscFiles), "AppPatch\\drvmain.sdb"); diff --git a/boot/freeldr/freeldr/ntldr/winldr.h b/boot/freeldr/freeldr/ntldr/winldr.h index 29c6a55d0e4..a13d916a96e 100644 --- a/boot/freeldr/freeldr/ntldr/winldr.h +++ b/boot/freeldr/freeldr/ntldr/winldr.h @@ -48,9 +48,7 @@ typedef struct _LOADER_SYSTEM_BLOCK LOADER_PARAMETER_BLOCK LoaderBlock; LOADER_PARAMETER_EXTENSION Extension; SETUP_LOADER_BLOCK SetupBlock; -#ifdef _M_IX86 HEADLESS_LOADER_BLOCK HeadlessLoaderBlock; -#endif NLS_DATA_BLOCK NlsDataBlock; CHAR LoadOptions[MAX_OPTIONS_LENGTH+1]; CHAR ArcBootDeviceName[MAX_PATH+1];