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

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

    [NTOS:MM] Make the situation about dirty pages in image map a bit clearer
---
 ntoskrnl/mm/section.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ntoskrnl/mm/section.c b/ntoskrnl/mm/section.c
index b38dc0bfc4a..d71bc490934 100644
--- a/ntoskrnl/mm/section.c
+++ b/ntoskrnl/mm/section.c
@@ -1082,7 +1082,7 @@ MmUnsharePageEntrySectionSegment(PMEMORY_AREA MemoryArea,
         return FALSE;
     }
 
-    if (IS_DIRTY_SSE(Entry) && !(Segment->Image.Characteristics & 
IMAGE_SCN_MEM_SHARED))
+    if (Dirty && (MemoryArea->VadNode.u.VadFlags.VadType != VadImageMap))
     {
         ASSERT(!Segment->WriteCopy);
         ASSERT(MmGetSavedSwapEntryPage(Page) == 0);
@@ -1092,6 +1092,9 @@ MmUnsharePageEntrySectionSegment(PMEMORY_AREA MemoryArea,
         return FALSE;
     }
 
+    /* Only valid case for shared dirty pages is shared image section */
+    ASSERT(!Dirty || (Segment->Image.Characteristics & IMAGE_SCN_MEM_SHARED));
+
     SwapEntry = MmGetSavedSwapEntryPage(Page);
     if (Dirty && !SwapEntry)
     {

Reply via email to