mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:43:04 +00:00
[NTOS:MM] Check that we don't add rmap for NULL process
This commit is contained in:
parent
caf89b9582
commit
11eee4eeec
1 changed files with 6 additions and 18 deletions
|
@ -410,17 +410,11 @@ MmInsertRmap(PFN_NUMBER Page, PEPROCESS Process,
|
||||||
|
|
||||||
if (!RMAP_IS_SEGMENT(Address))
|
if (!RMAP_IS_SEGMENT(Address))
|
||||||
{
|
{
|
||||||
if (Process == NULL)
|
ASSERT(Process != NULL);
|
||||||
|
PrevSize = InterlockedExchangeAddUL(&Process->Vm.WorkingSetSize, PAGE_SIZE);
|
||||||
|
if (PrevSize >= Process->Vm.PeakWorkingSetSize)
|
||||||
{
|
{
|
||||||
Process = PsInitialSystemProcess;
|
Process->Vm.PeakWorkingSetSize = PrevSize + PAGE_SIZE;
|
||||||
}
|
|
||||||
if (Process)
|
|
||||||
{
|
|
||||||
PrevSize = InterlockedExchangeAddUL(&Process->Vm.WorkingSetSize, PAGE_SIZE);
|
|
||||||
if (PrevSize >= Process->Vm.PeakWorkingSetSize)
|
|
||||||
{
|
|
||||||
Process->Vm.PeakWorkingSetSize = PrevSize + PAGE_SIZE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -455,14 +449,8 @@ MmDeleteRmap(PFN_NUMBER Page, PEPROCESS Process,
|
||||||
ExFreeToNPagedLookasideList(&RmapLookasideList, current_entry);
|
ExFreeToNPagedLookasideList(&RmapLookasideList, current_entry);
|
||||||
if (!RMAP_IS_SEGMENT(Address))
|
if (!RMAP_IS_SEGMENT(Address))
|
||||||
{
|
{
|
||||||
if (Process == NULL)
|
ASSERT(Process != NULL);
|
||||||
{
|
(void)InterlockedExchangeAddUL(&Process->Vm.WorkingSetSize, -PAGE_SIZE);
|
||||||
Process = PsInitialSystemProcess;
|
|
||||||
}
|
|
||||||
if (Process)
|
|
||||||
{
|
|
||||||
(void)InterlockedExchangeAddUL(&Process->Vm.WorkingSetSize, -PAGE_SIZE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue