Commit 208f631c authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

regedit: Remove unnecessary string conversion when modifying REG_DWORD value.

parent 3b1faf59
......@@ -284,16 +284,16 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName)
DWORD value = *((DWORD*)stringValueData);
stringValueData = heap_xrealloc(stringValueData, 64);
wsprintfW(stringValueData, L"%x", value);
if (DialogBoxW(0, MAKEINTRESOURCEW(IDD_EDIT_DWORD), hwnd, modify_dlgproc) == IDOK) {
DWORD val;
CHAR* valueA = GetMultiByteString(stringValueData);
if (sscanf(valueA, isDecimal ? "%lu" : "%lx", &val)) {
lRet = RegSetValueExW(hKey, valueName, 0, type, (BYTE*)&val, sizeof(val));
if (lRet == ERROR_SUCCESS) result = TRUE;
if (DialogBoxW(0, MAKEINTRESOURCEW(IDD_EDIT_DWORD), hwnd, modify_dlgproc) == IDOK)
{
DWORD val;
if (swscanf(stringValueData, isDecimal ? L"%lu" : L"%lx", &val))
{
lRet = RegSetValueExW(hKey, valueName, 0, type, (BYTE*)&val, sizeof(val));
if (lRet == ERROR_SUCCESS) result = TRUE;
else error_code_messagebox(hwnd, IDS_SET_VALUE_FAILED);
}
heap_free(valueA);
}
}
}
} else if ( type == REG_QWORD ) {
UINT64 value = *((UINT64 *)stringValueData);
stringValueData = heap_xrealloc(stringValueData, 64);
......
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