Commit 0674e619 authored by Ted Percival's avatar Ted Percival Committed by Alexandre Julliard

regedit: Interpret REG_DWORD as unsigned in editor.

parent dfe4747b
......@@ -107,8 +107,8 @@ static BOOL change_dword_base(HWND hwndDlg, BOOL toHex)
DWORD val;
if (!GetDlgItemText(hwndDlg, IDC_VALUE_DATA, buf, COUNT_OF(buf))) return FALSE;
if (!_stscanf(buf, toHex ? "%d" : "%x", &val)) return FALSE;
wsprintf(buf, toHex ? "%lx" : "%ld", val);
if (!_stscanf(buf, toHex ? "%u" : "%x", &val)) return FALSE;
wsprintf(buf, toHex ? "%x" : "%u", val);
return SetDlgItemText(hwndDlg, IDC_VALUE_DATA, buf);
}
......@@ -305,10 +305,10 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath, LPCTSTR valueName)
else error_code_messagebox(hwnd, lRet);
}
} else if ( type == REG_DWORD ) {
wsprintf(stringValueData, isDecimal ? "%ld" : "%lx", *((DWORD*)stringValueData));
wsprintf(stringValueData, isDecimal ? "%u" : "%x", *((DWORD*)stringValueData));
if (DialogBox(0, MAKEINTRESOURCE(IDD_EDIT_DWORD), hwnd, modify_dlgproc) == IDOK) {
DWORD val;
if (_stscanf(stringValueData, isDecimal ? "%d" : "%x", &val)) {
if (_stscanf(stringValueData, isDecimal ? "%u" : "%x", &val)) {
lRet = RegSetValueEx(hKey, valueName, 0, type, (BYTE*)&val, sizeof(val));
if (lRet == ERROR_SUCCESS) result = TRUE;
else error_code_messagebox(hwnd, lRet);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment