Respectively using %p(us), and %p(as) format specifiers.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ntdll/unix/debug.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/dlls/ntdll/unix/debug.c b/dlls/ntdll/unix/debug.c index 6c4b86196c8..134ae619575 100644 --- a/dlls/ntdll/unix/debug.c +++ b/dlls/ntdll/unix/debug.c @@ -373,6 +373,18 @@ static size_t sprintf_dbgstr_wn( char *buffer, size_t length, const WCHAR *str, return dst - buffer; }
+static size_t sprintf_dbgstr_us( char *buffer, size_t length, const UNICODE_STRING *us ) +{ + if (!us) { if (length >= 7) strcpy(buffer, "<null>"); return 6; } + return sprintf_dbgstr_wn( buffer, length, us->Buffer, us->Length / sizeof(WCHAR) ); +} + +static size_t sprintf_dbgstr_as( char *buffer, size_t length, const ANSI_STRING *as ) +{ + if (!as) { if (length >= 7) strcpy(buffer, "<null>"); return 6; } + return sprintf_dbgstr_an( buffer, length, as->Buffer, as->Length ); +} + static int __cdecl wine_dbg_vsnprintf( char *buffer, size_t length, const char *format, __ms_va_list args ) { char fmtbuf[1024]; @@ -533,6 +545,16 @@ static int __cdecl wine_dbg_vsnprintf( char *buffer, size_t length, const char * append_checked( buf, end - buf, sprintf_dbgstr_wn( buf, end - buf, va_arg( args, const WCHAR * ), w ) ); snprintf_checked( buf, end - buf, spec + 7 ); } + else if (!strncmp( spec, "p(us)", 5 )) /* debugstr_us */ + { + append_checked( buf, end - buf, sprintf_dbgstr_us( buf, end - buf, va_arg( args, const UNICODE_STRING * ) ) ); + snprintf_checked( buf, end - buf, spec + 5 ); + } + else if (!strncmp( spec, "p(as)", 5 )) + { + append_checked( buf, end - buf, sprintf_dbgstr_as( buf, end - buf, va_arg( args, const ANSI_STRING * ) ) ); + snprintf_checked( buf, end - buf, spec + 5 ); + } else snprintf_dispatch( buf, end - buf, fmt, va_arg( args, void * ) ); break; case 'A':