mirror of
https://github.com/reactos/reactos.git
synced 2025-04-21 20:50:29 +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;
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue