Fix a possible resource leak in ColorizationColorAffectsBorders

(cherry picked from commit 0c911b6ffe)
(cherry picked from commit ffbaf5e1d1)
This commit is contained in:
Ivan Migalev
2020-01-24 13:42:14 +07:00
committed by jbrbot
parent 418c3ddf7a
commit 89be5a82a6

View File

@@ -499,7 +499,7 @@ BOOL ColorizationColorAffectsBorders() {
DWORD bufSize(sizeof(DWORD));
HKEY hKey = NULL;
if (::RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\DWM"), 0, KEY_READ, &hKey) != ERROR_SUCCESS) return TRUE;
if (::RegQueryValueEx(hKey, _T("ColorPrevalence"), NULL, NULL, reinterpret_cast<LPBYTE>(&result), &bufSize) != ERROR_SUCCESS) return TRUE;
if (::RegQueryValueEx(hKey, _T("ColorPrevalence"), NULL, NULL, reinterpret_cast<LPBYTE>(&result), &bufSize) != ERROR_SUCCESS) result = 1;
RegCloseKey(hKey);
return result == 0 ? FALSE : TRUE;
}