title: Reading Windows Registry Key REG_BINARY in c++
body: <p>I'm trying to read a registry key in c++,
  that's my function:</p>
  
  <pre><code>    DWORD regkey()
  {
      HKEY hKey;
      DWORD dwDisp = REG_BINARY;
      DWORD dwSize = sizeof(dwDisp);
      DWORD dwValue = 0;
      DWORD dwReturn;
      DWORD dwBufSize = sizeof(dwDisp);
  
      if( RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"HERE\\IS\\THE\\REGKEY",0, KEY_ALL_ACCESS, &amp;hKey) == ERROR_SUCCESS)
      {
          DWORD error = RegQueryValueEx(hKey,L"key",0,0, (LPBYTE)&amp;dwReturn, &amp;dwBufSize);
          if(error == ERROR_SUCCESS)
          {
              return dwReturn;
          }
      }
  
      RegCloseKey(hKey);
  
      return 0;
  }
  </code></pre>
  
  <p>but it's returning nothing... please help me.</p>