Applied David Welsh's fix for getting physical address from specified process instead of current one here as well

svn path=/trunk/; revision=1555
This commit is contained in:
Phillip Susi 2001-01-21 19:00:59 +00:00
parent 10f230ae0a
commit 782b28151b

View file

@ -276,7 +276,7 @@ NTSTATUS MmFreeMemoryArea(PMADDRESS_SPACE AddressSpace,
{ {
MEMORY_AREA* MemoryArea; MEMORY_AREA* MemoryArea;
ULONG i; ULONG i;
LARGE_INTEGER PhysicalAddr; ULONG PhysicalAddr;
DPRINT("MmFreeMemoryArea(AddressSpace %x, BaseAddress %x, Length %x," DPRINT("MmFreeMemoryArea(AddressSpace %x, BaseAddress %x, Length %x,"
"FreePages %d)\n",AddressSpace,BaseAddress,Length,FreePages); "FreePages %d)\n",AddressSpace,BaseAddress,Length,FreePages);
@ -292,11 +292,12 @@ NTSTATUS MmFreeMemoryArea(PMADDRESS_SPACE AddressSpace,
{ {
for (i=0;i<=(MemoryArea->Length/PAGESIZE);i++) for (i=0;i<=(MemoryArea->Length/PAGESIZE);i++)
{ {
PhysicalAddr = MmGetPhysicalAddress(MemoryArea->BaseAddress + PhysicalAddr = MmGetPhysicalAddressForProcess(AddressSpace->Process,
(i*PAGESIZE)); MemoryArea->BaseAddress +
if (PhysicalAddr.u.LowPart != 0) (i*PAGESIZE));
if (PhysicalAddr != 0)
{ {
MmDereferencePage((PVOID)(ULONG)(PhysicalAddr.u.LowPart)); MmDereferencePage((PVOID)PhysicalAddr);
} }
} }
} }