[NTOS:Mm] Handle RosMm pages in MiDecrementReferenceCount

This is required, when RosMm unmaps locked pages and they later get unlocked.
This commit is contained in:
Timo Kreuzer 2023-04-09 23:12:14 +03:00
parent 80dd9f5a90
commit 5f014e421b

View file

@ -1219,6 +1219,10 @@ MiDecrementShareCount(IN PMMPFN Pfn1,
}
}
VOID
NTAPI
MmDereferencePage(PFN_NUMBER Pfn);
VOID
NTAPI
MiDecrementReferenceCount(IN PMMPFN Pfn1,
@ -1227,6 +1231,13 @@ MiDecrementReferenceCount(IN PMMPFN Pfn1,
/* PFN lock must be held */
MI_ASSERT_PFN_LOCK_HELD();
/* Handle RosMm PFNs here, too (in case they got locked/unlocked by ARM3) */
if (MI_IS_ROS_PFN(Pfn1))
{
MmDereferencePage(PageFrameIndex);
return;
}
/* Sanity checks on the page */
if (PageFrameIndex > MmHighestPhysicalPage ||
Pfn1 != MI_PFN_ELEMENT(PageFrameIndex) ||