Skip to content

Commit

Permalink
regedit: Correctly export REG_DWORD values with no data.
Browse files Browse the repository at this point in the history
Signed-off-by: Hugh McMaster <[email protected]>
Signed-off-by: Alexandre Julliard <[email protected]>
  • Loading branch information
hughmcmaster authored and julliard committed Nov 10, 2017
1 parent aabdc27 commit 8a8a2c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions programs/regedit/regproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1345,8 +1345,12 @@ static void export_data(FILE *fp, WCHAR *value_name, DWORD value_len, DWORD type
export_string_data(&buf, data, size);
break;
case REG_DWORD:
export_dword_data(&buf, data);
break;
if (size)
{
export_dword_data(&buf, data);
break;
}
/* fall through */
case REG_NONE:
case REG_EXPAND_SZ:
case REG_BINARY:
Expand Down
4 changes: 2 additions & 2 deletions programs/regedit/tests/regedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -3588,7 +3588,7 @@ static void test_export(void)
RegCloseKey(hkey);

run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\\" KEY_BASE);
ok(compare_export("file.reg", empty_hex_test, TODO_REG_COMPARE), "compare_export() failed\n");
ok(compare_export("file.reg", empty_hex_test, 0), "compare_export() failed\n");

delete_key(HKEY_CURRENT_USER, KEY_BASE);

Expand All @@ -3605,7 +3605,7 @@ static void test_export(void)
RegCloseKey(hkey);

run_regedit_exe("regedit.exe /e file.reg HKEY_CURRENT_USER\\" KEY_BASE);
ok(compare_export("file.reg", empty_hex_test2, TODO_REG_COMPARE), "compare_export() failed\n");
ok(compare_export("file.reg", empty_hex_test2, 0), "compare_export() failed\n");

delete_key(HKEY_CURRENT_USER, KEY_BASE);

Expand Down

0 comments on commit 8a8a2c9

Please sign in to comment.