/* FUNCTIONS ***************************************************************/
-BOOLEAN MmUnmapPageTable(PULONG Pt);
+static BOOLEAN MmUnmapPageTable(PULONG Pt);
VOID
MiFlushTlb(PULONG Pt, PVOID Address)
return Pt;
}
-BOOLEAN MmUnmapPageTable(PULONG Pt)
+static BOOLEAN MmUnmapPageTable(PULONG Pt)
{
if (!IS_HYPERSPACE(Pt))
{
return(PTE_TO_PFN(Entry));
}
-VOID
-NTAPI
-MmDisableVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN* WasDirty, PPFN_NUMBER Page)
-/*
- * FUNCTION: Delete a virtual mapping
- */
-{
- BOOLEAN WasValid;
- ULONG Pte;
- PULONG Pt;
-
- Pt = MmGetPageTableForProcess(Process, Address, FALSE);
- if (Pt == NULL)
- {
- KeBugCheck(MEMORY_MANAGEMENT);
- }
-
- /*
- * Atomically disable the present bit and get the old value.
- */
- do
- {
- Pte = *Pt;
- } while (Pte != InterlockedCompareExchangePte(Pt, Pte & ~PA_PRESENT, Pte));
-
- MiFlushTlb(Pt, Address);
-
- WasValid = (Pte & PA_PRESENT);
- if (!WasValid)
- {
- KeBugCheck(MEMORY_MANAGEMENT);
- }
-
- /*
- * Return some information to the caller
- */
- if (WasDirty != NULL)
- {
- *WasDirty = Pte & PA_DIRTY;
- }
- if (Page != NULL)
- {
- *Page = PTE_TO_PFN(Pte);
- }
-}
-
-VOID
-NTAPI
-MmRawDeleteVirtualMapping(PVOID Address)
-{
- PULONG Pt;
-
- Pt = MmGetPageTableForProcess(NULL, Address, FALSE);
- if (Pt && *Pt)
- {
- /*
- * Set the entry to zero
- */
- InterlockedExchangePte(Pt, 0);
- MiFlushTlb(Pt, Address);
- }
-}
-
VOID
NTAPI
MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN FreePage,