Fix compilation of freeldr. (a number of ULONG / ULONG_PTR issues, remove LoadReactOSSetup2 for non-x86 builds

svn path=/branches/ros-amd64-bringup/; revision=40247
This commit is contained in:
Timo Kreuzer
2009-03-26 04:57:19 +00:00
parent 4b70da652e
commit 9426678d4d
4 changed files with 13 additions and 9 deletions
+2
View File
@@ -124,8 +124,10 @@ VOID RunLoader(VOID)
}
else if (_stricmp(SettingValue, "ReactOSSetup2") == 0)
{
#ifdef __i386__
// WinLdr-style boot
LoadReactOSSetup2();
#endif
}
#endif
#ifdef __i386__
@@ -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>
@@ -406,7 +406,7 @@ WinLdrLoadImage(IN PCHAR FileName,
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 @@ WinLdrLoadImage(IN PCHAR FileName,
/* 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 @@ WinLdrpBindImportName(IN OUT PLOADER_PARAMETER_BLOCK WinLdrBlock,
/* 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 @@ WinLdrpBindImportName(IN OUT PLOADER_PARAMETER_BLOCK WinLdrBlock,
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 @@ WinLdrpBindImportName(IN OUT PLOADER_PARAMETER_BLOCK WinLdrBlock,
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(
@@ -432,7 +432,7 @@ LoadAndBootWindows(PCSTR OperatingSystemName, USHORT OperatingSystemVersion)
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;