else DPRINT1(fmt, ##__VA_ARGS__)
VOID
-MiDumpPoolConsumers(BOOLEAN CalledFromDbg, ULONG Tag)
+MiDumpPoolConsumers(BOOLEAN CalledFromDbg, ULONG Tag, ULONG Mask)
{
SIZE_T i;
{
//
// If there's a tag, attempt to do a pretty print
- // only if it matches the caller tag, or if
+ // only if it matches the caller's tag, or if
// any tag is allowed
+ // For checking whether it matches caller's tag,
+ // use the mask to make sure not to mess with the wildcards
//
- if (TableEntry->Key != 0 && TableEntry->Key != TAG_NONE && (Tag == 0 || TableEntry->Key == Tag))
+ if (TableEntry->Key != 0 && TableEntry->Key != TAG_NONE &&
+ (Tag == 0 || (TableEntry->Key & Mask) == (Tag & Mask)))
{
CHAR Tag[4];
TableEntry->PagedAllocs, TableEntry->PagedBytes);
}
}
- else if (Tag == 0 || Tag == TAG_NONE)
+ else if (Tag == 0 || (Tag & Mask) == (TAG_NONE & Mask))
{
MiDumperPrint(CalledFromDbg, "Anon\t\t%ld\t\t%ld\t\t%ld\t\t%ld\n",
TableEntry->NonPagedAllocs, TableEntry->NonPagedBytes,
//
// Out of memory, display current consumption
//
- MiDumpPoolConsumers(FALSE, 0);
+ MiDumpPoolConsumers(FALSE, 0, 0);
#endif
//
//
// Out of memory, display current consumption
//
- MiDumpPoolConsumers(FALSE, 0);
+ MiDumpPoolConsumers(FALSE, 0, 0);
#endif
//
PCHAR Argv[])
{
ULONG Tag = 0;
+ ULONG Mask = 0;
if (Argc > 1)
{
CHAR Tmp[4];
ULONG Len;
+ USHORT i;
/* Get the tag */
Len = strlen(Argv[1]);
{
Len = 4;
}
- RtlCopyMemory(Tmp, Argv[1], Len * sizeof(CHAR));
+ /* Generate the mask to have wildcards support */
+ for (i = 0; i < Len; ++i)
+ {
+ Tmp[i] = Argv[1][i];
+ if (Tmp[i] != '?')
+ {
+ Mask |= (0xFF << i * 8);
+ }
+ }
+ /* Get the tag in the ulong form */
Tag = *((PULONG)Tmp);
}
- MiDumpPoolConsumers(TRUE, Tag);
+ /* Call the dumper */
+ MiDumpPoolConsumers(TRUE, Tag, Mask);
return TRUE;
}