[NTOS] Just go ahead and allow printing all the printable ASCII characters in ExpTagAllowPrint().

As documented in https://docs.microsoft.com/fr-fr/windows-hardware/drivers/ddi/wdm/nf-wdm-exallocatepoolwithtag
pool tag "characters" must be a value in the range 0x20 (space) to 0x7E (tilde),
which happen indeed to be the range of printable (non-extended) ASCII characters.

(The display problem was originally caught while attempting to display
the pool tag 0x3a306847 corresponding to 'Gh0:', a win32ss GDIOBJ pool tag
encoded with macro GDIOBJ_POOL_TAG().)
This commit is contained in:
Hermès Bélusca-Maïto 2019-10-27 01:19:11 +02:00
parent b3033b81a4
commit f5e86c0fd3
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -463,21 +463,13 @@ ExpComputePartialHashForAddress(IN PVOID BaseAddress)
}
#if DBG
FORCEINLINE
BOOLEAN
ExpTagAllowPrint(CHAR Tag)
{
if ((Tag >= 'a' && Tag <= 'z') ||
(Tag >= 'A' && Tag <= 'Z') ||
(Tag >= '0' && Tag <= '9') ||
Tag == ' ' || Tag == '=' ||
Tag == '?' || Tag == '@')
{
return TRUE;
}
return FALSE;
}
/*
* FORCEINLINE
* BOOLEAN
* ExpTagAllowPrint(CHAR Tag);
*/
#define ExpTagAllowPrint(Tag) \
((Tag) >= 0x20 /* Space */ && (Tag) <= 0x7E /* Tilde */)
#ifdef KDBG
#define MiDumperPrint(dbg, fmt, ...) \
@ -587,7 +579,7 @@ MiDumpPoolConsumers(BOOLEAN CalledFromDbg, ULONG Tag, ULONG Mask, ULONG Flags)
{
if (Verbose)
{
MiDumperPrint(CalledFromDbg, "%x\t%ld\t\t%ld\t\t%ld\t\t%ld\t\t%ld\t\t%ld\t\t%ld\t\t%ld\n", TableEntry->Key,
MiDumperPrint(CalledFromDbg, "0x%08x\t%ld\t\t%ld\t\t%ld\t\t%ld\t\t%ld\t\t%ld\t\t%ld\t\t%ld\n", TableEntry->Key,
TableEntry->NonPagedAllocs, TableEntry->NonPagedFrees,
(TableEntry->NonPagedAllocs - TableEntry->NonPagedFrees), TableEntry->NonPagedBytes,
TableEntry->PagedAllocs, TableEntry->PagedFrees,
@ -595,7 +587,7 @@ MiDumpPoolConsumers(BOOLEAN CalledFromDbg, ULONG Tag, ULONG Mask, ULONG Flags)
}
else
{
MiDumperPrint(CalledFromDbg, "%x\t%ld\t\t%ld\t\t%ld\t\t%ld\n", TableEntry->Key,
MiDumperPrint(CalledFromDbg, "0x%08x\t%ld\t\t%ld\t\t%ld\t\t%ld\n", TableEntry->Key,
TableEntry->NonPagedAllocs, TableEntry->NonPagedBytes,
TableEntry->PagedAllocs, TableEntry->PagedBytes);
}