Skip to content

Commit 27ebfbc

Browse files
committed
Revert reg function changes (only for 1.7)
1 parent 3e43e7e commit 27ebfbc

File tree

4 files changed

+34
-369
lines changed

4 files changed

+34
-369
lines changed

Client/core/CVersionUpdater.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3155,20 +3155,8 @@ int CVersionUpdater::DoSendDownloadRequestToNextServer()
31553155
iReqKB3035131 = IsHotFixInstalled("KB3035131") ? 0 : 1;
31563156
}
31573157

3158-
int secureBootStatus = 0;
3159-
const SString secureBootValue =
3160-
GetSystemRegistryValue((uint)HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\SecureBoot\\State", "UEFISecureBootEnabled", &secureBootStatus);
3161-
bool bSecureBootEnabled = false;
3162-
if (secureBootStatus > 0)
3163-
{
3164-
// Parse the registry value into a numeric flag
3165-
char* secureBootEnd = nullptr;
3166-
const long secureBootNumeric = strtol(secureBootValue.c_str(), &secureBootEnd, 10);
3167-
if (secureBootEnd != secureBootValue.c_str() && *secureBootEnd == '\0')
3168-
{
3169-
bSecureBootEnabled = secureBootNumeric != 0;
3170-
}
3171-
}
3158+
bool bSecureBootEnabled =
3159+
(GetSystemRegistryValue((uint)HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\SecureBoot\\State", "UEFISecureBootEnabled") == "\x01");
31723160
// Compile some system stats
31733161
SDxStatus dxStatus;
31743162
g_pGraphics->GetRenderItemManager()->GetDxStatus(dxStatus);

Client/core/DXHook/CProxyDirect3D9.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -350,20 +350,7 @@ HRESULT CProxyDirect3D9::CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND
350350
#endif
351351

352352
// Set dark titlebar if needed
353-
int themeStatus = 0;
354-
const SString appsUseLightTheme =
355-
GetSystemRegistryValue((uint)HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", "AppsUseLightTheme", &themeStatus);
356-
BOOL darkTitleBar = FALSE;
357-
if (themeStatus > 0)
358-
{
359-
// Parse the registry value into a numeric flag
360-
char* themeEnd = nullptr;
361-
const long themeNumeric = strtol(appsUseLightTheme.c_str(), &themeEnd, 10);
362-
if (themeEnd != appsUseLightTheme.c_str() && *themeEnd == '\0')
363-
{
364-
darkTitleBar = (themeNumeric == 0);
365-
}
366-
}
353+
BOOL darkTitleBar = GetSystemRegistryValue((uint)HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", "AppsUseLightTheme") == "\x0";
367354
DwmSetWindowAttribute(hFocusWindow, DWMWA_USE_IMMERSIVE_DARK_MODE, &darkTitleBar, sizeof(darkTitleBar));
368355

369356
// Update icon

Shared/sdk/SharedUtil.Misc.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,20 @@ namespace SharedUtil
6262
SString GetMajorVersionString();
6363

6464
// Get a system registry value
65-
SString GetSystemRegistryValue(uint hKey, const SString& strPath, const SString& strName, int* iResult = nullptr);
65+
SString GetSystemRegistryValue(uint hKey, const SString& strPath, const SString& strName);
6666

6767
// Get/set registry values for the current version
6868
void SetRegistryValue(const SString& strPath, const SString& strName, const SString& strValue, bool bFlush = false);
69-
SString GetRegistryValue(const SString& strPath, const SString& strName, int* iResult = nullptr);
69+
SString GetRegistryValue(const SString& strPath, const SString& strName);
7070
bool RemoveRegistryKey(const SString& strPath);
7171

7272
// Get/set registry values for a particular version
7373
void SetVersionRegistryValue(const SString& strVersion, const SString& strPath, const SString& strName, const SString& strValue);
74-
SString GetVersionRegistryValue(const SString& strVersion, const SString& strPath, const SString& strName, int* iResult = nullptr);
74+
SString GetVersionRegistryValue(const SString& strVersion, const SString& strPath, const SString& strName);
7575

7676
// Get/set registry values for all versions (Common)
7777
void SetCommonRegistryValue(const SString& strPath, const SString& strName, const SString& strValue);
78-
SString GetCommonRegistryValue(const SString& strPath, const SString& strName, int* iResult = nullptr);
78+
SString GetCommonRegistryValue(const SString& strPath, const SString& strName);
7979

8080
bool ShellExecuteBlocking(const SString& strAction, const SString& strFile, const SString& strParameters = "", const SString& strDirectory = "",
8181
int nShowCmd = 1);

0 commit comments

Comments
 (0)