diff --git a/reactos/boot/freeldr/freeldr/windows/i386/wlmemory.c b/reactos/boot/freeldr/freeldr/windows/i386/wlmemory.c index 578927c9daf..8eb7bb61c44 100644 --- a/reactos/boot/freeldr/freeldr/windows/i386/wlmemory.c +++ b/reactos/boot/freeldr/freeldr/windows/i386/wlmemory.c @@ -148,7 +148,7 @@ MempSetupPaging(IN ULONG StartPage, ULONG Entry, Page; //Print(L"MempSetupPaging: SP 0x%X, Number: 0x%X\n", StartPage, NumberOfPages); - + // HACK if (StartPage+NumberOfPages >= 0x80000) { @@ -487,13 +487,13 @@ WinLdrSetProcessorContext(PVOID GdtIdt, IN ULONG Pcr, IN ULONG Tss) "1:\n"); #elif defined(_MSC_VER) /* We can't express the above in MASM so we use this far return instead */ - DbgPrint("WinLdrSetProcessorContext: Performing untested far-return\n"); - __asm { + __asm + { push 8 push offset resume retf resume: - }; + }; #else #error #endif diff --git a/reactos/boot/freeldr/freeldr/windows/setupldr2.c b/reactos/boot/freeldr/freeldr/windows/setupldr2.c index 58ee4d89d31..a371cc72a02 100644 --- a/reactos/boot/freeldr/freeldr/windows/setupldr2.c +++ b/reactos/boot/freeldr/freeldr/windows/setupldr2.c @@ -123,7 +123,7 @@ SetupLdrScanBootDrivers(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, LPC do { if (InfGetDataField(&InfContext, 7, &Media) && - InfGetDataField(&InfContext, 0, &DriverName) && + InfGetDataField(&InfContext, 0, &DriverName) && InfGetDataField(&InfContext, 13, &dirIndex)) { if ((strcmp(Media, "x") == 0) && @@ -137,7 +137,7 @@ SetupLdrScanBootDrivers(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, LPC swprintf(ImagePathW, L"%S", ImagePath); wcscat(ImagePathW, L"\\"); wcscat(ImagePathW, ServiceName); - + /* Remove .sys extension */ ServiceName[wcslen(ServiceName) - 4] = 0; @@ -310,12 +310,7 @@ VOID LoadReactOSSetup2(VOID) /* Load all referenced DLLs for kernel, HAL and kdcom.dll */ strcpy(SearchPath, BootPath); - WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, KernelDTE); - WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, HalDTE); - if (KdComDTE) - WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, KdComDTE); - /* In system32 too */ - strcpy(SearchPath + strlen(BootPath), "system32\\"); + strcat(SearchPath, "system32\\"); WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, KernelDTE); WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, HalDTE); if (KdComDTE)