[ros-diffs] [fireball] 51171: [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 sta...

fireball at svn.reactos.org fireball at svn.reactos.org
Sun Mar 27 11:32:55 UTC 2011


Author: fireball
Date: Sun Mar 27 11:32:55 2011
New Revision: 51171

URL: http://svn.reactos.org/svn/reactos?rev=51171&view=rev
Log:
[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.

Modified:
    trunk/reactos/ntoskrnl/mm/section.c

Modified: trunk/reactos/ntoskrnl/mm/section.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=51171&r1=51170&r2=51171&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Sun Mar 27 11:32:55 2011
@@ -4571,6 +4571,7 @@
    PMMSUPPORT AddressSpace;
    ULONG ViewOffset;
    NTSTATUS Status = STATUS_SUCCESS;
+   BOOLEAN NotAtBase = FALSE;
 
    if ((ULONG_PTR)SectionObject & 1)
    {
@@ -4652,6 +4653,8 @@
             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 @@
 
    MmUnlockAddressSpace(AddressSpace);
 
-   return(STATUS_SUCCESS);
+   if (NotAtBase)
+       Status = STATUS_IMAGE_NOT_AT_BASE;
+   else
+       Status = STATUS_SUCCESS;
+
+   return Status;
 }
 
 /*




More information about the Ros-diffs mailing list