Author: tkreuzer
Date: Mon Jan 19 12:45:26 2009
New Revision: 38950
URL:
http://svn.reactos.org/svn/reactos?rev=38950&view=rev
Log:
Fix return value of FrLdrReadAndMapImage when image is already loaded.
Modified:
branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/imageldr.c
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/imageldr.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
==============================================================================
--- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/imageldr.c
[iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/imageldr.c
[iso-8859-1] Mon Jan 19 12:45:26 2009
@@ -445,13 +445,15 @@
PIMAGE_NT_HEADERS NtHeader;
PIMAGE_SECTION_HEADER Section;
NTSTATUS Status = STATUS_SUCCESS;
+ PLOADER_MODULE pModule;
/* Try to see, maybe it's loaded already */
- if (LdrGetModuleObject(Name) != NULL)
- {
- /* It's loaded, return NULL. It would be wise to return
- correct LoadBase, but it seems to be ignored almost everywhere */
- return NULL;
+ if ((pModule = LdrGetModuleObject(Name)) != NULL)
+ {
+ /* It's loaded, return LoadBase */
+ ImageBase = (PVOID)pModule->ModStart;
+ LoadBase = RVA(ImageBase, -KSEG0_BASE);
+ return LoadBase;
}
/* Set the virtual (image) and physical (load) addresses */