Commit 81a030b9 authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

reg: Delete the default registry value instead of overwriting it.

parent bf74c6a5
......@@ -525,19 +525,15 @@ static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
/* FIXME delete failed */
}
}
else if (value_name)
else if (value_name || value_empty)
{
if (RegDeleteValueW(subkey,value_name) != ERROR_SUCCESS)
if (RegDeleteValueW(subkey, value_empty ? NULL : value_name) != ERROR_SUCCESS)
{
RegCloseKey(subkey);
output_message(STRING_CANNOT_FIND);
return 1;
}
}
else if (value_empty)
{
RegSetValueExW(subkey,NULL,0,REG_SZ,NULL,0);
}
RegCloseKey(subkey);
output_message(STRING_SUCCESS);
......
......@@ -441,7 +441,7 @@ static void test_delete(void)
run_reg_exe("reg delete HKCU\\" KEY_BASE " /ve /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
err = RegQueryValueExA(hkey, "", NULL, NULL, NULL, NULL);
todo_wine ok(err == ERROR_FILE_NOT_FOUND, "got %d\n", err);
ok(err == ERROR_FILE_NOT_FOUND, "got %d, expected 2\n", err);
run_reg_exe("reg delete HKCU\\" KEY_BASE " /va /f", &r);
ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\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