[NTOSKRNL] Add support for the paged pool in the memory dumper

This commit is contained in:
Pierre Schweitzer 2017-12-29 09:04:34 +01:00
parent bb63841b57
commit 1433ade827
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -500,7 +500,8 @@ MiDumpNonPagedPoolConsumers(BOOLEAN CalledFromDbg)
// //
// Print table header // Print table header
// //
MiDumperPrint(CalledFromDbg, "Tag\t\tAllocs\t\tUsed\n"); MiDumperPrint(CalledFromDbg, "\t\tNonPaged\t\t\tPaged\n");
MiDumperPrint(CalledFromDbg, "Tag\t\tAllocs\t\tUsed\t\tAllocs\t\tUsed\n");
// //
// We'll extract allocations for all the tracked pools // We'll extract allocations for all the tracked pools
@ -512,9 +513,9 @@ MiDumpNonPagedPoolConsumers(BOOLEAN CalledFromDbg)
TableEntry = &PoolTrackTable[i]; TableEntry = &PoolTrackTable[i];
// //
// We only care about non paged // We only care about tags which have allocated memory
// //
if (TableEntry->NonPagedBytes != 0) if (TableEntry->NonPagedBytes != 0 || TableEntry->PagedBytes != 0)
{ {
// //
// If there's a tag, attempt to do a pretty print // If there's a tag, attempt to do a pretty print
@ -536,16 +537,22 @@ MiDumpNonPagedPoolConsumers(BOOLEAN CalledFromDbg)
// //
// Print in reversed order to match what is in source code // Print in reversed order to match what is in source code
// //
MiDumperPrint(CalledFromDbg, "'%c%c%c%c'\t\t%ld\t\t%ld\n", Tag[3], Tag[2], Tag[1], Tag[0], TableEntry->NonPagedAllocs, TableEntry->NonPagedBytes); MiDumperPrint(CalledFromDbg, "'%c%c%c%c'\t\t%ld\t\t%ld\t\t%ld\t\t%ld\n", Tag[3], Tag[2], Tag[1], Tag[0],
TableEntry->NonPagedAllocs, TableEntry->NonPagedBytes,
TableEntry->PagedAllocs, TableEntry->PagedBytes);
} }
else else
{ {
MiDumperPrint(CalledFromDbg, "%x\t%ld\t\t%ld\n", TableEntry->Key, TableEntry->NonPagedAllocs, TableEntry->NonPagedBytes); MiDumperPrint(CalledFromDbg, "%x\t%ld\t\t%ld\t\t%ld\t\t%ld\n", TableEntry->Key,
TableEntry->NonPagedAllocs, TableEntry->NonPagedBytes,
TableEntry->PagedAllocs, TableEntry->PagedBytes);
} }
} }
else else
{ {
MiDumperPrint(CalledFromDbg, "Anon\t\t%ld\t\t%ld\n", TableEntry->NonPagedAllocs, TableEntry->NonPagedBytes); MiDumperPrint(CalledFromDbg, "Anon\t\t%ld\t\t%ld\t\t%ld\t\t%ld\n",
TableEntry->NonPagedAllocs, TableEntry->NonPagedBytes,
TableEntry->PagedAllocs, TableEntry->PagedBytes);
} }
} }
} }