https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cc6bc02b916cd2084c9aa…
commit cc6bc02b916cd2084c9aa8ef5efccfdc7f14d7a4
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Wed Jan 27 16:19:07 2021 +0100
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Wed Feb 3 09:41:23 2021 +0100
[NTOS:CC] Make sure to purge the Mm side in CcPurgeCacheSection
---
ntoskrnl/cc/fs.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/ntoskrnl/cc/fs.c b/ntoskrnl/cc/fs.c
index 161833d14e2..bef6502f73f 100644
--- a/ntoskrnl/cc/fs.c
+++ b/ntoskrnl/cc/fs.c
@@ -180,7 +180,10 @@ CcPurgeCacheSection (
SharedCacheMap = SectionObjectPointer->SharedCacheMap;
if (!SharedCacheMap)
- return FALSE;
+ {
+ Success = TRUE;
+ goto purgeMm;
+ }
StartOffset = FileOffset != NULL ? FileOffset->QuadPart : 0;
if (Length == 0 || FileOffset == NULL)
@@ -257,6 +260,11 @@ CcPurgeCacheSection (
ASSERT(Refs == 0);
}
+ /* Now make sure that Mm doesn't hold some pages here. */
+purgeMm:
+ if (Success)
+ Success = MmPurgeSegment(SectionObjectPointer, FileOffset, Length);
+
return Success;
}