mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Lock always the address space if we changing the virtual mapping.
This is necessary because we can create or remove a page table. svn path=/trunk/; revision=18848
This commit is contained in:
parent
d74ef35a60
commit
470db6b8eb
1 changed files with 5 additions and 1 deletions
|
@ -171,6 +171,7 @@ MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace,
|
||||||
*/
|
*/
|
||||||
if (!WasDirty)
|
if (!WasDirty)
|
||||||
{
|
{
|
||||||
|
MmLockAddressSpace(AddressSpace);
|
||||||
MmDeleteVirtualMapping(AddressSpace->Process, Address, FALSE, NULL, NULL);
|
MmDeleteVirtualMapping(AddressSpace->Process, Address, FALSE, NULL, NULL);
|
||||||
MmDeleteAllRmaps(Page, NULL, NULL);
|
MmDeleteAllRmaps(Page, NULL, NULL);
|
||||||
if ((SwapEntry = MmGetSavedSwapEntryPage(Page)) != 0)
|
if ((SwapEntry = MmGetSavedSwapEntryPage(Page)) != 0)
|
||||||
|
@ -178,6 +179,7 @@ MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace,
|
||||||
MmCreatePageFileMapping(AddressSpace->Process, Address, SwapEntry);
|
MmCreatePageFileMapping(AddressSpace->Process, Address, SwapEntry);
|
||||||
MmSetSavedSwapEntryPage(Page, 0);
|
MmSetSavedSwapEntryPage(Page, 0);
|
||||||
}
|
}
|
||||||
|
MmUnlockAddressSpace(AddressSpace);
|
||||||
MmReleasePageMemoryConsumer(MC_USER, Page);
|
MmReleasePageMemoryConsumer(MC_USER, Page);
|
||||||
PageOp->Status = STATUS_SUCCESS;
|
PageOp->Status = STATUS_SUCCESS;
|
||||||
KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE);
|
KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE);
|
||||||
|
@ -222,8 +224,10 @@ MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace,
|
||||||
* Otherwise we have succeeded, free the page
|
* Otherwise we have succeeded, free the page
|
||||||
*/
|
*/
|
||||||
DPRINT("MM: Swapped out virtual memory page 0x%.8X!\n", Page << PAGE_SHIFT);
|
DPRINT("MM: Swapped out virtual memory page 0x%.8X!\n", Page << PAGE_SHIFT);
|
||||||
|
MmLockAddressSpace(AddressSpace);
|
||||||
MmDeleteVirtualMapping(AddressSpace->Process, Address, FALSE, NULL, NULL);
|
MmDeleteVirtualMapping(AddressSpace->Process, Address, FALSE, NULL, NULL);
|
||||||
MmCreatePageFileMapping(AddressSpace->Process, Address, SwapEntry);
|
MmCreatePageFileMapping(AddressSpace->Process, Address, SwapEntry);
|
||||||
|
MmUnlockAddressSpace(AddressSpace);
|
||||||
MmDeleteAllRmaps(Page, NULL, NULL);
|
MmDeleteAllRmaps(Page, NULL, NULL);
|
||||||
MmSetSavedSwapEntryPage(Page, 0);
|
MmSetSavedSwapEntryPage(Page, 0);
|
||||||
MmReleasePageMemoryConsumer(MC_USER, Page);
|
MmReleasePageMemoryConsumer(MC_USER, Page);
|
||||||
|
@ -997,7 +1001,7 @@ MmQueryAnonMem(PMEMORY_AREA MemoryArea,
|
||||||
Info->BaseAddress = RegionBase;
|
Info->BaseAddress = RegionBase;
|
||||||
Info->AllocationBase = MemoryArea->StartingAddress;
|
Info->AllocationBase = MemoryArea->StartingAddress;
|
||||||
Info->AllocationProtect = MemoryArea->Attributes;
|
Info->AllocationProtect = MemoryArea->Attributes;
|
||||||
Info->RegionSize = (char*)RegionBase + Region->Length - (char*)Info->BaseAddress;
|
Info->RegionSize = Region->Length;
|
||||||
Info->State = Region->Type;
|
Info->State = Region->Type;
|
||||||
Info->Protect = Region->Protect;
|
Info->Protect = Region->Protect;
|
||||||
Info->Type = MEM_PRIVATE;
|
Info->Type = MEM_PRIVATE;
|
||||||
|
|
Loading…
Reference in a new issue