From f96f1224a7979b40cded4cbe73c6dfa057fb4ae1 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 1 Sep 2018 12:39:05 +0200 Subject: [PATCH] [NTOSKRNL] Fail on pinning when there's no pin access set 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ntoskrnl/cc/pin.c b/ntoskrnl/cc/pin.c index 3843cb26938..aba97049f19 100644 --- a/ntoskrnl/cc/pin.c +++ b/ntoskrnl/cc/pin.c @@ -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);