Signed-off-by: Hans Leidekker hans@codeweavers.com --- dlls/msi/appsearch.c | 7 +++++-- dlls/msi/tests/package.c | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 3 deletions(-)
diff --git a/dlls/msi/appsearch.c b/dlls/msi/appsearch.c index 047085d1f3..6b1768e8af 100644 --- a/dlls/msi/appsearch.c +++ b/dlls/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/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index d5f156825d..593e254405 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/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)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=51094
Your paranoid android.
=== w8adm (32 bit report) ===
msi: package.c:8107: Test failed: Expected "{9B4082BC-2E7A-4341-BC35-C2525232D61A}", got "apple" package.c:8116: Test failed: Expected L"{9B4082BC-2E7A-4341-BC35-C2525232D61A}", got L"apple" package.c:8158: Test failed: Expected first 3 chars of "{9B4082BC-2E7A-4341-BC35-C2525232D61A}", got "apple" package.c:8167: Test failed: Expected first 3 chars of L"{9B4082BC-2E7A-4341-BC35-C2525232D61A}", got L"apple" package.c:8177: Test failed: Expected first 37 chars of "{9B4082BC-2E7A-4341-BC35-C2525232D61A}", got "apple" package.c:8186: Test failed: Expected first 37 chars of L"{9B4082BC-2E7A-4341-BC35-C2525232D61A}", got L"apple" package.c:8196: Test failed: Expected "{9B4082BC-2E7A-4341-BC35-C2525232D61A}", got "apple" package.c:8205: Test failed: Expected L"{9B4082BC-2E7A-4341-BC35-C2525232D61A}", got L"apple" package.c:8251: Test failed: Expected "{9B4082BC-2E7A-4341-BC35-C2525232D61A}", got "apple" package.c:8260: Test failed: Expected L"{9B4082BC-2E7A-4341-BC35-C2525232D61A}", got L"apple"