Renamed the function to MmIsPageInUse, and only return TRUE if the page is in use. Like the name says.
svn path=/trunk/; revision=32364
BOOLEAN
NTAPI
-MmIsUsablePage(PFN_TYPE Page);
+MmIsPageInUse(PFN_TYPE Page);
VOID
NTAPI
BOOLEAN
NTAPI
-MmIsUsablePage(PFN_TYPE Pfn)
+MmIsPageInUse(PFN_TYPE Pfn)
{
- DPRINT("MmIsUsablePage(PhysicalAddress %x)\n", Pfn << PAGE_SHIFT);
+ DPRINT("MmIsPageInUse(PhysicalAddress %x)\n", Pfn << PAGE_SHIFT);
if (Pfn == 0 || Pfn >= MmPageArraySize)
{
KEBUGCHECK(0);
}
-
- if (MmPageArray[Pfn].Flags.Type != MM_PHYSICAL_PAGE_USED &&
- MmPageArray[Pfn].Flags.Type != MM_PHYSICAL_PAGE_BIOS)
- {
- return(FALSE);
- }
-
- return(TRUE);
+
+ return (MmPageArray[Pfn].Flags.Type == MM_PHYSICAL_PAGE_USED);
}
VOID
for (i = 0; i < PageCount; i++)
{
- if (!MmIsUsablePage(Pages[i]))
+ if (!MmIsPageInUse(Pages[i]))
{
- /* Is this an attempt to map KUSER_SHARED_DATA? */
- if ((Address == (PVOID)0x7FFE0000) && (PageCount == 1) && (Pages[0] == 2))
- {
- // allow
- }
- else
- {
- DPRINT1("Page at address %x not usable\n", PFN_TO_PTE(Pages[i]));
- KEBUGCHECK(0);
- }
+ DPRINT1("Page at address %x not in use\n", PFN_TO_PTE(Pages[i]));
+ KEBUGCHECK(0);
}
}