Commit 948888b9 authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

reg: Use strtoulW during conversion so we can set any value in the DWORD range.

parent 2fd01011
......@@ -243,7 +243,7 @@ static LPBYTE get_regdata(LPWSTR data, DWORD reg_type, WCHAR separator, DWORD *r
{
LPWSTR rest;
DWORD val;
val = strtolW(data, &rest, 0);
val = strtoulW(data, &rest, 0);
if (*rest) {
output_message(STRING_MISSING_INTEGER);
break;
......
......@@ -281,8 +281,7 @@ static void test_add(void)
run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword8 /t REG_dword /d 0xdeadbeef /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
dword = 0xdeadbeef;
verify_reg(hkey, "dword8", REG_DWORD, &dword, sizeof(dword),
(sizeof(long) > sizeof(DWORD)) ? 0 : TODO_REG_DATA);
verify_reg(hkey, "dword8", REG_DWORD, &dword, sizeof(dword), 0);
run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_DWORD /v dword9 /f /d -1", &r);
todo_wine ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */), "got exit code %u\n", r);
......@@ -295,8 +294,7 @@ static void test_add(void)
run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword12 /t REG_DWORD /d 0xffffffff /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
dword = ~0u;
verify_reg(hkey, "dword12", REG_DWORD, &dword, sizeof(dword),
(sizeof(long) > sizeof(DWORD)) ? 0 : TODO_REG_DATA);
verify_reg(hkey, "dword12", REG_DWORD, &dword, sizeof(dword), 0);
run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword13 /t REG_DWORD /d 00x123 /f", &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
......
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