Author: ion
Date: Tue Dec 5 21:33:03 2006
New Revision: 25071
URL:
http://svn.reactos.org/svn/reactos?rev=25071&view=rev
Log:
- 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...
Modified:
trunk/reactos/lib/rtl/image.c
Modified: trunk/reactos/lib/rtl/image.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/image.c?rev=25071&…
==============================================================================
--- trunk/reactos/lib/rtl/image.c (original)
+++ trunk/reactos/lib/rtl/image.c Tue Dec 5 21:33:03 2006
@@ -226,10 +226,6 @@
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 @@
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 @@
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);