[NTOSKRNL] Return the amount of hits in system lookaside lists in ExQueryPoolUsage()
authorPierre Schweitzer <pierre@reactos.org>
Sun, 9 Dec 2018 17:25:11 +0000 (18:25 +0100)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 9 Dec 2018 17:25:11 +0000 (18:25 +0100)
ntoskrnl/mm/ARM3/expool.c

index de75cfb..0828126 100644 (file)
@@ -1669,10 +1669,30 @@ ExQueryPoolUsage(OUT PULONG PagedPoolPages,
 #endif
 
     //
-    // FIXME: Not yet supported
+    // Get the amount of hits in the system lookaside lists
     //
-    *NonPagedPoolLookasideHits += 0;
-    *PagedPoolLookasideHits += 0;
+    if (!IsListEmpty(&ExPoolLookasideListHead))
+    {
+        PLIST_ENTRY ListEntry;
+
+        for (ListEntry = ExPoolLookasideListHead.Flink;
+             ListEntry != &ExPoolLookasideListHead;
+             ListEntry = ListEntry->Flink)
+        {
+            PGENERAL_LOOKASIDE Lookaside;
+
+            Lookaside = CONTAINING_RECORD(ListEntry, GENERAL_LOOKASIDE, ListEntry);
+
+            if (Lookaside->Type == NonPagedPool)
+            {
+                *NonPagedPoolLookasideHits += Lookaside->AllocateHits;
+            }
+            else
+            {
+                *PagedPoolLookasideHits += Lookaside->AllocateHits;
+            }
+        }
+    }
 }
 
 VOID