isle: Match readReg to Original

This commit is contained in:
Moss Gallagher 2023-06-11 02:48:27 -07:00
parent f81c5f944c
commit 1244a7a57b

View file

@ -119,15 +119,17 @@ BOOL readReg(LPCSTR name, LPSTR outValue, DWORD outSize)
HKEY hKey; HKEY hKey;
DWORD valueType; DWORD valueType;
BOOL out = FALSE;
unsigned long size = outSize;
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Mindscape\\LEGO Island", 0, KEY_READ, &hKey) == ERROR_SUCCESS) { if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Mindscape\\LEGO Island", 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
if (RegQueryValueExA(hKey, name, NULL, &valueType, (LPBYTE) outValue, &outSize) == ERROR_SUCCESS) { if (RegQueryValueExA(hKey, name, NULL, &valueType, (LPBYTE) outValue, &size) == ERROR_SUCCESS) {
if (RegCloseKey(hKey) == ERROR_SUCCESS) { if (RegCloseKey(hKey) == ERROR_SUCCESS) {
return TRUE; out = TRUE;
} }
} }
} }
return FALSE; return out;
} }
int readRegBool(LPCSTR name, BOOL *out) int readRegBool(LPCSTR name, BOOL *out)