[NTOS:MM] Fix MiInsertSharedUserPageVad preventing boot on x64
authorTuur Martens <tuurmartens4@gmail.com>
Mon, 23 May 2022 19:08:17 +0000 (21:08 +0200)
committerGeorge Bișoc <george.bisoc@reactos.org>
Sun, 29 May 2022 11:28:27 +0000 (13:28 +0200)
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.

ntoskrnl/mm/ARM3/procsup.c

index 2ddd91c..4111d71 100644 (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;
+        }
     }