Search code examples
c++visual-c++device-driverwdknt-native-api

Convert char array to Unicode


I am developing a device driver in Visual C++. I need to convert a character array to Unicode as well as wide character array in my driver.

Pointer to useful functions will be appreciated. I know "RtlInitUnicodeString" which concerts wchar to Unicode but need help for conversion of simple character arrays.


Solution

  • If you are ok with the "current system locale" setting for the input encoding and the output in the usual UTF-16, the RtlAnsiStringToUnicodeString should be available in kernel-mode.