mirror of
https://github.com/reactos/reactos.git
synced 2025-05-17 08:16:59 +00:00
- Revert 25070: NO.
- Please look what I did inside FreeLdr. I called this function perfectly without needing to modify how it works. It's what the AdditionalBias parameter is there for... svn path=/trunk/; revision=25071
This commit is contained in:
parent
35d9339017
commit
9dbd8d4fbe
1 changed files with 3 additions and 19 deletions
|
@ -226,10 +226,6 @@ LdrProcessRelocationBlockLongLong(
|
|||
return (PIMAGE_BASE_RELOCATION)TypeOffset;
|
||||
}
|
||||
|
||||
/* NOTE: When this function is called with LoaderName == "FLx86"
|
||||
it's going to behave differently: it will perform all
|
||||
relocations as needed, but will access only valid physical
|
||||
addresses (not virtual addresses) */
|
||||
ULONG
|
||||
NTAPI
|
||||
LdrRelocateImageWithBias(
|
||||
|
@ -254,10 +250,10 @@ LdrRelocateImageWithBias(
|
|||
if (NtHeaders == NULL)
|
||||
return Invalid;
|
||||
|
||||
/*if (NtHeaders->FileHeader.Characteristics & IMAGE_FILE_RELOCS_STRIPPED)
|
||||
if (NtHeaders->FileHeader.Characteristics & IMAGE_FILE_RELOCS_STRIPPED)
|
||||
{
|
||||
return Conflict;
|
||||
}*/
|
||||
}
|
||||
|
||||
RelocationDDir = &NtHeaders->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC];
|
||||
|
||||
|
@ -266,19 +262,7 @@ LdrRelocateImageWithBias(
|
|||
return Success;
|
||||
}
|
||||
|
||||
/* ROS/FreeLoader/arch-specific stuff, for relocating while being in PA mode */
|
||||
if ((LoaderName != NULL) && (!strncmp(LoaderName, "FLx86", 5)))
|
||||
{
|
||||
/* Calculate it, converting BaseAddress to a virtual address */
|
||||
Delta = ((ULONG_PTR)BaseAddress | 0x80000000) -
|
||||
NtHeaders->OptionalHeader.ImageBase + AdditionalBias;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Calculate it as usual */
|
||||
Delta = (ULONG_PTR)BaseAddress - NtHeaders->OptionalHeader.ImageBase + AdditionalBias;
|
||||
}
|
||||
|
||||
Delta = (ULONG_PTR)BaseAddress - NtHeaders->OptionalHeader.ImageBase + AdditionalBias;
|
||||
RelocationDir = (PIMAGE_BASE_RELOCATION)((ULONG_PTR)BaseAddress + RelocationDDir->VirtualAddress);
|
||||
RelocationEnd = (PIMAGE_BASE_RELOCATION)((ULONG_PTR)RelocationDir + RelocationDDir->Size);
|
||||
|
||||
|
|
Loading…
Reference in a new issue