mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 21:23:39 +00:00
regedit: Remove unnecessary string conversion when modifying REG_DWORD value.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
parent
3b1faf59f6
commit
208f631cee
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue