[NTOSKRNL]
authorJérôme Gardou <jerome.gardou@reactos.org>
Fri, 28 Oct 2011 16:34:48 +0000 (16:34 +0000)
committerJérôme Gardou <jerome.gardou@reactos.org>
Fri, 28 Oct 2011 16:34:48 +0000 (16:34 +0000)
- remove unused variables/arguments
- Add small check in MmNotPresentFaultSectionView

svn path=/trunk/; revision=54262

reactos/ntoskrnl/include/internal/mm.h
reactos/ntoskrnl/mm/anonmem.c
reactos/ntoskrnl/mm/mmfault.c
reactos/ntoskrnl/mm/section.c

index 5beffed..c937d08 100644 (file)
@@ -935,8 +935,7 @@ NTAPI
 MmNotPresentFaultVirtualMemory(
     PMMSUPPORT AddressSpace,
     MEMORY_AREA* MemoryArea,
-    PVOID Address,
-    BOOLEAN Locked
+    PVOID Address
 );
 
 NTSTATUS
@@ -1656,8 +1655,7 @@ NTAPI
 MmNotPresentFaultSectionView(
     PMMSUPPORT AddressSpace,
     MEMORY_AREA* MemoryArea,
-    PVOID Address,
-    BOOLEAN Locked
+    PVOID Address
 );
 
 NTSTATUS
@@ -1678,8 +1676,7 @@ NTAPI
 MmAccessFaultSectionView(
     PMMSUPPORT AddressSpace,
     MEMORY_AREA* MemoryArea,
-    PVOID Address,
-    BOOLEAN Locked
+    PVOID Address
 );
 
 VOID
index 1eeae31..669b336 100644 (file)
@@ -161,8 +161,7 @@ NTSTATUS
 NTAPI
 MmNotPresentFaultVirtualMemory(PMMSUPPORT AddressSpace,
                                MEMORY_AREA* MemoryArea,
-                               PVOID Address,
-                               BOOLEAN Locked)
+                               PVOID Address)
 /*
  * FUNCTION: Move data into memory to satisfy a page not present fault
  * ARGUMENTS:
index 9a3ecf9..7d5080e 100644 (file)
@@ -29,8 +29,7 @@ MmpAccessFault(KPROCESSOR_MODE Mode,
    PMMSUPPORT AddressSpace;
    MEMORY_AREA* MemoryArea;
    NTSTATUS Status;
-   BOOLEAN Locked = FromMdl;
-
+   
    DPRINT("MmAccessFault(Mode %d, Address %x)\n", Mode, Address);
 
    if (KeGetCurrentIrql() >= DISPATCH_LEVEL)
@@ -80,8 +79,7 @@ MmpAccessFault(KPROCESSOR_MODE Mode,
          case MEMORY_AREA_SECTION_VIEW:
             Status = MmAccessFaultSectionView(AddressSpace,
                                               MemoryArea,
-                                              (PVOID)Address,
-                                              Locked);
+                                              (PVOID)Address);
             break;
 
          case MEMORY_AREA_VIRTUAL_MEMORY:
@@ -124,7 +122,6 @@ MmNotPresentFault(KPROCESSOR_MODE Mode,
    PMMSUPPORT AddressSpace;
    MEMORY_AREA* MemoryArea;
    NTSTATUS Status;
-   BOOLEAN Locked = FromMdl;
 
    DPRINT("MmNotPresentFault(Mode %d, Address %x)\n", Mode, Address);
 
@@ -179,15 +176,13 @@ MmNotPresentFault(KPROCESSOR_MODE Mode,
          case MEMORY_AREA_SECTION_VIEW:
             Status = MmNotPresentFaultSectionView(AddressSpace,
                                                   MemoryArea,
-                                                  (PVOID)Address,
-                                                  Locked);
+                                                  (PVOID)Address);
             break;
 
          case MEMORY_AREA_VIRTUAL_MEMORY:
             Status = MmNotPresentFaultVirtualMemory(AddressSpace,
                                                     MemoryArea,
-                                                    (PVOID)Address,
-                                                    Locked);
+                                                    (PVOID)Address);
             break;
 
 #ifdef  NEWCC
index 1cfc808..ef4ae6f 100644 (file)
@@ -1309,8 +1309,7 @@ NTSTATUS
 NTAPI
 MmNotPresentFaultSectionView(PMMSUPPORT AddressSpace,
                              MEMORY_AREA* MemoryArea,
-                             PVOID Address,
-                             BOOLEAN Locked)
+                             PVOID Address)
 {
    ULONG Offset;
    PFN_NUMBER Page;
@@ -1335,6 +1334,14 @@ MmNotPresentFaultSectionView(PMMSUPPORT AddressSpace,
    {
       return(STATUS_SUCCESS);
    }
+   
+   /*
+    * Check for the virtual memory area being deleted.
+    */
+   if (MemoryArea->DeleteInProgress)
+   {
+      return(STATUS_UNSUCCESSFUL);
+   }
 
    PAddress = MM_ROUND_DOWN(Address, PAGE_SIZE);
    Offset = (ULONG)((ULONG_PTR)PAddress - (ULONG_PTR)MemoryArea->StartingAddress
@@ -1805,8 +1812,7 @@ NTSTATUS
 NTAPI
 MmAccessFaultSectionView(PMMSUPPORT AddressSpace,
                          MEMORY_AREA* MemoryArea,
-                         PVOID Address,
-                         BOOLEAN Locked)
+                         PVOID Address)
 {
    PMM_SECTION_SEGMENT Segment;
    PROS_SECTION_OBJECT Section;
@@ -1820,7 +1826,7 @@ MmAccessFaultSectionView(PMMSUPPORT AddressSpace,
    ULONG Entry;
    PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
 
-   DPRINT("MmAccessFaultSectionView(%x, %x, %x, %x)\n", AddressSpace, MemoryArea, Address, Locked);
+   DPRINT("MmAccessFaultSectionView(%x, %x, %x, %x)\n", AddressSpace, MemoryArea, Address);
 
    /*
     * Check if the page has been paged out or has already been set readwrite