mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Used MmFreeVirtualMemory in MmDeleteTeb because MmFreeMemoryAreaByPtr doesn't free the region list entries.
svn path=/trunk/; revision=16930
This commit is contained in:
parent
3a76f91710
commit
15a077c46a
1 changed files with 8 additions and 34 deletions
|
@ -103,49 +103,23 @@ MmDeleteKernelStack(PVOID Stack,
|
||||||
MmUnlockAddressSpace(MmGetKernelAddressSpace());
|
MmUnlockAddressSpace(MmGetKernelAddressSpace());
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
|
||||||
MiFreePebPage(PVOID Context,
|
|
||||||
MEMORY_AREA* MemoryArea,
|
|
||||||
PVOID Address,
|
|
||||||
PFN_TYPE Page,
|
|
||||||
SWAPENTRY SwapEntry,
|
|
||||||
BOOLEAN Dirty)
|
|
||||||
{
|
|
||||||
PEPROCESS Process = (PEPROCESS)Context;
|
|
||||||
|
|
||||||
if (Page != 0)
|
|
||||||
{
|
|
||||||
SWAPENTRY SavedSwapEntry;
|
|
||||||
SavedSwapEntry = MmGetSavedSwapEntryPage(Page);
|
|
||||||
if (SavedSwapEntry != 0)
|
|
||||||
{
|
|
||||||
MmFreeSwapPage(SavedSwapEntry);
|
|
||||||
MmSetSavedSwapEntryPage(Page, 0);
|
|
||||||
}
|
|
||||||
MmDeleteRmap(Page, Process, Address);
|
|
||||||
MmReleasePageMemoryConsumer(MC_USER, Page);
|
|
||||||
}
|
|
||||||
else if (SwapEntry != 0)
|
|
||||||
{
|
|
||||||
MmFreeSwapPage(SwapEntry);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
STDCALL
|
STDCALL
|
||||||
MmDeleteTeb(PEPROCESS Process,
|
MmDeleteTeb(PEPROCESS Process,
|
||||||
PTEB Teb)
|
PTEB Teb)
|
||||||
{
|
{
|
||||||
PMADDRESS_SPACE ProcessAddressSpace = &Process->AddressSpace;
|
PMADDRESS_SPACE ProcessAddressSpace = &Process->AddressSpace;
|
||||||
|
PMEMORY_AREA MemoryArea;
|
||||||
|
|
||||||
/* Lock the Address Space */
|
/* Lock the Address Space */
|
||||||
MmLockAddressSpace(ProcessAddressSpace);
|
MmLockAddressSpace(ProcessAddressSpace);
|
||||||
|
|
||||||
/* Delete the Stack */
|
MemoryArea = MmLocateMemoryAreaByAddress(ProcessAddressSpace, (PVOID)Teb);
|
||||||
MmFreeMemoryAreaByPtr(ProcessAddressSpace,
|
if (MemoryArea)
|
||||||
Teb,
|
{
|
||||||
MiFreePebPage,
|
/* Delete the Teb */
|
||||||
Process);
|
MmFreeVirtualMemory(Process, MemoryArea);
|
||||||
|
}
|
||||||
|
|
||||||
/* Unlock the Address Space */
|
/* Unlock the Address Space */
|
||||||
MmUnlockAddressSpace(ProcessAddressSpace);
|
MmUnlockAddressSpace(ProcessAddressSpace);
|
||||||
|
|
Loading…
Reference in a new issue