[NTOS:MM] Save the dirty bit when sharing a segment page

This commit is contained in:
Jérôme Gardou 2020-12-14 15:48:27 +01:00
parent 3141668724
commit 3c2b1bf59b

View file

@ -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);
}