* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: anonmem.c,v 1.8 2002/11/05 20:31:34 hbirr Exp $
+/* $Id: anonmem.c,v 1.9 2002/11/05 21:13:14 dwelch Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/mm/anonmem.c
SWAPENTRY SwapEntry;
NTSTATUS Status;
PMDL Mdl;
- ULONG flProtect;
DPRINT("MmPageOutVirtualMemory(Address 0x%.8X) PID %d\n",
Address, MemoryArea->Process->UniqueProcessId);
/*
* Disable the virtual mapping.
*/
-#if 0
MmDisableVirtualMapping(MemoryArea->Process, Address,
&WasDirty, &PhysicalAddress);
-#else
- flProtect = MmGetPageProtect(MemoryArea->Process, Address);
- MmDeleteVirtualMapping(MemoryArea->Process, Address, FALSE,
- &WasDirty, &PhysicalAddress);
-#endif
if (PhysicalAddress.QuadPart == 0)
{
*/
if (!WasDirty)
{
-#if 0
MmDeleteVirtualMapping(MemoryArea->Process, Address, FALSE, NULL, NULL);
-#endif
MmDeleteAllRmaps(PhysicalAddress, NULL, NULL);
if ((SwapEntry = MmGetSavedSwapEntryPage(PhysicalAddress)) != 0)
{
if (SwapEntry == 0)
{
MmShowOutOfSpaceMessagePagingFile();
-#if 0
MmEnableVirtualMapping(MemoryArea->Process, Address);
-#else
- MmCreateVirtualMapping(MemoryArea->Process, Address,
- flProtect, PhysicalAddress, TRUE);
-#endif
PageOp->Status = STATUS_UNSUCCESSFUL;
KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE);
MmReleasePageOp(PageOp);
{
DPRINT1("MM: Failed to write to swap page (Status was 0x%.8X)\n",
Status);
-#if 0
MmEnableVirtualMapping(MemoryArea->Process, Address);
-#else
- MmCreateVirtualMapping(MemoryArea->Process, Address,
- flProtect, PhysicalAddress, TRUE);
-#endif
PageOp->Status = STATUS_UNSUCCESSFUL;
KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE);
MmReleasePageOp(PageOp);
* Otherwise we have succeeded, free the page
*/
DPRINT("MM: Swapped out virtual memory page 0x%.8X!\n", PhysicalAddress);
-#if 0
MmDeleteVirtualMapping(MemoryArea->Process, Address, FALSE, NULL, NULL);
-#endif
MmCreatePageFileMapping(MemoryArea->Process, Address, SwapEntry);
MmDeleteAllRmaps(PhysicalAddress, NULL, NULL);
MmSetSavedSwapEntryPage(PhysicalAddress, 0);
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: page.c,v 1.46 2002/11/05 20:39:03 hbirr Exp $
+/* $Id: page.c,v 1.47 2002/11/05 21:13:15 dwelch Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/mm/i386/page.c
}
return(PTE_TO_PAGE(PageEntry));
}
-#if 0
+
VOID
MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOL* WasDirty, PHYSICAL_ADDRESS* PhysicalAddr)
/*
PhysicalAddr->u.LowPart = PAGE_MASK(Pte);
}
}
-#endif
+
VOID
MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, BOOL FreePage,
BOOL* WasDirty, PHYSICAL_ADDRESS* PhysicalAddr)
KeDetachProcess();
}
}
-#if 0
+
VOID MmEnableVirtualMapping(PEPROCESS Process, PVOID Address)
{
PULONG PageEntry;
KeDetachProcess();
}
}
-#endif
+
BOOLEAN MmIsPagePresent(PEPROCESS Process, PVOID Address)
{
return((MmGetPageEntryForProcess1(Process, Address)) & PA_PRESENT);