mirror of
https://github.com/reactos/reactos.git
synced 2024-09-12 22:02:18 +00:00
Fix return value of FrLdrReadAndMapImage when image is already loaded.
svn path=/branches/ros-amd64-bringup/; revision=38950
This commit is contained in:
parent
03c5f702be
commit
74bcfdb123
|
@ -445,13 +445,15 @@ FrLdrReadAndMapImage(IN FILE *Image,
|
|||
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)
|
||||
if ((pModule = 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;
|
||||
/* It's loaded, return LoadBase */
|
||||
ImageBase = (PVOID)pModule->ModStart;
|
||||
LoadBase = RVA(ImageBase, -KSEG0_BASE);
|
||||
return LoadBase;
|
||||
}
|
||||
|
||||
/* Set the virtual (image) and physical (load) addresses */
|
||||
|
|
Loading…
Reference in a new issue