https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f96f1224a7979b40cded4…
commit f96f1224a7979b40cded4cbe73c6dfa057fb4ae1
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sat Sep 1 12:39:05 2018 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sat Sep 1 12:41:01 2018 +0200
[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 3843cb2693..aba97049f1 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);