A UNICODE_STRING with Length==0 is an empty string, the value of Buffer
is irrelevant.
If
RtlInitEmptyUnicodeString(&EmptyString, NULL, 0);
printf("%wZ", &EmptyString);
prints "(null)", then that's a bug in printf.
This special-casing with L"" is highly irregular and should be avoided.
On 2018
This change (on my own code snippet btw, see commit 5a1a35ca5a6) was necessary
because otherwise, the StringPrintf call that is done below (which would then
use a WindowTitleU.Buffer == NULL) would generate the harderror dialog title:
"(null)" (in addition to other strings being appended), inste
On 2018-04-08 16:17, Hermès Bélusca-Maïto wrote:
/* Retrieve the window title of the client, if it has one */
-RtlInitEmptyUnicodeString(&WindowTitleU, NULL, 0);
+RtlInitEmptyUnicodeString(&WindowTitleU, L"", 0);
This looks like a bug. Can you explain why you think it's necessary