https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3c2b1bf59b0771a92f7d2…
commit 3c2b1bf59b0771a92f7d2aa8c96cad1dd58dc31d
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Mon Dec 14 15:48:27 2020 +0100
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Wed Feb 3 09:41:22 2021 +0100
[NTOS:MM] Save the dirty bit when sharing a segment page
---
ntoskrnl/mm/section.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/ntoskrnl/mm/section.c b/ntoskrnl/mm/section.c
index 8acc368a884..a3efe4f0b6b 100644
--- a/ntoskrnl/mm/section.c
+++ b/ntoskrnl/mm/section.c
@@ -1020,6 +1020,7 @@ MmSharePageEntrySectionSegment(PMM_SECTION_SEGMENT Segment,
PLARGE_INTEGER Offset)
{
ULONG_PTR Entry;
+ BOOLEAN Dirty;
Entry = MmGetPageEntrySectionSegment(Segment, Offset);
if (Entry == 0)
@@ -1036,7 +1037,10 @@ MmSharePageEntrySectionSegment(PMM_SECTION_SEGMENT Segment,
{
KeBugCheck(MEMORY_MANAGEMENT);
}
+ Dirty = IS_DIRTY_SSE(Entry);
Entry = MAKE_SSE(PAGE_FROM_SSE(Entry), SHARE_COUNT_FROM_SSE(Entry) + 1);
+ if (Dirty)
+ Entry = DIRTY_SSE(Entry);
MmSetPageEntrySectionSegment(Segment, Offset, Entry);
}