diff --git a/boot/freeldr/freeldr/include/debug.h b/boot/freeldr/freeldr/include/debug.h index efff30f3954..cf2ef906472 100644 --- a/boot/freeldr/freeldr/include/debug.h +++ b/boot/freeldr/freeldr/include/debug.h @@ -125,6 +125,16 @@ void MEMORY_WRITE_BREAKPOINT4(unsigned long addr); #endif // DBG +#define __STRING2__(x) #x +#define __STRING__(x) __STRING2__(x) +#define __STRLINE__ __STRING__(__LINE__) + +#if !defined(_MSC_VER) && !defined(__pragma) +#define __pragma(x) _Pragma(#x) +#endif +#define _WARN(msg) __pragma(message("WARNING! Line " __STRLINE__ ": " msg)) + + DECLSPEC_NORETURN void NTAPI diff --git a/boot/freeldr/freeldr/ntldr/headless.c b/boot/freeldr/freeldr/ntldr/headless.c index cb19d4286c9..9a04457e574 100644 --- a/boot/freeldr/freeldr/ntldr/headless.c +++ b/boot/freeldr/freeldr/ntldr/headless.c @@ -47,6 +47,7 @@ VOID WinLdrLoadGUID( _Out_ PGUID SystemGuid) { +#if (defined(_M_IX86) || defined(_M_AMD64)) && !defined(UEFIBOOT) PSYSID_UUID_ENTRY CurrentAddress; CurrentAddress = (PSYSID_UUID_ENTRY)0xE0000; @@ -59,6 +60,9 @@ WinLdrLoadGUID( } CurrentAddress = (PSYSID_UUID_ENTRY)((ULONG_PTR)CurrentAddress + 1); } +#else + _WARN("WinLdrLoadGUID needs SMBIOS table reading implementation on this platform!"); +#endif RtlZeroMemory(SystemGuid, SYSID_UUID_DATA_SIZE); } @@ -251,11 +255,14 @@ WinLdrSetupEms( } else { - LoaderRedirectionInformation.PortAddress = (PUCHAR)strtoul(Option, 0, 16); +#ifdef _WIN64 +#define strtoulptr strtoull +#else +#define strtoulptr strtoul +#endif + LoaderRedirectionInformation.PortAddress = (PUCHAR)strtoulptr(Option, 0, 16); if (LoaderRedirectionInformation.PortAddress) - { LoaderRedirectionInformation.PortNumber = 3; - } } } diff --git a/boot/freeldr/freeldr/ntldr/winldr.c b/boot/freeldr/freeldr/ntldr/winldr.c index f82e85d7e20..abd1e34d87e 100644 --- a/boot/freeldr/freeldr/ntldr/winldr.c +++ b/boot/freeldr/freeldr/ntldr/winldr.c @@ -1193,10 +1193,8 @@ LoadAndBootWindowsCommon( ASSERT(OperatingSystemVersion != 0); -#ifdef _M_IX86 /* Setup redirection support */ WinLdrSetupEms(BootOptions); -#endif /* Convert BootPath to SystemRoot */ SystemRoot = strstr(BootPath, "\\"); diff --git a/boot/freeldr/freeldr/rosload.cmake b/boot/freeldr/freeldr/rosload.cmake index 1ab4e5ee405..3494a652459 100644 --- a/boot/freeldr/freeldr/rosload.cmake +++ b/boot/freeldr/freeldr/rosload.cmake @@ -18,6 +18,7 @@ list(APPEND ROSLOAD_SOURCE lib/rtl/libsupp.c ${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmboot.c ntldr/conversion.c + ntldr/headless.c ntldr/inffile.c ntldr/registry.c ntldr/setupldr.c @@ -32,8 +33,7 @@ if(ARCH STREQUAL "i386") arch/i386/halstub.c arch/i386/ntoskrnl.c disk/scsiport.c - ntldr/arch/i386/winldr.c - ntldr/headless.c) + ntldr/arch/i386/winldr.c) list(APPEND ROSLOAD_ASM_SOURCE arch/i386/drvmap.S @@ -46,8 +46,7 @@ elseif(ARCH STREQUAL "amd64") list(APPEND ROSLOAD_ASM_SOURCE arch/amd64/misc.S - arch/amd64/linux.S - ) + arch/amd64/linux.S) elseif(ARCH STREQUAL "arm") diff --git a/boot/freeldr/freeldr/uefi.cmake b/boot/freeldr/freeldr/uefi.cmake index b02c694c993..1d74f2c690a 100644 --- a/boot/freeldr/freeldr/uefi.cmake +++ b/boot/freeldr/freeldr/uefi.cmake @@ -56,6 +56,7 @@ add_asm_files(uefifreeldr_common_asm ${FREELDR_COMMON_ASM_SOURCE} ${UEFILDR_COMM list(APPEND FREELDR_NTLDR_SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/config/cmboot.c ntldr/conversion.c + ntldr/headless.c ntldr/inffile.c ntldr/registry.c ntldr/setupldr.c @@ -65,8 +66,7 @@ list(APPEND FREELDR_NTLDR_SOURCE if(ARCH STREQUAL "i386") list(APPEND FREELDR_NTLDR_SOURCE - ntldr/arch/i386/winldr.c - ntldr/headless.c) + ntldr/arch/i386/winldr.c) elseif(ARCH STREQUAL "amd64") list(APPEND FREELDR_NTLDR_SOURCE ntldr/arch/amd64/winldr.c)