Skip to content

Commit

Permalink
Fix setting registry value
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansjfw committed Jan 22, 2025
1 parent ab8df1a commit d4cd86d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/common/SettingsAPI/settings_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d4cd86d

Please sign in to comment.