Author: tkreuzer Date: Thu Mar 26 07:57:19 2009 New Revision: 40247
URL: http://svn.reactos.org/svn/reactos?rev=40247&view=rev Log: Fix compilation of freeldr. (a number of ULONG / ULONG_PTR issues, remove LoadReactOSSetup2 for non-x86 builds
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/bootmgr.c branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/setupldr_main.rbuild branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/peloader.c branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/winldr.c
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/bootmgr.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/f... ============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/bootmgr.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/bootmgr.c [iso-8859-1] Thu Mar 26 07:57:19 2009 @@ -124,8 +124,10 @@ } else if (_stricmp(SettingValue, "ReactOSSetup2") == 0) { +#ifdef __i386__ // WinLdr-style boot LoadReactOSSetup2(); +#endif } #endif #ifdef __i386__
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/setupldr_main.rbuild URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/f... ============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/setupldr_main.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/setupldr_main.rbuild [iso-8859-1] Thu Mar 26 07:57:19 2009 @@ -18,6 +18,8 @@ <file>setupldr.c</file> </directory> <directory name="windows"> - <file>setupldr2.c</file> + <if property="ARCH" value="i386"> + <file>setupldr2.c</file> + </if> </directory> </module>
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/peloader.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/f... ============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/peloader.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/peloader.c [iso-8859-1] Thu Mar 26 07:57:19 2009 @@ -406,7 +406,7 @@ if (SizeOfRawData < VirtualSize) { DPRINTM(DPRINT_PELOADER, "WinLdrLoadImage(): SORD %d < VS %d\n", SizeOfRawData, VirtualSize); - RtlZeroMemory((PVOID)(SectionHeader->VirtualAddress + (ULONG)PhysicalBase + SizeOfRawData), VirtualSize - SizeOfRawData); + RtlZeroMemory((PVOID)(SectionHeader->VirtualAddress + (ULONG_PTR)PhysicalBase + SizeOfRawData), VirtualSize - SizeOfRawData); }
SectionHeader++; @@ -421,7 +421,7 @@
/* Relocate the image, if it needs it */ - if (NtHeaders->OptionalHeader.ImageBase != (ULONG)VirtualBase) + if (NtHeaders->OptionalHeader.ImageBase != (ULONG_PTR)VirtualBase) { DPRINTM(DPRINT_PELOADER, "Relocating %p -> %p\n", NtHeaders->OptionalHeader.ImageBase, VirtualBase); @@ -528,7 +528,7 @@ /* AddressOfData in thunk entry will become a virtual address (from relative) */ //DPRINTM(DPRINT_PELOADER, "WinLdrpBindImportName(): ThunkData->u1.AOD was %p\n", ThunkData->u1.AddressOfData); ThunkData->u1.AddressOfData = - (ULONG)RVA(ImageBase, ThunkData->u1.AddressOfData); + (ULONG_PTR)RVA(ImageBase, ThunkData->u1.AddressOfData); //DPRINTM(DPRINT_PELOADER, "WinLdrpBindImportName(): ThunkData->u1.AOD became %p\n", ThunkData->u1.AddressOfData); }
@@ -630,11 +630,11 @@ FunctionTable = (PULONG)VaToPa(RVA(DllBase, ExportDirectory->AddressOfFunctions));
/* Save a pointer to the function */ - ThunkData->u1.Function = (ULONG)RVA(DllBase, FunctionTable[Ordinal]); + ThunkData->u1.Function = (ULONG_PTR)RVA(DllBase, FunctionTable[Ordinal]);
/* Is it a forwarder? (function pointer isn't within the export directory) */ - if (((ULONG)VaToPa((PVOID)ThunkData->u1.Function) > (ULONG)ExportDirectory) && - ((ULONG)VaToPa((PVOID)ThunkData->u1.Function) < ((ULONG)ExportDirectory + ExportSize))) + if (((ULONG_PTR)VaToPa((PVOID)ThunkData->u1.Function) > (ULONG_PTR)ExportDirectory) && + ((ULONG_PTR)VaToPa((PVOID)ThunkData->u1.Function) < ((ULONG_PTR)ExportDirectory + ExportSize))) { PLDR_DATA_TABLE_ENTRY DataTableEntry; CHAR ForwardDllName[255]; @@ -685,7 +685,7 @@ ImportByName->Hint = 0;
/* And finally point ThunkData's AddressOfData to that structure */ - RefThunkData.u1.AddressOfData = (ULONG)ImportByName; + RefThunkData.u1.AddressOfData = (ULONG_PTR)ImportByName;
/* And recursively call ourselves */ Status = WinLdrpBindImportName(
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/winldr.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/f... ============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/winldr.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/winldr.c [iso-8859-1] Thu Mar 26 07:57:19 2009 @@ -432,7 +432,7 @@ CHAR BootOptions[256]; PVOID NtosBase = NULL, HalBase = NULL, KdComBase = NULL; BOOLEAN Status; - ULONG SectionId; + ULONG_PTR SectionId; ULONG BootDevice; PLOADER_PARAMETER_BLOCK LoaderBlock, LoaderBlockVA; KERNEL_ENTRY_POINT KiSystemStartup;