Guest User

Untitled

a guest
Nov 11th, 2016
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. BOOL GetBinKey(char *key, BYTE *value, DWORD size)
  2. {
  3.     HKEY hKey;
  4.  
  5.     if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
  6.             DEFAULT_SUBKEY,
  7.             0,
  8.             KEY_QUERY_VALUE | KEY_WOW64_32KEY,
  9.             &hKey) == ERROR_SUCCESS)
  10.     {
  11.         if (RegQueryValueEx(hKey,
  12.                 key,
  13.                 NULL,
  14.                 NULL,
  15.                 (LPBYTE)value,
  16.                 &size) != ERROR_SUCCESS)
  17.         {
  18.             return FALSE;
  19.         }
  20.     }
  21.     else return FALSE;
  22.  
  23.     return TRUE;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment