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] 231/360: [WINESYNC] msi: Fix architecture handling in the AppSearch action.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=435274d1ecb9eb2fb629b…
commit 435274d1ecb9eb2fb629bd5c49224f649246eebe Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 01:23:59 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:19 2022 +0100 [WINESYNC] msi: Fix architecture handling in the AppSearch action. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id eb508e5a014f59fbb2c70d9909ba0870ce2b901a by Hans Leidekker <hans(a)codeweavers.com> --- dll/win32/msi/appsearch.c | 7 ++++-- modules/rostests/winetests/msi/package.c | 37 +++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/dll/win32/msi/appsearch.c b/dll/win32/msi/appsearch.c index 047085d1f39..6b1768e8af2 100644 --- a/dll/win32/msi/appsearch.c +++ b/dll/win32/msi/appsearch.c @@ -372,6 +372,7 @@ static UINT search_reg( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig const WCHAR *keyPath, *valueName; WCHAR *deformatted = NULL, *ptr = NULL, *end; int root, type; + REGSAM access = KEY_READ; HKEY rootKey, key = NULL; DWORD sz = 0, regType; LPBYTE value = NULL; @@ -406,6 +407,8 @@ static UINT search_reg( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig break; case msidbRegistryRootLocalMachine: rootKey = HKEY_LOCAL_MACHINE; + if (type & msidbLocatorType64bit) access |= KEY_WOW64_64KEY; + else access |= KEY_WOW64_32KEY; break; case msidbRegistryRootUsers: rootKey = HKEY_USERS; @@ -415,10 +418,10 @@ static UINT search_reg( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig goto end; } - rc = RegOpenKeyW(rootKey, deformatted, &key); + rc = RegOpenKeyExW( rootKey, deformatted, 0, access, &key ); if (rc) { - TRACE("RegOpenKeyW returned %d\n", rc); + TRACE("RegOpenKeyExW returned %d\n", rc); goto end; } diff --git a/modules/rostests/winetests/msi/package.c b/modules/rostests/winetests/msi/package.c index d5f156825df..593e254405c 100644 --- a/modules/rostests/winetests/msi/package.c +++ b/modules/rostests/winetests/msi/package.c @@ -4036,6 +4036,8 @@ static void test_appsearch(void) add_appsearch_entry( hdb, "'WEBBROWSERPROG', 'NewSignature1'" ); add_appsearch_entry( hdb, "'NOTEPAD', 'NewSignature2'" ); add_appsearch_entry( hdb, "'REGEXPANDVAL', 'NewSignature3'" ); + add_appsearch_entry( hdb, "'32KEYVAL', 'NewSignature4'" ); + add_appsearch_entry( hdb, "'64KEYVAL', 'NewSignature5'" ); create_reglocator_table( hdb ); add_reglocator_entry( hdb, "NewSignature1", 0, "htmlfile\\shell\\open\\command", "", 1 ); @@ -4045,7 +4047,26 @@ static void test_appsearch(void) r = RegSetValueExA(hkey, NULL, 0, REG_EXPAND_SZ, (const BYTE*)reg_expand_value, strlen(reg_expand_value) + 1); ok( r == ERROR_SUCCESS, "Could not set key value: %d.\n", r); RegCloseKey(hkey); - add_reglocator_entry( hdb, "NewSignature3", 1, "Software\\Winetest_msi", "", 1 ); + add_reglocator_entry( hdb, "NewSignature3", 1, "Software\\Winetest_msi", "", msidbLocatorTypeFileName ); + + r = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Winetest_msi", 0, NULL, 0, KEY_ALL_ACCESS|KEY_WOW64_32KEY, + NULL, &hkey, NULL); + ok( r == ERROR_SUCCESS, "Could not create key: %d.\n", r ); + r = RegSetValueExA(hkey, NULL, 0, REG_SZ, (const BYTE *)"c:\\windows\\system32\\notepad.exe", + sizeof("c:\\windows\\system32\\notepad.exe")); + ok( r == ERROR_SUCCESS, "Could not set key value: %d.\n", r); + RegCloseKey(hkey); + add_reglocator_entry( hdb, "NewSignature4", 2, "Software\\Winetest_msi", "", msidbLocatorTypeFileName ); + + r = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Winetest_msi", 0, NULL, 0, KEY_ALL_ACCESS|KEY_WOW64_64KEY, + NULL, &hkey, NULL); + ok( r == ERROR_SUCCESS, "Could not create key: %d.\n", r ); + r = RegSetValueExA(hkey, NULL, 0, REG_SZ, (const BYTE *)"c:\\windows\\system32\\notepad.exe", + sizeof("c:\\windows\\system32\\notepad.exe")); + ok( r == ERROR_SUCCESS, "Could not set key value: %d.\n", r); + RegCloseKey(hkey); + add_reglocator_entry( hdb, "NewSignature5", 2, "Software\\Winetest_msi", "", + msidbLocatorTypeFileName|msidbLocatorType64bit ); create_drlocator_table( hdb ); add_drlocator_entry( hdb, "'NewSignature2', 0, 'c:\\windows\\system32', 0" ); @@ -4054,6 +4075,8 @@ static void test_appsearch(void) add_signature_entry( hdb, "'NewSignature1', 'FileName', '', '', '', '', '', '', ''" ); add_signature_entry( hdb, "'NewSignature2', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''" ); add_signature_entry( hdb, "'NewSignature3', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''" ); + add_signature_entry( hdb, "'NewSignature4', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''" ); + add_signature_entry( hdb, "'NewSignature5', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''" ); r = package_from_db( hdb, &hpkg ); if (r == ERROR_INSTALL_PACKAGE_REJECTED) @@ -4086,10 +4109,22 @@ static void test_appsearch(void) ok( r == ERROR_SUCCESS, "get property failed: %d\n", r); ok( lstrlenA(prop) != 0, "Expected non-zero length\n"); + size = sizeof(prop); + r = MsiGetPropertyA( hpkg, "32KEYVAL", prop, &size ); + ok( r == ERROR_SUCCESS, "get property failed: %d\n", r); + ok( lstrlenA(prop) != 0, "Expected non-zero length\n"); + + size = sizeof(prop); + r = MsiGetPropertyA( hpkg, "64KEYVAL", prop, &size ); + ok( r == ERROR_SUCCESS, "get property failed: %d\n", r); + ok( lstrlenA(prop) != 0, "Expected non-zero length\n"); + done: MsiCloseHandle( hpkg ); DeleteFileA(msifile); RegDeleteKeyA(HKEY_CURRENT_USER, "Software\\Winetest_msi"); + delete_key(HKEY_LOCAL_MACHINE, "Software\\Winetest_msi", KEY_WOW64_32KEY); + delete_key(HKEY_LOCAL_MACHINE, "Software\\Winetest_msi", KEY_WOW64_64KEY); } static void test_appsearch_complocator(void)
2 years, 9 months
1
0
0
0
[reactos] 230/360: [WINESYNC] msi: Remove system environment variables on uninstall.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6537d52d548f42ce9e94a…
commit 6537d52d548f42ce9e94a42042686716ed8079ef Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 01:23:59 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:19 2022 +0100 [WINESYNC] msi: Remove system environment variables on uninstall. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 7f95ed7cd2d440420c0c3d1a938af8b48960f352 by Hans Leidekker <hans(a)codeweavers.com> --- dll/win32/msi/action.c | 2 +- modules/rostests/winetests/msi/action.c | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dll/win32/msi/action.c b/dll/win32/msi/action.c index ce39c16f483..07f3778d1ce 100644 --- a/dll/win32/msi/action.c +++ b/dll/win32/msi/action.c @@ -7064,7 +7064,7 @@ static UINT env_parse_flags( LPCWSTR *name, LPCWSTR *value, DWORD *flags ) else if (*cptr == '!') *flags |= ENV_ACT_REMOVEMATCH; else if (*cptr == '*') - *flags |= ENV_MOD_MACHINE; + *flags |= ENV_MOD_MACHINE | ENV_ACT_REMOVE; else break; diff --git a/modules/rostests/winetests/msi/action.c b/modules/rostests/winetests/msi/action.c index 6a34adf7ac5..97b52af52a8 100644 --- a/modules/rostests/winetests/msi/action.c +++ b/modules/rostests/winetests/msi/action.c @@ -250,7 +250,8 @@ static const char env_environment_dat[] = "Var26\t+-MSITESTVAR20\t2[~]\tOne\n" "Var27\t+-MSITESTVAR21\t[~];1\tOne\n" "Var28\t-MSITESTVAR22\t1\tOne\n" - "Var29\t-MSITESTVAR23\t2\tOne\n"; + "Var29\t-MSITESTVAR23\t2\tOne\n" + "Var30\t*MSITESTVAR100\t1\tOne\n"; static const char service_install_dat[] = "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t" @@ -4846,7 +4847,7 @@ static void test_envvar(void) { char buffer[16]; UINT r, i; - HKEY env; + HKEY env, env2; LONG res; if (is_process_limited()) @@ -4860,6 +4861,10 @@ static void test_envvar(void) 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); + res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Control\\Session Manager\\Environment", + 0, NULL, 0, KEY_ALL_ACCESS, NULL, &env2, NULL); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + res = RegSetValueExA(env, "MSITESTVAR1", 0, REG_SZ, (const BYTE *)"0", 2); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); @@ -4913,6 +4918,7 @@ static void test_envvar(void) CHECK_REG_STR(env, "MSITESTVAR19", "1"); CHECK_REG_STR(env, "MSITESTVAR20", "1"); CHECK_REG_STR(env, "MSITESTVAR21", "1"); + CHECK_REG_STR(env2, "MSITESTVAR100", "1"); res = RegSetValueExA(env, "MSITESTVAR22", 0, REG_SZ, (const BYTE *)"1", 2); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); @@ -4940,11 +4946,15 @@ todo_wine { ok(res == ERROR_FILE_NOT_FOUND, "[%d] got %u\n", i, res); } + res = RegDeleteValueA(env2, "MSITESTVAR100"); + ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); + error: RegDeleteValueA(env, "MSITESTVAR1"); RegDeleteValueA(env, "MSITESTVAR2"); RegDeleteValueA(env, "MSITESTVAR21"); RegCloseKey(env); + RegCloseKey(env2); DeleteFileA(msifile); }
2 years, 9 months
1
0
0
0
[reactos] 229/360: [WINESYNC] msi: Take architecture into account when accessing the shared dll reference count.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4d61fb5224f2f7050b5c8…
commit 4d61fb5224f2f7050b5c80e834ccca0bc17ced2a Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 01:23:58 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:19 2022 +0100 [WINESYNC] msi: Take architecture into account when accessing the shared dll reference count. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 5b6bf621cdc0b67528e2f0312d0a89d7cdfce5a7 by Hans Leidekker <hans(a)codeweavers.com> --- dll/win32/msi/action.c | 58 +++++++++++++++++--------------------------------- 1 file changed, 20 insertions(+), 38 deletions(-) diff --git a/dll/win32/msi/action.c b/dll/win32/msi/action.c index e241b26ad85..ce39c16f483 100644 --- a/dll/win32/msi/action.c +++ b/dll/win32/msi/action.c @@ -3324,66 +3324,48 @@ static LPWSTR resolve_keypath( MSIPACKAGE* package, MSICOMPONENT *cmp ) return NULL; } -static HKEY openSharedDLLsKey(void) +static HKEY open_shared_dlls_key( MSICOMPONENT *comp, BOOL create, REGSAM access ) { - HKEY hkey=0; static const WCHAR path[] = - {'S','o','f','t','w','a','r','e','\\', - 'M','i','c','r','o','s','o','f','t','\\', - 'W','i','n','d','o','w','s','\\', - 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', + {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\', + 'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', 'S','h','a','r','e','d','D','L','L','s',0}; - - RegCreateKeyW(HKEY_LOCAL_MACHINE,path,&hkey); - return hkey; + return open_key( comp, HKEY_LOCAL_MACHINE, path, create, access ); } -static UINT ACTION_GetSharedDLLsCount(LPCWSTR dll) +static UINT get_shared_dlls_count( MSICOMPONENT *comp ) { - HKEY hkey; - DWORD count=0; - DWORD type; - DWORD sz = sizeof(count); - DWORD rc; - - hkey = openSharedDLLsKey(); - rc = RegQueryValueExW(hkey, dll, NULL, &type, (LPBYTE)&count, &sz); - if (rc != ERROR_SUCCESS) - count = 0; - RegCloseKey(hkey); + DWORD count, type, sz = sizeof(count); + HKEY hkey = open_shared_dlls_key( comp, FALSE, KEY_READ ); + if (RegQueryValueExW( hkey, comp->FullKeypath, NULL, &type, (BYTE *)&count, &sz )) count = 0; + RegCloseKey( hkey ); return count; } -static UINT ACTION_WriteSharedDLLsCount(LPCWSTR path, UINT count) +static void write_shared_dlls_count( MSICOMPONENT *comp, const WCHAR *path, INT count ) { - HKEY hkey; - - hkey = openSharedDLLsKey(); + HKEY hkey = open_shared_dlls_key( comp, TRUE, KEY_SET_VALUE ); if (count > 0) msi_reg_set_val_dword( hkey, path, count ); else - RegDeleteValueW(hkey,path); + RegDeleteValueW( hkey, path ); RegCloseKey(hkey); - return count; } -static void ACTION_RefCountComponent( MSIPACKAGE* package, MSICOMPONENT *comp ) +static void refcount_component( MSIPACKAGE *package, MSICOMPONENT *comp ) { MSIFEATURE *feature; INT count = 0; BOOL write = FALSE; /* only refcount DLLs */ - if (comp->KeyPath == NULL || - comp->assembly || - comp->Attributes & msidbComponentAttributesRegistryKeyPath || + if (!comp->KeyPath || comp->assembly || comp->Attributes & msidbComponentAttributesRegistryKeyPath || comp->Attributes & msidbComponentAttributesODBCDataSource) write = FALSE; else { - count = ACTION_GetSharedDLLsCount( comp->FullKeypath); + count = get_shared_dlls_count( comp ); write = (count > 0); - if (comp->Attributes & msidbComponentAttributesSharedDllRefCount) write = TRUE; } @@ -3426,18 +3408,18 @@ static void ACTION_RefCountComponent( MSIPACKAGE* package, MSICOMPONENT *comp ) LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry ) { if (file->Component == comp) - ACTION_WriteSharedDLLsCount( file->TargetPath, count ); + write_shared_dlls_count( comp, file->TargetPath, count ); } } - + /* add a count for permanent */ if (comp->Attributes & msidbComponentAttributesPermanent) count ++; - + comp->RefCount = count; if (write) - ACTION_WriteSharedDLLsCount( comp->FullKeypath, comp->RefCount ); + write_shared_dlls_count( comp, comp->FullKeypath, comp->RefCount ); } static WCHAR *build_full_keypath( MSIPACKAGE *package, MSICOMPONENT *comp ) @@ -3487,7 +3469,7 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package) msi_free( comp->FullKeypath ); comp->FullKeypath = build_full_keypath( package, comp ); - ACTION_RefCountComponent( package, comp ); + refcount_component( package, comp ); if (package->need_rollback) action = comp->Installed; else action = comp->ActionRequest;
2 years, 9 months
1
0
0
0
[reactos] 228/360: [WINESYNC] msi: Get rid of a redundant get_registry_view call.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=92a82b2faa71a54fffd05…
commit 92a82b2faa71a54fffd05da3a55e70d4d8bbb934 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 01:23:58 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:18 2022 +0100 [WINESYNC] msi: Get rid of a redundant get_registry_view call. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 5caebb2650e386904544a2c0326e2b0f1bd39bc3 by Hans Leidekker <hans(a)codeweavers.com> --- dll/win32/msi/action.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dll/win32/msi/action.c b/dll/win32/msi/action.c index 626e6c9032d..e241b26ad85 100644 --- a/dll/win32/msi/action.c +++ b/dll/win32/msi/action.c @@ -2929,7 +2929,7 @@ static int is_key_empty(const MSICOMPONENT *comp, HKEY root, const WCHAR *path) HKEY key; LONG res; - key = open_key(comp, root, path, FALSE, get_registry_view(comp) | KEY_READ); + key = open_key(comp, root, path, FALSE, KEY_READ); if (!key) return 0; res = RegQueryInfoKeyW(key, 0, 0, 0, &subkeys, 0, 0, &values, 0, 0, 0, 0); @@ -2941,12 +2941,10 @@ static int is_key_empty(const MSICOMPONENT *comp, HKEY root, const WCHAR *path) static void delete_key( const MSICOMPONENT *comp, HKEY root, const WCHAR *path ) { LONG res = ERROR_SUCCESS; - REGSAM access = 0; + REGSAM access = get_registry_view( comp ); WCHAR *subkey, *p; HKEY hkey; - access |= get_registry_view( comp ); - if (!(subkey = strdupW( path ))) return; do { @@ -2954,7 +2952,7 @@ static void delete_key( const MSICOMPONENT *comp, HKEY root, const WCHAR *path ) { *p = 0; if (!p[1]) continue; /* trailing backslash */ - hkey = open_key( comp, root, subkey, FALSE, access | READ_CONTROL ); + hkey = open_key( comp, root, subkey, FALSE, READ_CONTROL ); if (!hkey) break; if (!is_key_empty(comp, hkey, p + 1)) {
2 years, 9 months
1
0
0
0
[reactos] 227/360: [WINESYNC] msi: Use KEY_WOW64_* flags in ACTION_Register/UnregisterClassInfo.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3635da209682edaddeaf2…
commit 3635da209682edaddeaf2f6ea9995393bc46d94a Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 01:23:58 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:18 2022 +0100 [WINESYNC] msi: Use KEY_WOW64_* flags in ACTION_Register/UnregisterClassInfo. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 70732e273eb52821bfd725f3b1ea1919b8c0e3b0 by Hans Leidekker <hans(a)codeweavers.com> --- dll/win32/msi/classes.c | 25 ++++++++++++------------- dll/win32/msi/msipriv.h | 1 - 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/dll/win32/msi/classes.c b/dll/win32/msi/classes.c index 293aa1063b6..7b0a4a4d0e6 100644 --- a/dll/win32/msi/classes.c +++ b/dll/win32/msi/classes.c @@ -747,7 +747,7 @@ static UINT register_appid(const MSIAPPID *appid, LPCWSTR app ) UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) { static const WCHAR szFileType_fmt[] = {'F','i','l','e','T','y','p','e','\\','%','s','\\','%','i',0}; - const WCHAR *keypath; + REGSAM access = KEY_ALL_ACCESS; MSIRECORD *uirow; HKEY hkey, hkey2, hkey3; MSICLASS *cls; @@ -760,12 +760,12 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) if (r != ERROR_SUCCESS) return r; - if (is_64bit && package->platform == PLATFORM_INTEL) - keypath = szWow6432NodeCLSID; + if (package->platform == PLATFORM_INTEL) + access |= KEY_WOW64_32KEY; else - keypath = szCLSID; + access |= KEY_WOW64_64KEY; - if (RegCreateKeyW(HKEY_CLASSES_ROOT, keypath, &hkey) != ERROR_SUCCESS) + if (RegCreateKeyExW( HKEY_CLASSES_ROOT, szCLSID, 0, NULL, 0, access, NULL, &hkey, NULL )) return ERROR_FUNCTION_FAILED; LIST_FOR_EACH_ENTRY( cls, &package->classes, MSICLASS, entry ) @@ -873,7 +873,6 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) if (cls->DefInprocHandler32) msi_reg_set_subkey_val( hkey2, szInprocHandler32, NULL, cls->DefInprocHandler32 ); - RegCloseKey(hkey2); /* if there is a FileTypeMask, register the FileType */ @@ -902,7 +901,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) index ++; } } - + uirow = MSI_CreateRecord(1); MSI_RecordSetStringW( uirow, 1, cls->clsid ); MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow); @@ -915,7 +914,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package ) { static const WCHAR szFileType[] = {'F','i','l','e','T','y','p','e','\\',0}; - const WCHAR *keypath; + REGSAM access = KEY_ALL_ACCESS; MSIRECORD *uirow; MSICLASS *cls; HKEY hkey, hkey2; @@ -928,13 +927,13 @@ UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package ) if (r != ERROR_SUCCESS) return r; - if (is_64bit && package->platform == PLATFORM_INTEL) - keypath = szWow6432NodeCLSID; + if (package->platform == PLATFORM_INTEL) + access |= KEY_WOW64_32KEY; else - keypath = szCLSID; + access |= KEY_WOW64_64KEY; - if (RegOpenKeyW( HKEY_CLASSES_ROOT, keypath, &hkey ) != ERROR_SUCCESS) - return ERROR_SUCCESS; + if (RegCreateKeyExW( HKEY_CLASSES_ROOT, szCLSID, 0, NULL, 0, access, NULL, &hkey, NULL )) + return ERROR_FUNCTION_FAILED; LIST_FOR_EACH_ENTRY( cls, &package->classes, MSICLASS, entry ) { diff --git a/dll/win32/msi/msipriv.h b/dll/win32/msi/msipriv.h index aa33d1007e6..3d5df922f23 100644 --- a/dll/win32/msi/msipriv.h +++ b/dll/win32/msi/msipriv.h @@ -1207,7 +1207,6 @@ static const WCHAR szX64[] = {'x','6','4',0}; static const WCHAR szAMD64[] = {'A','M','D','6','4',0}; static const WCHAR szARM[] = {'A','r','m',0}; static const WCHAR szARM64[] = {'A','r','m','6','4',0}; -static const WCHAR szWow6432NodeCLSID[] = {'W','o','w','6','4','3','2','N','o','d','e','\\','C','L','S','I','D',0}; static const WCHAR szStreams[] = {'_','S','t','r','e','a','m','s',0}; static const WCHAR szStorages[] = {'_','S','t','o','r','a','g','e','s',0}; static const WCHAR szMsiPublishAssemblies[] = {'M','s','i','P','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0};
2 years, 9 months
1
0
0
0
[reactos] 226/360: [WINESYNC] msi: Use case sensitive compare in handle_msi_break.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a3cf801a46c3f37f78ec3…
commit a3cf801a46c3f37f78ec352c4b4cfb9f87f9d129 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 01:23:56 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:18 2022 +0100 [WINESYNC] msi: Use case sensitive compare in handle_msi_break. 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 8c4b75f252dd5f127320144a43472d4558489af4 by Piotr Caban <piotr(a)codeweavers.com> --- dll/win32/msi/custom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/win32/msi/custom.c b/dll/win32/msi/custom.c index cde14ff34a8..6da8ab1b3de 100644 --- a/dll/win32/msi/custom.c +++ b/dll/win32/msi/custom.c @@ -469,7 +469,7 @@ static void handle_msi_break(LPCSTR target) if (!GetEnvironmentVariableA("MsiBreak", val, MAX_PATH)) return; - if (strcasecmp(val, target)) + if (strcmp(val, target)) return; sprintf(msg, format, GetCurrentProcessId(), GetCurrentProcessId());
2 years, 9 months
1
0
0
0
[reactos] 225/360: [WINESYNC] msi: Add MsiSourceListForceResolution{A, W} stub.
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b3eae05b1106d2800b639…
commit b3eae05b1106d2800b639bc5a76340db02d1a7f0 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 01:21:44 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:18 2022 +0100 [WINESYNC] msi: Add MsiSourceListForceResolution{A,W} stub. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=46881
Signed-off-by: Louis Lenders <xerox.xerox2000x(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> wine commit id 2e95d2247d8fb83d040bdfce388ed4e96172427c by Louis Lenders <xerox.xerox2000x(a)gmail.com> --- dll/win32/msi/msi.spec | 4 ++-- dll/win32/msi/source.c | 18 ++++++++++++++++++ sdk/include/psdk/msi.h | 4 ++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/dll/win32/msi/msi.spec b/dll/win32/msi/msi.spec index eeb9ea757c0..406a9104629 100644 --- a/dll/win32/msi/msi.spec +++ b/dll/win32/msi/msi.spec @@ -205,8 +205,8 @@ 209 stdcall MsiSourceListClearAllW(wstr wstr long) 210 stdcall MsiSourceListAddSourceA(str str long str) 211 stdcall MsiSourceListAddSourceW(wstr wstr long wstr) -212 stub MsiSourceListForceResolutionA -213 stub MsiSourceListForceResolutionW +212 stdcall MsiSourceListForceResolutionA(str str long) +213 stdcall MsiSourceListForceResolutionW(wstr wstr long) 214 stdcall MsiIsProductElevatedA(str ptr) 215 stdcall MsiIsProductElevatedW(wstr ptr) 216 stdcall MsiGetShortcutTargetA(str ptr ptr ptr) diff --git a/dll/win32/msi/source.c b/dll/win32/msi/source.c index 3640b0dfbd2..ed1c6b66a4b 100644 --- a/dll/win32/msi/source.c +++ b/dll/win32/msi/source.c @@ -1330,3 +1330,21 @@ UINT WINAPI MsiSourceListClearSourceW(LPCWSTR szProductCodeOrPatchCode, LPCWSTR dwContext, dwOptions, debugstr_w(szSource)); return ERROR_SUCCESS; } + +/****************************************************************** + * MsiSourceListForceResolutionA (MSI.@) + */ +UINT WINAPI MsiSourceListForceResolutionA(const CHAR *product, const CHAR *user, DWORD reserved) +{ + FIXME("(%s %s %x)\n", debugstr_a(product), debugstr_a(user), reserved); + return ERROR_SUCCESS; +} + +/****************************************************************** + * MsiSourceListForceResolutionW (MSI.@) + */ +UINT WINAPI MsiSourceListForceResolutionW(const WCHAR *product, const WCHAR *user, DWORD reserved) +{ + FIXME("(%s %s %x)\n", debugstr_w(product), debugstr_w(user), reserved); + return ERROR_SUCCESS; +} diff --git a/sdk/include/psdk/msi.h b/sdk/include/psdk/msi.h index 84386c5ec4c..f1a19177ed6 100644 --- a/sdk/include/psdk/msi.h +++ b/sdk/include/psdk/msi.h @@ -1344,6 +1344,10 @@ MsiSourceListAddMediaDiskW( #define MsiSourceListAddMediaDisk WINELIB_NAME_AW(MsiSourceListAddMediaDisk) +UINT WINAPI MsiSourceListForceResolutionA(const CHAR*, const CHAR*, DWORD); +UINT WINAPI MsiSourceListForceResolutionW(const WCHAR*, const WCHAR*, DWORD); +#define MsiSourceListForceResolution WINELIB_NAME_AW(MsiSourceListForceResolution) + UINT WINAPI MsiEnumPatchesA(
2 years, 9 months
1
0
0
0
[reactos] 224/360: [WINESYNC] msi: Handle the remote case in MsiViewGetError().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d672ffc384062f7f91404…
commit d672ffc384062f7f914048b832dd65a0ac07be77 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 01:21:43 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:18 2022 +0100 [WINESYNC] msi: Handle the remote case in MsiViewGetError(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=46830
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 942964fdfbd0cb2af1ea6a1c681fc73d399bcce3 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/msiquery.c | 80 ++++++++++++++++++++++-- dll/win32/msi/winemsi.idl | 2 + modules/rostests/winetests/msi/custom.c | 104 +++++++++++++++++++++++++++++++ modules/rostests/winetests/msi/install.c | 15 +++++ 4 files changed, 195 insertions(+), 6 deletions(-) diff --git a/dll/win32/msi/msiquery.c b/dll/win32/msi/msiquery.c index 524cb7898b4..f04e98257c4 100644 --- a/dll/win32/msi/msiquery.c +++ b/dll/win32/msi/msiquery.c @@ -778,9 +778,35 @@ MSIDBERROR WINAPI MsiViewGetErrorW( MSIHANDLE handle, LPWSTR buffer, LPDWORD buf if (!buflen) return MSIDBERROR_INVALIDARG; - query = msihandle2msiinfo( handle, MSIHANDLETYPE_VIEW ); - if( !query ) - return MSIDBERROR_INVALIDARG; + if (!(query = msihandle2msiinfo(handle, MSIHANDLETYPE_VIEW))) + { + WCHAR *remote_column = NULL; + MSIHANDLE remote; + + if (!(remote = msi_get_remote(handle))) + return MSIDBERROR_INVALIDARG; + + if (!*buflen) + return MSIDBERROR_FUNCTIONERROR; + + __TRY + { + r = remote_ViewGetError(remote, &remote_column); + } + __EXCEPT(rpc_filter) + { + r = GetExceptionCode(); + } + __ENDTRY; + + if (msi_strncpyW(remote_column ? remote_column : szEmpty, -1, buffer, buflen) == ERROR_MORE_DATA) + r = MSIDBERROR_MOREDATA; + + if (remote_column) + midl_user_free(remote_column); + + return r; + } if ((r = query->view->error)) column = query->view->error_column; else column = szEmpty; @@ -803,9 +829,35 @@ MSIDBERROR WINAPI MsiViewGetErrorA( MSIHANDLE handle, LPSTR buffer, LPDWORD bufl if (!buflen) return MSIDBERROR_INVALIDARG; - query = msihandle2msiinfo( handle, MSIHANDLETYPE_VIEW ); - if (!query) - return MSIDBERROR_INVALIDARG; + if (!(query = msihandle2msiinfo(handle, MSIHANDLETYPE_VIEW))) + { + WCHAR *remote_column = NULL; + MSIHANDLE remote; + + if (!(remote = msi_get_remote(handle))) + return MSIDBERROR_INVALIDARG; + + if (!*buflen) + return MSIDBERROR_FUNCTIONERROR; + + __TRY + { + r = remote_ViewGetError(remote, &remote_column); + } + __EXCEPT(rpc_filter) + { + r = GetExceptionCode(); + } + __ENDTRY; + + if (msi_strncpyWtoA(remote_column ? remote_column : szEmpty, -1, buffer, buflen, FALSE) == ERROR_MORE_DATA) + r = MSIDBERROR_MOREDATA; + + if (remote_column) + midl_user_free(remote_column); + + return r; + } if ((r = query->view->error)) column = query->view->error_column; else column = szEmpty; @@ -1199,6 +1251,22 @@ UINT __cdecl s_remote_ViewGetColumnInfo(MSIHANDLE view, MSICOLINFO info, struct return r; } +MSIDBERROR __cdecl s_remote_ViewGetError(MSIHANDLE view, LPWSTR *column) +{ + WCHAR empty[1]; + DWORD size = 1; + UINT r; + + r = MsiViewGetErrorW(view, empty, &size); + if (r == MSIDBERROR_MOREDATA) + { + if (!(*column = midl_user_allocate(++size * sizeof(WCHAR)))) + return MSIDBERROR_FUNCTIONERROR; + r = MsiViewGetErrorW(view, *column, &size); + } + return r; +} + UINT __cdecl s_remote_ViewModify(MSIHANDLE view, MSIMODIFY mode, struct wire_record *remote_rec, struct wire_record **remote_refreshed) { diff --git a/dll/win32/msi/winemsi.idl b/dll/win32/msi/winemsi.idl index 16586036949..7888b0ceb40 100644 --- a/dll/win32/msi/winemsi.idl +++ b/dll/win32/msi/winemsi.idl @@ -32,6 +32,7 @@ typedef int INSTALLSTATE; typedef int MSICOLINFO; typedef int MSIMODIFY; typedef int MSICOSTTREE; +typedef int MSIDBERROR; #define MSIFIELD_NULL 0 #define MSIFIELD_INT 1 @@ -68,6 +69,7 @@ interface IWineMsiRemote UINT remote_ViewExecute( [in] MSIHANDLE view, [in, unique] struct wire_record *record ); UINT remote_ViewFetch( [in] MSIHANDLE view, [out] struct wire_record **record ); UINT remote_ViewGetColumnInfo( [in] MSIHANDLE view, [in] MSICOLINFO info, [out] struct wire_record **record ); + MSIDBERROR remote_ViewGetError( [in] MSIHANDLE view, [out, string] LPWSTR *column ); UINT remote_ViewModify( [in] MSIHANDLE view, [in] MSIMODIFY mode, [in] struct wire_record *record, [out] struct wire_record **refreshed ); diff --git a/modules/rostests/winetests/msi/custom.c b/modules/rostests/winetests/msi/custom.c index 43b8369b17f..3a189efff68 100644 --- a/modules/rostests/winetests/msi/custom.c +++ b/modules/rostests/winetests/msi/custom.c @@ -1159,6 +1159,109 @@ static void test_invalid_functions(MSIHANDLE hinst) MsiCloseHandle(db); } +static void test_view_get_error(MSIHANDLE hinst) +{ + MSIHANDLE db, view, rec; + char buffer[5]; + MSIDBERROR err; + DWORD sz; + UINT r; + + db = MsiGetActiveDatabase(hinst); + ok(hinst, db, "MsiGetActiveDatabase failed\n"); + + r = MsiDatabaseOpenViewA(db, "SELECT * FROM `test2`", &view); + ok(hinst, !r, "got %u\n", r); + + r = MsiViewExecute(view, 0); + ok(hinst, !r, "got %u\n", r); + + sz = 0; + err = MsiViewGetErrorA(0, NULL, &sz); + todo_wine ok(hinst, err == MSIDBERROR_FUNCTIONERROR, "got %d\n", err); + ok(hinst, sz == 0, "got size %u\n", sz); + + err = MsiViewGetErrorA(view, NULL, NULL); + ok(hinst, err == MSIDBERROR_INVALIDARG, "got %d\n", err); + + sz = 0; + err = MsiViewGetErrorA(view, NULL, &sz); + ok(hinst, err == MSIDBERROR_FUNCTIONERROR, "got %d\n", err); + ok(hinst, sz == 0, "got size %u\n", sz); + + sz = 0; + strcpy(buffer, "x"); + err = MsiViewGetErrorA(view, buffer, &sz); + ok(hinst, err == MSIDBERROR_FUNCTIONERROR, "got %d\n", err); + ok(hinst, !strcmp(buffer, "x"), "got \"%s\"\n", buffer); + ok(hinst, sz == 0, "got size %u\n", sz); + + sz = 1; + strcpy(buffer, "x"); + err = MsiViewGetErrorA(view, buffer, &sz); + ok(hinst, err == MSIDBERROR_NOERROR, "got %d\n", err); + ok(hinst, !buffer[0], "got \"%s\"\n", buffer); + ok(hinst, sz == 0, "got size %u\n", sz); + + rec = MsiCreateRecord(2); + MsiRecordSetInteger(rec, 1, 1); + MsiRecordSetInteger(rec, 2, 2); + r = MsiViewModify(view, MSIMODIFY_VALIDATE_NEW, rec); + ok(hinst, r == ERROR_INVALID_DATA, "got %u\n", r); + + sz = 2; + strcpy(buffer, "x"); + err = MsiViewGetErrorA(view, buffer, &sz); + ok(hinst, err == MSIDBERROR_DUPLICATEKEY, "got %d\n", err); + ok(hinst, !strcmp(buffer, "A"), "got \"%s\"\n", buffer); + ok(hinst, sz == 1, "got size %u\n", sz); + + sz = 2; + strcpy(buffer, "x"); + err = MsiViewGetErrorA(view, buffer, &sz); + todo_wine ok(hinst, err == MSIDBERROR_NOERROR, "got %d\n", err); + todo_wine ok(hinst, !buffer[0], "got \"%s\"\n", buffer); + todo_wine ok(hinst, sz == 0, "got size %u\n", sz); + + r = MsiViewModify(view, MSIMODIFY_VALIDATE_NEW, rec); + ok(hinst, r == ERROR_INVALID_DATA, "got %u\n", r); + + sz = 1; + strcpy(buffer, "x"); + err = MsiViewGetErrorA(view, buffer, &sz); + ok(hinst, err == MSIDBERROR_MOREDATA, "got %d\n", err); + ok(hinst, !buffer[0], "got \"%s\"\n", buffer); + ok(hinst, sz == 1, "got size %u\n", sz); + + sz = 1; + strcpy(buffer, "x"); + err = MsiViewGetErrorA(view, buffer, &sz); + todo_wine ok(hinst, err == MSIDBERROR_NOERROR, "got %d\n", err); + ok(hinst, !buffer[0], "got \"%s\"\n", buffer); + todo_wine ok(hinst, sz == 0, "got size %u\n", sz); + + r = MsiViewModify(view, MSIMODIFY_VALIDATE_NEW, rec); + ok(hinst, r == ERROR_INVALID_DATA, "got %u\n", r); + + sz = 0; + strcpy(buffer, "x"); + err = MsiViewGetErrorA(view, buffer, &sz); + ok(hinst, err == MSIDBERROR_FUNCTIONERROR, "got %d\n", err); + ok(hinst, !strcmp(buffer, "x"), "got \"%s\"\n", buffer); + ok(hinst, sz == 0, "got size %u\n", sz); + + sz = 0; + strcpy(buffer, "x"); + err = MsiViewGetErrorA(view, buffer, &sz); + ok(hinst, err == MSIDBERROR_FUNCTIONERROR, "got %d\n", err); + ok(hinst, !strcmp(buffer, "x"), "got \"%s\"\n", buffer); + ok(hinst, sz == 0, "got size %u\n", sz); + + MsiCloseHandle(rec); + MsiCloseHandle(view); + MsiCloseHandle(db); +} + /* Main test. Anything that doesn't depend on a specific install configuration * or have undesired side effects should go here. */ UINT WINAPI main_test(MSIHANDLE hinst) @@ -1186,6 +1289,7 @@ UINT WINAPI main_test(MSIHANDLE hinst) test_format_record(hinst); test_costs(hinst); test_invalid_functions(hinst); + test_view_get_error(hinst); return ERROR_SUCCESS; } diff --git a/modules/rostests/winetests/msi/install.c b/modules/rostests/winetests/msi/install.c index 27dc83f87e2..e348f327011 100644 --- a/modules/rostests/winetests/msi/install.c +++ b/modules/rostests/winetests/msi/install.c @@ -700,6 +700,19 @@ static const CHAR ca1_test_seq_dat[] = "Action\tCondition\tSequence\n" "nested1\t\t1\n" "nested51\t\t2\n"; +static const CHAR ca1_test2_dat[] = + "A\tB\n" + "i2\ti2\n" + "test2\tA\n" + "1\t2\n"; + +static const CHAR ca1__validation_dat[] = + "Table\tColumn\tNullable\tMinValue\tMaxValue\tKeyTable\tKeyColumn\tCategory\tSet\tDescription\n" + "s32\ts32\ts4\tI4\tI4\tS255\tI2\tS32\tS255\tS255\n" + "_Validation\tTable\tColumn\n" + "test2\tA\tN\t\t\t\t\t\t\t\n" + "test2\tB\tN\t\t\t\t\t\t\t\n"; + static const CHAR ca51_component_dat[] = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n" "s72\tS38\ts72\ti2\tS255\tS72\n" "Component\tComponent\n" @@ -1714,6 +1727,8 @@ static const msi_table ca1_tables[] = ADD_TABLE(ca1_install_exec_seq), ADD_TABLE(ca1_custom_action), ADD_TABLE(ca1_test_seq), + ADD_TABLE(ca1_test2), + ADD_TABLE(ca1__validation), }; static const msi_table ca51_tables[] =
2 years, 9 months
1
0
0
0
[reactos] 223/360: [WINESYNC] msi: Perform partial copies in MsiViewGetError().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=616d504d32474b244e77a…
commit 616d504d32474b244e77ab63cdedb110216bde51 Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 01:21:42 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:17 2022 +0100 [WINESYNC] msi: Perform partial copies in MsiViewGetError(). 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 6a3dbf11923b96c93f1869c9b9ed34d68bdb2576 by Zebediah Figura <z.figura12(a)gmail.com> --- dll/win32/msi/msiquery.c | 26 ++++++-------------------- modules/rostests/winetests/msi/db.c | 4 ++-- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/dll/win32/msi/msiquery.c b/dll/win32/msi/msiquery.c index 9f4c5975306..524cb7898b4 100644 --- a/dll/win32/msi/msiquery.c +++ b/dll/win32/msi/msiquery.c @@ -772,7 +772,6 @@ MSIDBERROR WINAPI MsiViewGetErrorW( MSIHANDLE handle, LPWSTR buffer, LPDWORD buf MSIQUERY *query; const WCHAR *column; MSIDBERROR r; - DWORD len; TRACE("%u %p %p\n", handle, buffer, buflen); @@ -786,15 +785,9 @@ MSIDBERROR WINAPI MsiViewGetErrorW( MSIHANDLE handle, LPWSTR buffer, LPDWORD buf if ((r = query->view->error)) column = query->view->error_column; else column = szEmpty; - len = strlenW( column ); - if (buffer) - { - if (*buflen > len) - strcpyW( buffer, column ); - else - r = MSIDBERROR_MOREDATA; - } - *buflen = len; + if (msi_strncpyW(column, -1, buffer, buflen) == ERROR_MORE_DATA) + r = MSIDBERROR_MOREDATA; + msiobj_release( &query->hdr ); return r; } @@ -804,7 +797,6 @@ MSIDBERROR WINAPI MsiViewGetErrorA( MSIHANDLE handle, LPSTR buffer, LPDWORD bufl MSIQUERY *query; const WCHAR *column; MSIDBERROR r; - DWORD len; TRACE("%u %p %p\n", handle, buffer, buflen); @@ -818,15 +810,9 @@ MSIDBERROR WINAPI MsiViewGetErrorA( MSIHANDLE handle, LPSTR buffer, LPDWORD bufl if ((r = query->view->error)) column = query->view->error_column; else column = szEmpty; - len = WideCharToMultiByte( CP_ACP, 0, column, -1, NULL, 0, NULL, NULL ); - if (buffer) - { - if (*buflen >= len) - WideCharToMultiByte( CP_ACP, 0, column, -1, buffer, *buflen, NULL, NULL ); - else - r = MSIDBERROR_MOREDATA; - } - *buflen = len - 1; + if (msi_strncpyWtoA(column, -1, buffer, buflen, FALSE) == ERROR_MORE_DATA) + r = MSIDBERROR_MOREDATA; + msiobj_release( &query->hdr ); return r; } diff --git a/modules/rostests/winetests/msi/db.c b/modules/rostests/winetests/msi/db.c index 16b20e530bc..181301e1fe9 100644 --- a/modules/rostests/winetests/msi/db.c +++ b/modules/rostests/winetests/msi/db.c @@ -9163,14 +9163,14 @@ static void test_view_get_error(void) strcpy(buffer, "x"); err = MsiViewGetErrorA(view, buffer, &sz); ok(err == MSIDBERROR_MOREDATA, "got %d\n", err); - todo_wine ok(!buffer[0], "got \"%s\"\n", buffer); + ok(!buffer[0], "got \"%s\"\n", buffer); ok(sz == 1, "got size %u\n", sz); sz = 1; strcpy(buffer, "x"); err = MsiViewGetErrorA(view, buffer, &sz); todo_wine ok(err == MSIDBERROR_NOERROR, "got %d\n", err); - todo_wine ok(!buffer[0], "got \"%s\"\n", buffer); + ok(!buffer[0], "got \"%s\"\n", buffer); todo_wine ok(sz == 0, "got size %u\n", sz); r = MsiViewModify(view, MSIMODIFY_VALIDATE_NEW, rec);
2 years, 9 months
1
0
0
0
[reactos] 222/360: [WINESYNC] msi/tests: Separate and expand tests for MsiViewGetError().
by winesync
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a7fd7860ad17b1ad813b0…
commit a7fd7860ad17b1ad813b0325dbd583b3b046669c Author: winesync <ros-dev(a)reactos.org> AuthorDate: Sun Mar 13 01:21:42 2022 +0100 Commit: Mark Jansen <mark.jansen(a)reactos.org> CommitDate: Sun Mar 20 19:28:17 2022 +0100 [WINESYNC] msi/tests: Separate and expand tests for MsiViewGetError(). 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 fac04043d93b9e24f9f68954c6688310ab424954 by Zebediah Figura <z.figura12(a)gmail.com> --- modules/rostests/winetests/msi/db.c | 176 +++++++++++++++++++++++++++--------- 1 file changed, 132 insertions(+), 44 deletions(-) diff --git a/modules/rostests/winetests/msi/db.c b/modules/rostests/winetests/msi/db.c index 9fbf43eaee9..16b20e530bc 100644 --- a/modules/rostests/winetests/msi/db.c +++ b/modules/rostests/winetests/msi/db.c @@ -879,45 +879,17 @@ static void test_viewmodify(void) r = run_query( hdb, 0, query ); ok(r == ERROR_SUCCESS, "query failed\n"); - /* check what the error function reports without doing anything */ - sz = 0; - /* passing NULL as the 3rd param make function to crash on older platforms */ - err = MsiViewGetErrorA( 0, NULL, &sz ); - ok(err == MSIDBERROR_INVALIDARG, "MsiViewGetError return\n"); - - /* open a view */ query = "SELECT * FROM `phone`"; r = MsiDatabaseOpenViewA(hdb, query, &hview); ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n"); - /* see what happens with a good hview and bad args */ - err = MsiViewGetErrorA( hview, NULL, NULL ); - ok(err == MSIDBERROR_INVALIDARG || err == MSIDBERROR_NOERROR, - "MsiViewGetError returns %u (expected -3)\n", err); - err = MsiViewGetErrorA( hview, buffer, NULL ); - ok(err == MSIDBERROR_INVALIDARG, "MsiViewGetError return\n"); - - /* see what happens with a zero length buffer */ - sz = 0; - buffer[0] = 'x'; - err = MsiViewGetErrorA( hview, buffer, &sz ); - ok(err == MSIDBERROR_MOREDATA, "MsiViewGetError return\n"); - ok(buffer[0] == 'x', "buffer cleared\n"); - ok(sz == 0, "size not zero\n"); - - /* ok this one is strange */ - sz = 0; - err = MsiViewGetErrorA( hview, NULL, &sz ); - ok(err == MSIDBERROR_NOERROR, "MsiViewGetError return\n"); - ok(sz == 0, "size not zero\n"); - - /* see if it really has an error */ - sz = sizeof buffer; - buffer[0] = 'x'; + /* check what the error function reports without doing anything */ + sz = sizeof(buffer); + strcpy(buffer, "x"); err = MsiViewGetErrorA( hview, buffer, &sz ); - ok(err == MSIDBERROR_NOERROR, "MsiViewGetError return\n"); - ok(buffer[0] == 0, "buffer not cleared\n"); - ok(sz == 0, "size not zero\n"); + ok(err == MSIDBERROR_NOERROR, "got %d\n", err); + ok(!buffer[0], "got \"%s\"\n", buffer); + ok(sz == 0, "got size %u\n", sz); r = MsiViewExecute(hview, 0); ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n"); @@ -933,12 +905,12 @@ static void test_viewmodify(void) r = MsiViewModify(hview, -1, hrec ); ok(r == ERROR_INVALID_DATA, "MsiViewModify failed\n"); - sz = sizeof buffer; - buffer[0] = 'x'; + sz = sizeof(buffer); + strcpy(buffer, "x"); err = MsiViewGetErrorA( hview, buffer, &sz ); - ok(err == MSIDBERROR_NOERROR, "MsiViewGetError return\n"); - ok(buffer[0] == 0, "buffer not cleared\n"); - ok(sz == 0, "size not zero\n"); + ok(err == MSIDBERROR_NOERROR, "got %d\n", err); + ok(!buffer[0], "got \"%s\"\n", buffer); + ok(sz == 0, "got size %u\n", sz); r = MsiCloseHandle(hrec); ok(r == ERROR_SUCCESS, "failed to close record\n"); @@ -965,12 +937,12 @@ static void test_viewmodify(void) r = MsiViewModify(hview, MSIMODIFY_VALIDATE_NEW, hrec ); ok(r == ERROR_INVALID_DATA, "MsiViewModify failed %u\n", r); - sz = sizeof buffer; - buffer[0] = 'x'; + sz = sizeof(buffer); + strcpy(buffer, "x"); err = MsiViewGetErrorA( hview, buffer, &sz ); - ok(err == MSIDBERROR_DUPLICATEKEY, "MsiViewGetError returned %u\n", err); - ok(!strcmp(buffer, "id"), "expected \"id\" c, got \"%s\"\n", buffer); - ok(sz == 2, "size not 2\n"); + ok(err == MSIDBERROR_DUPLICATEKEY, "got %d\n", err); + ok(!strcmp(buffer, "id"), "got \"%s\"\n", buffer); + ok(sz == 2, "got size %u\n", sz); /* insert the same thing again */ r = MsiViewExecute(hview, 0); @@ -9109,6 +9081,121 @@ static void test_viewmodify_insert(void) DeleteFileA(msifile); } +static void test_view_get_error(void) +{ + MSIHANDLE view, rec, db = create_db(); + MSIDBERROR err; + char buffer[5]; + DWORD sz; + UINT r; + + r = run_query(db, 0, "CREATE TABLE `T` (`A` SHORT, `B` SHORT NOT NULL PRIMARY KEY `A`)"); + ok(!r, "got %u\n", r); + r = run_query(db, 0, "INSERT INTO `T` (`A`, `B`) VALUES (1, 2)"); + r = run_query(db, 0, "CREATE TABLE `_Validation` (" + "`Table` CHAR(32) NOT NULL, `Column` CHAR(32) NOT NULL, " + "`Nullable` CHAR(4) NOT NULL, `MinValue` INT, `MaxValue` INT, " + "`KeyTable` CHAR(255), `KeyColumn` SHORT, `Category` CHAR(32), " + "`Set` CHAR(255), `Description` CHAR(255) PRIMARY KEY `Table`, `Column`)"); + ok(!r, "got %u\n", r); + r = run_query(db, 0, "INSERT INTO `_Validation` (`Table`, `Column`, `Nullable`) VALUES ('T', 'A', 'N')"); + ok(!r, "got %u\n", r); + r = run_query(db, 0, "INSERT INTO `_Validation` (`Table`, `Column`, `Nullable`) VALUES ('T', 'B', 'N')"); + ok(!r, "got %u\n", r); + + r = MsiDatabaseOpenViewA(db, "SELECT * FROM `T`", &view); + ok(!r, "got %u\n", r); + + r = MsiViewExecute(view, 0); + ok(!r, "got %u\n", r); + + sz = 0; + err = MsiViewGetErrorA(0, NULL, &sz); + ok(err == MSIDBERROR_INVALIDARG, "got %d\n", err); + ok(sz == 0, "got size %u\n", sz); + + err = MsiViewGetErrorA(view, NULL, NULL); + ok(err == MSIDBERROR_INVALIDARG, "got %d\n", err); + + sz = 0; + err = MsiViewGetErrorA(view, NULL, &sz); + ok(err == MSIDBERROR_NOERROR, "got %d\n", err); + ok(sz == 0, "got size %u\n", sz); + + sz = 0; + strcpy(buffer, "x"); + err = MsiViewGetErrorA(view, buffer, &sz); + ok(err == MSIDBERROR_MOREDATA, "got %d\n", err); + ok(!strcmp(buffer, "x"), "got \"%s\"\n", buffer); + ok(sz == 0, "got size %u\n", sz); + + sz = 1; + strcpy(buffer, "x"); + err = MsiViewGetErrorA(view, buffer, &sz); + ok(err == MSIDBERROR_NOERROR, "got %d\n", err); + ok(!buffer[0], "got \"%s\"\n", buffer); + ok(sz == 0, "got size %u\n", sz); + + rec = MsiCreateRecord(2); + MsiRecordSetInteger(rec, 1, 1); + MsiRecordSetInteger(rec, 2, 2); + r = MsiViewModify(view, MSIMODIFY_VALIDATE_NEW, rec); + ok(r == ERROR_INVALID_DATA, "got %u\n", r); + + sz = 2; + strcpy(buffer, "x"); + err = MsiViewGetErrorA(view, buffer, &sz); + ok(err == MSIDBERROR_DUPLICATEKEY, "got %d\n", err); + ok(!strcmp(buffer, "A"), "got \"%s\"\n", buffer); + ok(sz == 1, "got size %u\n", sz); + + sz = 2; + strcpy(buffer, "x"); + err = MsiViewGetErrorA(view, buffer, &sz); + todo_wine ok(err == MSIDBERROR_NOERROR, "got %d\n", err); + todo_wine ok(!buffer[0], "got \"%s\"\n", buffer); + todo_wine ok(sz == 0, "got size %u\n", sz); + + r = MsiViewModify(view, MSIMODIFY_VALIDATE_NEW, rec); + ok(r == ERROR_INVALID_DATA, "got %u\n", r); + + sz = 1; + strcpy(buffer, "x"); + err = MsiViewGetErrorA(view, buffer, &sz); + ok(err == MSIDBERROR_MOREDATA, "got %d\n", err); + todo_wine ok(!buffer[0], "got \"%s\"\n", buffer); + ok(sz == 1, "got size %u\n", sz); + + sz = 1; + strcpy(buffer, "x"); + err = MsiViewGetErrorA(view, buffer, &sz); + todo_wine ok(err == MSIDBERROR_NOERROR, "got %d\n", err); + todo_wine ok(!buffer[0], "got \"%s\"\n", buffer); + todo_wine ok(sz == 0, "got size %u\n", sz); + + r = MsiViewModify(view, MSIMODIFY_VALIDATE_NEW, rec); + ok(r == ERROR_INVALID_DATA, "got %u\n", r); + + sz = 0; + strcpy(buffer, "x"); + err = MsiViewGetErrorA(view, buffer, &sz); + ok(err == MSIDBERROR_MOREDATA, "got %d\n", err); + ok(!strcmp(buffer, "x"), "got \"%s\"\n", buffer); + ok(sz == 1, "got size %u\n", sz); + + sz = 0; + strcpy(buffer, "x"); + err = MsiViewGetErrorA(view, buffer, &sz); + ok(err == MSIDBERROR_MOREDATA, "got %d\n", err); + ok(!strcmp(buffer, "x"), "got \"%s\"\n", buffer); + todo_wine ok(sz == 0, "got size %u\n", sz); + + MsiCloseHandle(rec); + MsiCloseHandle(view); + MsiCloseHandle(db); + DeleteFileA(msifile); +} + START_TEST(db) { test_msidatabase(); @@ -9167,4 +9254,5 @@ START_TEST(db) test_primary_keys(); test_viewmodify_merge(); test_viewmodify_insert(); + test_view_get_error(); }
2 years, 9 months
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
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