https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7dab3583cc4c80304df61658fe4b1eeea8983f5e

commit 7dab3583cc4c80304df61658fe4b1eeea8983f5e
Author:     Jérôme Gardou <[email protected]>
AuthorDate: Wed Dec 2 12:12:11 2020 +0100
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Wed Feb 3 09:41:22 2021 +0100

    [NTOS/MM] Force flushing when the page is dirtified in user mode
---
 ntoskrnl/mm/section.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ntoskrnl/mm/section.c b/ntoskrnl/mm/section.c
index f3b30dedaed..6dcf764d7a1 100644
--- a/ntoskrnl/mm/section.c
+++ b/ntoskrnl/mm/section.c
@@ -4620,7 +4620,7 @@ MmRosFlushVirtualMemory(
         if (Entry != 0)
         {
             /* This will write the page to disk, if needed */
-            MmCheckDirtySegment(Segment, &SegmentOffset, 
MmIsDirtyPage(Process, CurrentAddress), FALSE);
+            MmCheckDirtySegment(Segment, &SegmentOffset, Process ? 
MmIsDirtyPage(Process, CurrentAddress) : FALSE, FALSE);
             Iosb->Information += PAGE_SIZE;
         }
         SegmentOffset.QuadPart += PAGE_SIZE;
@@ -4694,7 +4694,10 @@ MmCheckDirtySegment(
 
         /* Drop the reference we got */
         Entry = MAKE_SSE(Page << PAGE_SHIFT, SHARE_COUNT_FROM_SSE(Entry) - 1);
-        if (DirtyAgain) Entry = DIRTY_SSE(Entry);
+        if (DirtyAgain)
+        {
+            Entry = DIRTY_SSE(Entry);
+        }
         MmSetPageEntrySectionSegment(Segment, Offset, Entry);
     }
 

Reply via email to