} IRP_FIND_CTXT, *PIRP_FIND_CTXT;
extern PVOID MmNonPagedPoolEnd0;
+extern SIZE_T PoolBigPageTableSize;
+extern PPOOL_TRACKER_BIG_PAGES PoolBigPageTable;
+
+#define POOL_BIG_TABLE_ENTRY_FREE 0x1
/* Pool block/header/list access macros */
#define POOL_ENTRY(x) (PPOOL_HEADER)((ULONG_PTR)(x) - sizeof(POOL_HEADER))
return TRUE;
}
+static
+VOID
+ExpKdbgExtPoolFindLargePool(
+ ULONG Tag,
+ ULONG Mask,
+ VOID (NTAPI* FoundCallback)(PVOID, PVOID),
+ PVOID CallbackContext)
+{
+ ULONG i;
+
+ KdbpPrint("Scanning large pool allocation table for Tag: %.4s (%p : %p)\n", (PCHAR)&Tag, &PoolBigPageTable[0], &PoolBigPageTable[PoolBigPageTableSize - 1]);
+
+ for (i = 0; i < PoolBigPageTableSize; i++)
+ {
+ /* Free entry? */
+ if ((ULONG_PTR)PoolBigPageTable[i].Va & POOL_BIG_TABLE_ENTRY_FREE)
+ {
+ continue;
+ }
+
+ if ((PoolBigPageTable[i].Key & Mask) == (Tag & Mask))
+ {
+ 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);
+ }
+ }
+ }
+}
+
static
BOOLEAN
ExpKdbgExtValidatePoolHeader(
}
}
- /* FIXME: What about large pool? */
+ /* First search for large allocations */
+ ExpKdbgExtPoolFindLargePool(Tag, Mask, NULL, NULL);
if (PoolType == NonPagedPool)
{
{
if (!IsComplete)
{
- KdbpPrint("%p Thread %p current stack belongs to %wZ\n", Irp, Irp->Tail.Overlay.Thread, DriverName);
+ KdbpPrint("%p Thread %p current stack (%x, %x) belongs to %wZ\n", Irp, Irp->Tail.Overlay.Thread, IoStack->MajorFunction, IoStack->MinorFunction, DriverName);
}
else
{