I am debugging some old C code written in our company. The function is something like this --
uint32
ExecuteCommand(wchar_t *dnsName, // IN
wchar_t *dnsUser, // IN
PNameValue *nameValues, // OUT
size_t *valuesSize) // OUT
{
....
To debug this, I need to examine the values of dnsUser and dnsName being passed into this function. I tried the below options --
Util_Log(L"Printing the userName %S", dnsUser);
Util_Log(L"Printing the userName ", dnsUser);
Util_Log(L"Printing the userName %ls", dnsUser);
Util_Log(L"Printing the userName %lS",dnsUser);
Util_Log is a proprietary logging API used in our company. However, none of the above is working and the userName is getting printed in some garbled form in the generated logs. I tried using printf and wprintf but that didnt print anything in the logs--
printf("Printing the userName %S",userName);
wprintf("Printing the userName %lS %S", userName);
Just to add: Below is the signature of SimCfg_Log API.
void
Util_Log(const wchar_t *fmt, // IN
...) // IN
What is the correct way to print the wchar_t arguments in the method ? Also, any idea why using printf and wprintf is not printing anything in the logs?