[NTOS:MM] Add debug print to MiAllocateContiguousMemory in out-of-memory case
authorStanislav Motylkov <x86corez@gmail.com>
Fri, 4 Oct 2019 12:22:27 +0000 (15:22 +0300)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 27 Oct 2019 05:32:50 +0000 (06:32 +0100)
ntoskrnl/mm/ARM3/contmem.c

index 506f988..e8895b0 100644 (file)
@@ -444,11 +444,16 @@ MiAllocateContiguousMemory(IN SIZE_T NumberOfBytes,
     //
     // Otherwise, we'll go try to find some
     //
-    return MiFindContiguousMemory(LowestAcceptablePfn,
-                                  HighestAcceptablePfn,
-                                  BoundaryPfn,
-                                  SizeInPages,
-                                  CacheType);
+    BaseAddress = MiFindContiguousMemory(LowestAcceptablePfn,
+                                         HighestAcceptablePfn,
+                                         BoundaryPfn,
+                                         SizeInPages,
+                                         CacheType);
+    if (!BaseAddress)
+    {
+        DPRINT1("Unable to allocate contiguous memory for %d bytes (%d pages), out of memory!\n", NumberOfBytes, SizeInPages);
+    }
+    return BaseAddress;
 }
 
 VOID