mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
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:
parent
10f230ae0a
commit
782b28151b
1 changed files with 6 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue