[NTOS:MM] Fix MiInsertSharedUserPageVad preventing boot on x64

Fix MiInsertSharedUserPageVad to not charge the system process pool quota.
Even though PsChargeProcessNonPagedPoolQuota itself checks if the process specified is the system process, this doesn't work here as we're too early into boot for the kernel to know what the system process is.
This commit is contained in:
Tuur Martens 2022-05-23 21:08:17 +02:00 committed by George Bișoc
parent 96d137a559
commit cc99b9d96e

View file

@ -901,12 +901,15 @@ MiInsertSharedUserPageVad(
return Status;
}
Status = PsChargeProcessNonPagedPoolQuota(Process, sizeof(MMVAD_LONG));
if (!NT_SUCCESS(Status))
if (Process->QuotaBlock != NULL)
{
DPRINT1("Ran out of quota.\n");
ExFreePoolWithTag(Vad, 'ldaV');
return Status;
Status = PsChargeProcessNonPagedPoolQuota(Process, sizeof(MMVAD_LONG));
if (!NT_SUCCESS(Status))
{
DPRINT1("Ran out of quota.\n");
ExFreePoolWithTag(Vad, 'ldaV');
return Status;
}
}