PMM_REGION Region;
PMM_PAGEOP PageOp;
PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
- KIRQL OldIrql;
/*
* There is a window between taking the page fault and locking the
*/
if (MmIsPagePresent(NULL, Address))
{
- if (Locked)
- {
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
- MmLockPage(MmGetPfnForProcess(NULL, Address));
- KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
- }
return(STATUS_SUCCESS);
}
return(Status);
}
MmLockAddressSpace(AddressSpace);
- if (Locked)
- {
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
- MmLockPage(MmGetPfnForProcess(NULL, Address));
- KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
- }
KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE);
MmReleasePageOp(PageOp);
return(STATUS_SUCCESS);
/*
* Finish the operation
*/
- if (Locked)
- {
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
- MmLockPage(Page);
- KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
- }
PageOp->Status = STATUS_SUCCESS;
KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE);
MmReleasePageOp(PageOp);