mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 09:25:06 +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);
|
DWORD value = *((DWORD*)stringValueData);
|
||||||
stringValueData = heap_xrealloc(stringValueData, 64);
|
stringValueData = heap_xrealloc(stringValueData, 64);
|
||||||
wsprintfW(stringValueData, L"%x", value);
|
wsprintfW(stringValueData, L"%x", value);
|
||||||
if (DialogBoxW(0, MAKEINTRESOURCEW(IDD_EDIT_DWORD), hwnd, modify_dlgproc) == IDOK) {
|
if (DialogBoxW(0, MAKEINTRESOURCEW(IDD_EDIT_DWORD), hwnd, modify_dlgproc) == IDOK)
|
||||||
DWORD val;
|
{
|
||||||
CHAR* valueA = GetMultiByteString(stringValueData);
|
DWORD val;
|
||||||
if (sscanf(valueA, isDecimal ? "%lu" : "%lx", &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;
|
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);
|
else error_code_messagebox(hwnd, IDS_SET_VALUE_FAILED);
|
||||||
}
|
}
|
||||||
heap_free(valueA);
|
}
|
||||||
}
|
|
||||||
} else if ( type == REG_QWORD ) {
|
} else if ( type == REG_QWORD ) {
|
||||||
UINT64 value = *((UINT64 *)stringValueData);
|
UINT64 value = *((UINT64 *)stringValueData);
|
||||||
stringValueData = heap_xrealloc(stringValueData, 64);
|
stringValueData = heap_xrealloc(stringValueData, 64);
|
||||||
|
|
Loading…
Reference in a new issue