Print unicode strings in tests

Robert Shearman rob at
Tue May 31 21:45:34 CDT 2005

Paul Vriens wrote:

>I'd like to print unicode-strings in some tests (for debugging purposes).
>The following however does not show nice output on wine (it does on
>static const WCHAR dataW[] = {'S','o','m','e',' ','d','a','t','a',0};
>UNICODE_STRING usdata = { sizeof(dataW)-sizeof(WCHAR), sizeof(dataW),
>(LPWSTR)dataW };
>trace("Length is %d\n", usdata.Length);
>trace("Maximum Length is %d\n", usdata.MaximumLength);
>trace("The strings is %ls\n", usdata.Buffer);
>Our trace doesn't seem to be able to cope with %ls (or %S).
>Any ideas ?

You need to use wine_dbgstr_w to convert the string to ASCII.

Rob Shearman

More information about the wine-devel mailing list