[NTOS/MM] Force flushing when the page is dirtified in user mode

This commit is contained in:
Jérôme Gardou 2020-12-02 12:12:11 +01:00
parent 91edefa11e
commit 7dab3583cc

View file

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