Author: tkreuzer Date: Sat Jun 25 13:52:47 2011 New Revision: 52452
URL: http://svn.reactos.org/svn/reactos?rev=52452&view=rev Log: [FEELDR] - Don't try to load referenced dlls in any other dir than system32. A second attempt would fail on the first dll that was already loaded and the function would bail out before any missing dll could be loaded. This worked only by chance on gcc builds, because the 1st import was bootvid, which was always loaded in the 2nd attempt from system32, and the function failed after that, since hal and kdcom were already loaded.
Modified: trunk/reactos/boot/freeldr/freeldr/windows/i386/wlmemory.c trunk/reactos/boot/freeldr/freeldr/windows/setupldr2.c
Modified: trunk/reactos/boot/freeldr/freeldr/windows/i386/wlmemory.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/window... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/i386/wlmemory.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/i386/wlmemory.c [iso-8859-1] Sat Jun 25 13:52:47 2011 @@ -148,7 +148,7 @@ ULONG Entry, Page;
//Print(L"MempSetupPaging: SP 0x%X, Number: 0x%X\n", StartPage, NumberOfPages); - + // HACK if (StartPage+NumberOfPages >= 0x80000) { @@ -487,13 +487,13 @@ "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
Modified: trunk/reactos/boot/freeldr/freeldr/windows/setupldr2.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/window... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/setupldr2.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/setupldr2.c [iso-8859-1] Sat Jun 25 13:52:47 2011 @@ -123,7 +123,7 @@ 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 @@ swprintf(ImagePathW, L"%S", ImagePath); wcscat(ImagePathW, L"\"); wcscat(ImagePathW, ServiceName); - + /* Remove .sys extension */ ServiceName[wcslen(ServiceName) - 4] = 0;
@@ -310,16 +310,11 @@
/* Load all referenced DLLs for kernel, HAL and kdcom.dll */ strcpy(SearchPath, BootPath); + strcat(SearchPath, "system32\"); WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, KernelDTE); WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, HalDTE); if (KdComDTE) WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, KdComDTE); - /* In system32 too */ - strcpy(SearchPath + strlen(BootPath), "system32\"); - WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, KernelDTE); - WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, HalDTE); - if (KdComDTE) - WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, KdComDTE);
/* Load NLS data, they are in system32 */ SetupLdrLoadNlsData(LoaderBlock, InfHandle, SearchPath);