mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-06-05 06:14:25 +00:00
[idd] helper/registry: load and store no GPU preference
This commit is contained in:
@@ -171,7 +171,7 @@ std::optional<DWORD> CRegistrySettings::getDefaultRefresh()
|
||||
case ERROR_FILE_NOT_FOUND:
|
||||
return DEFAULT_REFRESH;
|
||||
default:
|
||||
DEBUG_ERROR_HR(status, "RegGetValue(Modes) length computation");
|
||||
DEBUG_ERROR_HR(status, "RegGetValue(Modes)");
|
||||
return {};
|
||||
}
|
||||
}
|
||||
@@ -180,3 +180,26 @@ LSTATUS CRegistrySettings::setDefaultRefresh(DWORD refresh)
|
||||
{
|
||||
return RegSetValueEx(hKey, L"DefaultRefresh", 0, REG_DWORD, (LPBYTE) &refresh, sizeof(DWORD));
|
||||
}
|
||||
|
||||
std::optional<bool> CRegistrySettings::getNoGPU()
|
||||
{
|
||||
DWORD result, cbData = sizeof result;
|
||||
|
||||
LSTATUS status = RegGetValue(hKey, nullptr, L"NoGPU", RRF_RT_REG_DWORD, nullptr, &result, &cbData);
|
||||
switch (status)
|
||||
{
|
||||
case ERROR_SUCCESS:
|
||||
return !!result;
|
||||
case ERROR_FILE_NOT_FOUND:
|
||||
return false;
|
||||
default:
|
||||
DEBUG_ERROR_HR(status, "RegGetValue(NoGPU)");
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
LSTATUS CRegistrySettings::setNoGPU(bool noGPU)
|
||||
{
|
||||
DWORD dwValue = noGPU;
|
||||
return RegSetValueEx(hKey, L"NoGPU", 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(DWORD));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user