mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-24 04:00:02 +01:00
[runner]Fix crashes caused by wrong setting AllowDataDiagnostics registry value (#37015)
* Fix setting registry value * Prevent future similar crashes
This commit is contained in:
@@ -174,9 +174,8 @@ namespace PTSettingsHelper
|
||||
return;
|
||||
}
|
||||
|
||||
const bool value = enabled;
|
||||
const size_t buf_size = sizeof(bool);
|
||||
if (RegSetValueExW(key, DataDiagnosticsRegValueName, 0, REG_QWORD, reinterpret_cast<const BYTE*>(&value), buf_size) != ERROR_SUCCESS)
|
||||
const DWORD value = enabled ? 1 : 0;
|
||||
if (RegSetValueExW(key, DataDiagnosticsRegValueName, 0, REG_DWORD, reinterpret_cast<const BYTE*>(&value), sizeof(value)) != ERROR_SUCCESS)
|
||||
{
|
||||
RegCloseKey(key);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user