[NTOSKRNL]
authorAmine Khaldi <amine.khaldi@reactos.org>
Fri, 11 Oct 2013 18:12:16 +0000 (18:12 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Fri, 11 Oct 2013 18:12:16 +0000 (18:12 +0000)
* Fix the owner's attributes handling when releasing the working set lock. CIDs 731438 and 731439.
CORE-6681

svn path=/trunk/; revision=60615

reactos/ntoskrnl/mm/ARM3/miarm.h
reactos/ntoskrnl/mm/ARM3/virtual.c

index e221f8f..67980ac 100644 (file)
@@ -1307,8 +1307,8 @@ FORCEINLINE
 VOID
 MiUnlockProcessWorkingSetForFault(IN PEPROCESS Process,
                                   IN PETHREAD Thread,
-                                  IN BOOLEAN Safe,
-                                  IN BOOLEAN Shared)
+                                  OUT PBOOLEAN Safe,
+                                  OUT PBOOLEAN Shared)
 {
     ASSERT(MI_WS_OWNER(Process));
 
@@ -1317,22 +1317,22 @@ MiUnlockProcessWorkingSetForFault(IN PEPROCESS Process,
     {
         /* Release unsafely */
         MiUnlockProcessWorkingSetUnsafe(Process, Thread);
-        Safe = FALSE;
-        Shared = FALSE;
+        *Safe = FALSE;
+        *Shared = FALSE;
     }
     else if (Thread->OwnsProcessWorkingSetExclusive == 1)
     {
         /* Owner is safe and exclusive, release normally */
         MiUnlockProcessWorkingSet(Process, Thread);
-        Safe = TRUE;
-        Shared = FALSE;
+        *Safe = TRUE;
+        *Shared = FALSE;
     }
     else
     {
         /* Owner is shared (implies safe), release normally */
         ASSERT(FALSE);
-        Safe = TRUE;
-        Shared = TRUE;
+        *Safe = TRUE;
+        *Shared = TRUE;
     }
 }
 
index b618a83..2b29549 100644 (file)
@@ -223,8 +223,8 @@ MiMakeSystemAddressValid(IN PVOID PageTableVirtualAddress,
         /* Release the working set lock */
         MiUnlockProcessWorkingSetForFault(CurrentProcess,
                                           CurrentThread,
-                                          WsSafe,
-                                          WsShared);
+                                          &WsSafe,
+                                          &WsShared);
 
         /* Fault it in */
         Status = MmAccessFault(FALSE, PageTableVirtualAddress, KernelMode, NULL);