title: strange characters with RegQueryValueEx
body: <p>I'm creating a NPAPI dll file and I need to get some information from the registry, but when I use RegQueryValueEx, I get some strange characters.</p>
  
  <p>For instance, my computer model is "N310", but I get "Nfb1fb1" or "N$(".</p>
  
  <p>I'm pretty sure that it's a charset issue, but I'm new with C++ and I need some help.</p>
  
  <p>I'm using Visual Studio 2010 and my project is using the UNICODE charset.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>char lszValue[255];
  std::string cadena;
  HKEY hKey;
  LONG returnStatus;
  DWORD dwType=REG_SZ;
  DWORD dwSize=255;
  
  returnStatus = RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"HARDWARE\\DESCRIPTION\\System\\BIOS", NULL, KEY_READ, &amp;hKey);
  if (returnStatus == ERROR_SUCCESS) {
      returnStatus = RegQueryValueEx(hKey, L"SystemProductName", NULL, &amp;dwType,(LPBYTE)&amp;lszValue, &amp;dwSize);
      lszValue[dwSize] = 0;
      cadena.assign(lszValue, dwSize);
  
      return cadena;
  }
  </code></pre>
  
  <p>Thank you very much and thanks for advance.</p>