https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d9a3fd16d41e3aa05b431…
commit d9a3fd16d41e3aa05b431222c500be87321d82dd
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Tue Jan 15 22:07:35 2019 +0100
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Tue Jan 15 22:07:35 2019 +0100
[NTOSKRNL] Add support for callback when enumerating large pool allocations
---
ntoskrnl/mm/ARM3/kdbg.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/ntoskrnl/mm/ARM3/kdbg.c b/ntoskrnl/mm/ARM3/kdbg.c
index e3a9ef3adf..1682fa8940 100644
--- a/ntoskrnl/mm/ARM3/kdbg.c
+++ b/ntoskrnl/mm/ARM3/kdbg.c
@@ -218,7 +218,9 @@ static
VOID
ExpKdbgExtPoolFindLargePool(
ULONG Tag,
- ULONG Mask)
+ ULONG Mask,
+ VOID (NTAPI* FoundCallback)(PVOID, PVOID),
+ PVOID CallbackContext)
{
ULONG i;
@@ -234,10 +236,17 @@ ExpKdbgExtPoolFindLargePool(
if ((PoolBigPageTable[i].Key & Mask) == (Tag & Mask))
{
- /* Print the line */
- KdbpPrint("%p: tag %.4s, size: %I64x\n",
- PoolBigPageTable[i].Va, (PCHAR)&PoolBigPageTable[i].Key,
- PoolBigPageTable[i].NumberOfPages << PAGE_SHIFT);
+ if (FoundCallback != NULL)
+ {
+ FoundCallback(PoolBigPageTable[i].Va, CallbackContext);
+ }
+ else
+ {
+ /* Print the line */
+ KdbpPrint("%p: tag %.4s, size: %I64x\n",
+ PoolBigPageTable[i].Va, (PCHAR)&PoolBigPageTable[i].Key,
+ PoolBigPageTable[i].NumberOfPages << PAGE_SHIFT);
+ }
}
}
}
@@ -456,7 +465,7 @@ ExpKdbgExtPoolFind(
}
/* First search for large allocations */
- ExpKdbgExtPoolFindLargePool(Tag, Mask);
+ ExpKdbgExtPoolFindLargePool(Tag, Mask, NULL, NULL);
if (PoolType == NonPagedPool)
{