Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- programs/reg/copy.c | 129 +++++++++++++++++++++++++++ programs/reg/tests/copy.c | 178 +++++++++++++++++++------------------- 2 files changed, 218 insertions(+), 89 deletions(-)
diff --git a/programs/reg/copy.c b/programs/reg/copy.c index ba0916e9956..29ada63da56 100644 --- a/programs/reg/copy.c +++ b/programs/reg/copy.c @@ -18,7 +18,136 @@
#include "reg.h"
+struct key { + HKEY root; /* system key */ + WCHAR *subkey; /* path to subkey */ + HKEY hkey; /* handle to opened or created key */ +}; + +static void output_error(LONG rc) +{ + if (rc == ERROR_FILE_NOT_FOUND) + output_message(STRING_KEY_NONEXIST); + else + output_message(STRING_ACCESS_DENIED); +} + +static int run_copy(struct key *src, struct key *dest, BOOL recurse, BOOL force) +{ + LONG rc; + DWORD max_subkey_len; + DWORD max_name_len, name_len; + DWORD max_data_size, data_size; + DWORD type, i; + WCHAR *name = NULL; + BYTE *data = NULL; + + if ((rc = RegOpenKeyExW(src->root, src->subkey, 0, KEY_READ, &src->hkey))) + { + output_error(rc); + return 1; + } + + if ((rc = RegCreateKeyExW(dest->root, dest->subkey, 0, NULL, REG_OPTION_NON_VOLATILE, + KEY_WRITE, NULL, &dest->hkey, NULL))) + { + RegCloseKey(src->hkey); + output_error(rc); + return 1; + } + + rc = RegQueryInfoKeyW(src->hkey, NULL, NULL, NULL, NULL, &max_subkey_len, NULL, + NULL, &max_name_len, &max_data_size, NULL, NULL); + if (rc) goto cleanup; + + max_name_len = max(max_subkey_len, max_name_len) + 1; + + if (!(name = malloc(max_name_len * sizeof(WCHAR)))) + { + rc = ERROR_NOT_ENOUGH_MEMORY; + goto cleanup; + } + + if (!(data = malloc(max_data_size))) + { + rc = ERROR_NOT_ENOUGH_MEMORY; + goto cleanup; + } + + for (i = 0; ; i++) + { + name_len = max_name_len; + data_size = max_data_size; + + rc = RegEnumValueW(src->hkey, i, name, &name_len, NULL, &type, data, &data_size); + if (rc == ERROR_NO_MORE_ITEMS) break; + if (rc) goto cleanup; + + if ((rc = RegSetValueExW(dest->hkey, name, 0, type, data, data_size))) + { + output_error(rc); + goto cleanup; + } + } + +cleanup: + free(name); + free(data); + + RegCloseKey(src->hkey); + RegCloseKey(dest->hkey); + + return rc != ERROR_NO_MORE_ITEMS; +} + int reg_copy(int argc, WCHAR *argvW[]) { + struct key src, dest; + BOOL recurse = FALSE, force = FALSE; + int i; + + if (argc == 3) + goto invalid; + + if (!parse_registry_key(argvW[2], &src.root, &src.subkey)) + return 1; + + if (!parse_registry_key(argvW[3], &dest.root, &dest.subkey)) + return 1; + + for (i = 4; i < argc; i++) + { + WCHAR *str; + + if (argvW[i][0] != '/' && argvW[i][0] != '-') + goto invalid; + + str = &argvW[i][1]; + + if (!lstrcmpiW(str, L"reg:32") || !lstrcmpiW(str, L"reg:64")) + continue; + else if (!str[0] || str[1]) + goto invalid; + + switch (towlower(*str)) + { + case 's': + if (recurse) goto invalid; + recurse = TRUE; + break; + case 'f': + if (force) goto invalid; + force = TRUE; + break; + default: + goto invalid; + } + } + + return run_copy(&src, &dest, recurse, force); + +invalid: + output_message(STRING_INVALID_SYNTAX); + output_message(STRING_FUNC_HELP, wcsupr(argvW[1])); return 1; } diff --git a/programs/reg/tests/copy.c b/programs/reg/tests/copy.c index 5ddcc2c0ffa..ef4a5f6acb8 100644 --- a/programs/reg/tests/copy.c +++ b/programs/reg/tests/copy.c @@ -136,54 +136,54 @@ static void test_copy_empty_key(void)
run_reg_exe("reg copy HKCU\" COPY_SRC " HKCU\" KEY_BASE " /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKCU\" KEY_BASE " file.reg", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n");
- todo_wine delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg copy HKCU\" COPY_SRC "\ HKCU\" KEY_BASE " /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKCU\" KEY_BASE " file.reg", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n");
- todo_wine delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg copy HKCU\" COPY_SRC " HKCU\" KEY_BASE "\ /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKCU\" KEY_BASE " file.reg", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n");
- todo_wine delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg copy HKCU\" COPY_SRC "\ HKCU\" KEY_BASE "\ /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKCU\" KEY_BASE " file.reg", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n");
run_reg_exe("reg copy HKCU\" COPY_SRC " HKCU\" KEY_BASE " /s /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKCU\" KEY_BASE " file.reg", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", empty_key_test, 0), "compare_export() failed\n"); }
static void test_copy_simple_data(void) @@ -206,54 +206,54 @@ static void test_copy_simple_data(void)
run_reg_exe("reg copy HKCU\" COPY_SRC " HKCU\" KEY_BASE " /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKCU\" KEY_BASE " file.reg /y", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n");
- todo_wine delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg copy HKCU\" COPY_SRC "\ HKCU\" KEY_BASE " /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKCU\" KEY_BASE " file.reg /y", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n");
- todo_wine delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg copy HKCU\" COPY_SRC " HKCU\" KEY_BASE "\ /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKCU\" KEY_BASE " file.reg /y", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n");
- todo_wine delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg copy HKCU\" COPY_SRC "\ HKCU\" KEY_BASE "\ /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKCU\" KEY_BASE " file.reg /y", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n");
run_reg_exe("reg copy HKCU\" COPY_SRC " HKCU\" KEY_BASE " /s /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKCU\" KEY_BASE " file.reg /y", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n"); }
static void test_copy_complex_data(void) @@ -308,21 +308,21 @@ static void test_copy_complex_data(void)
/* Copy values only */ run_reg_exe("reg copy HKCU\" COPY_SRC " HKCU\" KEY_BASE " /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKEY_CURRENT_USER\" KEY_BASE " file.reg /y", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", simple_data_test, 0), "compare_export() failed\n");
/* Copy subkeys and values */ run_reg_exe("reg copy HKCU\" COPY_SRC " HKCU\" KEY_BASE " /s /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKEY_CURRENT_USER\" KEY_BASE " file.reg /y", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", complex_data_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", complex_data_test, TODO_REG_COMPARE), "compare_export() failed\n"); }
static void test_copy_key_order(void) @@ -342,12 +342,12 @@ static void test_copy_key_order(void) close_key(hkey);
run_reg_exe("reg copy HKCU\" COPY_SRC " HKCU\" KEY_BASE " /s /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKCU\" KEY_BASE " file.reg /y", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", key_order_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", key_order_test, TODO_REG_COMPARE), "compare_export() failed\n"); }
static void test_copy_value_order(void) @@ -367,12 +367,12 @@ static void test_copy_value_order(void) close_key(hkey);
run_reg_exe("reg copy HKCU\" COPY_SRC " HKCU\" KEY_BASE " /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKCU\" KEY_BASE " file.reg /y", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", value_order_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", value_order_test, TODO_REG_COMPARE), "compare_export() failed\n"); }
static void test_copy_hex_data(void) @@ -399,15 +399,15 @@ static void test_copy_hex_data(void) close_key(hkey);
run_reg_exe("reg copy HKCU\" COPY_SRC " HKCU\" KEY_BASE " /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKCU\" KEY_BASE " file.reg /y", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", empty_hex_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", empty_hex_test, 0), "compare_export() failed\n");
delete_key(HKEY_CURRENT_USER, COPY_SRC); - todo_wine delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE);
/* Try copying after importing alternative registry data types */ test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" @@ -418,15 +418,15 @@ static void test_copy_hex_data(void) ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
run_reg_exe("reg copy HKCU\" COPY_SRC " HKCU\" KEY_BASE " /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKCU\" KEY_BASE " file.reg /y", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", empty_hex_test2, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", empty_hex_test2, 0), "compare_export() failed\n");
delete_key(HKEY_CURRENT_USER, COPY_SRC); - todo_wine delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE);
/* Try copying more complex hex data */ test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" @@ -437,12 +437,12 @@ static void test_copy_hex_data(void) ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
run_reg_exe("reg copy HKCU\" COPY_SRC " HKCU\" KEY_BASE " /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKEY_CURRENT_USER\" KEY_BASE " file.reg /y", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", hex_types_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", hex_types_test, 0), "compare_export() failed\n"); }
static void test_copy_embedded_null_values(void) @@ -469,12 +469,12 @@ static void test_copy_embedded_null_values(void) ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
run_reg_exe("reg copy HKCU\" COPY_SRC " HKCU\" KEY_BASE " /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKEY_CURRENT_USER\" KEY_BASE " file.reg /y", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", embedded_null_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", embedded_null_test, 0), "compare_export() failed\n"); }
static void test_copy_slashes(void) @@ -495,12 +495,12 @@ static void test_copy_slashes(void) close_key(hkey);
run_reg_exe("reg copy HKCU\" COPY_SRC " HKCU\" KEY_BASE " /s /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKCU\" KEY_BASE " file.reg /y", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", slashes_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", slashes_test, TODO_REG_COMPARE), "compare_export() failed\n"); }
static void test_copy_escaped_null_values(void) @@ -524,15 +524,15 @@ static void test_copy_escaped_null_values(void) close_key(hkey);
run_reg_exe("reg copy HKCU\" COPY_SRC " HKCU\" KEY_BASE " /f", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine verify_key(HKEY_CURRENT_USER, KEY_BASE); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE);
run_reg_exe("reg export HKCU\" KEY_BASE " file.reg /y", &r); - todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - todo_wine ok(compare_export("file.reg", escaped_null_test, 0), "compare_export() failed\n"); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", escaped_null_test, 0), "compare_export() failed\n");
delete_key(HKEY_CURRENT_USER, COPY_SRC); - todo_wine delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE); }
START_TEST(copy)