[NTOS/MM]

- Return STATUS_IMAGE_NOT_AT_BASE when mapping an image section to a different base address. New ntdll loader depends on this and fails to relocate the image if this status is not returned.

svn path=/trunk/; revision=51171
This commit is contained in:
Aleksey Bragin
2011-03-27 11:32:55 +00:00
parent 34bb476056
commit 828d04705a
+9 -1
View File
@@ -4571,6 +4571,7 @@ MmMapViewOfSection(IN PVOID SectionObject,
PMMSUPPORT AddressSpace;
ULONG ViewOffset;
NTSTATUS Status = STATUS_SUCCESS;
BOOLEAN NotAtBase = FALSE;
if ((ULONG_PTR)SectionObject & 1)
{
@@ -4652,6 +4653,8 @@ MmMapViewOfSection(IN PVOID SectionObject,
MmUnlockAddressSpace(AddressSpace);
return(STATUS_UNSUCCESSFUL);
}
/* Remember that we loaded image at a different base address */
NotAtBase = TRUE;
}
for (i = 0; i < NrSegments; i++)
@@ -4756,7 +4759,12 @@ MmMapViewOfSection(IN PVOID SectionObject,
MmUnlockAddressSpace(AddressSpace);
return(STATUS_SUCCESS);
if (NotAtBase)
Status = STATUS_IMAGE_NOT_AT_BASE;
else
Status = STATUS_SUCCESS;
return Status;
}
/*