From 782b28151b901ccf35c0807e47bb1a09dfbd169e Mon Sep 17 00:00:00 2001 From: Phillip Susi Date: Sun, 21 Jan 2001 19:00:59 +0000 Subject: [PATCH] Applied David Welsh's fix for getting physical address from specified process instead of current one here as well svn path=/trunk/; revision=1555 --- reactos/ntoskrnl/mm/marea.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/reactos/ntoskrnl/mm/marea.c b/reactos/ntoskrnl/mm/marea.c index 16bfdb270af..2a78762ea6e 100644 --- a/reactos/ntoskrnl/mm/marea.c +++ b/reactos/ntoskrnl/mm/marea.c @@ -276,7 +276,7 @@ NTSTATUS MmFreeMemoryArea(PMADDRESS_SPACE AddressSpace, { MEMORY_AREA* MemoryArea; ULONG i; - LARGE_INTEGER PhysicalAddr; + ULONG PhysicalAddr; DPRINT("MmFreeMemoryArea(AddressSpace %x, BaseAddress %x, Length %x," "FreePages %d)\n",AddressSpace,BaseAddress,Length,FreePages); @@ -292,11 +292,12 @@ NTSTATUS MmFreeMemoryArea(PMADDRESS_SPACE AddressSpace, { for (i=0;i<=(MemoryArea->Length/PAGESIZE);i++) { - PhysicalAddr = MmGetPhysicalAddress(MemoryArea->BaseAddress + - (i*PAGESIZE)); - if (PhysicalAddr.u.LowPart != 0) + PhysicalAddr = MmGetPhysicalAddressForProcess(AddressSpace->Process, + MemoryArea->BaseAddress + + (i*PAGESIZE)); + if (PhysicalAddr != 0) { - MmDereferencePage((PVOID)(ULONG)(PhysicalAddr.u.LowPart)); + MmDereferencePage((PVOID)PhysicalAddr); } } }