Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- programs/reg/export.c | 15 +++++++++++++++ programs/reg/tests/reg.c | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/programs/reg/export.c b/programs/reg/export.c index 6e59ca4c8d..b5662633a5 100644 --- a/programs/reg/export.c +++ b/programs/reg/export.c @@ -118,6 +118,14 @@ static void export_string_data(WCHAR **buf, WCHAR *data, size_t size) heap_free(str); }
+static void export_dword_data(WCHAR **buf, DWORD *data) +{ + static const WCHAR fmt[] = {'d','w','o','r','d',':','%','0','8','x',0}; + + *buf = heap_xalloc(15 * sizeof(WCHAR)); + sprintfW(*buf, fmt, *data); +} + static size_t export_hex_data_type(HANDLE hFile, DWORD type) { static const WCHAR hex[] = {'h','e','x',':',0}; @@ -192,6 +200,13 @@ static void export_data(HANDLE hFile, WCHAR *value_name, DWORD value_len, case REG_SZ: export_string_data(&buf, data, size); break; + case REG_DWORD: + if (size) + { + export_dword_data(&buf, data); + break; + } + /* fall through */ case REG_NONE: case REG_EXPAND_SZ: case REG_BINARY: diff --git a/programs/reg/tests/reg.c b/programs/reg/tests/reg.c index 88ec308954..1ec9ca0bd9 100644 --- a/programs/reg/tests/reg.c +++ b/programs/reg/tests/reg.c @@ -4451,7 +4451,7 @@ static void test_export(void)
run_reg_exe("reg export HKEY_CURRENT_USER\" KEY_BASE " file.reg", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - ok(compare_export("file.reg", simple_test, TODO_REG_COMPARE), "compare_export() failed\n"); + ok(compare_export("file.reg", simple_test, 0), "compare_export() failed\n");
/* Test registry export with a complex data structure */ add_key(hkey, "Subkey1", &subkey); @@ -4573,7 +4573,7 @@ static void test_export(void)
run_reg_exe("reg export HKEY_CURRENT_USER\" KEY_BASE " file.reg", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - ok(compare_export("file.reg", hex_types_test, TODO_REG_COMPARE), "compare_export() failed\n"); + ok(compare_export("file.reg", hex_types_test, 0), "compare_export() failed\n");
delete_key(HKEY_CURRENT_USER, KEY_BASE); }