mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[NTOS:Mm] Add PFN ShareCount handling to old Mm
This commit is contained in:
parent
73de609917
commit
80dd9f5a90
1 changed files with 20 additions and 2 deletions
|
@ -325,7 +325,18 @@ MmDeleteVirtualMappingEx(
|
|||
|
||||
if (!IsPhysical && OldPte.u.Hard.Valid)
|
||||
{
|
||||
// TODO: Handle PFN ShareCount
|
||||
PMMPFN Pfn1;
|
||||
KIRQL OldIrql;
|
||||
|
||||
OldIrql = MiAcquirePfnLock();
|
||||
Pfn1 = &MmPfnDatabase[OldPte.u.Hard.PageFrameNumber];
|
||||
ASSERT(Pfn1->u3.e1.PageLocation == ActiveAndValid);
|
||||
ASSERT(Pfn1->u2.ShareCount > 0);
|
||||
if (--Pfn1->u2.ShareCount == 0)
|
||||
{
|
||||
Pfn1->u3.e1.PageLocation = TransitionPage;
|
||||
}
|
||||
MiReleasePfnLock(OldIrql);
|
||||
}
|
||||
|
||||
MiUnlockProcessWorkingSetUnsafe(Process, PsGetCurrentThread());
|
||||
|
@ -685,7 +696,14 @@ MmCreateVirtualMappingUnsafeEx(
|
|||
|
||||
if (!IsPhysical)
|
||||
{
|
||||
// TODO: Handle PFN ShareCount
|
||||
PMMPFN Pfn1;
|
||||
KIRQL OldIrql;
|
||||
|
||||
OldIrql = MiAcquirePfnLock();
|
||||
Pfn1 = &MmPfnDatabase[TempPte.u.Hard.PageFrameNumber];
|
||||
Pfn1->u2.ShareCount++;
|
||||
Pfn1->u3.e1.PageLocation = ActiveAndValid;
|
||||
MiReleasePfnLock(OldIrql);
|
||||
}
|
||||
|
||||
/* We don't need to flush the TLB here because it only caches valid translations
|
||||
|
|
Loading…
Reference in a new issue