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
March 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
20 participants
436 discussions
Start a n
N
ew thread
[reactos] 111/360: [WINESYNC] msi: Add support for ProductToBeRegistered property.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=da8483616c2eb10864d1e…
commit da8483616c2eb10864d1e297e0a6fedb7df880f0 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:34:11 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:55 2022 +0100 [WINESYNC] msi: Add support for ProductToBeRegistered property. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 6dc49e4b685850a76a35b1d1d102903a0231c5cc by Piotr Caban <piotr(a)codeweavers.com> --- dll/win32/msi/action.c | 3 ++- dll/win32/msi/msipriv.h | 1 + dll/win32/msi/package.c | 11 ++++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dll/win32/msi/action.c b/dll/win32/msi/action.c index bca9dbfd66d..cd0f38a0469 100644 --- a/dll/win32/msi/action.c +++ b/dll/win32/msi/action.c @@ -5236,7 +5236,8 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package) UINT rc; /* FIXME: also need to publish if the product is in advertise mode */ - if (!msi_check_publish(package)) + if (!msi_get_property_int( package->db, szProductToBeRegistered, 0 ) + && !msi_check_publish(package)) return ERROR_SUCCESS; rc = MSIREG_OpenUninstallKey(package->ProductCode, package->platform, &hkey, TRUE); diff --git a/dll/win32/msi/msipriv.h b/dll/win32/msi/msipriv.h index 1f1ebeae680..1ddae28aaea 100644 --- a/dll/win32/msi/msipriv.h +++ b/dll/win32/msi/msipriv.h @@ -1201,6 +1201,7 @@ static const WCHAR szInstallLocation[] = {'I','n','s','t','a','l','l','L','o','c static const WCHAR szProperty[] = {'P','r','o','p','e','r','t','y',0}; static const WCHAR szUninstallable[] = {'U','n','i','n','s','t','a','l','l','a','b','l','e',0}; static const WCHAR szEXECUTEACTION[] = {'E','X','E','C','U','T','E','A','C','T','I','O','N',0}; +static const WCHAR szProductToBeRegistered[] = {'P','r','o','d','u','c','t','T','o','B','e','R','e','g','i','s','t','e','r','e','d',0}; /* memory allocation macro functions */ static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1); diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index 858f835e2bb..04ea2a75993 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -1471,7 +1471,8 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage) DWORD index = 0; MSISUMMARYINFO *si; BOOL delete_on_close = FALSE; - WCHAR *info_template, *productname; + WCHAR *info_template, *productname, *product_code; + MSIINSTALLCONTEXT context; TRACE("%s %p\n", debugstr_w(szPackage), pPackage); @@ -1567,6 +1568,14 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage) set_installed_prop( package ); msi_set_context( package ); + product_code = get_product_code( db ); + if (msi_locate_product( product_code, &context ) == ERROR_SUCCESS) + { + TRACE("product already registered\n"); + msi_set_property( package->db, szProductToBeRegistered, szOne, -1 ); + } + msi_free(product_code); + while (1) { WCHAR patch_code[GUID_SIZE];
2 years, 9 months
1
0
0
0
[reactos] 110/360: [WINESYNC] msi: Mark exported wine functions CDECL.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d27e3499c7674b120b3e2…
commit d27e3499c7674b120b3e262e90ea15b729d8dcc2 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:34:10 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:55 2022 +0100 [WINESYNC] msi: Mark exported wine functions CDECL. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id d0451d57348c0a25290f9326ca150843cd7d4486 by Zebediah Figura <zfigura(a)codeweavers.com> --- base/system/msiexec/msiexec.c | 2 +- dll/win32/msi/custom.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/base/system/msiexec/msiexec.c b/base/system/msiexec/msiexec.c index 2ed055771f6..5ebfea78ebf 100644 --- a/base/system/msiexec/msiexec.c +++ b/base/system/msiexec/msiexec.c @@ -393,7 +393,7 @@ static DWORD DoUnregServer(void) return ret; } -extern UINT __wine_msi_call_dll_function(GUID *guid); +extern UINT CDECL __wine_msi_call_dll_function(GUID *guid); static int DoEmbedding(LPCWSTR key) { diff --git a/dll/win32/msi/custom.c b/dll/win32/msi/custom.c index 6ffc27aa4ba..d444960c96f 100644 --- a/dll/win32/msi/custom.c +++ b/dll/win32/msi/custom.c @@ -485,7 +485,7 @@ static void handle_msi_break(LPCSTR target) static WCHAR ncalrpcW[] = {'n','c','a','l','r','p','c',0}; static WCHAR endpoint_lrpcW[] = {'m','s','i',0}; -UINT __wine_msi_call_dll_function(const GUID *guid) +UINT CDECL __wine_msi_call_dll_function(const GUID *guid) { MsiCustomActionEntryPoint fn; MSIHANDLE remote_package = 0;
2 years, 9 months
1
0
0
0
[reactos] 109/360: [WINESYNC] msi/tests: Add package minor/major upgrade tests.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=96486643cfb92b0a64f20…
commit 96486643cfb92b0a64f20d18751ed8f87ed500f8 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:34:09 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:54 2022 +0100 [WINESYNC] msi/tests: Add package minor/major upgrade tests. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id bdf8895d7671aa9b9a749a9fb99e82295f7b5c8f by Piotr Caban <piotr(a)codeweavers.com> --- modules/rostests/winetests/msi/package.c | 78 +++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 2 deletions(-) diff --git a/modules/rostests/winetests/msi/package.c b/modules/rostests/winetests/msi/package.c index 88bd60a8f2e..6671ca13195 100644 --- a/modules/rostests/winetests/msi/package.c +++ b/modules/rostests/winetests/msi/package.c @@ -751,6 +751,22 @@ static UINT create_actiontext_table( MSIHANDLE hdb ) return r; } +static UINT create_upgrade_table( MSIHANDLE hdb ) +{ + UINT r = run_query( hdb, + "CREATE TABLE `Upgrade` (" + "`UpgradeCode` CHAR(38) NOT NULL, " + "`VersionMin` CHAR(20), " + "`VersionMax` CHAR(20), " + "`Language` CHAR(255), " + "`Attributes` SHORT, " + "`Remove` CHAR(255), " + "`ActionProperty` CHAR(72) NOT NULL " + "PRIMARY KEY `UpgradeCode`, `VersionMin`, `VersionMax`, `Language`)" ); + ok(r == ERROR_SUCCESS, "Failed to create Upgrade table: %u\n", r); + return r; +} + static inline UINT add_entry(const char *file, int line, const char *type, MSIHANDLE hdb, const char *values, const char *insert) { char *query; @@ -805,6 +821,12 @@ static inline UINT add_entry(const char *file, int line, const char *type, MSIHA #define add_property_entry(hdb, values) add_entry(__FILE__, __LINE__, "Property", hdb, values, \ "INSERT INTO `Property` (`Property`, `Value`) VALUES( %s )") +#define update_ProductVersion_property(hdb, value) add_entry(__FILE__, __LINE__, "Property", hdb, value, \ + "UPDATE `Property` SET `Value` = '%s' WHERE `Property` = 'ProductVersion'") + +#define update_ProductCode_property(hdb, value) add_entry(__FILE__, __LINE__, "Property", hdb, value, \ + "UPDATE `Property` SET `Value` = '%s' WHERE `Property` = 'ProductCode'") + #define add_install_execute_sequence_entry(hdb, values) add_entry(__FILE__, __LINE__, "InstallExecuteSequence", hdb, values, \ "INSERT INTO `InstallExecuteSequence` " \ "(`Action`, `Condition`, `Sequence`) VALUES( %s )") @@ -854,6 +876,10 @@ static inline UINT add_entry(const char *file, int line, const char *type, MSIHA "INSERT INTO `ActionText` " \ "(`Action`, `Description`, `Template`) VALUES( %s )"); +#define add_upgrade_entry(hdb, values) add_entry(__FILE__, __LINE__, "Upgrade", hdb, values, \ + "INSERT INTO `Upgrade` " \ + "(`UpgradeCode`, `VersionMin`, `VersionMax`, `Language`, `Attributes`, `Remove`, `ActionProperty`) VALUES( %s )"); + static UINT add_reglocator_entry( MSIHANDLE hdb, const char *sig, UINT root, const char *path, const char *name, UINT type ) { @@ -3072,10 +3098,12 @@ static void test_states(void) char msi_cache_file[MAX_PATH]; DWORD cache_file_name_len; INSTALLSTATE state; - MSIHANDLE hpkg; + MSIHANDLE hpkg, hprod; UINT r; MSIHANDLE hdb; BOOL is_broken; + char value[MAX_PATH]; + DWORD size; if (is_process_limited()) { @@ -3094,6 +3122,7 @@ static void test_states(void) add_property_entry( hdb, "'ProductName', 'MSITEST'" ); add_property_entry( hdb, "'ProductVersion', '1.1.1'" ); add_property_entry( hdb, "'MSIFASTINSTALL', '1'" ); + add_property_entry( hdb, "'UpgradeCode', '{3494EEEA-4221-4A66-802E-DED8916BC5C5}'" ); create_install_execute_sequence_table( hdb ); add_install_execute_sequence_entry( hdb, "'CostInitialize', '', '800'" ); @@ -3779,8 +3808,53 @@ static void test_states(void) state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}", "three"); ok(state == INSTALLSTATE_LOCAL, "state = %d\n", state); + /* minor upgrade test with no REINSTALL argument */ + r = MsiOpenProductA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}", &hprod); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + size = MAX_PATH; + r = MsiGetProductPropertyA(hprod, "ProductVersion", value, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!strcmp(value, "1.1.1"), "ProductVersion = %s\n", value); + MsiCloseHandle(hprod); + + r = MsiOpenDatabaseA(msifile2, (const char*)MSIDBOPEN_DIRECT, &hdb); + ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r); + add_install_execute_sequence_entry( hdb, "'FindRelatedProducts', '', '100'" ); + add_install_execute_sequence_entry( hdb, "'RemoveExistingProducts', '', '1401'" ); + create_upgrade_table( hdb ); + add_upgrade_entry( hdb, "'{3494EEEA-4221-4A66-802E-DED8916BC5C5}', NULL, '1.1.2', NULL, 0, NULL, 'OLDERVERSIONBEINGUPGRADED'"); + update_ProductVersion_property( hdb, "1.1.2" ); + set_summary_str(hdb, PID_REVNUMBER, "{A219A62A-D931-4F1B-89DB-FF1C300A8D43}"); + r = MsiDatabaseCommit(hdb); + ok(r == ERROR_SUCCESS, "MsiDatabaseCommit failed: %d\n", r); + MsiCloseHandle(hdb); + + r = MsiInstallProductA(msifile2, ""); + todo_wine ok(r == ERROR_PRODUCT_VERSION, "Expected ERROR_PRODUCT_VERSION, got %d\n", r); + + /* major upgrade test */ + r = MsiOpenDatabaseA(msifile2, (const char*)MSIDBOPEN_DIRECT, &hdb); + ok(r == ERROR_SUCCESS, "failed to open database: %d\n", r); + update_ProductCode_property( hdb, "{333DB27A-C25E-4EBC-9BEC-0F49546C19A6}" ); + r = MsiDatabaseCommit(hdb); + ok(r == ERROR_SUCCESS, "MsiDatabaseCommit failed: %d\n", r); + MsiCloseHandle(hdb); + + r = MsiInstallProductA(msifile2, ""); + ok(r == S_OK, "Expected ERROR_PRODUCT_VERSION, got %d\n", r); + + r = MsiOpenProductA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}", &hprod); + ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r); + r = MsiOpenProductA("{333DB27A-C25E-4EBC-9BEC-0F49546C19A6}", &hprod); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + size = MAX_PATH; + r = MsiGetProductPropertyA(hprod, "ProductVersion", value, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!strcmp(value, "1.1.2"), "ProductVersion = %s\n", value); + MsiCloseHandle(hprod); + /* uninstall the product */ - r = MsiInstallProductA(msifile4, "REMOVE=ALL"); + r = MsiInstallProductA(msifile2, "REMOVE=ALL"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); DeleteFileA(msifile);
2 years, 9 months
1
0
0
0
[reactos] 108/360: [WINESYNC] msi/tests: Use the available ARRAY_SIZE() macro.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8667645111b235b0fe967…
commit 8667645111b235b0fe9674603db1f282dff16eaf Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:34:09 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:54 2022 +0100 [WINESYNC] msi/tests: Use the available ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id b716661c4a5c492fff79bed14190f33b47afebc8 by Michael Stefaniuc <mstefani(a)winehq.org> --- modules/rostests/winetests/msi/action.c | 64 +++++------ modules/rostests/winetests/msi/automation.c | 70 ++++++------ modules/rostests/winetests/msi/db.c | 12 +- modules/rostests/winetests/msi/install.c | 169 ++++++++++++++-------------- modules/rostests/winetests/msi/msi.c | 30 ++--- modules/rostests/winetests/msi/package.c | 2 +- modules/rostests/winetests/msi/patch.c | 8 +- modules/rostests/winetests/msi/record.c | 4 +- 8 files changed, 178 insertions(+), 181 deletions(-) diff --git a/modules/rostests/winetests/msi/action.c b/modules/rostests/winetests/msi/action.c index 61a998663ba..432ae0dc8ae 100644 --- a/modules/rostests/winetests/msi/action.c +++ b/modules/rostests/winetests/msi/action.c @@ -2653,7 +2653,7 @@ static void test_register_product(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\maximus", 500); - create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table)); + create_database(msifile, pp_tables, ARRAY_SIZE(pp_tables)); MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL); @@ -2920,7 +2920,7 @@ static void test_publish_product(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\maximus", 500); - create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table)); + create_database(msifile, pp_tables, ARRAY_SIZE(pp_tables)); if (is_wow64) access |= KEY_WOW64_64KEY; @@ -3153,7 +3153,7 @@ static void test_publish_features(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\maximus", 500); - create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table)); + create_database(msifile, pp_tables, ARRAY_SIZE(pp_tables)); if (is_wow64) access |= KEY_WOW64_64KEY; @@ -3339,7 +3339,7 @@ static void test_register_user(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\maximus", 500); - create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table)); + create_database(msifile, pp_tables, ARRAY_SIZE(pp_tables)); if (is_wow64) access |= KEY_WOW64_64KEY; @@ -3433,7 +3433,7 @@ static void test_process_components(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\maximus", 500); - create_database(msifile, ppc_tables, sizeof(ppc_tables) / sizeof(msi_table)); + create_database(msifile, ppc_tables, ARRAY_SIZE(ppc_tables)); if (is_wow64) access |= KEY_WOW64_64KEY; @@ -3581,7 +3581,7 @@ static void test_publish(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\maximus", 500); - create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table)); + create_database(msifile, pp_tables, ARRAY_SIZE(pp_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -4155,7 +4155,7 @@ static void test_publish_sourcelist(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\maximus", 500); - create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table)); + create_database(msifile, pp_tables, ARRAY_SIZE(pp_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -4355,7 +4355,7 @@ static void test_remove_files(void) create_file("msitest\\helium", 500); create_file("msitest\\lithium", 500); - create_database(msifile, rem_tables, sizeof(rem_tables) / sizeof(msi_table)); + create_database(msifile, rem_tables, ARRAY_SIZE(rem_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -4512,7 +4512,7 @@ static void test_move_files(void) create_file("bur", 100); create_file("bird", 100); - create_database(msifile, mov_tables, sizeof(mov_tables) / sizeof(msi_table)); + create_database(msifile, mov_tables, ARRAY_SIZE(mov_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -4633,7 +4633,7 @@ static void test_duplicate_files(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\maximus", 500); - create_database(msifile, df_tables, sizeof(df_tables) / sizeof(msi_table)); + create_database(msifile, df_tables, ARRAY_SIZE(df_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -4676,7 +4676,7 @@ static void test_write_registry_values(void) CreateDirectoryA("msitest", NULL); - create_database(msifile, wrv_tables, sizeof(wrv_tables) / sizeof(msi_table)); + create_database(msifile, wrv_tables, ARRAY_SIZE(wrv_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -4842,7 +4842,7 @@ static void test_envvar(void) return; } - create_database(msifile, env_tables, sizeof(env_tables) / sizeof(msi_table)); + create_database(msifile, env_tables, ARRAY_SIZE(env_tables)); res = RegCreateKeyExA(HKEY_CURRENT_USER, "Environment", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &env, NULL); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); @@ -4951,7 +4951,7 @@ static void test_create_remove_folder(void) CreateDirectoryA("msitest\\second", NULL); create_file("msitest\\first\\one.txt", 1000); create_file("msitest\\second\\two.txt", 1000); - create_database(msifile, cf_tables, sizeof(cf_tables) / sizeof(msi_table)); + create_database(msifile, cf_tables, ARRAY_SIZE(cf_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5031,7 +5031,7 @@ static void test_start_stop_services(void) CloseServiceHandle(scm); create_test_files(); - create_database(msifile, sss_tables, sizeof(sss_tables) / sizeof(msi_table)); + create_database(msifile, sss_tables, ARRAY_SIZE(sss_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5131,7 +5131,7 @@ static void test_delete_services(void) if (!service) return; create_test_files(); - create_database(msifile, sds_tables, sizeof(sds_tables) / sizeof(msi_table)); + create_database(msifile, sds_tables, ARRAY_SIZE(sds_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5193,7 +5193,7 @@ static void test_install_services(void) } create_test_files(); - create_database(msifile, sis_tables, sizeof(sis_tables) / sizeof(msi_table)); + create_database(msifile, sis_tables, ARRAY_SIZE(sis_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5270,7 +5270,7 @@ static void test_self_registration(void) create_test_files(); extract_resource("selfreg.dll", "TESTDLL", "msitest\\selfreg.dll"); - create_database(msifile, sr_tables, sizeof(sr_tables) / sizeof(msi_table)); + create_database(msifile, sr_tables, ARRAY_SIZE(sr_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5318,7 +5318,7 @@ static void test_register_font(void) create_test_files(); create_file("msitest\\font.ttf", 1000); - create_database(msifile, font_tables, sizeof(font_tables) / sizeof(msi_table)); + create_database(msifile, font_tables, ARRAY_SIZE(font_tables)); if (is_wow64) access |= KEY_WOW64_64KEY; @@ -5368,7 +5368,7 @@ static void test_validate_product_id(void) } create_test_files(); - create_database(msifile, vp_tables, sizeof(vp_tables) / sizeof(msi_table)); + create_database(msifile, vp_tables, ARRAY_SIZE(vp_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5427,7 +5427,7 @@ static void test_install_remove_odbc(void) create_file("msitest\\ODBCtranslator.dll", 1000); create_file("msitest\\ODBCtranslator2.dll", 1000); create_file("msitest\\ODBCsetup.dll", 1000); - create_database(msifile, odbc_tables, sizeof(odbc_tables) / sizeof(msi_table)); + create_database(msifile, odbc_tables, ARRAY_SIZE(odbc_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5513,7 +5513,7 @@ static void test_register_typelib(void) create_test_files(); extract_resource("typelib.tlb", "TYPELIB", "msitest\\typelib.dll"); - create_database(msifile, tl_tables, sizeof(tl_tables) / sizeof(msi_table)); + create_database(msifile, tl_tables, ARRAY_SIZE(tl_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5556,7 +5556,7 @@ static void test_create_remove_shortcut(void) create_test_files(); create_file("msitest\\target.txt", 1000); - create_database(msifile, crs_tables, sizeof(crs_tables) / sizeof(msi_table)); + create_database(msifile, crs_tables, ARRAY_SIZE(crs_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5605,7 +5605,7 @@ static void test_publish_components(void) create_test_files(); create_file("msitest\\english.txt", 1000); - create_database(msifile, pub_tables, sizeof(pub_tables) / sizeof(msi_table)); + create_database(msifile, pub_tables, ARRAY_SIZE(pub_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5691,7 +5691,7 @@ static void test_remove_duplicate_files(void) create_file("msitest\\original.txt", 1000); create_file("msitest\\original2.txt", 1000); create_file("msitest\\original3.txt", 1000); - create_database(msifile, rd_tables, sizeof(rd_tables) / sizeof(msi_table)); + create_database(msifile, rd_tables, ARRAY_SIZE(rd_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5739,7 +5739,7 @@ static void test_find_related_products(void) create_test_files(); create_file("msitest\\product.txt", 1000); - create_database(msifile, frp_tables, sizeof(frp_tables) / sizeof(msi_table)); + create_database(msifile, frp_tables, ARRAY_SIZE(frp_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5783,7 +5783,7 @@ static void test_ini_values(void) create_test_files(); create_file("msitest\\inifile.txt", 1000); - create_database(msifile, ini_tables, sizeof(ini_tables) / sizeof(msi_table)); + create_database(msifile, ini_tables, ARRAY_SIZE(ini_tables)); lstrcpyA(inifile, PROG_FILES_DIR); lstrcatA(inifile, "\\msitest"); @@ -5844,7 +5844,7 @@ static void test_register_class_info(void) create_test_files(); create_file("msitest\\class.txt", 1000); - create_database(msifile, rci_tables, sizeof(rci_tables) / sizeof(msi_table)); + create_database(msifile, rci_tables, ARRAY_SIZE(rci_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5909,7 +5909,7 @@ static void test_register_extension_info(void) create_test_files(); create_file("msitest\\extension.txt", 1000); - create_database(msifile, rei_tables, sizeof(rei_tables) / sizeof(msi_table)); + create_database(msifile, rei_tables, ARRAY_SIZE(rei_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5961,7 +5961,7 @@ static void test_register_progid_info(void) create_test_files(); create_file("msitest\\progid.txt", 1000); - create_database(msifile, rpi_tables, sizeof(rpi_tables) / sizeof(msi_table)); + create_database(msifile, rpi_tables, ARRAY_SIZE(rpi_tables)); res = RegCreateKeyExA(HKEY_CLASSES_ROOT, "Winetest.Orphaned", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, NULL); @@ -6087,7 +6087,7 @@ static void test_register_mime_info(void) create_test_files(); create_file("msitest\\mime.txt", 1000); - create_database(msifile, rmi_tables, sizeof(rmi_tables) / sizeof(msi_table)); + create_database(msifile, rmi_tables, ARRAY_SIZE(rmi_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -6185,7 +6185,7 @@ static void test_publish_assemblies(void) create_file_data("msitest\\manifest_local.txt", manifest_local, 0); create_file("msitest\\application_win32.txt", 1000); create_file("msitest\\application_dotnet.txt", 1000); - create_database(msifile, pa_tables, sizeof(pa_tables) / sizeof(msi_table)); + create_database(msifile, pa_tables, ARRAY_SIZE(pa_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -6343,7 +6343,7 @@ static void test_remove_existing_products(void) create_test_files(); create_file("msitest\\rep.txt", 1000); - create_database(msifile, rep_tables, sizeof(rep_tables) / sizeof(msi_table)); + create_database(msifile, rep_tables, ARRAY_SIZE(rep_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); diff --git a/modules/rostests/winetests/msi/automation.c b/modules/rostests/winetests/msi/automation.c index 39d19801225..3478149f429 100644 --- a/modules/rostests/winetests/msi/automation.c +++ b/modules/rostests/winetests/msi/automation.c @@ -359,9 +359,7 @@ static BOOL create_package(LPWSTR path) DWORD len; /* Prepare package */ - create_database(msifile, tables, - sizeof(tables) / sizeof(msi_table), summary_info, - sizeof(summary_info) / sizeof(msi_summary_info)); + create_database(msifile, tables, ARRAY_SIZE(tables), summary_info, ARRAY_SIZE(summary_info)); len = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, CURR_DIR, -1, path, MAX_PATH); @@ -907,7 +905,7 @@ static HRESULT Installer_CreateRecord(int count, IDispatch **pRecord) { VARIANT varresult; VARIANTARG vararg[1]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&vararg[0]); @@ -922,7 +920,7 @@ static HRESULT Installer_CreateRecord(int count, IDispatch **pRecord) static HRESULT Installer_RegistryValue(HKEY hkey, LPCWSTR szKey, VARIANT vValue, VARIANT *pVarResult, VARTYPE vtExpect) { VARIANTARG vararg[3]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; VariantInit(&vararg[2]); V_VT(&vararg[2]) = VT_I4; @@ -987,7 +985,7 @@ static HRESULT Installer_OpenPackage(LPCWSTR szPackagePath, int options, IDispat { VARIANT varresult; VARIANTARG vararg[2]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&vararg[1]); @@ -1006,7 +1004,7 @@ static HRESULT Installer_OpenDatabase(LPCWSTR szDatabasePath, int openmode, IDis { VARIANT varresult; VARIANTARG vararg[2]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&vararg[1]); @@ -1025,7 +1023,7 @@ static HRESULT Installer_InstallProduct(LPCWSTR szPackagePath, LPCWSTR szPropert { VARIANT varresult; VARIANTARG vararg[2]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; VariantInit(&vararg[1]); V_VT(&vararg[1]) = VT_BSTR; @@ -1041,7 +1039,7 @@ static HRESULT Installer_ProductState(LPCWSTR szProduct, int *pInstallState) { VARIANT varresult; VARIANTARG vararg[1]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&vararg[0]); @@ -1058,7 +1056,7 @@ static HRESULT Installer_ProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute, LPW { VARIANT varresult; VARIANTARG vararg[2]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&vararg[1]); @@ -1089,7 +1087,7 @@ static HRESULT Installer_RelatedProducts(LPCWSTR szProduct, IDispatch **pStringL { VARIANT varresult; VARIANTARG vararg[1]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&vararg[0]); @@ -1131,7 +1129,7 @@ static HRESULT Installer_SummaryInformation(BSTR PackagePath, int UpdateCount, I { VARIANT varresult; VARIANTARG vararg[2]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&vararg[1]); @@ -1161,7 +1159,7 @@ static HRESULT Session_PropertyGet(IDispatch *pSession, LPCWSTR szName, LPWSTR s { VARIANT varresult; VARIANTARG vararg[1]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&vararg[0]); @@ -1179,7 +1177,7 @@ static HRESULT Session_PropertyPut(IDispatch *pSession, LPCWSTR szName, LPCWSTR VARIANT varresult; VARIANTARG vararg[2]; DISPID dispid = DISPID_PROPERTYPUT; - DISPPARAMS dispparams = {vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1}; + DISPPARAMS dispparams = {vararg, &dispid, ARRAY_SIZE(vararg), 1}; VariantInit(&vararg[1]); V_VT(&vararg[1]) = VT_BSTR; @@ -1207,7 +1205,7 @@ static HRESULT Session_ModeGet(IDispatch *pSession, int iFlag, VARIANT_BOOL *mod { VARIANT varresult; VARIANTARG vararg[1]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&vararg[0]); @@ -1225,7 +1223,7 @@ static HRESULT Session_ModePut(IDispatch *pSession, int iFlag, VARIANT_BOOL mode VARIANT varresult; VARIANTARG vararg[2]; DISPID dispid = DISPID_PROPERTYPUT; - DISPPARAMS dispparams = {vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1}; + DISPPARAMS dispparams = {vararg, &dispid, ARRAY_SIZE(vararg), 1}; VariantInit(&vararg[1]); V_VT(&vararg[1]) = VT_I4; @@ -1252,7 +1250,7 @@ static HRESULT Session_DoAction(IDispatch *pSession, LPCWSTR szAction, int *iRet { VARIANT varresult; VARIANTARG vararg[1]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&vararg[0]); @@ -1269,7 +1267,7 @@ static HRESULT Session_EvaluateCondition(IDispatch *pSession, LPCWSTR szConditio { VARIANT varresult; VARIANTARG vararg[1]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&vararg[0]); @@ -1286,7 +1284,7 @@ static HRESULT Session_Message(IDispatch *pSession, LONG kind, IDispatch *record { VARIANT varresult; VARIANTARG vararg[2]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&varresult); @@ -1307,7 +1305,7 @@ static HRESULT Session_SetInstallLevel(IDispatch *pSession, LONG iInstallLevel) { VARIANT varresult; VARIANTARG vararg[1]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; VariantInit(&vararg[0]); V_VT(&vararg[0]) = VT_I4; @@ -1320,7 +1318,7 @@ static HRESULT Session_FeatureCurrentState(IDispatch *pSession, LPCWSTR szName, { VARIANT varresult; VARIANTARG vararg[1]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&vararg[0]); @@ -1337,7 +1335,7 @@ static HRESULT Session_FeatureRequestStateGet(IDispatch *pSession, LPCWSTR szNam { VARIANT varresult; VARIANTARG vararg[1]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&vararg[0]); @@ -1355,7 +1353,7 @@ static HRESULT Session_FeatureRequestStatePut(IDispatch *pSession, LPCWSTR szNam VARIANT varresult; VARIANTARG vararg[2]; DISPID dispid = DISPID_PROPERTYPUT; - DISPPARAMS dispparams = {vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1}; + DISPPARAMS dispparams = {vararg, &dispid, ARRAY_SIZE(vararg), 1}; VariantInit(&vararg[1]); V_VT(&vararg[1]) = VT_BSTR; @@ -1371,7 +1369,7 @@ static HRESULT Database_OpenView(IDispatch *pDatabase, LPCWSTR szSql, IDispatch { VARIANT varresult; VARIANTARG vararg[1]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&vararg[0]); @@ -1387,7 +1385,7 @@ static HRESULT Database_SummaryInformation(IDispatch *pDatabase, int iUpdateCoun { VARIANT varresult; VARIANTARG vararg[1]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&vararg[0]); @@ -1403,7 +1401,7 @@ static HRESULT View_Execute(IDispatch *pView, IDispatch *pRecord) { VARIANT varresult; VARIANTARG vararg[1]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; VariantInit(&vararg[0]); V_VT(&vararg[0]) = VT_DISPATCH; @@ -1425,7 +1423,7 @@ static HRESULT View_Modify(IDispatch *pView, int iMode, IDispatch *pRecord) { VARIANT varresult; VARIANTARG vararg[2]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; VariantInit(&vararg[1]); V_VT(&vararg[1]) = VT_I4; @@ -1460,7 +1458,7 @@ static HRESULT Record_StringDataGet(IDispatch *pRecord, int iField, LPWSTR szStr { VARIANT varresult; VARIANTARG vararg[1]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&vararg[0]); @@ -1478,7 +1476,7 @@ static HRESULT Record_StringDataPut(IDispatch *pRecord, int iField, LPCWSTR szSt VARIANT varresult; VARIANTARG vararg[2]; DISPID dispid = DISPID_PROPERTYPUT; - DISPPARAMS dispparams = {vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1}; + DISPPARAMS dispparams = {vararg, &dispid, ARRAY_SIZE(vararg), 1}; VariantInit(&vararg[1]); V_VT(&vararg[1]) = VT_I4; @@ -1494,7 +1492,7 @@ static HRESULT Record_IntegerDataGet(IDispatch *pRecord, int iField, int *pValue { VARIANT varresult; VARIANTARG vararg[1]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&vararg[0]); @@ -1512,7 +1510,7 @@ static HRESULT Record_IntegerDataPut(IDispatch *pRecord, int iField, int iValue) VARIANT varresult; VARIANTARG vararg[2]; DISPID dispid = DISPID_PROPERTYPUT; - DISPPARAMS dispparams = {vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1}; + DISPPARAMS dispparams = {vararg, &dispid, ARRAY_SIZE(vararg), 1}; VariantInit(&vararg[1]); V_VT(&vararg[1]) = VT_I4; @@ -1537,7 +1535,7 @@ static HRESULT StringList_Item(IDispatch *pStringList, int iIndex, LPWSTR szStri { VARIANT varresult; VARIANTARG vararg[1]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; HRESULT hr; VariantInit(&vararg[0]); @@ -1563,7 +1561,7 @@ static HRESULT StringList_Count(IDispatch *pStringList, int *pCount) static HRESULT SummaryInfo_PropertyGet(IDispatch *pSummaryInfo, int pid, VARIANT *pVarResult, VARTYPE vtExpect) { VARIANTARG vararg[1]; - DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0}; VariantInit(&vararg[0]); V_VT(&vararg[0]) = VT_I4; @@ -1576,7 +1574,7 @@ static HRESULT SummaryInfo_PropertyPut(IDispatch *pSummaryInfo, int pid, VARIANT VARIANT varresult; VARIANTARG vararg[2]; DISPID dispid = DISPID_PROPERTYPUT; - DISPPARAMS dispparams = {vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1}; + DISPPARAMS dispparams = {vararg, &dispid, ARRAY_SIZE(vararg), 1}; VariantInit(&vararg[1]); V_VT(&vararg[1]) = VT_I4; @@ -1854,7 +1852,7 @@ static void test_Database(IDispatch *pDatabase, BOOL readonly) ok(pSummaryInfo != NULL, "Database_SummaryInformation should not have returned NULL record\n"); if (pSummaryInfo) { - test_SummaryInfo(pSummaryInfo, summary_info, sizeof(summary_info)/sizeof(msi_summary_info), readonly); + test_SummaryInfo(pSummaryInfo, summary_info, ARRAY_SIZE(summary_info), readonly); IDispatch_Release(pSummaryInfo); } } @@ -2701,7 +2699,7 @@ static void test_Installer(void) ok(hr == S_OK, "Installer_SummaryInformation failed, hresult 0x%08x\n", hr); if (hr == S_OK) { - test_SummaryInfo(pSumInfo, summary_info, sizeof(summary_info)/sizeof(msi_summary_info), TRUE); + test_SummaryInfo(pSumInfo, summary_info, ARRAY_SIZE(summary_info), TRUE); IDispatch_Release(pSumInfo); } diff --git a/modules/rostests/winetests/msi/db.c b/modules/rostests/winetests/msi/db.c index ff54a95ab11..2b927b78f26 100644 --- a/modules/rostests/winetests/msi/db.c +++ b/modules/rostests/winetests/msi/db.c @@ -5221,12 +5221,12 @@ static void test_collation(void) r = MsiViewFetch(hview, &hrec); ok(r == ERROR_SUCCESS, "MsiViewFetch failed\n"); - sz = sizeof(bufferW) / sizeof(bufferW[0]); + sz = ARRAY_SIZE(bufferW); r = MsiRecordGetStringW(hrec, 1, bufferW, &sz); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!memcmp(bufferW, letter_a_ring, sizeof(letter_a_ring)), "Expected %s, got %s\n", wine_dbgstr_w(letter_a_ring), wine_dbgstr_w(bufferW)); - sz = sizeof(bufferW) / sizeof(bufferW[0]); + sz = ARRAY_SIZE(bufferW); r = MsiRecordGetStringW(hrec, 2, bufferW, &sz); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!lstrcmpW(bufferW, letter_C), "Expected C, got %s\n", wine_dbgstr_w(bufferW)); @@ -5234,12 +5234,12 @@ static void test_collation(void) r = MsiViewFetch(hview, &hrec); ok(r == ERROR_SUCCESS, "MsiViewFetch failed\n"); - sz = sizeof(bufferW) / sizeof(bufferW[0]); + sz = ARRAY_SIZE(bufferW); r = MsiRecordGetStringW(hrec, 1, bufferW, &sz); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!memcmp(bufferW, letter_a_with_ring, sizeof(letter_a_with_ring)), "Expected %s, got %s\n", wine_dbgstr_w(letter_a_with_ring), wine_dbgstr_w(bufferW)); - sz = sizeof(bufferW) / sizeof(bufferW[0]); + sz = ARRAY_SIZE(bufferW); r = MsiRecordGetStringW(hrec, 2, bufferW, &sz); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!lstrcmpW(bufferW, letter_D), "Expected D, got %s\n", wine_dbgstr_w(bufferW)); @@ -5257,12 +5257,12 @@ static void test_collation(void) r = MsiViewFetch(hview, &hrec); ok(r == ERROR_SUCCESS, "MsiViewFetch failed\n"); - sz = sizeof(bufferW) / sizeof(bufferW[0]); + sz = ARRAY_SIZE(bufferW); r = MsiRecordGetStringW(hrec, 1, bufferW, &sz); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!memcmp(bufferW, letter_a_with_ring, sizeof(letter_a_with_ring)), "Expected %s, got %s\n", wine_dbgstr_w(letter_a_with_ring), wine_dbgstr_w(bufferW)); - sz = sizeof(bufferW) / sizeof(bufferW[0]); + sz = ARRAY_SIZE(bufferW); r = MsiRecordGetStringW(hrec, 2, bufferW, &sz); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!lstrcmpW(bufferW, letter_D), "Expected D, got %s\n", wine_dbgstr_w(bufferW)); diff --git a/modules/rostests/winetests/msi/install.c b/modules/rostests/winetests/msi/install.c index 951f0e72221..f21e32789f3 100644 --- a/modules/rostests/winetests/msi/install.c +++ b/modules/rostests/winetests/msi/install.c @@ -2706,7 +2706,7 @@ static void test_MsiInstallProduct(void) "Expected ERROR_PATH_NOT_FOUND, got %d\n", r); create_test_files(); - create_database(msifile, tables, sizeof(tables) / sizeof(msi_table)); + create_database(msifile, tables, ARRAY_SIZE(tables)); /* install, don't publish */ r = MsiInstallProductA(msifile, NULL); @@ -2757,7 +2757,7 @@ static void test_MsiInstallProduct(void) ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest"); - create_database(msifile, up_tables, sizeof(up_tables) / sizeof(msi_table)); + create_database(msifile, up_tables, ARRAY_SIZE(up_tables)); /* not published, RemovePreviousVersions set */ r = MsiInstallProductA(msifile, NULL); @@ -2769,7 +2769,7 @@ static void test_MsiInstallProduct(void) ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest"); - create_database(msifile, up2_tables, sizeof(up2_tables) / sizeof(msi_table)); + create_database(msifile, up2_tables, ARRAY_SIZE(up2_tables)); /* not published, version number bumped */ r = MsiInstallProductA(msifile, NULL); @@ -2781,7 +2781,7 @@ static void test_MsiInstallProduct(void) ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest"); - create_database(msifile, up3_tables, sizeof(up3_tables) / sizeof(msi_table)); + create_database(msifile, up3_tables, ARRAY_SIZE(up3_tables)); /* not published, RemovePreviousVersions set and version number bumped */ r = MsiInstallProductA(msifile, NULL); @@ -2793,7 +2793,7 @@ static void test_MsiInstallProduct(void) ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest"); - create_database(msifile, up4_tables, sizeof(up4_tables) / sizeof(msi_table)); + create_database(msifile, up4_tables, ARRAY_SIZE(up4_tables)); /* install, publish product */ r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1"); @@ -2804,7 +2804,7 @@ static void test_MsiInstallProduct(void) res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey); ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); - create_database(msifile, up4_tables, sizeof(up4_tables) / sizeof(msi_table)); + create_database(msifile, up4_tables, ARRAY_SIZE(up4_tables)); /* published, reinstall */ r = MsiInstallProductA(msifile, NULL); @@ -2815,7 +2815,7 @@ static void test_MsiInstallProduct(void) res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey); ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); - create_database(msifile, up5_tables, sizeof(up5_tables) / sizeof(msi_table)); + create_database(msifile, up5_tables, ARRAY_SIZE(up5_tables)); /* published product, RemovePreviousVersions set */ r = MsiInstallProductA(msifile, NULL); @@ -2826,7 +2826,7 @@ static void test_MsiInstallProduct(void) res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey); ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); - create_database(msifile, up6_tables, sizeof(up6_tables) / sizeof(msi_table)); + create_database(msifile, up6_tables, ARRAY_SIZE(up6_tables)); /* published product, version number bumped */ r = MsiInstallProductA(msifile, NULL); @@ -2837,7 +2837,7 @@ static void test_MsiInstallProduct(void) res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey); ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); - create_database(msifile, up7_tables, sizeof(up7_tables) / sizeof(msi_table)); + create_database(msifile, up7_tables, ARRAY_SIZE(up7_tables)); /* published product, RemovePreviousVersions set and version number bumped */ r = MsiInstallProductA(msifile, NULL); @@ -2863,7 +2863,7 @@ static void test_MsiSetComponentState(void) char path[MAX_PATH]; UINT r; - create_database(msifile, tables, sizeof(tables) / sizeof(msi_table)); + create_database(msifile, tables, ARRAY_SIZE(tables)); CoInitialize(NULL); @@ -2913,7 +2913,7 @@ static void test_packagecoltypes(void) LPCSTR query; UINT r, count; - create_database(msifile, tables, sizeof(tables) / sizeof(msi_table)); + create_database(msifile, tables, ARRAY_SIZE(tables)); CoInitialize(NULL); @@ -3032,7 +3032,7 @@ static void test_continuouscabs(void) } create_cc_test_files(); - create_database(msifile, cc_tables, sizeof(cc_tables) / sizeof(msi_table)); + create_database(msifile, cc_tables, ARRAY_SIZE(cc_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -3055,7 +3055,7 @@ static void test_continuouscabs(void) DeleteFileA(msifile); create_cc_test_files(); - create_database(msifile, cc2_tables, sizeof(cc2_tables) / sizeof(msi_table)); + create_database(msifile, cc2_tables, ARRAY_SIZE(cc2_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -3081,7 +3081,7 @@ static void test_continuouscabs(void) /* Filename from cab is right and the one from msi is wrong */ create_cc_test_files(); - create_database(msifile, cc3_tables, sizeof(cc3_tables) / sizeof(msi_table)); + create_database(msifile, cc3_tables, ARRAY_SIZE(cc3_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -3105,7 +3105,7 @@ static void test_continuouscabs(void) /* Filename from msi is right and the one from cab is wrong */ create_cc_test_files(); ok(MoveFileA("test2.cab", "test2_.cab"), "Cannot rename test2.cab to test2_.cab\n"); - create_database(msifile, cc3_tables, sizeof(cc3_tables) / sizeof(msi_table)); + create_database(msifile, cc3_tables, ARRAY_SIZE(cc3_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -3137,7 +3137,7 @@ static void test_caborder(void) create_file("augustus", 50000); create_file("caesar", 500); - create_database(msifile, cc_tables, sizeof(cc_tables) / sizeof(msi_table)); + create_database(msifile, cc_tables, ARRAY_SIZE(cc_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -3177,7 +3177,7 @@ static void test_caborder(void) DeleteFileA(msifile); create_cc_test_files(); - create_database(msifile, co_tables, sizeof(co_tables) / sizeof(msi_table)); + create_database(msifile, co_tables, ARRAY_SIZE(co_tables)); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r); @@ -3193,7 +3193,7 @@ static void test_caborder(void) DeleteFileA(msifile); create_cc_test_files(); - create_database(msifile, co2_tables, sizeof(co2_tables) / sizeof(msi_table)); + create_database(msifile, co2_tables, ARRAY_SIZE(co2_tables)); r = MsiInstallProductA(msifile, NULL); ok(!delete_pf("msitest\\caesar", TRUE), "File is installed\n"); @@ -3229,7 +3229,7 @@ static void test_mixedmedia(void) create_file("msitest\\augustus", 500); create_file("caesar", 500); - create_database(msifile, mm_tables, sizeof(mm_tables) / sizeof(msi_table)); + create_database(msifile, mm_tables, ARRAY_SIZE(mm_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -3262,7 +3262,7 @@ static void test_samesequence(void) UINT r; create_cc_test_files(); - create_database(msifile, ss_tables, sizeof(ss_tables) / sizeof(msi_table)); + create_database(msifile, ss_tables, ARRAY_SIZE(ss_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -3291,7 +3291,7 @@ static void test_uiLevelFlags(void) UINT r; create_cc_test_files(); - create_database(msifile, ui_tables, sizeof(ui_tables) / sizeof(msi_table)); + create_database(msifile, ui_tables, ARRAY_SIZE(ui_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE | INSTALLUILEVEL_SOURCERESONLY, NULL); @@ -3346,7 +3346,7 @@ static void test_readonlyfile(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\maximus", 500); - create_database(msifile, rof_tables, sizeof(rof_tables) / sizeof(msi_table)); + create_database(msifile, rof_tables, ARRAY_SIZE(rof_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -3398,7 +3398,7 @@ static void test_readonlyfile_cab(void) create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0"); DeleteFileA("maximus"); - create_database(msifile, rofc_tables, sizeof(rofc_tables) / sizeof(msi_table)); + create_database(msifile, rofc_tables, ARRAY_SIZE(rofc_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -3452,7 +3452,7 @@ static void test_setdirproperty(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\maximus", 500); - create_database(msifile, sdp_tables, sizeof(sdp_tables) / sizeof(msi_table)); + create_database(msifile, sdp_tables, ARRAY_SIZE(sdp_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -3493,7 +3493,7 @@ static void test_cabisextracted(void) create_cab_file("test2.cab", MEDIA_SIZE, "augustus\0"); create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0"); - create_database(msifile, cie_tables, sizeof(cie_tables) / sizeof(msi_table)); + create_database(msifile, cie_tables, ARRAY_SIZE(cie_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -3727,7 +3727,7 @@ static void test_transformprop(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\augustus", 500); - create_database(msifile, tp_tables, sizeof(tp_tables) / sizeof(msi_table)); + create_database(msifile, tp_tables, ARRAY_SIZE(tp_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -3775,7 +3775,7 @@ static void test_currentworkingdir(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\augustus", 500); - create_database(msifile, cwd_tables, sizeof(cwd_tables) / sizeof(msi_table)); + create_database(msifile, cwd_tables, ARRAY_SIZE(cwd_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -3859,7 +3859,7 @@ static void test_admin(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\augustus", 500); - create_database(msifile, adm_tables, sizeof(adm_tables) / sizeof(msi_table)); + create_database(msifile, adm_tables, ARRAY_SIZE(adm_tables)); set_admin_summary_info(msifileW); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -3937,7 +3937,7 @@ static void test_adminprops(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\augustus", 500); - create_database(msifile, amp_tables, sizeof(amp_tables) / sizeof(msi_table)); + create_database(msifile, amp_tables, ARRAY_SIZE(amp_tables)); set_admin_summary_info(msifileW); set_admin_property_stream(msifile); @@ -3990,7 +3990,7 @@ static void test_missingcab(void) create_file("maximus", 500); create_file("tiberius", 500); - create_database(msifile, mc_tables, sizeof(mc_tables) / sizeof(msi_table)); + create_database(msifile, mc_tables, ARRAY_SIZE(mc_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -4058,7 +4058,7 @@ static void test_sourcefolder(void) CreateDirectoryA("msitest", NULL); create_file("augustus", 500); - create_database(msifile, sf_tables, sizeof(sf_tables) / sizeof(msi_table)); + create_database(msifile, sf_tables, ARRAY_SIZE(sf_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -4097,7 +4097,7 @@ static void test_customaction1(void) UINT r; create_test_files(); - create_database(msifile, ca1_tables, sizeof(ca1_tables) / sizeof(msi_table)); + create_database(msifile, ca1_tables, ARRAY_SIZE(ca1_tables)); /* create a test table */ MsiOpenDatabaseW(msifileW, MSIDBOPEN_TRANSACT, &hdb); @@ -4153,7 +4153,7 @@ static void test_customaction51(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\augustus", 500); - create_database(msifile, ca51_tables, sizeof(ca51_tables) / sizeof(msi_table)); + create_database(msifile, ca51_tables, ARRAY_SIZE(ca51_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -4197,7 +4197,7 @@ static void test_installstate(void) create_file("msitest\\lambda", 500); create_file("msitest\\mu", 500); - create_database(msifile, is_tables, sizeof(is_tables) / sizeof(msi_table)); + create_database(msifile, is_tables, ARRAY_SIZE(is_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -4588,11 +4588,11 @@ static void test_sourcepath(void) return; } - create_database(msifile, sp_tables, sizeof(sp_tables) / sizeof(msi_table)); + create_database(msifile, sp_tables, ARRAY_SIZE(sp_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); - for (i = 0; i < sizeof(spmap) / sizeof(spmap[0]); i++) + for (i = 0; i < ARRAY_SIZE(spmap); i++) { if (spmap[i].sost) { @@ -4675,7 +4675,7 @@ static void test_missingcomponent(void) create_file("msitest\\lithium", 500); create_file("beryllium", 500); - create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table)); + create_database(msifile, mcp_tables, ARRAY_SIZE(mcp_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -4728,7 +4728,7 @@ static void test_sourcedirprop(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\augustus", 500); - create_database(msifile, ca51_tables, sizeof(ca51_tables) / sizeof(msi_table)); + create_database(msifile, ca51_tables, ARRAY_SIZE(ca51_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -4788,8 +4788,7 @@ static void test_adminimage(void) create_file("msitest\\cabout\\new\\five.txt", 100); create_file("msitest\\filename", 100); - create_database_wordcount(msifile, ai_tables, - sizeof(ai_tables) / sizeof(msi_table), + create_database_wordcount(msifile, ai_tables, ARRAY_SIZE(ai_tables), 100, msidbSumInfoSourceTypeAdminImage, ";1033", "{004757CA-5092-49C2-AD20-28E1CE0DF5F2}"); @@ -4833,7 +4832,7 @@ static void test_propcase(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\augustus", 500); - create_database(msifile, pc_tables, sizeof(pc_tables) / sizeof(msi_table)); + create_database(msifile, pc_tables, ARRAY_SIZE(pc_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -4909,7 +4908,7 @@ static void test_int_widths( void ) r = MsiOpenDatabaseW(msidb, MSIDBOPEN_CREATE, &db); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); - for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) + for (i = 0; i < ARRAY_SIZE(tests); i++) { DWORD count; HANDLE handle = CreateFileW(msitable, GENERIC_WRITE, 0, NULL, @@ -4942,7 +4941,7 @@ static void test_shortcut(void) } create_test_files(); - create_database(msifile, sc_tables, sizeof(sc_tables) / sizeof(msi_table)); + create_database(msifile, sc_tables, ARRAY_SIZE(sc_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -4989,7 +4988,7 @@ static void test_preselected(void) } create_test_files(); - create_database(msifile, ps_tables, sizeof(ps_tables) / sizeof(msi_table)); + create_database(msifile, ps_tables, ARRAY_SIZE(ps_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5045,7 +5044,7 @@ static void test_installed_prop(void) } create_test_files(); - create_database(msifile, ip_tables, sizeof(ip_tables) / sizeof(msi_table)); + create_database(msifile, ip_tables, ARRAY_SIZE(ip_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5084,7 +5083,7 @@ static void test_allusers_prop(void) } create_test_files(); - create_database(msifile, aup_tables, sizeof(aup_tables) / sizeof(msi_table)); + create_database(msifile, aup_tables, ARRAY_SIZE(aup_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5105,7 +5104,7 @@ static void test_allusers_prop(void) delete_test_files(); create_test_files(); - create_database(msifile, aup2_tables, sizeof(aup2_tables) / sizeof(msi_table)); + create_database(msifile, aup2_tables, ARRAY_SIZE(aup2_tables)); /* ALLUSERS property set to 1 */ r = MsiInstallProductA(msifile, "FULL=1"); @@ -5119,7 +5118,7 @@ static void test_allusers_prop(void) delete_test_files(); create_test_files(); - create_database(msifile, aup3_tables, sizeof(aup3_tables) / sizeof(msi_table)); + create_database(msifile, aup3_tables, ARRAY_SIZE(aup3_tables)); /* ALLUSERS property set to 2 */ r = MsiInstallProductA(msifile, "FULL=1"); @@ -5133,7 +5132,7 @@ static void test_allusers_prop(void) delete_test_files(); create_test_files(); - create_database(msifile, aup4_tables, sizeof(aup4_tables) / sizeof(msi_table)); + create_database(msifile, aup4_tables, ARRAY_SIZE(aup4_tables)); /* ALLUSERS property set to 2, conditioned on ALLUSERS = 1 */ r = MsiInstallProductA(msifile, "FULL=1"); @@ -5248,7 +5247,7 @@ static void test_file_in_use(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\maximus", 500); - create_database(msifile, fiu_tables, sizeof(fiu_tables) / sizeof(msi_table)); + create_database(msifile, fiu_tables, ARRAY_SIZE(fiu_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5310,7 +5309,7 @@ static void test_file_in_use_cab(void) create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0"); DeleteFileA("maximus"); - create_database(msifile, fiuc_tables, sizeof(fiuc_tables) / sizeof(msi_table)); + create_database(msifile, fiuc_tables, ARRAY_SIZE(fiuc_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5368,7 +5367,7 @@ static void test_feature_override(void) create_file("msitest\\override.txt", 1000); create_file("msitest\\preselected.txt", 1000); create_file("msitest\\notpreselected.txt", 1000); - create_database(msifile, fo_tables, sizeof(fo_tables) / sizeof(msi_table)); + create_database(msifile, fo_tables, ARRAY_SIZE(fo_tables)); if (is_wow64) access |= KEY_WOW64_64KEY; @@ -5448,7 +5447,7 @@ static void test_icon_table(void) return; } - create_database(msifile, icon_base_tables, sizeof(icon_base_tables) / sizeof(msi_table)); + create_database(msifile, icon_base_tables, ARRAY_SIZE(icon_base_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5528,7 +5527,7 @@ static void test_package_validation(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\maximus", 500); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;1033"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "Intel;1033"); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5543,19 +5542,19 @@ static void test_package_validation(void) ok(delete_pf("msitest", FALSE), "directory does not exist\n"); DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel,9999;9999"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 200, "Intel,9999;9999"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_INSTALL_LANGUAGE_UNSUPPORTED, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r); DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel,1033;9999"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 200, "Intel,1033;9999"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_INSTALL_LANGUAGE_UNSUPPORTED, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r); DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel,9999;1033"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 200, "Intel,9999;1033"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); @@ -5563,25 +5562,25 @@ static void test_package_validation(void) ok(delete_pf("msitest", FALSE), "directory does not exist\n"); DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel64,9999;1033"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 200, "Intel64,9999;1033"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r); DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel32,1033;1033"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 200, "Intel32,1033;1033"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r); DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel32,9999;1033"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 200, "Intel32,9999;1033"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r); DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;9999"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "Intel;9999"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_INSTALL_LANGUAGE_UNSUPPORTED, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r); @@ -5591,14 +5590,14 @@ static void test_package_validation(void) if (GetSystemDefaultLangID() == MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US )) { DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;9"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "Intel;9"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n"); ok(delete_pf("msitest", FALSE), "directory does not exist\n"); DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;1024"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "Intel;1024"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n"); @@ -5606,7 +5605,7 @@ static void test_package_validation(void) } DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel32;0"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "Intel32;0"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r); @@ -5616,7 +5615,7 @@ static void test_package_validation(void) if (is_64bit && !is_wow64) { DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;0"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "Intel;0"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); @@ -5624,7 +5623,7 @@ static void test_package_validation(void) ok(delete_pf("msitest", FALSE), "directory does not exist\n"); DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "x64;0"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "x64;0"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_INSTALL_PACKAGE_INVALID, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r); @@ -5632,7 +5631,7 @@ static void test_package_validation(void) ok(!delete_pf("msitest", FALSE), "directory exists\n"); DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "x64;0"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 200, "x64;0"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); @@ -5642,7 +5641,7 @@ static void test_package_validation(void) else if (is_wow64) { DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;0"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "Intel;0"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); @@ -5650,7 +5649,7 @@ static void test_package_validation(void) ok(delete_pf("msitest", FALSE), "directory does not exist\n"); DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "x64;0"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "x64;0"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_INSTALL_PACKAGE_INVALID, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r); @@ -5658,7 +5657,7 @@ static void test_package_validation(void) ok(!delete_pf("msitest", FALSE), "directory exists\n"); DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "x64;0"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 200, "x64;0"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); @@ -5668,7 +5667,7 @@ static void test_package_validation(void) else { DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;0"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "Intel;0"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); @@ -5676,7 +5675,7 @@ static void test_package_validation(void) ok(delete_pf("msitest", FALSE), "directory does not exist\n"); DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Alpha,Beta,Intel;0"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "Alpha,Beta,Intel;0"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); @@ -5684,7 +5683,7 @@ static void test_package_validation(void) ok(delete_pf("msitest", FALSE), "directory does not exist\n"); DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "x64;0"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "x64;0"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r); @@ -5692,7 +5691,7 @@ static void test_package_validation(void) ok(!delete_pf("msitest", FALSE), "directory exists\n"); DeleteFileA(msifile); - create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "x64;0"); + create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 200, "x64;0"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r); @@ -5719,7 +5718,7 @@ static void test_upgrade_code(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\upgradecode.txt", 1000); - create_database(msifile, uc_tables, sizeof(uc_tables) / sizeof(msi_table)); + create_database(msifile, uc_tables, ARRAY_SIZE(uc_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5758,7 +5757,7 @@ static void test_mixed_package(void) return; } MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); - create_database_template(msifile, mixed_tables, sizeof(mixed_tables)/sizeof(msi_table), 200, "x64;1033"); + create_database_template(msifile, mixed_tables, ARRAY_SIZE(mixed_tables), 200, "x64;1033"); r = MsiInstallProductA(msifile, NULL); if (r == ERROR_INSTALL_PACKAGE_REJECTED) @@ -5826,7 +5825,7 @@ static void test_mixed_package(void) ok(res == ERROR_FILE_NOT_FOUND, "64-bit CLSID key not removed\n"); DeleteFileA( msifile ); - create_database_template(msifile, mixed_tables, sizeof(mixed_tables)/sizeof(msi_table), 200, "Intel;1033"); + create_database_template(msifile, mixed_tables, ARRAY_SIZE(mixed_tables), 200, "Intel;1033"); r = MsiInstallProductA(msifile, NULL); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); @@ -5903,7 +5902,7 @@ static void test_volume_props(void) } CreateDirectoryA("msitest", NULL); create_file("msitest\\volumeprop.txt", 1000); - create_database(msifile, vp_tables, sizeof(vp_tables)/sizeof(msi_table)); + create_database(msifile, vp_tables, ARRAY_SIZE(vp_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5929,9 +5928,9 @@ static void test_shared_component(void) } CreateDirectoryA("msitest", NULL); create_file("msitest\\sharedcomponent.txt", 1000); - create_database_wordcount(msifile, shc_tables, sizeof(shc_tables)/sizeof(shc_tables[0]), + create_database_wordcount(msifile, shc_tables, ARRAY_SIZE(shc_tables), 100, 0, ";", "{A8826420-FD72-4E61-9E15-C1944CF4CBE1}"); - create_database_wordcount(msifile2, shc2_tables, sizeof(shc2_tables)/sizeof(shc2_tables[0]), + create_database_wordcount(msifile2, shc2_tables, ARRAY_SIZE(shc2_tables), 100, 0, ";", "{A8B50B30-0E8A-4ACD-B3CF-1A5DC58B2739}"); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -5979,7 +5978,7 @@ static void test_remove_upgrade_code(void) if (is_wow64) access |= KEY_WOW64_64KEY; create_test_files(); - create_database( msifile, icon_base_tables, sizeof(icon_base_tables)/sizeof(icon_base_tables[0]) ); + create_database( msifile, icon_base_tables, ARRAY_SIZE( icon_base_tables )); MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL ); @@ -6024,7 +6023,7 @@ static void test_feature_tree(void) } create_file( "msitest\\featuretree.txt", 1000 ); - create_database( msifile, ft_tables, sizeof(ft_tables)/sizeof(ft_tables[0]) ); + create_database( msifile, ft_tables, ARRAY_SIZE( ft_tables )); MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL ); @@ -6063,7 +6062,7 @@ static void test_deferred_action(void) GetTempFileNameA(path, "da", 0, file); sprintf(buffer, "TESTPATH=\"%s\"", file); - create_database(msifile, da_tables, sizeof(da_tables) / sizeof(da_tables[0])); + create_database(msifile, da_tables, ARRAY_SIZE(da_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -6102,7 +6101,7 @@ static void test_wow64(void) } create_test_files(); - create_database_template(msifile, x64_tables, sizeof(x64_tables)/sizeof(msi_table), 200, "x64;0"); + create_database_template(msifile, x64_tables, ARRAY_SIZE(x64_tables), 200, "x64;0"); r = MsiInstallProductA(msifile, NULL); if (r == ERROR_INSTALL_PACKAGE_REJECTED) { @@ -6155,7 +6154,7 @@ static void test_source_resolution(void) } create_test_files(); - create_database(msifile, sr_tables, sizeof(sr_tables) / sizeof(msi_table)); + create_database(msifile, sr_tables, ARRAY_SIZE(sr_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); diff --git a/modules/rostests/winetests/msi/msi.c b/modules/rostests/winetests/msi/msi.c index d72264ea5e2..099ed1a3291 100644 --- a/modules/rostests/winetests/msi/msi.c +++ b/modules/rostests/winetests/msi/msi.c @@ -1094,7 +1094,7 @@ static void test_MsiGetFileHash(void) r = pMsiGetFileHashA(name, 0, NULL); ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); - for (i = 0; i < sizeof(hash_data) / sizeof(hash_data[0]); i++) + for (i = 0; i < ARRAY_SIZE(hash_data); i++) { int ret; @@ -3313,7 +3313,7 @@ static void test_MsiProvideComponent(void) create_test_files(); create_file("msitest\\sourcedir.txt", 1000); - create_database(msifile, sd_tables, sizeof(sd_tables) / sizeof(msi_table)); + create_database(msifile, sd_tables, ARRAY_SIZE(sd_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -13454,7 +13454,7 @@ static void test_MsiConfigureProductEx(void) create_file_data("msitest\\helium", "helium", 500); create_file_data("msitest\\lithium", "lithium", 500); - create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table)); + create_database(msifile, mcp_tables, ARRAY_SIZE(mcp_tables)); if (is_wow64) access |= KEY_WOW64_64KEY; @@ -13582,7 +13582,7 @@ static void test_MsiConfigureProductEx(void) ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n"); ok(!delete_pf("msitest", FALSE), "Directory not removed\n"); - create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table)); + create_database(msifile, mcp_tables, ARRAY_SIZE(mcp_tables)); /* install the product, machine */ r = MsiInstallProductA(msifile, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42"); @@ -13623,7 +13623,7 @@ static void test_MsiConfigureProductEx(void) ok(pf_exists("msitest"), "File not installed\n"); RegCloseKey(props); - create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table)); + create_database(msifile, mcp_tables, ARRAY_SIZE(mcp_tables)); /* LastUsedSource can be used as a last resort */ r = MsiConfigureProductExA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", @@ -13731,7 +13731,7 @@ static void test_MsiSetFeatureAttributes(void) skip("process is limited\n"); return; } - create_database( msifile, tables, sizeof(tables) / sizeof(tables[0]) ); + create_database( msifile, tables, ARRAY_SIZE( tables )); strcpy( path, CURR_DIR ); strcat( path, "\\" ); @@ -13813,7 +13813,7 @@ static void test_MsiGetFeatureInfo(void) skip("process is limited\n"); return; } - create_database( msifile, tables, sizeof(tables) / sizeof(tables[0]) ); + create_database( msifile, tables, ARRAY_SIZE( tables )); strcpy( path, CURR_DIR ); strcat( path, "\\" ); @@ -13997,9 +13997,9 @@ static void test_lastusedsource(void) create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0"); DeleteFileA("maximus"); - create_database("msifile0.msi", lus0_tables, sizeof(lus0_tables) / sizeof(msi_table)); - create_database("msifile1.msi", lus1_tables, sizeof(lus1_tables) / sizeof(msi_table)); - create_database("msifile2.msi", lus2_tables, sizeof(lus2_tables) / sizeof(msi_table)); + create_database("msifile0.msi", lus0_tables, ARRAY_SIZE(lus0_tables)); + create_database("msifile1.msi", lus1_tables, ARRAY_SIZE(lus1_tables)); + create_database("msifile2.msi", lus2_tables, ARRAY_SIZE(lus2_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); @@ -14119,7 +14119,7 @@ static void test_setpropertyfolder(void) CreateDirectoryA("msitest", NULL); create_file("msitest\\maximus", 500); - create_database(msifile, spf_tables, sizeof(spf_tables) / sizeof(msi_table)); + create_database(msifile, spf_tables, ARRAY_SIZE(spf_tables)); MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL); @@ -14162,7 +14162,7 @@ static void test_sourcedir_props(void) create_test_files(); create_file("msitest\\sourcedir.txt", 1000); - create_database(msifile, sd_tables, sizeof(sd_tables) / sizeof(msi_table)); + create_database(msifile, sd_tables, ARRAY_SIZE(sd_tables)); MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL); @@ -14229,11 +14229,11 @@ static void test_concurrentinstall(void) create_file("msitest\\maximus", 500); create_file("msitest\\msitest\\augustus", 500); - create_database(msifile, ci_tables, sizeof(ci_tables) / sizeof(msi_table)); + create_database(msifile, ci_tables, ARRAY_SIZE(ci_tables)); lstrcpyA(path, CURR_DIR); lstrcatA(path, "\\msitest\\concurrent.msi"); - create_database(path, ci2_tables, sizeof(ci2_tables) / sizeof(msi_table)); + create_database(path, ci2_tables, ARRAY_SIZE(ci2_tables)); MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL); @@ -14277,7 +14277,7 @@ static void test_command_line_parsing(void) } create_test_files(); - create_database(msifile, cl_tables, sizeof(cl_tables)/sizeof(msi_table)); + create_database(msifile, cl_tables, ARRAY_SIZE(cl_tables)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); diff --git a/modules/rostests/winetests/msi/package.c b/modules/rostests/winetests/msi/package.c index 09d2e0b61b8..88bd60a8f2e 100644 --- a/modules/rostests/winetests/msi/package.c +++ b/modules/rostests/winetests/msi/package.c @@ -187,7 +187,7 @@ static LSTATUS package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey, REGSAM acce dwMaxSubkeyLen++; dwMaxValueLen++; dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen); - if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR)) + if (dwMaxLen > ARRAY_SIZE(szNameBuf)) { /* Name too big: alloc a buffer for it */ if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR)))) diff --git a/modules/rostests/winetests/msi/patch.c b/modules/rostests/winetests/msi/patch.c index a09084002e0..b5779824430 100644 --- a/modules/rostests/winetests/msi/patch.c +++ b/modules/rostests/winetests/msi/patch.c @@ -731,7 +731,7 @@ static void test_simple_patch( void ) CreateDirectoryA( "msitest", NULL ); create_file( "msitest\\patch.txt", 1000 ); - create_database( msifile, tables, sizeof(tables) / sizeof(struct msi_table) ); + create_database( msifile, tables, ARRAY_SIZE(tables) ); create_patch( mspfile ); MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL ); @@ -929,7 +929,7 @@ static void test_MsiOpenDatabase( void ) MsiCloseHandle( hdb ); DeleteFileA( mspfile ); - create_database( msifile, tables, sizeof(tables) / sizeof(struct msi_table) ); + create_database( msifile, tables, ARRAY_SIZE(tables) ); create_patch( mspfile ); r = MsiOpenDatabaseW( msifileW, MSIDBOPEN_READONLY + MSIDBOPEN_PATCHFILE, &hdb ); @@ -1072,7 +1072,7 @@ static void test_system_tables( void ) CreateDirectoryA( "msitest", NULL ); create_file( "msitest\\patch.txt", 1000 ); - create_database( msifile, tables, sizeof(tables) / sizeof(struct msi_table) ); + create_database( msifile, tables, ARRAY_SIZE(tables) ); create_patch( mspfile ); MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL ); @@ -1261,7 +1261,7 @@ static void test_patch_registration( void ) CreateDirectoryA( "msitest", NULL ); create_file( "msitest\\patch.txt", 1000 ); - create_database( msifile, tables, sizeof(tables) / sizeof(struct msi_table) ); + create_database( msifile, tables, ARRAY_SIZE(tables) ); create_patch( mspfile ); MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL ); diff --git a/modules/rostests/winetests/msi/record.c b/modules/rostests/winetests/msi/record.c index 777f1f78ed0..d0ad15b8fef 100644 --- a/modules/rostests/winetests/msi/record.c +++ b/modules/rostests/winetests/msi/record.c @@ -138,7 +138,7 @@ static void test_msirecord(void) ok(buf[0] == 0, "MsiRecordGetStringA returned the wrong string\n"); ok(sz == 0, "MsiRecordGetStringA returned the wrong length\n"); bufW[0] = 0; - sz = sizeof bufW / sizeof bufW[0]; + sz = ARRAY_SIZE(bufW); r = MsiRecordGetStringW(h, 0, bufW, &sz); ok(r == ERROR_SUCCESS, "Failed to get string at 0\n"); ok(bufW[0] == 0, "MsiRecordGetStringW returned the wrong string\n"); @@ -156,7 +156,7 @@ static void test_msirecord(void) ok(buf[0] == 0, "MsiRecordGetStringA returned the wrong string\n"); ok(sz == 0, "MsiRecordGetStringA returned the wrong length\n"); bufW[0] = 0; - sz = sizeof bufW / sizeof bufW[0]; + sz = ARRAY_SIZE(bufW); r = MsiRecordGetStringW(h, 0, bufW, &sz); ok(r == ERROR_SUCCESS, "Failed to get string at 0\n"); ok(bufW[0] == 0, "MsiRecordGetStringW returned the wrong string\n");
2 years, 9 months
1
0
0
0
[reactos] 107/360: [WINESYNC] msi/tests: Avoid ARRAY_SIZE-like macros.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=42961bd8b08fbad89e845…
commit 42961bd8b08fbad89e8456a3d38f72cfbaf2109b Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:34:08 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:54 2022 +0100 [WINESYNC] msi/tests: Avoid ARRAY_SIZE-like macros. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 74b0dec3c1be0e16c7c2d487e0780a150d15e75c by Michael Stefaniuc <mstefani(a)winehq.org> --- modules/rostests/winetests/msi/db.c | 4 +--- modules/rostests/winetests/msi/install.c | 4 +--- modules/rostests/winetests/msi/patch.c | 12 +++--------- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/modules/rostests/winetests/msi/db.c b/modules/rostests/winetests/msi/db.c index 477ab0ad399..ff54a95ab11 100644 --- a/modules/rostests/winetests/msi/db.c +++ b/modules/rostests/winetests/msi/db.c @@ -3033,8 +3033,6 @@ static const struct { { name9, data9, sizeof data9 }, }; -#define NUM_TRANSFORM_TABLES (sizeof table_transform_data/sizeof table_transform_data[0]) - static void generate_transform_manual(void) { IStorage *stg = NULL; @@ -3056,7 +3054,7 @@ static void generate_transform_manual(void) r = IStorage_SetClass( stg, &CLSID_MsiTransform ); ok(r == S_OK, "failed to set storage type\n"); - for (i=0; i<NUM_TRANSFORM_TABLES; i++) + for (i=0; i<ARRAY_SIZE(table_transform_data); i++) { r = IStorage_CreateStream( stg, table_transform_data[i].name, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm ); diff --git a/modules/rostests/winetests/msi/install.c b/modules/rostests/winetests/msi/install.c index 3eb6c804221..951f0e72221 100644 --- a/modules/rostests/winetests/msi/install.c +++ b/modules/rostests/winetests/msi/install.c @@ -3671,8 +3671,6 @@ static const struct { { name3, data3, sizeof data3 }, }; -#define NUM_TRANSFORM_TABLES (sizeof table_transform_data/sizeof table_transform_data[0]) - static void generate_transform_manual(void) { IStorage *stg = NULL; @@ -3694,7 +3692,7 @@ static void generate_transform_manual(void) r = IStorage_SetClass(stg, &CLSID_MsiTransform); ok(r == S_OK, "failed to set storage type\n"); - for (i=0; i<NUM_TRANSFORM_TABLES; i++) + for (i=0; i<ARRAY_SIZE(table_transform_data); i++) { r = IStorage_CreateStream(stg, table_transform_data[i].name, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm); diff --git a/modules/rostests/winetests/msi/patch.c b/modules/rostests/winetests/msi/patch.c index b6e990b461e..a09084002e0 100644 --- a/modules/rostests/winetests/msi/patch.c +++ b/modules/rostests/winetests/msi/patch.c @@ -446,8 +446,6 @@ static const struct table_data table_patch_data[] = { { p_name6, p_data6, sizeof p_data6 } }; -#define NUM_PATCH_TABLES (sizeof table_patch_data/sizeof table_patch_data[0]) - static const WCHAR t1_name0[] = { 0x4840, 0x430f, 0x422f, 0 }; /* File */ static const WCHAR t1_name1[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 }; /* _StringData */ static const WCHAR t1_name2[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 }; /* _StringPool */ @@ -519,8 +517,6 @@ static const struct table_data table_transform1_data[] = { { t1_name3, t1_data3, sizeof t1_data3 } }; -#define NUM_TRANSFORM1_TABLES (sizeof table_transform1_data/sizeof table_transform1_data[0]) - static const WCHAR t2_name0[] = { 0x4840, 0x430f, 0x422f, 0 }; /* File */ static const WCHAR t2_name1[] = { 0x4840, 0x4216, 0x4327, 0x4824, 0 }; /* Media */ static const WCHAR t2_name2[] = { 0x4840, 0x3b3f, 0x43f2, 0x4438, 0x45b1, 0 }; /* _Columns */ @@ -644,8 +640,6 @@ static const struct table_data table_transform2_data[] = { { t2_name9, t2_data9, sizeof t2_data9 } }; -#define NUM_TRANSFORM2_TABLES (sizeof table_transform2_data/sizeof table_transform2_data[0]) - static void write_tables( IStorage *stg, const struct table_data *tables, UINT num_tables ) { IStream *stm; @@ -692,7 +686,7 @@ static void create_patch( const char *filename ) r = IStorage_SetClass( stg, &CLSID_MsiPatch ); ok( r == S_OK, "failed to set storage type 0x%08x\n", r ); - write_tables( stg, table_patch_data, NUM_PATCH_TABLES ); + write_tables( stg, table_patch_data, ARRAY_SIZE( table_patch_data )); r = IStorage_CreateStorage( stg, p_name7, mode, 0, 0, &stg1 ); ok( r == S_OK, "failed to create substorage 0x%08x\n", r ); @@ -700,7 +694,7 @@ static void create_patch( const char *filename ) r = IStorage_SetClass( stg1, &CLSID_MsiTransform ); ok( r == S_OK, "failed to set storage type 0x%08x\n", r ); - write_tables( stg1, table_transform1_data, NUM_TRANSFORM1_TABLES ); + write_tables( stg1, table_transform1_data, ARRAY_SIZE( table_transform1_data )); IStorage_Release( stg1 ); r = IStorage_CreateStorage( stg, p_name8, mode, 0, 0, &stg2 ); @@ -709,7 +703,7 @@ static void create_patch( const char *filename ) r = IStorage_SetClass( stg2, &CLSID_MsiTransform ); ok( r == S_OK, "failed to set storage type 0x%08x\n", r ); - write_tables( stg2, table_transform2_data, NUM_TRANSFORM2_TABLES ); + write_tables( stg2, table_transform2_data, ARRAY_SIZE( table_transform2_data )); IStorage_Release( stg2 ); IStorage_Release( stg ); }
2 years, 9 months
1
0
0
0
[reactos] 106/360: [WINESYNC] msi: Store the current script in the package.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0d762dcba31c9dce9fc03…
commit 0d762dcba31c9dce9fc035e93b411248f3de80be Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:34:06 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:54 2022 +0100 [WINESYNC] msi: Store the current script in the package. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 756bbb5bb756d1fcbeea41e10a6fdf2149fa1323 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/action.c | 25 +++++++++++++++---------- dll/win32/msi/custom.c | 4 ++-- dll/win32/msi/dialog.c | 2 +- dll/win32/msi/install.c | 2 +- dll/win32/msi/msi.c | 6 +++--- dll/win32/msi/msipriv.h | 5 +++-- dll/win32/msi/package.c | 1 + 7 files changed, 26 insertions(+), 19 deletions(-) diff --git a/dll/win32/msi/action.c b/dll/win32/msi/action.c index e5633821af0..bca9dbfd66d 100644 --- a/dll/win32/msi/action.c +++ b/dll/win32/msi/action.c @@ -517,7 +517,7 @@ static UINT ITERATE_Actions(MSIRECORD *row, LPVOID param) return ERROR_SUCCESS; } - rc = ACTION_PerformAction(package, action, SCRIPT_NONE); + rc = ACTION_PerformAction(package, action); msi_dialog_check_messages( NULL ); @@ -611,7 +611,7 @@ static UINT ACTION_ProcessUISequence(MSIPACKAGE *package) /******************************************************** * ACTION helper functions and functions that perform the actions *******************************************************/ -static UINT ACTION_HandleCustomAction(MSIPACKAGE *package, LPCWSTR action, UINT script) +static UINT ACTION_HandleCustomAction(MSIPACKAGE *package, LPCWSTR action) { UINT arc; INT uirc; @@ -620,7 +620,7 @@ static UINT ACTION_HandleCustomAction(MSIPACKAGE *package, LPCWSTR action, UINT if (uirc == IDCANCEL) return ERROR_INSTALL_USEREXIT; ui_actioninfo(package, action, TRUE, 0); - arc = ACTION_CustomAction( package, action, script ); + arc = ACTION_CustomAction(package, action); uirc = !arc; if (arc == ERROR_FUNCTION_NOT_CALLED && needs_ui_sequence(package)) @@ -1553,11 +1553,13 @@ static UINT execute_script( MSIPACKAGE *package, UINT script ) TRACE("executing script %u\n", script); + package->script = script; + if (script == SCRIPT_ROLLBACK) { for (i = package->script_actions_count[script]; i > 0; i--) { - rc = ACTION_PerformAction(package, package->script_actions[script][i-1], script); + rc = ACTION_PerformAction(package, package->script_actions[script][i-1]); if (rc != ERROR_SUCCESS) { ERR("Execution of script %i halted; action %s returned %u\n", @@ -1570,7 +1572,7 @@ static UINT execute_script( MSIPACKAGE *package, UINT script ) { for (i = 0; i < package->script_actions_count[script]; i++) { - rc = ACTION_PerformAction(package, package->script_actions[script][i], script); + rc = ACTION_PerformAction(package, package->script_actions[script][i]); if (rc != ERROR_SUCCESS) { ERR("Execution of script %i halted; action %s returned %u\n", @@ -1579,6 +1581,9 @@ static UINT execute_script( MSIPACKAGE *package, UINT script ) } } } + + package->script = SCRIPT_NONE; + msi_free_action_script(package, script); return rc; } @@ -5686,7 +5691,7 @@ static UINT ACTION_ExecuteAction(MSIPACKAGE *package) msiobj_release(&uirow->hdr); } else - rc = ACTION_PerformAction(package, action, SCRIPT_NONE); + rc = ACTION_PerformAction(package, action); /* Send all set properties. */ if (!MSI_OpenQuery(package->db, &view, prop_query)) @@ -7937,7 +7942,7 @@ static UINT ACTION_HandleStandardAction(MSIPACKAGE *package, LPCWSTR action) return rc; } -UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script) +UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action) { UINT rc; @@ -7947,7 +7952,7 @@ UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script) rc = ACTION_HandleStandardAction(package, action); if (rc == ERROR_FUNCTION_NOT_CALLED) - rc = ACTION_HandleCustomAction(package, action, script); + rc = ACTION_HandleCustomAction(package, action); if (rc == ERROR_FUNCTION_NOT_CALLED) WARN("unhandled msi action %s\n", debugstr_w(action)); @@ -8000,7 +8005,7 @@ static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq) return ERROR_FUNCTION_FAILED; } - rc = ACTION_PerformAction(package, action, SCRIPT_NONE); + rc = ACTION_PerformAction(package, action); msiobj_release(&row->hdr); } @@ -8128,7 +8133,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath, msi_set_property( package->db, szRollbackDisabled, szOne, -1 ); } - rc = ACTION_PerformAction(package, action, SCRIPT_NONE); + rc = ACTION_PerformAction(package, action); /* process the ending type action */ if (rc == ERROR_SUCCESS) diff --git a/dll/win32/msi/custom.c b/dll/win32/msi/custom.c index 3e96aee62c0..6ffc27aa4ba 100644 --- a/dll/win32/msi/custom.c +++ b/dll/win32/msi/custom.c @@ -1209,7 +1209,7 @@ static UINT defer_custom_action( MSIPACKAGE *package, const WCHAR *action, UINT return ERROR_SUCCESS; } -UINT ACTION_CustomAction( MSIPACKAGE *package, LPCWSTR action, UINT script ) +UINT ACTION_CustomAction(MSIPACKAGE *package, const WCHAR *action) { static const WCHAR query[] = { 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', @@ -1249,7 +1249,7 @@ UINT ACTION_CustomAction( MSIPACKAGE *package, LPCWSTR action, UINT script ) if (type & msidbCustomActionTypeNoImpersonate) WARN("msidbCustomActionTypeNoImpersonate not handled\n"); - if (!action_type_matches_script( type, script )) + if (!action_type_matches_script(type, package->script)) { rc = defer_custom_action( package, action, type ); goto end; diff --git a/dll/win32/msi/dialog.c b/dll/win32/msi/dialog.c index 32414f1c65b..3f2ddc36d6f 100644 --- a/dll/win32/msi/dialog.c +++ b/dll/win32/msi/dialog.c @@ -4380,7 +4380,7 @@ static UINT event_spawn_wait_dialog( msi_dialog *dialog, const WCHAR *argument ) static UINT event_do_action( msi_dialog *dialog, const WCHAR *argument ) { - ACTION_PerformAction( dialog->package, argument, SCRIPT_NONE ); + ACTION_PerformAction(dialog->package, argument); return ERROR_SUCCESS; } diff --git a/dll/win32/msi/install.c b/dll/win32/msi/install.c index 80e535304ff..5a149d74599 100644 --- a/dll/win32/msi/install.c +++ b/dll/win32/msi/install.c @@ -83,7 +83,7 @@ UINT WINAPI MsiDoActionW( MSIHANDLE hInstall, LPCWSTR szAction ) return remote_DoAction(remote, szAction); } - ret = ACTION_PerformAction( package, szAction, SCRIPT_NONE ); + ret = ACTION_PerformAction(package, szAction); msiobj_release( &package->hdr ); return ret; diff --git a/dll/win32/msi/msi.c b/dll/win32/msi/msi.c index b53c2241e43..734246930ce 100644 --- a/dll/win32/msi/msi.c +++ b/dll/win32/msi/msi.c @@ -3742,7 +3742,7 @@ UINT WINAPI MsiCollectUserInfoW(LPCWSTR szProduct) if (!package) return ERROR_CALL_NOT_IMPLEMENTED; - rc = ACTION_PerformAction(package, szFirstRun, SCRIPT_NONE); + rc = ACTION_PerformAction(package, szFirstRun); msiobj_release( &package->hdr ); MsiCloseHandle(handle); @@ -3768,7 +3768,7 @@ UINT WINAPI MsiCollectUserInfoA(LPCSTR szProduct) if (!package) return ERROR_CALL_NOT_IMPLEMENTED; - rc = ACTION_PerformAction(package, szFirstRun, SCRIPT_NONE); + rc = ACTION_PerformAction(package, szFirstRun); msiobj_release( &package->hdr ); MsiCloseHandle(handle); @@ -3849,7 +3849,7 @@ UINT WINAPI MsiConfigureFeatureW(LPCWSTR szProduct, LPCWSTR szFeature, INSTALLST MsiSetInternalUI( INSTALLUILEVEL_BASIC, NULL ); - r = ACTION_PerformAction( package, szCostInitialize, SCRIPT_NONE ); + r = ACTION_PerformAction(package, szCostInitialize); if (r != ERROR_SUCCESS) goto end; diff --git a/dll/win32/msi/msipriv.h b/dll/win32/msi/msipriv.h index 95f46d070a6..1f1ebeae680 100644 --- a/dll/win32/msi/msipriv.h +++ b/dll/win32/msi/msipriv.h @@ -414,6 +414,7 @@ typedef struct tagMSIPACKAGE struct list mimes; struct list appids; + enum script script; LPWSTR *script_actions[SCRIPT_MAX]; int script_actions_count[SCRIPT_MAX]; LPWSTR *unique_actions; @@ -976,9 +977,9 @@ extern WCHAR *gszLogFile DECLSPEC_HIDDEN; extern HINSTANCE msi_hInstance DECLSPEC_HIDDEN; /* action related functions */ -extern UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script) DECLSPEC_HIDDEN; +extern UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action) DECLSPEC_HIDDEN; extern void ACTION_FinishCustomActions( const MSIPACKAGE* package) DECLSPEC_HIDDEN; -extern UINT ACTION_CustomAction(MSIPACKAGE *, const WCHAR *, UINT) DECLSPEC_HIDDEN; +extern UINT ACTION_CustomAction(MSIPACKAGE *package, const WCHAR *action) DECLSPEC_HIDDEN; /* actions in other modules */ extern UINT ACTION_AppSearch(MSIPACKAGE *package) DECLSPEC_HIDDEN; diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index b42158c6c02..858f835e2bb 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -1119,6 +1119,7 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db ) msi_load_admin_properties( package ); package->log_file = INVALID_HANDLE_VALUE; + package->script = SCRIPT_NONE; } return package; }
2 years, 9 months
1
0
0
0
[reactos] 105/360: [WINESYNC] msi: Resolve source when executing InstallFiles.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=19863c800244ca9ca4939…
commit 19863c800244ca9ca4939395ff63b2da51b35425 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:34:05 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:54 2022 +0100 [WINESYNC] msi: Resolve source when executing InstallFiles. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 536a86f21ff0f8432309225b61695138be95cb3a by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/files.c | 2 ++ modules/rostests/winetests/msi/install.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/dll/win32/msi/files.c b/dll/win32/msi/files.c index adffcafb587..f6cf3e7a8cc 100644 --- a/dll/win32/msi/files.c +++ b/dll/win32/msi/files.c @@ -357,6 +357,8 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package) UINT rc = ERROR_SUCCESS; MSIFILE *file; + msi_set_sourcedir_props(package, FALSE); + schedule_install_files(package); mi = msi_alloc_zero( sizeof(MSIMEDIAINFO) ); diff --git a/modules/rostests/winetests/msi/install.c b/modules/rostests/winetests/msi/install.c index af37d93c425..3eb6c804221 100644 --- a/modules/rostests/winetests/msi/install.c +++ b/modules/rostests/winetests/msi/install.c @@ -1328,6 +1328,7 @@ static const CHAR sr_install_exec_seq_dat[] = "sourcedir_unset\tSourceDir\t700\n" "ResolveSource\tRESOLVE_SOURCE\t800\n" "ProcessComponents\tPROCESS_COMPONENTS\t800\n" + "InstallFiles\tINSTALL_FILES\t800\n" "sourcedir_set\tNOT SourceDir\t900\n" "InstallFinalize\t\t1000\n"; @@ -6166,6 +6167,10 @@ static void test_source_resolution(void) r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1"); ok(r == ERROR_SUCCESS, "got %u\n", r); + r = MsiInstallProductA(msifile, "INSTALL_FILES=1"); + ok(r == ERROR_SUCCESS, "got %u\n", r); + + delete_pf_files(); delete_test_files(); DeleteFileA(msifile); }
2 years, 9 months
1
0
0
0
[reactos] 104/360: [WINESYNC] msi/tests: Test that some actions cause resolution of SourceDir.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=88888f8f4f302018c053b…
commit 88888f8f4f302018c053b4228db79d367fa3836c Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:34:05 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:53 2022 +0100 [WINESYNC] msi/tests: Test that some actions cause resolution of SourceDir. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 38747c32347afc4d8be18a577fe91f8325a68340 by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/install.c | 62 ++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/modules/rostests/winetests/msi/install.c b/modules/rostests/winetests/msi/install.c index a4726d631cf..af37d93c425 100644 --- a/modules/rostests/winetests/msi/install.c +++ b/modules/rostests/winetests/msi/install.c @@ -1316,6 +1316,28 @@ static const CHAR x64_directory_dat[] = "ProgramFiles64Folder\tTARGETDIR\t.\n" "TARGETDIR\t\tSourceDir"; +static const CHAR sr_install_exec_seq_dat[] = + "Action\tCondition\tSequence\n" + "s72\tS255\tI2\n" + "InstallExecuteSequence\tAction\n" + "CostInitialize\t\t200\n" + "FileCost\t\t300\n" + "CostFinalize\t\t400\n" + "InstallValidate\t\t500\n" + "InstallInitialize\t\t600\n" + "sourcedir_unset\tSourceDir\t700\n" + "ResolveSource\tRESOLVE_SOURCE\t800\n" + "ProcessComponents\tPROCESS_COMPONENTS\t800\n" + "sourcedir_set\tNOT SourceDir\t900\n" + "InstallFinalize\t\t1000\n"; + +static const CHAR sr_custom_action_dat[] = + "Action\tType\tSource\tTarget\n" + "s72\ti2\tS64\tS0\n" + "CustomAction\tAction\n" + "sourcedir_unset\t19\t\tSourceDir should not be set\n" + "sourcedir_set\t19\t\tSourceDir should be set\n"; + static const msi_table tables[] = { ADD_TABLE(component), @@ -1984,6 +2006,19 @@ static const msi_table x64_tables[] = ADD_TABLE(install_exec_seq), }; +static const msi_table sr_tables[] = +{ + ADD_TABLE(media), + ADD_TABLE(directory), + ADD_TABLE(file), + ADD_TABLE(component), + ADD_TABLE(feature), + ADD_TABLE(feature_comp), + ADD_TABLE(property), + ADD_TABLE(sr_install_exec_seq), + ADD_TABLE(sr_custom_action), +}; + /* cabinet definitions */ /* make the max size large so there is only one cab file */ @@ -6109,6 +6144,32 @@ error: DeleteFileA(msifile); } +/* Test what actions cause resolution of SourceDir when executed. */ +static void test_source_resolution(void) +{ + UINT r; + + if (is_process_limited()) + { + skip( "process is limited\n" ); + return; + } + + create_test_files(); + create_database(msifile, sr_tables, sizeof(sr_tables) / sizeof(msi_table)); + + MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); + + r = MsiInstallProductA(msifile, "RESOLVE_SOURCE=1"); + ok(r == ERROR_SUCCESS, "got %u\n", r); + + r = MsiInstallProductA(msifile, "PROCESS_COMPONENTS=1"); + ok(r == ERROR_SUCCESS, "got %u\n", r); + + delete_test_files(); + DeleteFileA(msifile); +} + START_TEST(install) { DWORD len; @@ -6200,6 +6261,7 @@ START_TEST(install) test_feature_tree(); test_deferred_action(); test_wow64(); + test_source_resolution(); DeleteFileA(customdll);
2 years, 9 months
1
0
0
0
[reactos] 103/360: [WINESYNC] msi/tests: Test deferral of WriteRegistryValues.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a2e86899fd72869e25a1a…
commit a2e86899fd72869e25a1ae3c361dbdc1414d2c46 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:34:04 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:53 2022 +0100 [WINESYNC] msi/tests: Test deferral of WriteRegistryValues. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id ed2861c28cdfd2bb97abb7d376f9aa2d975ea97d by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/action.c | 14 ++++++++++++++ modules/rostests/winetests/msi/custom.c | 28 ++++++++++++++++++++++++++++ modules/rostests/winetests/msi/custom.spec | 2 ++ 3 files changed, 44 insertions(+) diff --git a/modules/rostests/winetests/msi/action.c b/modules/rostests/winetests/msi/action.c index b7a7dde33ba..61a998663ba 100644 --- a/modules/rostests/winetests/msi/action.c +++ b/modules/rostests/winetests/msi/action.c @@ -698,12 +698,25 @@ static const char wrv_install_exec_seq_dat[] = "InstallInitialize\t\t1500\n" "ProcessComponents\t\t1600\n" "RemoveRegistryValues\t\t4900\n" + "rrv_immediate\tREMOVE\t4901\n" + "rrv_deferred\tREMOVE\t4902\n" "WriteRegistryValues\t\t5000\n" + "wrv_immediate\tNOT REMOVE\t5001\n" + "wrv_deferred\tNOT REMOVE\t5002\n" "RegisterProduct\t\t6100\n" "PublishFeatures\t\t6200\n" "PublishProduct\t\t6300\n" "InstallFinalize\t\t6600\n"; +static const char wrv_custom_action_dat[] = + "Action\tType\tSource\tTarget\n" + "s72\ti2\tS64\tS0\n" + "CustomAction\tAction\n" + "wrv_immediate\t1\tcustom.dll\twrv_absent\n" + "wrv_deferred\t1025\tcustom.dll\twrv_present\n" + "rrv_immediate\t1\tcustom.dll\twrv_present\n" + "rrv_deferred\t1025\tcustom.dll\twrv_absent\n"; + static const char cf_directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\n" "s72\tS72\tl255\n" @@ -2028,6 +2041,7 @@ static const msi_table wrv_tables[] = ADD_TABLE(wrv_feature), ADD_TABLE(wrv_feature_comp), ADD_TABLE(wrv_install_exec_seq), + ADD_TABLE(wrv_custom_action), ADD_TABLE(property), ADD_TABLE(media), ADD_TABLE(wrv_registry), diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 3e742e381bc..4d45c9e448f 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -1922,3 +1922,31 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) return ERROR_SUCCESS; } + +UINT WINAPI wrv_present(MSIHANDLE hinst) +{ + HKEY key; + LONG res; + + res = RegOpenKeyA(HKEY_CURRENT_USER, "msitest", &key); + ok(hinst, !res, "got %u\n", res); + todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) + check_reg_str(hinst, key, "sz", "string"); + RegCloseKey(key); + + return ERROR_SUCCESS; +} + +UINT WINAPI wrv_absent(MSIHANDLE hinst) +{ + HKEY key; + LONG res; + + res = RegOpenKeyA(HKEY_CURRENT_USER, "msitest", &key); + ok(hinst, !res, "got %u\n", res); + todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED)) + check_reg_str(hinst, key, "sz", NULL); + RegCloseKey(key); + + return ERROR_SUCCESS; +} diff --git a/modules/rostests/winetests/msi/custom.spec b/modules/rostests/winetests/msi/custom.spec index bfd83928e44..b94f6cce703 100644 --- a/modules/rostests/winetests/msi/custom.spec +++ b/modules/rostests/winetests/msi/custom.spec @@ -53,3 +53,5 @@ @ stdcall sss_stopped(long) @ stdcall tl_present(long) @ stdcall tl_absent(long) +@ stdcall wrv_present(long) +@ stdcall wrv_absent(long)
2 years, 9 months
1
0
0
0
[reactos] 102/360: [WINESYNC] msi/tests: Simplify and clarify WriteRegistryValues and RemoveRegistryValues tests.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=158d7545ab98375e15992…
commit 158d7545ab98375e15992e1ea19b85e85b13a625 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sat Mar 12 16:34:04 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:27:53 2022 +0100 [WINESYNC] msi/tests: Simplify and clarify WriteRegistryValues and RemoveRegistryValues tests. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 3c2b229431805ff771f4c20be52d1a9d7ff0ced3 by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/action.c | 612 ++++++++++---------------------- 1 file changed, 181 insertions(+), 431 deletions(-) diff --git a/modules/rostests/winetests/msi/action.c b/modules/rostests/winetests/msi/action.c index 35f851f21e7..b7a7dde33ba 100644 --- a/modules/rostests/winetests/msi/action.c +++ b/modules/rostests/winetests/msi/action.c @@ -186,7 +186,7 @@ static const char property_dat[] = "SERVDISP\tTestServiceDisp\n" "SERVDISP2\tTestServiceDisp2\n" "MSIFASTINSTALL\t1\n" - "regdata15\t#x01\n"; + "regdata17\t#1\n"; static const char env_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" @@ -637,8 +637,8 @@ static const char wrv_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" "s72\tS38\ts72\ti2\tS255\tS72\n" "Component\tComponent\n" - "augustus\t\tMSITESTDIR\t0\t\taugustus\n" - "caesar\t\tMSITESTDIR\t1\t\t\n"; + "augustus\t{bafe0297-cbcc-4e08-8a78-7e9b83456eef}\tMSITESTDIR\t0\t\t\n" + "caesar\t{bafe0298-cbcc-4e08-8a78-7e9b83456eef}\tMSITESTDIR\t1\t\t\n"; static const char wrv_feature_dat[] = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n" @@ -658,23 +658,51 @@ static const char wrv_registry_dat[] = "Registry\tRoot\tKey\tName\tValue\tComponent_\n" "s72\ti2\tl255\tL255\tL0\ts72\n" "Registry\tRegistry\n" - "regdata\t2\tSOFTWARE\\Wine\\msitest\tValue\t[~]one[~]two[~]three\taugustus\n" - "regdata1\t2\tSOFTWARE\\Wine\\msitest\t*\t\taugustus\n" - "regdata2\t2\tSOFTWARE\\Wine\\msitest\t*\t#%\taugustus\n" - "regdata3\t2\tSOFTWARE\\Wine\\msitest\t*\t#x\taugustus\n" - "regdata4\t2\tSOFTWARE\\Wine\\msitest\\VisualStudio\\10.0\\AD7Metrics\\Exception\\{049EC4CC-30D2-4032-9256-EE18EB41B62B}\\Common Language Runtime Exceptions\\System.Workflow.ComponentModel.Serialization\\System.Workflow.ComponentModel.Serialization.WorkflowMarkupSerializationException\tlong\tkey\taugustus\n" - "regdata5\t2\tSOFTWARE\\Wine\\msitest\tValue1\t[~]one[~]\taugustus\n" - "regdata6\t2\tSOFTWARE\\Wine\\msitest\tValue2\t[~]two\taugustus\n" - "regdata7\t2\tSOFTWARE\\Wine\\msitest\tValue3\tone[~]\taugustus\n" - "regdata8\t2\tSOFTWARE\\Wine\\msitest\tValue4\tone[~]two\taugustus\n" - "regdata9\t2\tSOFTWARE\\Wine\\msitest\tValue5\t[~]one[~]two[~]three\taugustus\n" - "regdata10\t2\tSOFTWARE\\Wine\\msitest\tValue6\t[~]\taugustus\n" - "regdata11\t2\tSOFTWARE\\Wine\\msitest\tValue7\t[~]two\taugustus\n" - "regdata12\t2\tSOFTWARE\\Wine\\msitest\tValue8\t#1\taugustus\n" - "regdata13\t2\tSOFTWARE\\Wine\\msitest\tValue9\t#x1\taugustus\n" - "regdata14\t2\tSOFTWARE\\Wine\\msitest\tValue10\t#x01\taugustus\n" - "regdata15\t2\tSOFTWARE\\Wine\\msitest\tValue11\t[regdata15]\taugustus\n" - "regdata16\t2\tSOFTWARE\\Wine\\msitest\tValue12\t#1\tcaesar\n"; + "regdata0\t1\tmsitest\tsz\tstring\taugustus\n" + "regdata1\t1\tmsitest\tmultisz\tone[~]two[~]three\taugustus\n" + "regdata2\t1\tmsitest\texpandsz\t#%string\taugustus\n" + "regdata3\t1\tmsitest\tdword\t#123\taugustus\n" + "regdata4\t1\tmsitest\tbinary\t#x01234567\taugustus\n" + "regdata5\t1\tmsitest\t\tdefault\taugustus\n" + "regdata6\t1\tmsitest\\subkey\t*\t\taugustus\n" + "regdata7\t1\tmsitest\\subkey\t*\t#%\taugustus\n" + "regdata8\t1\tmsitest\\subkey\t*\t#x\taugustus\n" + "regdata9\t1\tmsitest\\VisualStudio\\10.0\\AD7Metrics\\Exception\\{049EC4CC-30D2-4032-9256-EE18EB41B62B}\\Common Language Runtime Exceptions\\System.Workflow.ComponentModel.Serialization\\System.Workflow.ComponentModel.Serialization.WorkflowMarkupSerializationException\tlong\tkey\taugustus\n" + "regdata10\t1\tmsitest\tValue1\t[~]one[~]\taugustus\n" + "regdata11\t1\tmsitest\tValue2\t[~]two\taugustus\n" + "regdata12\t1\tmsitest\tValue3\tone[~]\taugustus\n" + "regdata13\t1\tmsitest\tValue4\tone[~]two\taugustus\n" + "regdata14\t1\tmsitest\tValue5\t[~]one[~]two[~]three\taugustus\n" + "regdata15\t1\tmsitest\tValue6\t[~]\taugustus\n" + "regdata16\t1\tmsitest\tValue7\t[~]two\taugustus\n" + "regdata17\t1\tmsitest\tformat\t[regdata17]\taugustus\n" + "regdata18\t1\tmsitest\tsource\t#1\tcaesar\n" + "regdata19\t1\tmsitest\\create\t+\t\taugustus\n" + "regdata20\t1\tmsitest\\delete\t-\t\taugustus\n"; + +static const char wrv_remove_registry_dat[] = + "RemoveRegistry\tRoot\tKey\tName\tComponent_\n" + "s72\ti2\tl255\tL255\ts72\n" + "RemoveRegistry\tRemoveRegistry\n" + "regdata0\t1\tmsitest\tinstremove\taugustus\n" + "regdata1\t1\tmsitest\\instremove\t-\taugustus\n"; + +static const char wrv_install_exec_seq_dat[] = + "Action\tCondition\tSequence\n" + "s72\tS255\tI2\n" + "InstallExecuteSequence\tAction\n" + "CostInitialize\t\t800\n" + "FileCost\t\t900\n" + "CostFinalize\t\t1000\n" + "InstallValidate\t\t1400\n" + "InstallInitialize\t\t1500\n" + "ProcessComponents\t\t1600\n" + "RemoveRegistryValues\t\t4900\n" + "WriteRegistryValues\t\t5000\n" + "RegisterProduct\t\t6100\n" + "PublishFeatures\t\t6200\n" + "PublishProduct\t\t6300\n" + "InstallFinalize\t\t6600\n"; static const char cf_directory_dat[] = "Directory\tDirectory_Parent\tDefaultDir\n" @@ -1292,65 +1320,6 @@ static const char rd_custom_action_dat[] = "rd_immediate\t1\tcustom.dll\trd_present\n" "rd_deferred\t1025\tcustom.dll\trd_absent\n"; -static const char rrv_file_dat[] = - "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" - "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" - "File\tFile\n" - "registry.txt\tregistry\tregistry.txt\t1000\t\t\t8192\t1\n"; - -static const char rrv_feature_dat[] = - "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n" - "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n" - "Feature\tFeature\n" - "registry\t\t\tregistry feature\t1\t2\tMSITESTDIR\t0\n"; - -static const char rrv_feature_comp_dat[] = - "Feature_\tComponent_\n" - "s38\ts72\n" - "FeatureComponents\tFeature_\tComponent_\n" - "registry\tregistry\n"; - -static const char rrv_component_dat[] = - "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" - "s72\tS38\ts72\ti2\tS255\tS72\n" - "Component\tComponent\n" - "registry\t{DA97585B-962D-45EB-AD32-DA15E60CA9EE}\tMSITESTDIR\t0\t\tregistry.txt\n"; - -static const char rrv_registry_dat[] = - "Registry\tRoot\tKey\tName\tValue\tComponent_\n" - "s72\ti2\tl255\tL255\tL0\ts72\n" - "Registry\tRegistry\n" - "reg1\t2\tSOFTWARE\\Wine\\keyA\t\tA\tregistry\n" - "reg2\t2\tSOFTWARE\\Wine\\keyA\tvalueA\tA\tregistry\n" - "reg3\t2\tSOFTWARE\\Wine\\key1\t-\t\tregistry\n"; - -static const char rrv_remove_registry_dat[] = - "RemoveRegistry\tRoot\tKey\tName\tComponent_\n" - "s72\ti2\tl255\tL255\ts72\n" - "RemoveRegistry\tRemoveRegistry\n" - "reg1\t2\tSOFTWARE\\Wine\\keyB\t\tregistry\n" - "reg2\t2\tSOFTWARE\\Wine\\keyB\tValueB\tregistry\n" - "reg3\t2\tSOFTWARE\\Wine\\key2\t-\tregistry\n"; - -static const char rrv_install_exec_seq_dat[] = - "Action\tCondition\tSequence\n" - "s72\tS255\tI2\n" - "InstallExecuteSequence\tAction\n" - "LaunchConditions\t\t100\n" - "CostInitialize\t\t800\n" - "FileCost\t\t900\n" - "CostFinalize\t\t1000\n" - "InstallValidate\t\t1400\n" - "InstallInitialize\t\t1500\n" - "ProcessComponents\t\t1600\n" - "RemoveFiles\t\t1700\n" - "InstallFiles\t\t2000\n" - "RemoveRegistryValues\t\t3000\n" - "RegisterProduct\t\t5000\n" - "PublishFeatures\t\t5100\n" - "PublishProduct\t\t5200\n" - "InstallFinalize\t\t6000\n"; - static const char frp_file_dat[] = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n" "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n" @@ -2058,11 +2027,11 @@ static const msi_table wrv_tables[] = ADD_TABLE(directory), ADD_TABLE(wrv_feature), ADD_TABLE(wrv_feature_comp), - ADD_TABLE(ci2_file), - ADD_TABLE(install_exec_seq), - ADD_TABLE(rof_media), + ADD_TABLE(wrv_install_exec_seq), ADD_TABLE(property), + ADD_TABLE(media), ADD_TABLE(wrv_registry), + ADD_TABLE(wrv_remove_registry), }; static const msi_table cf_tables[] = @@ -2235,20 +2204,6 @@ static const msi_table rd_tables[] = ADD_TABLE(property) }; -static const msi_table rrv_tables[] = -{ - ADD_TABLE(directory), - ADD_TABLE(rrv_component), - ADD_TABLE(rrv_feature), - ADD_TABLE(rrv_feature_comp), - ADD_TABLE(rrv_file), - ADD_TABLE(rrv_registry), - ADD_TABLE(rrv_remove_registry), - ADD_TABLE(rrv_install_exec_seq), - ADD_TABLE(media), - ADD_TABLE(property) -}; - static const msi_table frp_tables[] = { ADD_TABLE(directory), @@ -2371,75 +2326,6 @@ static const msi_table rep_tables[] = ADD_TABLE(media) }; -/* based on RegDeleteTreeW from dlls/advapi32/registry.c */ -static LSTATUS action_RegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey, REGSAM access) -{ - LONG ret; - DWORD dwMaxSubkeyLen, dwMaxValueLen; - DWORD dwMaxLen, dwSize; - char szNameBuf[MAX_PATH], *lpszName = szNameBuf; - HKEY hSubKey = hKey; - - if(lpszSubKey) - { - ret = RegOpenKeyExA(hKey, lpszSubKey, 0, access, &hSubKey); - if (ret) return ret; - } - - ret = RegQueryInfoKeyA(hSubKey, NULL, NULL, NULL, NULL, - &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL); - if (ret) goto cleanup; - - dwMaxSubkeyLen++; - dwMaxValueLen++; - dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen); - if (dwMaxLen > sizeof(szNameBuf)) - { - /* Name too big: alloc a buffer for it */ - if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen))) - { - ret = ERROR_NOT_ENOUGH_MEMORY; - goto cleanup; - } - } - - /* Recursively delete all the subkeys */ - while (TRUE) - { - dwSize = dwMaxLen; - if (RegEnumKeyExA(hSubKey, 0, lpszName, &dwSize, NULL, - NULL, NULL, NULL)) break; - - ret = action_RegDeleteTreeA(hSubKey, lpszName, access); - if (ret) goto cleanup; - } - - if (lpszSubKey) - { - if (pRegDeleteKeyExA) - ret = pRegDeleteKeyExA(hKey, lpszSubKey, access, 0); - else - ret = RegDeleteKeyA(hKey, lpszSubKey); - } - else - while (TRUE) - { - dwSize = dwMaxLen; - if (RegEnumValueA(hKey, 0, lpszName, &dwSize, - NULL, NULL, NULL, NULL)) break; - - ret = RegDeleteValueA(hKey, lpszName); - if (ret) goto cleanup; - } - -cleanup: - if (lpszName != szNameBuf) - HeapFree(GetProcessHeap(), 0, lpszName); - if(lpszSubKey) - RegCloseKey(hSubKey); - return ret; -} - /* cabinet definitions */ /* make the max size large so there is only one cab file */ @@ -2611,6 +2497,25 @@ static void check_reg_str(HKEY prodkey, LPCSTR name, LPCSTR expected, BOOL bcase } } +static void check_reg_multi(HKEY prodkey, const char *name, const char *expect, DWORD line) +{ + char val[MAX_PATH]; + DWORD size, type; + LONG res; + + size = MAX_PATH; + val[0] = '\0'; + res = RegQueryValueExA(prodkey, name, NULL, &type, (BYTE *)val, &size); + + if (res != ERROR_SUCCESS || type != REG_MULTI_SZ) + { + ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n"); + return; + } + + ok_(__FILE__, line)(!memcmp(val, expect, size), "wrong data\n"); +} + static void check_reg_dword(HKEY prodkey, LPCSTR name, DWORD expected, DWORD line) { DWORD val, size, type; @@ -2646,6 +2551,9 @@ static void check_reg_dword(HKEY prodkey, LPCSTR name, DWORD expected, DWORD lin RegDeleteValueA(prodkey, name); \ } while(0) +#define CHECK_REG_MULTI(key, name, expect) \ + check_reg_multi(key, name, expect, __LINE__); + #define CHECK_REG_DWORD(prodkey, name, expected) \ check_reg_dword(prodkey, name, expected, __LINE__); @@ -4740,12 +4648,11 @@ error: static void test_write_registry_values(void) { - UINT r; - LONG res; - HKEY hkey; + HKEY hkey, subkey; DWORD type, size; - CHAR path[MAX_PATH]; - BYTE buf[8]; + char buf[20]; + LONG res; + UINT r; if (is_process_limited()) { @@ -4754,18 +4661,12 @@ static void test_write_registry_values(void) } CreateDirectoryA("msitest", NULL); - create_file("msitest\\augustus", 500); create_database(msifile, wrv_tables, sizeof(wrv_tables) / sizeof(msi_table)); MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); - if (is_64bit) - res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, NULL, 0, - KEY_ALL_ACCESS, NULL, &hkey, NULL); - else - res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", 0, NULL, 0, KEY_ALL_ACCESS, - NULL, &hkey, NULL); + res = RegCreateKeyA(HKEY_CURRENT_USER, "msitest", &hkey); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); res = RegSetValueExA(hkey, "Value1", 0, REG_MULTI_SZ, (const BYTE *)"two\0", 5); @@ -4782,7 +4683,13 @@ static void test_write_registry_values(void) ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); res = RegSetValueExA(hkey, "Value7", 0, REG_SZ, (const BYTE *)"one", 4); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - RegCloseKey(hkey); + + res = RegSetValueExA(hkey, "instremove", 0, REG_SZ, (const BYTE *)"val", 3); + ok(!res, "got %u\n", res); + + res = RegCreateKeyA(hkey, "instremove", &subkey); + ok(!res, "got %u\n", res); + RegCloseKey(subkey); r = MsiInstallProductA(msifile, NULL); if (r == ERROR_INSTALL_PACKAGE_REJECTED) @@ -4791,157 +4698,120 @@ static void test_write_registry_values(void) goto error; } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); - ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n"); - ok(delete_pf("msitest", FALSE), "Directory not created\n"); - if (is_64bit) - res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, KEY_ALL_ACCESS, &hkey); - else - res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", 0, KEY_ALL_ACCESS, &hkey); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + CHECK_REG_STR(hkey, "sz", "string"); + CHECK_REG_MULTI(hkey, "multisz", "one\0two\0three\0"); + CHECK_REG_DWORD(hkey, "dword", 123); - size = MAX_PATH; - type = 0xdeadbeef; - memset(path, 'a', MAX_PATH); - res = RegQueryValueExA(hkey, "Value", NULL, &type, (LPBYTE)path, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(!memcmp(path, "one\0two\0three\0\0", size), "Wrong multi-sz data\n"); - ok(size == 15, "Expected 15, got %d\n", size); - ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type); - - res = RegQueryValueExA(hkey, "", NULL, NULL, NULL, NULL); - ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); - - res = action_RegDeleteTreeA(hkey, "VisualStudio", KEY_ALL_ACCESS); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - - size = MAX_PATH; - type = 0xdeadbeef; - memset(path, 'a', MAX_PATH); - res = RegQueryValueExA(hkey, "Value1", NULL, &type, (LPBYTE)path, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(!memcmp(path, "one\0", size), "Wrong multi-sz data\n"); - ok(size == 5, "Expected 5, got %d\n", size); - ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type); + size = sizeof(buf); + res = RegQueryValueExA(hkey, "expandsz", NULL, &type, (BYTE *)buf, &size); + ok(!res, "got %u\n", res); + ok(type == REG_EXPAND_SZ, "got %d\n", type); + ok(!strcmp(buf, "string"), "got %s\n", buf); - size = MAX_PATH; - type = 0xdeadbeef; - memset(path, 'a', MAX_PATH); - res = RegQueryValueExA(hkey, "Value2", NULL, &type, (LPBYTE)path, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(!memcmp(path, "one\0two\0", size), "Wrong multi-sz data\n"); - ok(size == 9, "Expected 9, got %d\n", size); - ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type); + size = sizeof(buf); + res = RegQueryValueExA(hkey, "binary", NULL, &type, (BYTE *)buf, &size); + ok(!res, "got %u\n", res); + ok(type == REG_BINARY, "got %d\n", type); + ok(size == 4, "got size %u\n", size); + ok(!memcmp(buf, "\x01\x23\x45\x67", 4), "wrong data\n"); - size = MAX_PATH; - type = 0xdeadbeef; - memset(path, 'a', MAX_PATH); - res = RegQueryValueExA(hkey, "Value3", NULL, &type, (LPBYTE)path, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(!memcmp(path, "one\0two\0", size), "Wrong multi-sz data\n"); - ok(size == 9, "Expected 9, got %d\n", size); - ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type); + CHECK_REG_STR(hkey, "", "default"); - size = MAX_PATH; - type = 0xdeadbeef; - memset(path, 'a', MAX_PATH); - res = RegQueryValueExA(hkey, "Value4", NULL, &type, (LPBYTE)path, &size); + res = RegOpenKeyA(hkey, "VisualStudio", &subkey); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(!memcmp(path, "one\0two\0", size), "Wrong multi-sz data\n"); - ok(size == 9, "Expected 9, got %d\n", size); - ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type); + RegCloseKey(subkey); + + CHECK_REG_MULTI(hkey, "Value1", "one\0"); + CHECK_REG_MULTI(hkey, "Value2", "one\0two\0"); + CHECK_REG_MULTI(hkey, "Value3", "one\0two\0"); + CHECK_REG_MULTI(hkey, "Value4", "one\0two\0"); + CHECK_REG_MULTI(hkey, "Value5", "one\0two\0three\0"); + CHECK_REG_MULTI(hkey, "Value6", ""); + CHECK_REG_MULTI(hkey, "Value7", "two\0"); + + CHECK_REG_DWORD(hkey, "format", 1); + CHECK_REG_DWORD(hkey, "source", 1); + + res = RegOpenKeyA(hkey, "subkey", &subkey); + ok(!res, "got %u\n", res); + res = RegQueryValueExA(subkey, "", NULL, NULL, NULL, NULL); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + RegCloseKey(subkey); + + res = RegOpenKeyA(hkey, "create", &subkey); + ok(!res, "got %u\n", res); + RegCloseKey(subkey); + + res = RegOpenKeyA(hkey, "delete", &subkey); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + res = RegCreateKeyA(hkey, "delete", &subkey); + ok(!res, "got %u\n", res); + RegCloseKey(subkey); + + res = RegQueryValueExA(hkey, "instremove", NULL, NULL, NULL, NULL); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + res = RegOpenKeyA(hkey, "instremove", &subkey); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); - size = MAX_PATH; - type = 0xdeadbeef; - memset(path, 'a', MAX_PATH); - res = RegQueryValueExA(hkey, "Value5", NULL, &type, (LPBYTE)path, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(!memcmp(path, "one\0two\0three\0", size), "Wrong multi-sz data\n"); - ok(size == 15, "Expected 15, got %d\n", size); - ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type); + r = MsiInstallProductA(msifile, "REMOVE=ALL"); + ok(!r, "got %u\n", r); - size = MAX_PATH; - type = 0xdeadbeef; - memset(path, 'a', MAX_PATH); - res = RegQueryValueExA(hkey, "Value6", NULL, &type, (LPBYTE)path, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(!memcmp(path, "", size), "Wrong multi-sz data\n"); - ok(size == 1, "Expected 1, got %d\n", size); - ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type); + res = RegQueryValueExA(hkey, "sz", NULL, NULL, NULL, NULL); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + res = RegQueryValueExA(hkey, "multisz", NULL, NULL, NULL, NULL); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + res = RegQueryValueExA(hkey, "dword", NULL, NULL, NULL, NULL); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + res = RegQueryValueExA(hkey, "expandsz", NULL, NULL, NULL, NULL); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + res = RegQueryValueExA(hkey, "binary", NULL, NULL, NULL, NULL); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + res = RegQueryValueExA(hkey, "", NULL, NULL, NULL, NULL); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + + res = RegOpenKeyA(hkey, "VisualStudio", &subkey); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + + res = RegQueryValueExA(hkey, "Value1", NULL, NULL, NULL, NULL); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + res = RegQueryValueExA(hkey, "Value4", NULL, NULL, NULL, NULL); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + res = RegQueryValueExA(hkey, "Value5", NULL, NULL, NULL, NULL); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + res = RegQueryValueExA(hkey, "Value6", NULL, NULL, NULL, NULL); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + res = RegQueryValueExA(hkey, "Value7", NULL, NULL, NULL, NULL); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); - size = MAX_PATH; - type = 0xdeadbeef; - memset(path, 'a', MAX_PATH); - res = RegQueryValueExA(hkey, "Value7", NULL, &type, (LPBYTE)path, &size); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - ok(!memcmp(path, "two\0", size), "Wrong multi-sz data\n"); - ok(size == 5, "Expected 5, got %d\n", size); - ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type); +todo_wine { + CHECK_REG_MULTI(hkey, "Value2", "one\0"); + CHECK_REG_MULTI(hkey, "Value3", "two\0"); +} - size = sizeof(buf); - type = 0xdeadbeef; - memset(buf, 0, size); - res = RegQueryValueExA(hkey, "Value8", NULL, &type, buf, &size); - ok(res == ERROR_SUCCESS, "got %u\n", res); - ok(*(DWORD *)buf == 1, "got %u\n", *(DWORD *)buf); - ok(size == 4, "got %u\n", size); - ok(type == REG_DWORD, "got %u\n", type); + res = RegQueryValueExA(hkey, "format", NULL, NULL, NULL, NULL); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); + res = RegQueryValueExA(hkey, "source", NULL, NULL, NULL, NULL); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); - size = sizeof(buf); - type = 0xdeadbeef; - memset(buf, 0, size); - res = RegQueryValueExA(hkey, "Value9", NULL, &type, buf, &size); - ok(res == ERROR_SUCCESS, "got %u\n", res); - ok(buf[0] == 1, "got %u\n", buf[0]); - ok(size == 1, "got %u\n", size); - ok(type == REG_BINARY, "got %u\n", type); + res = RegOpenKeyA(hkey, "subkey", &subkey); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); - size = sizeof(buf); - type = 0xdeadbeef; - memset(buf, 0, size); - res = RegQueryValueExA(hkey, "Value10", NULL, &type, buf, &size); - ok(res == ERROR_SUCCESS, "got %u\n", res); - ok(buf[0] == 1, "got %u\n", buf[0]); - ok(size == 1, "got %u\n", size); - ok(type == REG_BINARY, "got %u\n", type); + res = RegOpenKeyA(hkey, "create", &subkey); + ok(!res, "got %u\n", res); + RegCloseKey(subkey); + res = RegDeleteKeyA(hkey, "create"); + ok(!res, "got %u\n", res); - size = sizeof(buf); - type = 0xdeadbeef; - memset(buf, 0, size); - res = RegQueryValueExA(hkey, "Value11", NULL, &type, buf, &size); - ok(res == ERROR_SUCCESS, "got %u\n", res); - ok(buf[0] == 1, "got %u\n", buf[0]); - ok(size == 1, "got %u\n", size); - ok(type == REG_BINARY, "got %u\n", type); + res = RegOpenKeyA(hkey, "delete", &subkey); + ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res); - size = sizeof(buf); - type = 0xdeadbeef; - memset(buf, 0, size); - res = RegQueryValueExA(hkey, "Value12", NULL, &type, buf, &size); - ok(res == ERROR_SUCCESS, "got %u\n", res); - ok(*(DWORD *)buf == 1, "got %u\n", *(DWORD *)buf); - ok(size == 4, "got %u\n", size); - ok(type == REG_DWORD, "got %u\n", type); - - RegDeleteValueA(hkey, "Value"); - RegDeleteValueA(hkey, "Value1"); - RegDeleteValueA(hkey, "Value2"); - RegDeleteValueA(hkey, "Value3"); - RegDeleteValueA(hkey, "Value4"); - RegDeleteValueA(hkey, "Value5"); - RegDeleteValueA(hkey, "Value6"); - RegDeleteValueA(hkey, "Value7"); - RegDeleteValueA(hkey, "Value8"); - RegDeleteValueA(hkey, "Value9"); - RegDeleteValueA(hkey, "Value10"); - RegDeleteValueA(hkey, "Value11"); - RegDeleteValueA(hkey, "Value12"); RegCloseKey(hkey); - RegDeleteKeyA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest"); + res = RegDeleteKeyA(HKEY_CURRENT_USER, "msitest"); + ok(!res, "got %u\n", res); error: DeleteFileA(msifile); - DeleteFileA("msitest\\augustus"); RemoveDirectoryA("msitest"); } @@ -5843,125 +5713,6 @@ error: DeleteFileA(msifile); } -static void test_remove_registry_values(void) -{ - UINT r; - LONG res; - HKEY key; - REGSAM access = KEY_ALL_ACCESS; - - if (is_process_limited()) - { - skip("process is limited\n"); - return; - } - - create_test_files(); - create_file("msitest\\registry.txt", 1000); - create_database(msifile, rrv_tables, sizeof(rrv_tables) / sizeof(msi_table)); - - if (is_wow64) - access |= KEY_WOW64_64KEY; - - MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); - - RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, NULL, 0, access, NULL, &key, NULL); - RegSetValueExA(key, "value1", 0, REG_SZ, (const BYTE *)"1", 2); - RegCloseKey(key); - - RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, NULL, 0, access, NULL, &key, NULL); - RegSetValueExA(key, "value2", 0, REG_SZ, (const BYTE *)"2", 2); - RegCloseKey(key); - - RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", 0, NULL, 0, access, NULL, &key, NULL); - RegSetValueExA(key, "", 0, REG_SZ, (const BYTE *)"default", 8); - RegSetValueExA(key, "valueA", 0, REG_SZ, (const BYTE *)"A", 2); - RegSetValueExA(key, "valueB", 0, REG_SZ, (const BYTE *)"B", 2); - RegCloseKey(key); - - RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", 0, NULL, 0, access, NULL, &key, NULL); - RegSetValueExA(key, "", 0, REG_SZ, (const BYTE *)"default", 8); - RegSetValueExA(key, "valueB", 0, REG_SZ, (const BYTE *)"B", 2); - RegCloseKey(key); - - r = MsiInstallProductA(msifile, NULL); - if (r == ERROR_INSTALL_PACKAGE_REJECTED) - { - skip("Not enough rights to perform tests\n"); - goto error; - } - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); - - res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, access, &key); - ok(res == ERROR_SUCCESS, "key removed\n"); - RegCloseKey(key); - - if (is_64bit) - { - res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\key2", 0, KEY_ALL_ACCESS, &key); - ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n"); - } - else - { - res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, KEY_ALL_ACCESS, &key); - ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n"); - } - - res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, NULL, 0, access, NULL, &key, NULL); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); - RegCloseKey(key); - - r = MsiInstallProductA(msifile, "REMOVE=ALL"); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); - - if (is_64bit) - { - res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\key1", 0, KEY_ALL_ACCESS, &key); - ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n"); - } - else - { - res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, KEY_ALL_ACCESS, &key); - ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n"); - } - - res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, access, &key); - ok(res == ERROR_SUCCESS, "key removed\n"); - RegCloseKey(key); - - res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", 0, access, &key); - ok(res == ERROR_SUCCESS, "key removed\n"); - RegCloseKey(key); - - if (is_64bit) - { - res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\keyB", 0, KEY_ALL_ACCESS, &key); - ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n"); - } - else - { - res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", 0, KEY_ALL_ACCESS, &key); - ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n"); - } - - delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", access); - delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", access); - delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine", access); - - ok(!delete_pf("msitest\\registry.txt", TRUE), "file not removed\n"); - ok(!delete_pf("msitest", FALSE), "directory not removed\n"); - -error: - delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", access); - delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", access); - delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", access); - delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", access); - - DeleteFileA("msitest\\registry.txt"); - delete_test_files(); - DeleteFileA(msifile); -} - static void test_find_related_products(void) { UINT r; @@ -6672,7 +6423,6 @@ START_TEST(action) test_create_remove_shortcut(); test_publish_components(); test_remove_duplicate_files(); - test_remove_registry_values(); test_find_related_products(); test_ini_values(); test_register_class_info();
2 years, 9 months
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
...
44
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Results per page:
10
25
50
100
200