improve accuracy of ReadReg functions

This commit is contained in:
Christian Semmler 2023-06-20 12:02:09 +02:00
parent 818192770c
commit ad5dd2ba06
No known key found for this signature in database
GPG Key ID: 086DAA1360BEEE5C
2 changed files with 8 additions and 4 deletions

View File

@ -110,7 +110,7 @@ void Isle::Close()
} }
// OFFSET: ISLE 0x402740 // OFFSET: ISLE 0x402740
BOOL ReadReg(LPCSTR name, LPSTR outValue, DWORD outSize) BOOL Isle::ReadReg(LPCSTR name, LPSTR outValue, DWORD outSize)
{ {
HKEY hKey; HKEY hKey;
DWORD valueType; DWORD valueType;
@ -129,7 +129,7 @@ BOOL ReadReg(LPCSTR name, LPSTR outValue, DWORD outSize)
} }
// OFFSET: ISLE 0x4027b0 // OFFSET: ISLE 0x4027b0
int ReadRegBool(LPCSTR name, BOOL *out) int Isle::ReadRegBool(LPCSTR name, BOOL *out)
{ {
char buffer[256]; char buffer[256];
@ -149,11 +149,11 @@ int ReadRegBool(LPCSTR name, BOOL *out)
} }
// OFFSET: ISLE 0x402880 // OFFSET: ISLE 0x402880
int ReadRegInt(LPCSTR name, int *out) int Isle::ReadRegInt(LPCSTR name, int *out)
{ {
char buffer[256]; char buffer[256];
if (ReadReg(name, buffer, sizeof(buffer))) { if (Isle::ReadReg(name, buffer, sizeof(buffer))) {
*out = atoi(buffer); *out = atoi(buffer);
return TRUE; return TRUE;
} }

View File

@ -14,6 +14,10 @@ class Isle
void Close(); void Close();
BOOL ReadReg(LPCSTR name, LPSTR outValue, DWORD outSize);
int ReadRegBool(LPCSTR name, BOOL *out);
int ReadRegInt(LPCSTR name, int *out);
MxResult SetupWindow(HINSTANCE hInstance); MxResult SetupWindow(HINSTANCE hInstance);
void Tick(BOOL sleepIfNotNextFrame); void Tick(BOOL sleepIfNotNextFrame);