regedit: Do not overwrite a hex data type with REG_BINARY when modifying a value.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hugh McMaster 2018-07-16 12:20:50 +00:00 committed by Alexandre Julliard
parent a131cff7a8
commit 6b620e6d61
1 changed files with 3 additions and 1 deletions

View File

@ -40,6 +40,7 @@ struct edit_params
{ {
HKEY hkey; HKEY hkey;
const WCHAR *value_name; const WCHAR *value_name;
DWORD type;
void *data; void *data;
DWORD size; DWORD size;
}; };
@ -159,7 +160,7 @@ static INT_PTR CALLBACK bin_modify_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wPara
data = heap_xalloc(size); data = heap_xalloc(size);
SendDlgItemMessageW(hwndDlg, IDC_VALUE_DATA, HEM_GETDATA, (WPARAM)size, (LPARAM)data); SendDlgItemMessageW(hwndDlg, IDC_VALUE_DATA, HEM_GETDATA, (WPARAM)size, (LPARAM)data);
lRet = RegSetValueExW(params->hkey, params->value_name, 0, REG_BINARY, data, size); lRet = RegSetValueExW(params->hkey, params->value_name, 0, params->type, data, size);
heap_free(data); heap_free(data);
if (lRet == ERROR_SUCCESS) if (lRet == ERROR_SUCCESS)
@ -351,6 +352,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName)
params.hkey = hKey; params.hkey = hKey;
params.value_name = valueName; params.value_name = valueName;
params.type = type;
params.data = stringValueData; params.data = stringValueData;
params.size = len; params.size = len;
result = DialogBoxParamW(NULL, MAKEINTRESOURCEW(IDD_EDIT_BINARY), hwnd, result = DialogBoxParamW(NULL, MAKEINTRESOURCEW(IDD_EDIT_BINARY), hwnd,