[NTOSKRNL] Don't call OOM dumper in case we were trying to allocate more than 100...
authorPierre Schweitzer <pierre@reactos.org>
Sat, 17 Feb 2018 14:09:38 +0000 (15:09 +0100)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 17 Feb 2018 14:09:38 +0000 (15:09 +0100)
In such case, we'll consider the caller is bogus and we'll fail in silence.
Dedicated to Mark (again!)

ntoskrnl/mm/ARM3/expool.c

index 54c6990..de75cfb 100644 (file)
@@ -1810,8 +1810,14 @@ ExAllocatePoolWithTag(IN POOL_TYPE PoolType,
 #if DBG
             //
             // Out of memory, display current consumption
 #if DBG
             //
             // Out of memory, display current consumption
+            // Let's consider that if the caller wanted more
+            // than a hundred pages, that's a bogus caller
+            // and we are not out of memory
             //
             //
-            MiDumpPoolConsumers(FALSE, 0, 0, 0);
+            if (NumberOfBytes < 100 * PAGE_SIZE)
+            {
+                MiDumpPoolConsumers(FALSE, 0, 0, 0);
+            }
 #endif
 
             //
 #endif
 
             //
@@ -2143,8 +2149,14 @@ ExAllocatePoolWithTag(IN POOL_TYPE PoolType,
 #if DBG
         //
         // Out of memory, display current consumption
 #if DBG
         //
         // Out of memory, display current consumption
+        // Let's consider that if the caller wanted more
+        // than a hundred pages, that's a bogus caller
+        // and we are not out of memory
         //
         //
-        MiDumpPoolConsumers(FALSE, 0, 0, 0);
+        if (NumberOfBytes < 100 * PAGE_SIZE)
+        {
+            MiDumpPoolConsumers(FALSE, 0, 0, 0);
+        }
 #endif
 
         //
 #endif
 
         //