ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
June 2022
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
17 participants
236 discussions
Start a n
N
ew thread
[reactos] 128/158: [WINESYNC] reg/tests: Modify verify_key() to support opening of registry views.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cd3b6fe7a9cba84ad8a4c…
commit cd3b6fe7a9cba84ad8a4cf9442280173ffb12d5b Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Jan 17 18:47:35 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:37 2022 +0200 [WINESYNC] reg/tests: Modify verify_key() to support opening of registry views. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id fdceb5ed7e5ce058cf9a64564e116f1bbe42d5ea by Hugh McMaster <hugh.mcmaster(a)outlook.com> --- modules/rostests/winetests/reg/add.c | 18 +++---- modules/rostests/winetests/reg/copy.c | 42 +++++++-------- modules/rostests/winetests/reg/delete.c | 2 +- modules/rostests/winetests/reg/import.c | 88 +++++++++++++++---------------- modules/rostests/winetests/reg/reg_test.h | 4 +- sdk/tools/winesync/reg.cfg | 2 +- 6 files changed, 78 insertions(+), 78 deletions(-) diff --git a/modules/rostests/winetests/reg/add.c b/modules/rostests/winetests/reg/add.c index c8091fb7305..112ae5b875d 100644 --- a/modules/rostests/winetests/reg/add.c +++ b/modules/rostests/winetests/reg/add.c @@ -97,12 +97,12 @@ void close_key_(const char *file, unsigned line, HKEY hkey) lok(err == ERROR_SUCCESS, "RegCloseKey failed: got error %d\n", err); } -void verify_key_(const char *file, unsigned line, HKEY key_base, const char *subkey) +void verify_key_(const char *file, unsigned line, HKEY root, const char *path, REGSAM sam) { HKEY hkey; LONG err; - err = RegOpenKeyExA(key_base, subkey, 0, KEY_READ, &hkey); + err = RegOpenKeyExA(root, path, 0, KEY_READ|sam, &hkey); lok(err == ERROR_SUCCESS, "RegOpenKeyExA failed: got error %d\n", err); if (hkey) @@ -302,15 +302,15 @@ static void test_key_formats(void) run_reg_exe("reg add HKCU\\" KEY_BASE "\\keytest3\\ /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r); - verify_key(hkey, "keytest3"); + verify_key(hkey, "keytest3", 0); run_reg_exe("reg add HKCU\\" KEY_BASE "\\keytest4 /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r); - verify_key(hkey, "keytest4"); + verify_key(hkey, "keytest4", 0); run_reg_exe("reg add HKCU\\" KEY_BASE "\\https://winehq.org /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "
https://winehq.org
"); + verify_key(hkey, "
https://winehq.org
", 0); close_key(hkey); delete_tree(HKEY_CURRENT_USER, KEY_BASE); @@ -384,8 +384,8 @@ static void test_add(void) run_reg_exe("reg add HKCU\\" KEY_BASE " /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); - verify_key(hkey, "Subkey"); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); + verify_key(hkey, "Subkey", 0); verify_reg(hkey, "Test1", REG_SZ, "Value1", 7, 0); verify_reg(hkey, "Test2", REG_DWORD, &dword, sizeof(dword), 0); verify_reg(hkey, NULL, REG_SZ, "", 1, 0); @@ -393,8 +393,8 @@ static void test_add(void) run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_NONE /d Test /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); - verify_key(hkey, "Subkey"); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); + verify_key(hkey, "Subkey", 0); verify_reg(hkey, "Test1", REG_SZ, "Value1", 7, 0); verify_reg(hkey, "Test2", REG_DWORD, &dword, sizeof(dword), 0); verify_reg(hkey, NULL, REG_NONE, "T\0e\0s\0t\0\0", 10, 0); diff --git a/modules/rostests/winetests/reg/copy.c b/modules/rostests/winetests/reg/copy.c index dafd0e90a3a..f25d520bdf6 100644 --- a/modules/rostests/winetests/reg/copy.c +++ b/modules/rostests/winetests/reg/copy.c @@ -137,7 +137,7 @@ static void test_copy_empty_key(void) run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -148,7 +148,7 @@ static void test_copy_empty_key(void) run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" KEY_BASE " /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -159,7 +159,7 @@ static void test_copy_empty_key(void) run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE "\\ /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -170,7 +170,7 @@ static void test_copy_empty_key(void) run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" KEY_BASE "\\ /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -179,7 +179,7 @@ static void test_copy_empty_key(void) run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /s /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -207,7 +207,7 @@ static void test_copy_simple_data(void) run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -218,7 +218,7 @@ static void test_copy_simple_data(void) run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" KEY_BASE " /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -229,7 +229,7 @@ static void test_copy_simple_data(void) run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE "\\ /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -240,7 +240,7 @@ static void test_copy_simple_data(void) run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" KEY_BASE "\\ /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -249,7 +249,7 @@ static void test_copy_simple_data(void) run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /s /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -309,7 +309,7 @@ static void test_copy_complex_data(void) /* Copy values only */ run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -318,7 +318,7 @@ static void test_copy_complex_data(void) /* Copy subkeys and values */ run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /s /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -343,7 +343,7 @@ static void test_copy_key_order(void) run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /s /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -368,7 +368,7 @@ static void test_copy_value_order(void) run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -400,7 +400,7 @@ static void test_copy_hex_data(void) run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -419,7 +419,7 @@ static void test_copy_hex_data(void) run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -438,7 +438,7 @@ static void test_copy_hex_data(void) run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -470,7 +470,7 @@ static void test_copy_embedded_null_values(void) run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -496,7 +496,7 @@ static void test_copy_slashes(void) run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /s /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -525,7 +525,7 @@ static void test_copy_escaped_null_values(void) run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); @@ -559,7 +559,7 @@ static void test_copy_key_class(void) run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(HKEY_CURRENT_USER, KEY_BASE); + verify_key(HKEY_CURRENT_USER, KEY_BASE, 0); open_key(HKEY_CURRENT_USER, KEY_BASE, 0, &hkey); verify_reg(hkey, "String", REG_SZ, "Data", 5, 0); diff --git a/modules/rostests/winetests/reg/delete.c b/modules/rostests/winetests/reg/delete.c index 575c393d2b3..ef106e67169 100644 --- a/modules/rostests/winetests/reg/delete.c +++ b/modules/rostests/winetests/reg/delete.c @@ -88,7 +88,7 @@ static void test_delete(void) run_reg_exe("reg delete HKCU\\" KEY_BASE " /va /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_reg_nonexist(hkey, "foo"); - verify_key(hkey, "subkey"); + verify_key(hkey, "subkey", 0); /* Test forward and back slashes */ add_key(hkey, "
https://winehq.org
", NULL); diff --git a/modules/rostests/winetests/reg/import.c b/modules/rostests/winetests/reg/import.c index 5d673ede8c1..54a59c1edb2 100644 --- a/modules/rostests/winetests/reg/import.c +++ b/modules/rostests/winetests/reg/import.c @@ -895,21 +895,21 @@ static void test_import(void) test_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1c ]\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey1c "); + verify_key(hkey, "Subkey1c ", 0); delete_key(hkey, "Subkey1c ", 0); test_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1d\t]\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey1d\t"); + verify_key(hkey, "Subkey1d\t", 0); delete_key(hkey, "Subkey1d\t", 0); test_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1e\\]\n" "\"Wine\"=\"Test value\"\n\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey1e\\"); - verify_key(hkey, "Subkey1e"); + verify_key(hkey, "Subkey1e\\", 0); + verify_key(hkey, "Subkey1e", 0); open_key(hkey, "Subkey1e", 0, &subkey); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); close_key(subkey); @@ -919,9 +919,9 @@ static void test_import(void) "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1f\\\\]\n" "\"Wine\"=\"Test value\"\n\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey1f\\\\"); - verify_key(hkey, "Subkey1f\\"); - verify_key(hkey, "Subkey1f"); + verify_key(hkey, "Subkey1f\\\\", 0); + verify_key(hkey, "Subkey1f\\", 0); + verify_key(hkey, "Subkey1f", 0); open_key(hkey, "Subkey1f\\\\", 0, &subkey); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); close_key(subkey); @@ -931,10 +931,10 @@ static void test_import(void) "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1g\\\\\\\\]\n" "\"Wine\"=\"Test value\"\n\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey1g\\\\\\\\"); - verify_key(hkey, "Subkey1g\\\\"); - verify_key(hkey, "Subkey1g\\"); - verify_key(hkey, "Subkey1g"); + verify_key(hkey, "Subkey1g\\\\\\\\", 0); + verify_key(hkey, "Subkey1g\\\\", 0); + verify_key(hkey, "Subkey1g\\", 0); + verify_key(hkey, "Subkey1g", 0); open_key(hkey, "Subkey1g\\\\", 0, &subkey); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); close_key(subkey); @@ -945,28 +945,28 @@ static void test_import(void) "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2b]\n\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey2a"); - verify_key(hkey, "Subkey2b"); + verify_key(hkey, "Subkey2a", 0); + verify_key(hkey, "Subkey2b", 0); test_import_str("REGEDIT4\n\n" "[ -HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey2a"); + verify_key(hkey, "Subkey2a", 0); test_import_str("REGEDIT4\n\n" "[\t-HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2b]\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey2b"); + verify_key(hkey, "Subkey2b", 0); test_import_str("REGEDIT4\n\n" "[- HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey2a"); + verify_key(hkey, "Subkey2a", 0); test_import_str("REGEDIT4\n\n" "[-\tHKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2b]\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey2b"); + verify_key(hkey, "Subkey2b", 0); test_import_str("REGEDIT4\n\n" "[-HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\n\n" @@ -980,8 +980,8 @@ static void test_import(void) "[hkey_CURRENT_user\\" KEY_BASE "\\Subkey3a]\n\n" "[HkEy_CuRrEnT_uSeR\\" KEY_BASE "\\SuBkEy3b]\n\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey3a"); - verify_key(hkey, "Subkey3b"); + verify_key(hkey, "Subkey3a", 0); + verify_key(hkey, "Subkey3b", 0); test_import_str("REGEDIT4\n\n" "[-HKEY_current_USER\\" KEY_BASE "\\sUBKEY3A]\n\n" @@ -994,7 +994,7 @@ static void test_import(void) test_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey4a]\n\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey4a"); + verify_key(hkey, "Subkey4a", 0); test_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n" @@ -1181,7 +1181,7 @@ static void test_import(void) "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2]\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_reg_nonexist(hkey, "Wine54b"); - verify_key(hkey, "Subkey2"); + verify_key(hkey, "Subkey2", 0); delete_key(hkey, "Subkey2", 0); @@ -1616,7 +1616,7 @@ static void test_import(void) ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_reg(hkey, "count/up", REG_SZ, "one/two/three", 14, 0); verify_reg(hkey, "\\foo\\bar", REG_SZ, "", 1, 0); - verify_key(hkey, "
https://winehq.org
"); + verify_key(hkey, "
https://winehq.org
", 0); close_key(hkey); @@ -2434,21 +2434,21 @@ static void test_unicode_import(void) test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1c ]\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey1c "); + verify_key(hkey, "Subkey1c ", 0); delete_key(hkey, "Subkey1c ", 0); test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1d\t]\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey1d\t"); + verify_key(hkey, "Subkey1d\t", 0); delete_key(hkey, "Subkey1d\t", 0); test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1e\\]\n" "\"Wine\"=\"Test value\"\n\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey1e\\"); - verify_key(hkey, "Subkey1e"); + verify_key(hkey, "Subkey1e\\", 0); + verify_key(hkey, "Subkey1e", 0); open_key(hkey, "Subkey1e", 0, &subkey); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); close_key(subkey); @@ -2458,9 +2458,9 @@ static void test_unicode_import(void) "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1f\\\\]\n" "\"Wine\"=\"Test value\"\n\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey1f\\\\"); - verify_key(hkey, "Subkey1f\\"); - verify_key(hkey, "Subkey1f"); + verify_key(hkey, "Subkey1f\\\\", 0); + verify_key(hkey, "Subkey1f\\", 0); + verify_key(hkey, "Subkey1f", 0); open_key(hkey, "Subkey1f\\\\", 0, &subkey); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); close_key(subkey); @@ -2470,10 +2470,10 @@ static void test_unicode_import(void) "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1g\\\\\\\\]\n" "\"Wine\"=\"Test value\"\n\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey1g\\\\\\\\"); - verify_key(hkey, "Subkey1g\\\\"); - verify_key(hkey, "Subkey1g\\"); - verify_key(hkey, "Subkey1g"); + verify_key(hkey, "Subkey1g\\\\\\\\", 0); + verify_key(hkey, "Subkey1g\\\\", 0); + verify_key(hkey, "Subkey1g\\", 0); + verify_key(hkey, "Subkey1g", 0); open_key(hkey, "Subkey1g\\\\", 0, &subkey); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); close_key(subkey); @@ -2484,28 +2484,28 @@ static void test_unicode_import(void) "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2b]\n\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey2a"); - verify_key(hkey, "Subkey2b"); + verify_key(hkey, "Subkey2a", 0); + verify_key(hkey, "Subkey2b", 0); test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[ -HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey2a"); + verify_key(hkey, "Subkey2a", 0); test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[\t-HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2b]\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey2b"); + verify_key(hkey, "Subkey2b", 0); test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[- HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey2a"); + verify_key(hkey, "Subkey2a", 0); test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[-\tHKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2b]\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey2b"); + verify_key(hkey, "Subkey2b", 0); test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[-HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2a]\n\n" @@ -2519,8 +2519,8 @@ static void test_unicode_import(void) "[hkey_CURRENT_user\\" KEY_BASE "\\Subkey3a]\n\n" "[HkEy_CuRrEnT_uSeR\\" KEY_BASE "\\SuBkEy3b]\n\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey3a"); - verify_key(hkey, "Subkey3b"); + verify_key(hkey, "Subkey3a", 0); + verify_key(hkey, "Subkey3b", 0); test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[-HKEY_current_USER\\" KEY_BASE "\\sUBKEY3A]\n\n" @@ -2533,7 +2533,7 @@ static void test_unicode_import(void) test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey4a]\n\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); - verify_key(hkey, "Subkey4a"); + verify_key(hkey, "Subkey4a", 0); test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n\n" @@ -2723,7 +2723,7 @@ static void test_unicode_import(void) "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey2]\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_reg_nonexist(hkey, "Wine54b"); - verify_key(hkey, "Subkey2"); + verify_key(hkey, "Subkey2", 0); delete_key(hkey, "Subkey2", 0); @@ -3165,7 +3165,7 @@ static void test_unicode_import(void) ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_reg(hkey, "count/up", REG_SZ, "one/two/three", 14, 0); verify_reg(hkey, "\\foo\\bar", REG_SZ, "", 1, 0); - verify_key(hkey, "
https://winehq.org
"); + verify_key(hkey, "
https://winehq.org
", 0); close_key(hkey); diff --git a/modules/rostests/winetests/reg/reg_test.h b/modules/rostests/winetests/reg/reg_test.h index ef76e4c92b0..7cf3f86014d 100644 --- a/modules/rostests/winetests/reg/reg_test.h +++ b/modules/rostests/winetests/reg/reg_test.h @@ -52,8 +52,8 @@ void open_key_(const char *file, unsigned line, HKEY root, const char *path, REG #define close_key(k) close_key_(__FILE__,__LINE__,k) void close_key_(const char *file, unsigned line, HKEY hkey); -#define verify_key(k,s) verify_key_(__FILE__,__LINE__,k,s) -void verify_key_(const char *file, unsigned line, HKEY key_base, const char *subkey); +#define verify_key(r,p,s) verify_key_(__FILE__,__LINE__,r,p,s) +void verify_key_(const char *file, unsigned line, HKEY root, const char *path, REGSAM sam); #define verify_key_nonexist(k,s) verify_key_nonexist_(__FILE__,__LINE__,k,s) void verify_key_nonexist_(const char *file, unsigned line, HKEY key_base, const char *subkey); diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index 482efc510ba..03a12dc17cf 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: 0eb85504b4b9bdeef8a402d39024e20ad99789a0 + wine: fdceb5ed7e5ce058cf9a64564e116f1bbe42d5ea
2 years, 6 months
1
0
0
0
[reactos] 127/158: [WINESYNC] reg/tests: Update reg_open() and reg_open_() definitions.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ea4fae511610ef9e29a0a…
commit ea4fae511610ef9e29a0ac6a11c4197a939e537f Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Jan 17 18:47:35 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:37 2022 +0200 [WINESYNC] reg/tests: Update reg_open() and reg_open_() definitions. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 0eb85504b4b9bdeef8a402d39024e20ad99789a0 by Hugh McMaster <hugh.mcmaster(a)outlook.com> --- modules/rostests/winetests/reg/add.c | 5 ++--- modules/rostests/winetests/reg/reg_test.h | 5 ++--- sdk/tools/winesync/reg.cfg | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/rostests/winetests/reg/add.c b/modules/rostests/winetests/reg/add.c index d2548c7d170..c8091fb7305 100644 --- a/modules/rostests/winetests/reg/add.c +++ b/modules/rostests/winetests/reg/add.c @@ -81,12 +81,11 @@ void verify_reg_nonexist_(const char *file, unsigned line, HKEY hkey, const char (value && *value) ? value : "(Default)", err); } -void open_key_(const char *file, unsigned line, const HKEY base, const char *path, - const DWORD sam, HKEY *hkey) +void open_key_(const char *file, unsigned line, HKEY root, const char *path, REGSAM sam, HKEY *hkey) { LONG err; - err = RegOpenKeyExA(base, path, 0, KEY_READ|sam, hkey); + err = RegOpenKeyExA(root, path, 0, KEY_READ|sam, hkey); lok(err == ERROR_SUCCESS, "RegOpenKeyExA failed: got error %d\n", err); } diff --git a/modules/rostests/winetests/reg/reg_test.h b/modules/rostests/winetests/reg/reg_test.h index 140f01580e8..ef76e4c92b0 100644 --- a/modules/rostests/winetests/reg/reg_test.h +++ b/modules/rostests/winetests/reg/reg_test.h @@ -46,9 +46,8 @@ void verify_reg_(const char *file, unsigned line, HKEY hkey, const char *value, #define verify_reg_nonexist(k,v) verify_reg_nonexist_(__FILE__,__LINE__,k,v) void verify_reg_nonexist_(const char *file, unsigned line, HKEY hkey, const char *value); -#define open_key(b,p,s,k) open_key_(__FILE__,__LINE__,b,p,s,k) -void open_key_(const char *file, unsigned line, const HKEY base, const char *path, - const DWORD sam, HKEY *hkey); +#define open_key(r,p,s,k) open_key_(__FILE__,__LINE__,r,p,s,k) +void open_key_(const char *file, unsigned line, HKEY root, const char *path, REGSAM sam, HKEY *hkey); #define close_key(k) close_key_(__FILE__,__LINE__,k) void close_key_(const char *file, unsigned line, HKEY hkey); diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index 978a8b294d1..482efc510ba 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: f06869199571466c989b0e75a8edfb55ad6e541a + wine: 0eb85504b4b9bdeef8a402d39024e20ad99789a0
2 years, 6 months
1
0
0
0
[reactos] 126/158: [WINESYNC] reg/tests: Modify delete_key() to support use of RegDeleteKeyEx().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0ea0084c73eddc88071bb…
commit 0ea0084c73eddc88071bb0366caf62870765cad8 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Jan 17 18:47:35 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:36 2022 +0200 [WINESYNC] reg/tests: Modify delete_key() to support use of RegDeleteKeyEx(). Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id f06869199571466c989b0e75a8edfb55ad6e541a by Hugh McMaster <hugh.mcmaster(a)outlook.com> --- modules/rostests/winetests/reg/add.c | 35 ++++++++++++++++------------ modules/rostests/winetests/reg/copy.c | 32 +++++++++++++------------- modules/rostests/winetests/reg/export.c | 14 ++++++------ modules/rostests/winetests/reg/import.c | 38 +++++++++++++++---------------- modules/rostests/winetests/reg/reg_test.h | 4 ++-- sdk/tools/winesync/reg.cfg | 2 +- 6 files changed, 66 insertions(+), 59 deletions(-) diff --git a/modules/rostests/winetests/reg/add.c b/modules/rostests/winetests/reg/add.c index 7fad8333ed5..d2548c7d170 100644 --- a/modules/rostests/winetests/reg/add.c +++ b/modules/rostests/winetests/reg/add.c @@ -138,15 +138,22 @@ void add_key_(const char *file, unsigned line, const HKEY hkey, const char *path RegCloseKey(new_key); } -void delete_key_(const char *file, unsigned line, const HKEY hkey, const char *path) +void delete_key_(const char *file, unsigned line, HKEY root, const char *path, REGSAM sam) { - if (path && *path) - { - LONG err; + LONG err; - err = RegDeleteKeyA(hkey, path); + if (!path) return; + + if (!sam) + { + err = RegDeleteKeyA(root, path); lok(err == ERROR_SUCCESS, "RegDeleteKeyA failed: got error %d\n", err); } + else + { + err = RegDeleteKeyExA(root, path, sam, 0); + lok(err == ERROR_SUCCESS, "RegDeleteKeyExA failed: got error %d\n", err); + } } LONG delete_tree(const HKEY key, const char *subkey) @@ -345,7 +352,7 @@ static void test_add(void) verify_reg(hkey, NULL, REG_SZ, "", 1, 0); close_key(hkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); /* Specifying a value name doesn't initialize the Default value in a new key */ run_reg_exe("reg add HKCU\\" KEY_BASE " /v Test /t REG_SZ /d \"Just me here\" /f", &r); @@ -357,7 +364,7 @@ static void test_add(void) verify_reg_nonexist(hkey, NULL); close_key(hkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); /* Adding a registry key via WinAPI doesn't initialize the Default value... */ add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey); @@ -423,7 +430,7 @@ static void test_reg_none(void) verify_reg(hkey, "none1", REG_NONE, "\0", 2, 0); close_key(hkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); } static void test_reg_sz(void) @@ -501,7 +508,7 @@ static void test_reg_sz(void) verify_reg(hkey, "\\foo\\bar", REG_SZ, "", 1, 0); close_key(hkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); } static void test_reg_expand_sz(void) @@ -542,7 +549,7 @@ static void test_reg_expand_sz(void) verify_reg(hkey, "expand3", REG_EXPAND_SZ, "", 1, 0); close_key(hkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); } static void test_reg_binary(void) @@ -606,7 +613,7 @@ static void test_reg_binary(void) ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); close_key(hkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); } static void test_reg_dword(void) @@ -709,7 +716,7 @@ static void test_reg_dword(void) verify_reg(hkey, "DWORD_LE", REG_DWORD_LITTLE_ENDIAN, &dword, sizeof(dword), 0); close_key(hkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); } /* REG_DWORD_BIG_ENDIAN is broken in every version of Windows. It behaves @@ -742,7 +749,7 @@ static void test_reg_dword_big_endian(void) verify_reg(hkey, "Test4", REG_DWORD_BIG_ENDIAN, &dword, sizeof(dword), 0); close_key(hkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); } static void test_reg_multi_sz(void) @@ -841,7 +848,7 @@ static void test_reg_multi_sz(void) verify_reg(hkey, "multi21", REG_MULTI_SZ, "two\\0\\0strings\0", 16, 0); close_key(hkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); } START_TEST(add) diff --git a/modules/rostests/winetests/reg/copy.c b/modules/rostests/winetests/reg/copy.c index 763135c2a0f..dafd0e90a3a 100644 --- a/modules/rostests/winetests/reg/copy.c +++ b/modules/rostests/winetests/reg/copy.c @@ -143,7 +143,7 @@ static void test_copy_empty_key(void) 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"); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" KEY_BASE " /f", &r); @@ -154,7 +154,7 @@ static void test_copy_empty_key(void) 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"); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE "\\ /f", &r); @@ -165,7 +165,7 @@ static void test_copy_empty_key(void) 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"); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" KEY_BASE "\\ /f", &r); @@ -213,7 +213,7 @@ static void test_copy_simple_data(void) 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"); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" KEY_BASE " /f", &r); @@ -224,7 +224,7 @@ static void test_copy_simple_data(void) 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"); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE "\\ /f", &r); @@ -235,7 +235,7 @@ static void test_copy_simple_data(void) 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"); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); run_reg_exe("reg copy HKCU\\" COPY_SRC "\\ HKCU\\" KEY_BASE "\\ /f", &r); @@ -406,8 +406,8 @@ static void test_copy_hex_data(void) 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); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, COPY_SRC, 0); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); /* Try copying after importing alternative registry data types */ test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" @@ -425,8 +425,8 @@ static void test_copy_hex_data(void) 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); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, COPY_SRC, 0); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); /* Try copying more complex hex data */ test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" @@ -531,8 +531,8 @@ static void test_copy_escaped_null_values(void) 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); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, COPY_SRC, 0); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); } static void test_copy_key_class(void) @@ -573,8 +573,8 @@ static void test_copy_key_class(void) RegCloseKey(hkey); - delete_key(HKEY_CURRENT_USER, COPY_SRC); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, COPY_SRC, 0); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); } static void test_copy_overwrite(void) @@ -611,8 +611,8 @@ static void test_copy_overwrite(void) verify_reg(hkey, NULL, REG_SZ, "Constant value", 15, 0); close_key(hkey); - delete_key(HKEY_CURRENT_USER, COPY_SRC); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, COPY_SRC, 0); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); } START_TEST(copy) diff --git a/modules/rostests/winetests/reg/export.c b/modules/rostests/winetests/reg/export.c index 1348b8eebdb..b45660a0e6e 100644 --- a/modules/rostests/winetests/reg/export.c +++ b/modules/rostests/winetests/reg/export.c @@ -297,8 +297,8 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); ok(compare_export("file.reg", key_order_test, 0), "compare_export() failed\n"); - delete_key(hkey, "Subkey1"); - delete_key(hkey, "Subkey2"); + delete_key(hkey, "Subkey1", 0); + delete_key(hkey, "Subkey2", 0); /* Test the export order of registry values. Windows exports registry values * in order of creation; Wine uses alphabetical order. @@ -310,7 +310,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r); 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"); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); /* Test registry export with empty hex data */ add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey); @@ -327,7 +327,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r); 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, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); /* Test registry export after importing alternative registry data types */ test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" @@ -345,7 +345,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r); 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, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" @@ -364,7 +364,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r); 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"); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); /* Test registry export with embedded null characters */ test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" @@ -401,7 +401,7 @@ static void test_export(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r); 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"); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); /* Test registry export with forward and back slashes */ add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey); diff --git a/modules/rostests/winetests/reg/import.c b/modules/rostests/winetests/reg/import.c index 06f9cb05f6c..5d673ede8c1 100644 --- a/modules/rostests/winetests/reg/import.c +++ b/modules/rostests/winetests/reg/import.c @@ -860,7 +860,7 @@ static void test_import(void) open_key(hkey, "Subkey\"1", 0, &subkey); verify_reg(subkey, "Wine\\31", REG_SZ, "Test value", 11, 0); close_key(subkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey\"1"); + delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey\"1", 0); test_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey/2]\n" @@ -869,7 +869,7 @@ static void test_import(void) open_key(hkey, "Subkey/2", 0, &subkey); verify_reg(subkey, "123/\"4;'5", REG_SZ, "Random value name", 18, 0); close_key(subkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey/2"); + delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey/2", 0); /* Test key creation */ test_import_str("REGEDIT4\n\n" @@ -896,13 +896,13 @@ static void test_import(void) "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1c ]\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_key(hkey, "Subkey1c "); - delete_key(hkey, "Subkey1c "); + delete_key(hkey, "Subkey1c ", 0); test_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1d\t]\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_key(hkey, "Subkey1d\t"); - delete_key(hkey, "Subkey1d\t"); + delete_key(hkey, "Subkey1d\t", 0); test_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1e\\]\n" @@ -913,7 +913,7 @@ static void test_import(void) open_key(hkey, "Subkey1e", 0, &subkey); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); close_key(subkey); - delete_key(hkey, "Subkey1e"); + delete_key(hkey, "Subkey1e", 0); test_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1f\\\\]\n" @@ -925,7 +925,7 @@ static void test_import(void) open_key(hkey, "Subkey1f\\\\", 0, &subkey); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); close_key(subkey); - delete_key(hkey, "Subkey1f\\\\"); + delete_key(hkey, "Subkey1f\\\\", 0); test_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1g\\\\\\\\]\n" @@ -938,7 +938,7 @@ static void test_import(void) open_key(hkey, "Subkey1g\\\\", 0, &subkey); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); close_key(subkey); - delete_key(hkey, "Subkey1g\\\\"); + delete_key(hkey, "Subkey1g\\\\", 0); /* Test key deletion. We start by creating some registry keys. */ test_import_str("REGEDIT4\n\n" @@ -1183,7 +1183,7 @@ static void test_import(void) verify_reg_nonexist(hkey, "Wine54b"); verify_key(hkey, "Subkey2"); - delete_key(hkey, "Subkey2"); + delete_key(hkey, "Subkey2", 0); test_import_str("REGEDIT4\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" @@ -2399,7 +2399,7 @@ static void test_unicode_import(void) open_key(hkey, "Subkey\"1", 0, &subkey); verify_reg(subkey, "Wine\\31", REG_SZ, "Test value", 11, 0); close_key(subkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey\"1"); + delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey\"1", 0); test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey/2]\n" @@ -2408,7 +2408,7 @@ static void test_unicode_import(void) open_key(hkey, "Subkey/2", 0, &subkey); verify_reg(subkey, "123/\"4;'5", REG_SZ, "Random value name", 18, 0); close_key(subkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey/2"); + delete_key(HKEY_CURRENT_USER, KEY_BASE "\\Subkey/2", 0); /* Test key creation */ test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" @@ -2435,13 +2435,13 @@ static void test_unicode_import(void) "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1c ]\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_key(hkey, "Subkey1c "); - delete_key(hkey, "Subkey1c "); + delete_key(hkey, "Subkey1c ", 0); test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1d\t]\n", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_key(hkey, "Subkey1d\t"); - delete_key(hkey, "Subkey1d\t"); + delete_key(hkey, "Subkey1d\t", 0); test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1e\\]\n" @@ -2452,7 +2452,7 @@ static void test_unicode_import(void) open_key(hkey, "Subkey1e", 0, &subkey); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); close_key(subkey); - delete_key(hkey, "Subkey1e"); + delete_key(hkey, "Subkey1e", 0); test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1f\\\\]\n" @@ -2464,7 +2464,7 @@ static void test_unicode_import(void) open_key(hkey, "Subkey1f\\\\", 0, &subkey); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); close_key(subkey); - delete_key(hkey, "Subkey1f\\\\"); + delete_key(hkey, "Subkey1f\\\\", 0); test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "\\Subkey1g\\\\\\\\]\n" @@ -2477,7 +2477,7 @@ static void test_unicode_import(void) open_key(hkey, "Subkey1g\\\\", 0, &subkey); verify_reg(subkey, "Wine", REG_SZ, "Test value", 11, 0); close_key(subkey); - delete_key(hkey, "Subkey1g\\\\"); + delete_key(hkey, "Subkey1g\\\\", 0); /* Test key deletion. We start by creating some registry keys. */ test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" @@ -2725,7 +2725,7 @@ static void test_unicode_import(void) verify_reg_nonexist(hkey, "Wine54b"); verify_key(hkey, "Subkey2"); - delete_key(hkey, "Subkey2"); + delete_key(hkey, "Subkey2", 0); test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n" "[HKEY_CURRENT_USER\\" KEY_BASE "]\n" @@ -3315,7 +3315,7 @@ static void test_import_with_whitespace(void) close_key(hkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); } static void test_unicode_import_with_whitespace(void) @@ -3461,7 +3461,7 @@ static void test_unicode_import_with_whitespace(void) close_key(hkey); - delete_key(HKEY_CURRENT_USER, KEY_BASE); + delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); } static void test_import_win31(void) @@ -3585,7 +3585,7 @@ static void test_import_win31(void) close_key(hkey); - delete_key(HKEY_CLASSES_ROOT, KEY_BASE); + delete_key(HKEY_CLASSES_ROOT, KEY_BASE, 0); } START_TEST(import) diff --git a/modules/rostests/winetests/reg/reg_test.h b/modules/rostests/winetests/reg/reg_test.h index 28e2d8e3abe..140f01580e8 100644 --- a/modules/rostests/winetests/reg/reg_test.h +++ b/modules/rostests/winetests/reg/reg_test.h @@ -62,8 +62,8 @@ void verify_key_nonexist_(const char *file, unsigned line, HKEY key_base, const #define add_key(k,p,s) add_key_(__FILE__,__LINE__,k,p,s) void add_key_(const char *file, unsigned line, const HKEY hkey, const char *path, HKEY *subkey); -#define delete_key(k,p) delete_key_(__FILE__,__LINE__,k,p) -void delete_key_(const char *file, unsigned line, const HKEY hkey, const char *path); +#define delete_key(r,p,s) delete_key_(__FILE__,__LINE__,r,p,s) +void delete_key_(const char *file, unsigned line, HKEY root, const char *path, REGSAM sam); LONG delete_tree(const HKEY key, const char *subkey); diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index aaef9395814..978a8b294d1 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: 8104629672db54fcc13f05f980149d2cc4170e24 + wine: f06869199571466c989b0e75a8edfb55ad6e541a
2 years, 6 months
1
0
0
0
[reactos] 125/158: [WINESYNC] reg/tests: Test how values are overwritten when copying.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9ad9ae45ace0e13fd7331…
commit 9ad9ae45ace0e13fd73312a0bb1a86228eaafd68 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Jan 17 18:47:35 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:36 2022 +0200 [WINESYNC] reg/tests: Test how values are overwritten when copying. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 8104629672db54fcc13f05f980149d2cc4170e24 by Hugh McMaster <hugh.mcmaster(a)outlook.com> --- modules/rostests/winetests/reg/copy.c | 39 +++++++++++++++++++++++++++++++++++ sdk/tools/winesync/reg.cfg | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/modules/rostests/winetests/reg/copy.c b/modules/rostests/winetests/reg/copy.c index 2604d54b639..763135c2a0f 100644 --- a/modules/rostests/winetests/reg/copy.c +++ b/modules/rostests/winetests/reg/copy.c @@ -577,6 +577,44 @@ static void test_copy_key_class(void) delete_key(HKEY_CURRENT_USER, KEY_BASE); } +static void test_copy_overwrite(void) +{ + HKEY hkey; + DWORD r, dword; + + add_key(HKEY_CURRENT_USER, COPY_SRC, &hkey); + add_value(hkey, "Wine1", REG_SZ, "def", 4); + dword = 0x5; + add_value(hkey, "Wine2", REG_DWORD, &dword, sizeof(dword)); + add_value(hkey, "Wine3", REG_BINARY, "\x11\x22\x33\x44", 4); + add_value(hkey, "Wine4", REG_MULTI_SZ, "Line1\0Line2\0Line3\0", 19); + close_key(hkey); + + add_key(HKEY_CURRENT_USER, KEY_BASE, &hkey); + add_value(hkey, "Wine1", REG_SZ, "abc", 4); + verify_reg_nonexist(hkey, "Wine2"); + add_value(hkey, "Wine3", REG_EXPAND_SZ, "%HOME%\\%PATH%", 14); + dword = 0x1; + add_value(hkey, "Wine4", REG_DWORD, &dword, sizeof(dword)); + add_value(hkey, NULL, REG_SZ, "Constant value", 15); + close_key(hkey); + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + + open_key(HKEY_CURRENT_USER, KEY_BASE, 0, &hkey); + verify_reg(hkey, "Wine1", REG_SZ, "def", 4, 0); + dword = 0x5; + verify_reg(hkey, "Wine2", REG_DWORD, &dword, sizeof(dword), 0); + verify_reg(hkey, "Wine3", REG_BINARY, "\x11\x22\x33\x44", 4, 0); + verify_reg(hkey, "Wine4", REG_MULTI_SZ, "Line1\0Line2\0Line3\0", 19, 0); + verify_reg(hkey, NULL, REG_SZ, "Constant value", 15, 0); + close_key(hkey); + + delete_key(HKEY_CURRENT_USER, COPY_SRC); + delete_key(HKEY_CURRENT_USER, KEY_BASE); +} + START_TEST(copy) { DWORD r; @@ -597,4 +635,5 @@ START_TEST(copy) test_copy_slashes(); test_copy_escaped_null_values(); test_copy_key_class(); + test_copy_overwrite(); } diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index 2e7adbfeb59..aaef9395814 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: aeeda123b1185e6d6f6c975354fe567c4573502e + wine: 8104629672db54fcc13f05f980149d2cc4170e24
2 years, 6 months
1
0
0
0
[reactos] 124/158: [WINESYNC] reg: Prompt the user to confirm whether they want to overwrite existing values when copying a key.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7d85b1aef4e6c9b9441e9…
commit 7d85b1aef4e6c9b9441e97c256a338d93b0d9a12 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Jan 17 18:47:14 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:36 2022 +0200 [WINESYNC] reg: Prompt the user to confirm whether they want to overwrite existing values when copying a key. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=48000
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id aeeda123b1185e6d6f6c975354fe567c4573502e by Hugh McMaster <hugh.mcmaster(a)outlook.com> --- base/applications/cmdutils/reg/copy.c | 79 +++++++++++++++++++++++++++++-- base/applications/cmdutils/reg/resource.h | 3 ++ sdk/tools/winesync/reg.cfg | 2 +- 3 files changed, 80 insertions(+), 4 deletions(-) diff --git a/base/applications/cmdutils/reg/copy.c b/base/applications/cmdutils/reg/copy.c index 208adc46e00..3ede5440cb6 100644 --- a/base/applications/cmdutils/reg/copy.c +++ b/base/applications/cmdutils/reg/copy.c @@ -16,12 +16,20 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include <stdio.h> #include "reg.h" struct key { HKEY root; /* system key */ - WCHAR *subkey; /* path to subkey */ + WCHAR *subkey; /* relative path to subkey */ HKEY hkey; /* handle to opened or created key */ + WCHAR *path; /* full path to subkey */ +}; + +enum operation { + COPY_NO, + COPY_YES, + COPY_ALL }; static void output_error(LONG rc) @@ -32,13 +40,50 @@ static void output_error(LONG rc) output_message(STRING_ACCESS_DENIED); } +static enum operation ask_overwrite_value(WCHAR *path, WCHAR *value) +{ + HMODULE hmod; + static WCHAR Ybuffer[4]; + static WCHAR Nbuffer[4]; + static WCHAR Abuffer[4]; + static WCHAR defval[32]; + WCHAR answer[MAX_PATH]; + WCHAR *str; + DWORD count; + + hmod = GetModuleHandleW(NULL); + LoadStringW(hmod, STRING_YES, Ybuffer, ARRAY_SIZE(Ybuffer)); + LoadStringW(hmod, STRING_NO, Nbuffer, ARRAY_SIZE(Nbuffer)); + LoadStringW(hmod, STRING_ALL, Abuffer, ARRAY_SIZE(Abuffer)); + LoadStringW(hmod, STRING_DEFAULT_VALUE, defval, ARRAY_SIZE(defval)); + + str = (value && *value) ? value : defval; + + while (1) + { + output_message(STRING_COPY_CONFIRM, path, str); + output_message(STRING_YESNOALL); + + ReadConsoleW(GetStdHandle(STD_INPUT_HANDLE), answer, ARRAY_SIZE(answer), &count, NULL); + + *answer = towupper(*answer); + + if (*answer == *Ybuffer) + return COPY_YES; + if (*answer == *Nbuffer) + return COPY_NO; + if (*answer == *Abuffer) + return COPY_ALL; + } +} + 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; + DWORD type, dispos, i; WCHAR *name = NULL; BYTE *data = NULL; @@ -49,7 +94,7 @@ static int run_copy(struct key *src, struct key *dest, BOOL recurse, BOOL force) } if ((rc = RegCreateKeyExW(dest->root, dest->subkey, 0, NULL, REG_OPTION_NON_VOLATILE, - KEY_WRITE, NULL, &dest->hkey, NULL))) + KEY_READ|KEY_WRITE, NULL, &dest->hkey, &dispos))) { RegCloseKey(src->hkey); output_error(rc); @@ -83,6 +128,18 @@ static int run_copy(struct key *src, struct key *dest, BOOL recurse, BOOL force) if (rc == ERROR_NO_MORE_ITEMS) break; if (rc) goto cleanup; + if (!force && dispos == REG_OPENED_EXISTING_KEY) + { + if (!RegQueryValueExW(dest->hkey, name, NULL, NULL, NULL, NULL)) + { + enum operation op; + + op = ask_overwrite_value(src->path, name); + if (op == COPY_NO) continue; + if (op == COPY_ALL) force = TRUE; + } + } + if ((rc = RegSetValueExW(dest->hkey, name, 0, type, data, data_size))) { output_error(rc); @@ -93,6 +150,7 @@ static int run_copy(struct key *src, struct key *dest, BOOL recurse, BOOL force) for (i = 0; recurse; i++) { struct key subkey_src, subkey_dest; + size_t path_len; name_len = max_name_len; @@ -105,7 +163,20 @@ static int run_copy(struct key *src, struct key *dest, BOOL recurse, BOOL force) subkey_dest.root = dest->hkey; subkey_dest.subkey = name; + path_len = lstrlenW(src->path) + name_len + 2; + + if (!(subkey_src.path = malloc(path_len * sizeof(WCHAR)))) + { + rc = ERROR_NOT_ENOUGH_MEMORY; + goto cleanup; + } + + swprintf(subkey_src.path, path_len, L"%s\\%s", src->path, name); + rc = run_copy(&subkey_src, &subkey_dest, TRUE, force); + + free(subkey_src.path); + if (rc) goto cleanup; } @@ -169,6 +240,8 @@ int reg_copy(int argc, WCHAR *argvW[]) return 1; } + src.path = src.subkey; + return run_copy(&src, &dest, recurse, force); invalid: diff --git a/base/applications/cmdutils/reg/resource.h b/base/applications/cmdutils/reg/resource.h index b7afad26d22..80b36634119 100644 --- a/base/applications/cmdutils/reg/resource.h +++ b/base/applications/cmdutils/reg/resource.h @@ -27,7 +27,9 @@ /* Shared */ #define STRING_YES 100 #define STRING_NO 101 +#define STRING_ALL 102 #define STRING_YESNO 103 +#define STRING_YESNOALL 104 #define STRING_INVALID_SYNTAX 105 #define STRING_FUNC_HELP 106 #define STRING_ACCESS_DENIED 107 @@ -63,6 +65,7 @@ /* copy.c */ #define STRING_COPY_SRC_DEST_SAME 250 +#define STRING_COPY_CONFIRM 251 /* delete.c */ #define STRING_DELETE_VALUE 300 diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index 1f071ea0f1c..2e7adbfeb59 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: 664f8b638d421540e73b4e046a9aa5e66f8cc4ff + wine: aeeda123b1185e6d6f6c975354fe567c4573502e
2 years, 6 months
1
0
0
0
[reactos] 123/158: [WINESYNC] reg/tests: Test whether the 'copy' command copies user-defined key classes.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=07427368d30bbb3e4e9f5…
commit 07427368d30bbb3e4e9f579ef8b04a4bbd08e5e7 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Jan 17 18:47:14 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:36 2022 +0200 [WINESYNC] reg/tests: Test whether the 'copy' command copies user-defined key classes. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 664f8b638d421540e73b4e046a9aa5e66f8cc4ff by Hugh McMaster <hugh.mcmaster(a)outlook.com> --- modules/rostests/winetests/reg/copy.c | 43 +++++++++++++++++++++++++++++++++++ sdk/tools/winesync/reg.cfg | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/modules/rostests/winetests/reg/copy.c b/modules/rostests/winetests/reg/copy.c index 70f9496b149..2604d54b639 100644 --- a/modules/rostests/winetests/reg/copy.c +++ b/modules/rostests/winetests/reg/copy.c @@ -535,6 +535,48 @@ static void test_copy_escaped_null_values(void) delete_key(HKEY_CURRENT_USER, KEY_BASE); } +static void test_copy_key_class(void) +{ + HKEY hkey; + LONG rc; + char class[] = "class"; + char buf[16]; + DWORD buf_size, r; + + rc = RegCreateKeyExA(HKEY_CURRENT_USER, COPY_SRC, 0, class, REG_OPTION_NON_VOLATILE, + KEY_READ|KEY_WRITE, NULL, &hkey, NULL); + ok(rc == ERROR_SUCCESS, "RegCreateKeyExA failed: got %d, expected 0\n", rc); + + add_value(hkey, "String", REG_SZ, "Data", 5); + + buf_size = sizeof(buf); + + rc = RegQueryInfoKeyA(hkey, buf, &buf_size, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ok(rc == ERROR_SUCCESS, "RegQueryInfoKeyA failed: got %d, expected 0\n", rc); + ok(!strcmp(buf, "class"), "Incorrect key class set; got '%s', expected '%s'\n", buf, class); + + RegCloseKey(hkey); + + run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_key(HKEY_CURRENT_USER, KEY_BASE); + + open_key(HKEY_CURRENT_USER, KEY_BASE, 0, &hkey); + verify_reg(hkey, "String", REG_SZ, "Data", 5, 0); + + memset(buf, 0, sizeof(buf)); + buf_size = sizeof(buf); + + rc = RegQueryInfoKeyA(hkey, buf, &buf_size, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ok(rc == ERROR_SUCCESS, "RegQueryInfoKeyA failed: got %d, expected 0\n", rc); + ok(strlen(buf) == 0, "Key class should not exist\n"); + + RegCloseKey(hkey); + + delete_key(HKEY_CURRENT_USER, COPY_SRC); + delete_key(HKEY_CURRENT_USER, KEY_BASE); +} + START_TEST(copy) { DWORD r; @@ -554,4 +596,5 @@ START_TEST(copy) test_copy_embedded_null_values(); test_copy_slashes(); test_copy_escaped_null_values(); + test_copy_key_class(); } diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index 44d7c5205ee..1f071ea0f1c 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: 0abc002a3e232be3445241e435ef17ac89d6c947 + wine: 664f8b638d421540e73b4e046a9aa5e66f8cc4ff
2 years, 6 months
1
0
0
0
[reactos] 122/158: [WINESYNC] reg: Fail if the source and destination keys are the same when copying.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=20aa38c6e73a1367b7e11…
commit 20aa38c6e73a1367b7e11ca289f320782e0736d5 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Jan 17 18:43:11 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:36 2022 +0200 [WINESYNC] reg: Fail if the source and destination keys are the same when copying. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 0abc002a3e232be3445241e435ef17ac89d6c947 by Hugh McMaster <hugh.mcmaster(a)outlook.com> manual adjustment needed --- base/applications/cmdutils/reg/copy.c | 6 ++++++ base/applications/cmdutils/reg/reg.c | 17 +++++++---------- base/applications/cmdutils/reg/resource.h | 3 +++ sdk/tools/winesync/reg.cfg | 2 +- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/base/applications/cmdutils/reg/copy.c b/base/applications/cmdutils/reg/copy.c index 34abf8ade18..208adc46e00 100644 --- a/base/applications/cmdutils/reg/copy.c +++ b/base/applications/cmdutils/reg/copy.c @@ -163,6 +163,12 @@ int reg_copy(int argc, WCHAR *argvW[]) } } + if (src.root == dest.root && !lstrcmpiW(src.subkey, dest.subkey)) + { + output_message(STRING_COPY_SRC_DEST_SAME); + return 1; + } + return run_copy(&src, &dest, recurse, force); invalid: diff --git a/base/applications/cmdutils/reg/reg.c b/base/applications/cmdutils/reg/reg.c index 7099cba594e..0c8eb47863c 100644 --- a/base/applications/cmdutils/reg/reg.c +++ b/base/applications/cmdutils/reg/reg.c @@ -206,7 +206,7 @@ WCHAR *build_subkey_path(WCHAR *path, DWORD path_len, WCHAR *subkey_name, DWORD WCHAR *get_long_key(HKEY root, WCHAR *path) { - int i, len, path_len; + int i, len; WCHAR *long_key; for (i = 0; i < ARRAY_SIZE(root_rels); i++) @@ -224,15 +224,7 @@ WCHAR *get_long_key(HKEY root, WCHAR *path) return long_key; } - path_len = lstrlenW(path); - - if (path[path_len - 1] == '\\') - { - path[path_len - 1] = 0; - path_len--; - } - - len += path_len + 1; /* add one for the concatenating backslash */ + len += lstrlenW(path) + 1; /* add one for the concatenating backslash */ long_key = malloc((len + 1) * sizeof(WCHAR)); swprintf(long_key, L"%s\\%s", root_rels[i].long_name, path); return long_key; @@ -240,6 +232,8 @@ WCHAR *get_long_key(HKEY root, WCHAR *path) BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path) { + WCHAR *p; + if (!sane_path(key)) return FALSE; @@ -263,6 +257,9 @@ BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path) return FALSE; } + p = *path + lstrlenW(*path) - 1; + if (*p == '\\') *p = 0; + return TRUE; } diff --git a/base/applications/cmdutils/reg/resource.h b/base/applications/cmdutils/reg/resource.h index b3f660ca13b..b7afad26d22 100644 --- a/base/applications/cmdutils/reg/resource.h +++ b/base/applications/cmdutils/reg/resource.h @@ -61,6 +61,9 @@ #define STRING_OVERWRITE_VALUE 205 #define STRING_INVALID_CMDLINE 206 +/* copy.c */ +#define STRING_COPY_SRC_DEST_SAME 250 + /* delete.c */ #define STRING_DELETE_VALUE 300 #define STRING_DELETE_VALUEALL 301 diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index 351e3803ee8..44d7c5205ee 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: 8d9a228e99e1252a0d82c88e6a64635548c478a6 + wine: 0abc002a3e232be3445241e435ef17ac89d6c947
2 years, 6 months
1
0
0
0
[reactos] 121/158: [WINESYNC] reg: Support recursion in the 'copy' command.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ded0675d6686c4d6127ce…
commit ded0675d6686c4d6127ce8b1f2994e9befde26fc Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Jan 17 18:43:11 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:36 2022 +0200 [WINESYNC] reg: Support recursion in the 'copy' command. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 8d9a228e99e1252a0d82c88e6a64635548c478a6 by Hugh McMaster <hugh.mcmaster(a)outlook.com> --- base/applications/cmdutils/reg/copy.c | 19 +++++++++++++++++++ modules/rostests/winetests/reg/copy.c | 4 ++-- sdk/tools/winesync/reg.cfg | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/base/applications/cmdutils/reg/copy.c b/base/applications/cmdutils/reg/copy.c index 29ada63da56..34abf8ade18 100644 --- a/base/applications/cmdutils/reg/copy.c +++ b/base/applications/cmdutils/reg/copy.c @@ -90,6 +90,25 @@ static int run_copy(struct key *src, struct key *dest, BOOL recurse, BOOL force) } } + for (i = 0; recurse; i++) + { + struct key subkey_src, subkey_dest; + + name_len = max_name_len; + + rc = RegEnumKeyExW(src->hkey, i, name, &name_len, NULL, NULL, NULL, NULL); + if (rc) break; + + subkey_src.root = src->hkey; + subkey_src.subkey = name; + + subkey_dest.root = dest->hkey; + subkey_dest.subkey = name; + + rc = run_copy(&subkey_src, &subkey_dest, TRUE, force); + if (rc) goto cleanup; + } + cleanup: free(name); free(data); diff --git a/modules/rostests/winetests/reg/copy.c b/modules/rostests/winetests/reg/copy.c index ef4a5f6acb8..70f9496b149 100644 --- a/modules/rostests/winetests/reg/copy.c +++ b/modules/rostests/winetests/reg/copy.c @@ -322,7 +322,7 @@ static void test_copy_complex_data(void) run_reg_exe("reg export HKEY_CURRENT_USER\\" KEY_BASE " file.reg /y", &r); 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"); + ok(compare_export("file.reg", complex_data_test, 0), "compare_export() failed\n"); } static void test_copy_key_order(void) @@ -347,7 +347,7 @@ static void test_copy_key_order(void) run_reg_exe("reg export HKCU\\" KEY_BASE " file.reg /y", &r); 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"); + ok(compare_export("file.reg", key_order_test, 0), "compare_export() failed\n"); } static void test_copy_value_order(void) diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index 3c51e0300bd..351e3803ee8 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: b1ccb87d9debb1a07e35263a76b6e34a7dd6ee49 + wine: 8d9a228e99e1252a0d82c88e6a64635548c478a6
2 years, 6 months
1
0
0
0
[reactos] 120/158: [WINESYNC] reg: Partially implement the 'copy' command.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=da2d23fb949ef504713a7…
commit da2d23fb949ef504713a7c2bab6454febbf04237 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Jan 17 18:43:11 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:36 2022 +0200 [WINESYNC] reg: Partially implement the 'copy' command. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id b1ccb87d9debb1a07e35263a76b6e34a7dd6ee49 by Hugh McMaster <hugh.mcmaster(a)outlook.com> --- base/applications/cmdutils/reg/copy.c | 129 ++++++++++++++++++++++++ modules/rostests/winetests/reg/copy.c | 178 +++++++++++++++++----------------- sdk/tools/winesync/reg.cfg | 2 +- 3 files changed, 219 insertions(+), 90 deletions(-) diff --git a/base/applications/cmdutils/reg/copy.c b/base/applications/cmdutils/reg/copy.c index ba0916e9956..29ada63da56 100644 --- a/base/applications/cmdutils/reg/copy.c +++ b/base/applications/cmdutils/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/modules/rostests/winetests/reg/copy.c b/modules/rostests/winetests/reg/copy.c index 5ddcc2c0ffa..ef4a5f6acb8 100644 --- a/modules/rostests/winetests/reg/copy.c +++ b/modules/rostests/winetests/reg/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) diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index 6a8fafca526..3c51e0300bd 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: 8f997a8b9b75320449711d3b05241b5f1f580ac3 + wine: b1ccb87d9debb1a07e35263a76b6e34a7dd6ee49
2 years, 6 months
1
0
0
0
[reactos] 119/158: [WINESYNC] reg: Group resource IDs by source location.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=34aed2639af060cc356a7…
commit 34aed2639af060cc356a793c2961887e88146336 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Mon Jan 17 18:42:07 2022 +0100 Commit: Thomas Csovcsity <thc.fr13nd(a)gmail.com> CommitDate: Sun Jun 19 13:06:36 2022 +0200 [WINESYNC] reg: Group resource IDs by source location. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 8f997a8b9b75320449711d3b05241b5f1f580ac3 by Hugh McMaster <hugh.mcmaster(a)outlook.com> --- base/applications/cmdutils/reg/resource.h | 98 ++++++++++++++++++------------- sdk/tools/winesync/reg.cfg | 2 +- 2 files changed, 57 insertions(+), 43 deletions(-) diff --git a/base/applications/cmdutils/reg/resource.h b/base/applications/cmdutils/reg/resource.h index b80b402fd17..b3f660ca13b 100644 --- a/base/applications/cmdutils/reg/resource.h +++ b/base/applications/cmdutils/reg/resource.h @@ -22,45 +22,59 @@ #include <windef.h> -/* Translation IDs. */ -#define STRING_USAGE 101 -#define STRING_ADD_USAGE 102 -#define STRING_DELETE_USAGE 103 -#define STRING_QUERY_USAGE 104 -#define STRING_SUCCESS 105 -#define STRING_INVALID_KEY 106 -#define STRING_INVALID_CMDLINE 107 -#define STRING_NO_REMOTE 108 -#define STRING_VALUE_NONEXIST 109 -#define STRING_UNSUPPORTED_TYPE 110 -#define STRING_MISSING_NUMBER 111 -#define STRING_MISSING_HEXDATA 112 -#define STRING_UNHANDLED_TYPE 113 -#define STRING_OVERWRITE_VALUE 114 -#define STRING_YESNO 115 -#define STRING_YES 116 -#define STRING_NO 117 -#define STRING_CANCELLED 118 -#define STRING_DEFAULT_VALUE 119 -#define STRING_DELETE_VALUE 120 -#define STRING_DELETE_VALUEALL 121 -#define STRING_DELETE_SUBKEY 122 -#define STRING_INVALID_STRING 123 -#define STRING_VALUEALL_FAILED 124 -#define STRING_MATCHES_FOUND 126 -#define STRING_INVALID_SYNTAX 127 -#define STRING_INVALID_OPTION 128 -#define STRING_REG_HELP 129 -#define STRING_FUNC_HELP 130 -#define STRING_VALUE_NOT_SET 131 -#define STRING_IMPORT_USAGE 132 -#define STRING_FILE_NOT_FOUND 133 -#define STRING_ESCAPE_SEQUENCE 135 -#define STRING_EXPORT_USAGE 136 -#define STRING_INVALID_SYSTEM_KEY 137 -#define STRING_OVERWRITE_FILE 138 -#define STRING_KEY_NONEXIST 139 -#define STRING_KEY_IMPORT_FAILED 140 -#define STRING_REG_VIEW_USAGE 141 -#define STRING_ACCESS_DENIED 142 -#define STRING_COPY_USAGE 143 +/* Translation IDs */ + +/* Shared */ +#define STRING_YES 100 +#define STRING_NO 101 +#define STRING_YESNO 103 +#define STRING_INVALID_SYNTAX 105 +#define STRING_FUNC_HELP 106 +#define STRING_ACCESS_DENIED 107 +#define STRING_SUCCESS 108 +#define STRING_CANCELLED 109 +#define STRING_KEY_NONEXIST 110 +#define STRING_VALUE_NONEXIST 111 +#define STRING_DEFAULT_VALUE 112 + +/* reg.c */ +#define STRING_REG_HELP 150 +#define STRING_USAGE 151 +#define STRING_ADD_USAGE 152 +#define STRING_COPY_USAGE 153 +#define STRING_DELETE_USAGE 154 +#define STRING_EXPORT_USAGE 155 +#define STRING_IMPORT_USAGE 156 +#define STRING_QUERY_USAGE 157 +#define STRING_REG_VIEW_USAGE 164 +#define STRING_INVALID_KEY 165 +#define STRING_NO_REMOTE 166 +#define STRING_INVALID_SYSTEM_KEY 167 +#define STRING_INVALID_OPTION 168 + +/* add.c */ +#define STRING_MISSING_NUMBER 200 +#define STRING_MISSING_HEXDATA 201 +#define STRING_INVALID_STRING 202 +#define STRING_UNHANDLED_TYPE 203 +#define STRING_UNSUPPORTED_TYPE 204 +#define STRING_OVERWRITE_VALUE 205 +#define STRING_INVALID_CMDLINE 206 + +/* delete.c */ +#define STRING_DELETE_VALUE 300 +#define STRING_DELETE_VALUEALL 301 +#define STRING_DELETE_SUBKEY 302 +#define STRING_VALUEALL_FAILED 303 + +/* export.c */ +#define STRING_OVERWRITE_FILE 350 + +/* import.c */ +#define STRING_ESCAPE_SEQUENCE 400 +#define STRING_KEY_IMPORT_FAILED 401 +#define STRING_FILE_NOT_FOUND 402 + +/* query.c */ +#define STRING_VALUE_NOT_SET 450 +#define STRING_MATCHES_FOUND 451 diff --git a/sdk/tools/winesync/reg.cfg b/sdk/tools/winesync/reg.cfg index b4d7e7adebb..6a8fafca526 100644 --- a/sdk/tools/winesync/reg.cfg +++ b/sdk/tools/winesync/reg.cfg @@ -4,4 +4,4 @@ directories: files: programs/reg/resource.h: base/applications/cmdutils/reg/resource.h tags: - wine: e4f3d51fdde4b762d2317ce7b2aa140ac030989b + wine: 8f997a8b9b75320449711d3b05241b5f1f580ac3
2 years, 6 months
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
24
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Results per page:
10
25
50
100
200