What im doing wrong this time? The following code always returns 4 bytes only, instead of the whole string:
HKEY hkey;
DWORD dwType, dwSize;
char keybuffer[512];
if(RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("software\\company name\\game name"), 0, KEY_READ, &hkey) == ERROR_SUCCESS){
dwType = REG_SZ;
dwSize = sizeof(keybuffer);
RegQueryValueEx(hkey, TEXT("setting"), NULL, &dwType, (PBYTE)&keybuffer, &dwSize);
RegCloseKey(hkey);
}
Even if i change dwSize to anything, it will still return 4 bytes.
Edit: Apparently there was no bug in above code, but somewhere else -_-