From 828d04705abceafa449057ca35aa2d71332282ae Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Sun, 27 Mar 2011 11:32:55 +0000 Subject: [PATCH] [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 --- reactos/ntoskrnl/mm/section.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index aa092adf41d..83471dd5efc 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -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; } /*