Fix return value of FrLdrReadAndMapImage when image is already loaded.

svn path=/branches/ros-amd64-bringup/; revision=38950
This commit is contained in:
Timo Kreuzer 2009-01-19 18:45:26 +00:00
parent 03c5f702be
commit 74bcfdb123

View file

@ -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 */