My application properly reads and writes to the registry. Now, I need to read a registry value from:
HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography\\Machi
You have built targeting Unicode and so the registry API is returning UTF-16 Unicode text. Instead of char
use wchar_t
and remember that each wchar_t
element is 2 bytes wide.
Do also make sure that you account for the returned string not being null-terminated, as described in the documentation. You must take account of the value returned in dwBufSize
.