In Windows driver C code, I need to set a WCHAR array to a string that is #defined in a header file. The header file specifies an ascii string. It does not specify the L prefix for the string.
// In the header file
#define VERS_STR "3.2.4"
// In the C file, none of the following work
WCHAR awcStr[] = LVERS_STR; // Compiler Error: Treated as one name
WCHAR awcStr[] = L VERS_STR; // Compiler Error: L is unknown
WCHAR awcStr[] = L(VERS_STR); // Compiler Error
WCHAR awcStr[] = L"3.2.4"; // Compiles and runs, but I must use #define instead
I would call a conversion routine on the #define, but I can't find one that I can call from a Windows driver using C code.