[NTOSKRNL] Fail on pinning when there's no pin access set
authorPierre Schweitzer <pierre@reactos.org>
Sat, 1 Sep 2018 10:39:05 +0000 (12:39 +0200)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 1 Sep 2018 10:41:01 +0000 (12:41 +0200)
Instead of assert, now, CcPinRead will just fail. This is
not consistent without Windows behavior, but still better
than asserting while testing!

ntoskrnl/cc/pin.c

index 3843cb2..aba9704 100644 (file)
@@ -186,7 +186,11 @@ CcPinMappedData (
 
     SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
     ASSERT(SharedCacheMap);
-    ASSERT(SharedCacheMap->PinAccess);
+    if (!SharedCacheMap->PinAccess)
+    {
+        DPRINT1("FIXME: Pinning a file with no pin access!\n");
+        return FALSE;
+    }
 
     iBcb = *Bcb;
     ASSERT(iBcb->Pinned == FALSE);