/*++ Copyright (c) 1992 Microsoft Corporation Module Name: ptov.c Abstract: Kernel debugger extension for dumping all physical to virtual translations for a given process. Author: John Vert (jvert) 25-Jul-1995 Revision History: --*/ #include "precomp.h" BOOL ReadPhysicalPage( IN ULONG PageNumber, OUT PVOID Buffer ); DECLARE_API( ptov ) /*++ Routine Description: Dumps all physical to virtual translations for a given process Arguments: args - supplies physical address of PDE Return Value: None. --*/ { ULONG PdeAddress; ULONG ActualRead; PHARDWARE_PTE PageDirectory; PHARDWARE_PTE PageTable; ULONG i,j; ULONG VirtualPage=0; sscanf(args,"%lx",&PdeAddress); if (PdeAddress == 0) { dprintf("usage: ptov PhysicalAddressOfPDE\n"); return; } PageDirectory = LocalAlloc(LMEM_FIXED, PAGE_SIZE); if (PageDirectory == NULL) { dprintf("Couldn't allocate %d bytes for page directory\n",PAGE_SIZE); return; } PageTable = LocalAlloc(LMEM_FIXED, PAGE_SIZE); if (PageTable == NULL) { dprintf("Couldn't allocate %d bytes for page table\n",PAGE_SIZE); LocalFree(PageTable); } if (ReadPhysicalPage(PdeAddress,PageDirectory)) { for (i=0;i