mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:43:01 +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;
|
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
|
ULONG
|
||||||
NTAPI
|
NTAPI
|
||||||
LdrRelocateImageWithBias(
|
LdrRelocateImageWithBias(
|
||||||
|
@ -254,10 +250,10 @@ LdrRelocateImageWithBias(
|
||||||
if (NtHeaders == NULL)
|
if (NtHeaders == NULL)
|
||||||
return Invalid;
|
return Invalid;
|
||||||
|
|
||||||
/*if (NtHeaders->FileHeader.Characteristics & IMAGE_FILE_RELOCS_STRIPPED)
|
if (NtHeaders->FileHeader.Characteristics & IMAGE_FILE_RELOCS_STRIPPED)
|
||||||
{
|
{
|
||||||
return Conflict;
|
return Conflict;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
RelocationDDir = &NtHeaders->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC];
|
RelocationDDir = &NtHeaders->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC];
|
||||||
|
|
||||||
|
@ -266,19 +262,7 @@ LdrRelocateImageWithBias(
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ROS/FreeLoader/arch-specific stuff, for relocating while being in PA mode */
|
Delta = (ULONG_PTR)BaseAddress - NtHeaders->OptionalHeader.ImageBase + AdditionalBias;
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
RelocationDir = (PIMAGE_BASE_RELOCATION)((ULONG_PTR)BaseAddress + RelocationDDir->VirtualAddress);
|
RelocationDir = (PIMAGE_BASE_RELOCATION)((ULONG_PTR)BaseAddress + RelocationDDir->VirtualAddress);
|
||||||
RelocationEnd = (PIMAGE_BASE_RELOCATION)((ULONG_PTR)RelocationDir + RelocationDDir->Size);
|
RelocationEnd = (PIMAGE_BASE_RELOCATION)((ULONG_PTR)RelocationDir + RelocationDDir->Size);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue