mirror of
https://github.com/reactos/reactos.git
synced 2025-04-20 12:29:56 +00:00
[NTOS:KDBG] Add KdbpPrintUnicodeString
Calling normal unicode functions is not allowed at IRQL > APC_LEVEL, so calling _vsnprintf with unicode parameters from KDBG is invalid.
This commit is contained in:
parent
253362509e
commit
31a5fa61bb
2 changed files with 34 additions and 4 deletions
|
@ -107,6 +107,10 @@ KdbpPrint(
|
||||||
IN PCHAR Format,
|
IN PCHAR Format,
|
||||||
IN ... OPTIONAL);
|
IN ... OPTIONAL);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
KdbpPrintUnicodeString(
|
||||||
|
_In_ PCUNICODE_STRING String);
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
KdbpGetHexNumber(
|
KdbpGetHexNumber(
|
||||||
|
|
|
@ -564,10 +564,14 @@ KdbpPrintStructInternal
|
||||||
KdbpPrint("%s%p+%x: %s", Indent, ((PCHAR)BaseAddress) + Member->BaseOffset, Member->Size, Member->Name ? Member->Name : "<anoymous>");
|
KdbpPrint("%s%p+%x: %s", Indent, ((PCHAR)BaseAddress) + Member->BaseOffset, Member->Size, Member->Name ? Member->Name : "<anoymous>");
|
||||||
if (DoRead) {
|
if (DoRead) {
|
||||||
if (!strcmp(Member->Type, "_UNICODE_STRING")) {
|
if (!strcmp(Member->Type, "_UNICODE_STRING")) {
|
||||||
KdbpPrint("\"%wZ\"\n", ((PCHAR)BaseAddress) + Member->BaseOffset);
|
KdbpPrint("\"");
|
||||||
|
KdbpPrintUnicodeString(((PCHAR)BaseAddress) + Member->BaseOffset);
|
||||||
|
KdbpPrint("\"\n");
|
||||||
continue;
|
continue;
|
||||||
} else if (!strcmp(Member->Type, "PUNICODE_STRING")) {
|
} else if (!strcmp(Member->Type, "PUNICODE_STRING")) {
|
||||||
KdbpPrint("\"%wZ\"\n", *(((PUNICODE_STRING*)((PCHAR)BaseAddress) + Member->BaseOffset)));
|
KdbpPrint("\"");
|
||||||
|
KdbpPrintUnicodeString(*(((PUNICODE_STRING*)((PCHAR)BaseAddress) + Member->BaseOffset)));
|
||||||
|
KdbpPrint("\"\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
switch (Member->Size) {
|
switch (Member->Size) {
|
||||||
|
@ -2109,7 +2113,9 @@ KdbpCmdMod(
|
||||||
KdbpPrint(" Base Size Name\n");
|
KdbpPrint(" Base Size Name\n");
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
KdbpPrint(" %08x %08x %wZ\n", LdrEntry->DllBase, LdrEntry->SizeOfImage, &LdrEntry->BaseDllName);
|
KdbpPrint(" %p %08x ", LdrEntry->DllBase, LdrEntry->SizeOfImage);
|
||||||
|
KdbpPrintUnicodeString(&LdrEntry->BaseDllName);
|
||||||
|
KdbpPrint("\n");
|
||||||
|
|
||||||
if(DisplayOnlyOneModule || !KdbpSymFindModule(NULL, i++, &LdrEntry))
|
if(DisplayOnlyOneModule || !KdbpSymFindModule(NULL, i++, &LdrEntry))
|
||||||
break;
|
break;
|
||||||
|
@ -3035,6 +3041,24 @@ KdbpPrint(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
KdbpPrintUnicodeString(
|
||||||
|
_In_ PCUNICODE_STRING String)
|
||||||
|
{
|
||||||
|
ULONG i;
|
||||||
|
|
||||||
|
if ((String == NULL) || (String->Buffer == NULL))
|
||||||
|
{
|
||||||
|
KdbpPrint("<NULL>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < String->Length / sizeof(WCHAR); i++)
|
||||||
|
{
|
||||||
|
KdbpPrint("%c", (CHAR)String->Buffer[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** memrchr(), explicitly defined, since was absent in MinGW of RosBE. */
|
/** memrchr(), explicitly defined, since was absent in MinGW of RosBE. */
|
||||||
/*
|
/*
|
||||||
* Reverse memchr()
|
* Reverse memchr()
|
||||||
|
@ -3863,7 +3887,9 @@ KdbpCliModuleLoaded(
|
||||||
if (!KdbBreakOnModuleLoad)
|
if (!KdbBreakOnModuleLoad)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
KdbpPrint("Module %wZ loaded.\n", Name);
|
KdbpPrint("Module ");
|
||||||
|
KdbpPrintUnicodeString(Name);
|
||||||
|
KdbpPrint(" loaded.\n");
|
||||||
DbgBreakPointWithStatus(DBG_STATUS_CONTROL_C);
|
DbgBreakPointWithStatus(DBG_STATUS_CONTROL_C);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue