From 1244a7a57be0cb2cefe5186db76e75c0a674dc77 Mon Sep 17 00:00:00 2001 From: Moss Gallagher Date: Sun, 11 Jun 2023 02:48:27 -0700 Subject: [PATCH] isle: Match readReg to Original --- ISLE/isle.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ISLE/isle.cpp b/ISLE/isle.cpp index 3756f916..ae4f5040 100644 --- a/ISLE/isle.cpp +++ b/ISLE/isle.cpp @@ -119,15 +119,17 @@ BOOL readReg(LPCSTR name, LPSTR outValue, DWORD outSize) HKEY hKey; 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 (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) { - return TRUE; + out = TRUE; } } } - return FALSE; + return out; } int readRegBool(LPCSTR name, BOOL *out)