[PATCH 0/4] MR9739: msi/tests: Fix a test failure on ARM64 Windows 11.
From: Hans Leidekker <hans@codeweavers.com> --- dlls/msi/tests/action.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c index abf9332c45f..82d950ce466 100644 --- a/dlls/msi/tests/action.c +++ b/dlls/msi/tests/action.c @@ -3453,8 +3453,8 @@ static void test_register_user(void) ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res); CHECK_REG_STR(props, "ProductID", "none"); - CHECK_REG_STR(props, "RegCompany", company); - CHECK_REG_STR(props, "RegOwner", owner); + if (company) CHECK_REG_STR(props, "RegCompany", company); + if (owner) CHECK_REG_STR(props, "RegOwner", owner); RegDeleteValueA(props, "ProductID"); RegDeleteValueA(props, "RegCompany"); @@ -3475,8 +3475,8 @@ static void test_register_user(void) ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res); CHECK_REG_STR(props, "ProductID", "none"); - CHECK_REG_STR(props, "RegCompany", company); - CHECK_REG_STR(props, "RegOwner", owner); + if (company) CHECK_REG_STR(props, "RegCompany", company); + if (owner) CHECK_REG_STR(props, "RegOwner", owner); RegDeleteValueA(props, "ProductID"); RegDeleteValueA(props, "RegCompany"); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9739
From: Hans Leidekker <hans@codeweavers.com> --- dlls/msi/tests/install.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 4b967d1aa4b..dc1dd24fe58 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -5198,9 +5198,11 @@ static void process_pending_renames(HKEY hkey) flags |= MOVEFILE_REPLACE_EXISTING; dst++; } + if (src[0] == '*' && src[1] == '1') src += 2; /* win11 */ if (src[0] == '\\' && src[1] == '?' && src[2] == '?' && src[3] == '\\') src += 4; if (*dst) { + if (dst[0] == '*' && dst[1] == '1') dst += 2; /* win11 */ if (dst[0] == '\\' && dst[1] == '?' && dst[2] == '?' && dst[3] == '\\') dst += 4; fileret = MoveFileExA(src, dst, flags); ok(fileret, "Failed to move file %s -> %s (%lu)\n", src, dst, GetLastError()); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9739
From: Hans Leidekker <hans@codeweavers.com> --- dlls/msi/tests/msi.c | 75 ++++++++++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 27 deletions(-) diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c index 1cf6887e444..1fde82770fc 100644 --- a/dlls/msi/tests/msi.c +++ b/dlls/msi/tests/msi.c @@ -2280,6 +2280,11 @@ static void test_MsiQueryComponentState(void) lstrcatA(keypath, "\\InstallProperties"); res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &prodkey, NULL); + if (res == ERROR_ACCESS_DENIED) + { + skip("Not enough rights to perform tests\n"); + return; + } ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res); res = reg_set_str(prodkey, "LocalPackage", "msitest.msi"); @@ -2485,7 +2490,7 @@ static void test_MsiGetComponentPath(void) ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state); ok(size == MAX_PATH, "Expected size to be unchanged, got %lu\n", size); - res = reg_set_str(compkey, prod_squashed, "C:\\imapath"); + res = reg_set_str(compkey, prod_squashed, "c:\\msitest\\imapath"); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res); /* product value exists */ @@ -2493,15 +2498,15 @@ static void test_MsiGetComponentPath(void) size = MAX_PATH; state = MsiGetComponentPathA(prodcode, component, path, &size); ok(state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); - ok(!lstrcmpA(path, "C:\\imapath"), "Expected C:\\imapath, got %s\n", path); - ok(size == 10, "Expected 10, got %lu\n", size); + ok(!lstrcmpA(path, "c:\\msitest\\imapath"), "Expected c:\\msitest\\imapath, got %s\n", path); + ok(size == 18, "got %lu\n", size); path[0] = 0; size = MAX_PATH; state = MsiLocateComponentA(component, path, &size); ok(state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); - ok(!lstrcmpA(path, "C:\\imapath"), "Expected C:\\imapath, got %s\n", path); - ok(size == 10, "Expected 10, got %lu\n", size); + ok(!lstrcmpA(path, "c:\\msitest\\imapath"), "Expected c:\\msitest\\imapath, got %s\n", path); + ok(size == 18, "got %lu\n", size); lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\"); lstrcatA(keypath, "Installer\\UserData\\S-1-5-18\\Products\\"); @@ -2520,17 +2525,18 @@ static void test_MsiGetComponentPath(void) size = MAX_PATH; state = MsiGetComponentPathA(prodcode, component, path, &size); ok(state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); - ok(!lstrcmpA(path, "C:\\imapath"), "Expected C:\\imapath, got %s\n", path); - ok(size == 10, "Expected 10, got %lu\n", size); + ok(!lstrcmpA(path, "c:\\msitest\\imapath"), "Expected c:\\msitest\\imapath, got %s\n", path); + ok(size == 18, "got %lu\n", size); path[0] = 0; size = MAX_PATH; state = MsiLocateComponentA(component, path, &size); ok(state == INSTALLSTATE_ABSENT, "Expected INSTALLSTATE_ABSENT, got %d\n", state); - ok(!lstrcmpA(path, "C:\\imapath"), "Expected C:\\imapath, got %s\n", path); - ok(size == 10, "Expected 10, got %lu\n", size); + ok(!lstrcmpA(path, "c:\\msitest\\imapath"), "Expected c:\\msitest\\imapath, got %s\n", path); + ok(size == 18, "got %lu\n", size); - create_file("C:\\imapath", 11); + CreateDirectoryA("c:\\msitest", NULL); + create_file("c:\\msitest\\imapath", 11); /* file exists */ path[0] = 'a'; @@ -2538,28 +2544,28 @@ static void test_MsiGetComponentPath(void) state = MsiGetComponentPathA(prodcode, component, path, &size); ok(state == INSTALLSTATE_MOREDATA, "Expected INSTALLSTATE_MOREDATA, got %d\n", state); ok(path[0] == 'a', "got %s\n", path); - ok(size == 10, "Expected 10, got %lu\n", size); + ok(size == 18, "got %lu\n", size); path[0] = 0; size = MAX_PATH; state = MsiGetComponentPathA(prodcode, component, path, &size); ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); - ok(!lstrcmpA(path, "C:\\imapath"), "Expected C:\\imapath, got %s\n", path); - ok(size == 10, "Expected 10, got %lu\n", size); + ok(!lstrcmpA(path, "c:\\msitest\\imapath"), "Expected c:\\msitest\\imapath, got %s\n", path); + ok(size == 18, "got %lu\n", size); size = 0; path[0] = 'a'; state = MsiLocateComponentA(component, path, &size); ok(state == INSTALLSTATE_MOREDATA, "Expected INSTALLSTATE_MOREDATA, got %d\n", state); ok(path[0] == 'a', "got %s\n", path); - ok(size == 10, "Expected 10, got %lu\n", size); + ok(size == 18, "got %lu\n", size); path[0] = 0; size = MAX_PATH; state = MsiLocateComponentA(component, path, &size); ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state); - ok(!lstrcmpA(path, "C:\\imapath"), "Expected C:\\imapath, got %s\n", path); - ok(size == 10, "Expected 10, got %lu\n", size); + ok(!lstrcmpA(path, "c:\\msitest\\imapath"), "Expected c:\\msitest\\imapath, got %s\n", path); + ok(size == 18, "got %lu\n", size); RegDeleteValueA(compkey, prod_squashed); RegDeleteKeyExA(compkey, "", access & KEY_WOW64_64KEY, 0); @@ -2567,7 +2573,8 @@ static void test_MsiGetComponentPath(void) RegDeleteKeyExA(installprop, "", access & KEY_WOW64_64KEY, 0); RegCloseKey(compkey); RegCloseKey(installprop); - DeleteFileA("C:\\imapath"); + DeleteFileA("c:\\msitest\\imapath"); + RemoveDirectoryA("c:\\msitest"); lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\"); lstrcatA(keypath, "Installer\\UserData\\"); @@ -2576,6 +2583,12 @@ static void test_MsiGetComponentPath(void) lstrcatA(keypath, comp_squashed); res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &compkey, NULL); + if (res == ERROR_ACCESS_DENIED) + { + skip("Not enough rights to perform tests\n"); + LocalFree(usersid); + return; + } ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res); /* user managed component key exists */ @@ -3006,7 +3019,7 @@ static void test_MsiGetComponentPathEx(void) state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size ); ok( state == INSTALLSTATE_UNKNOWN, "got %d\n", state ); - res = reg_set_str( key_comp, prod_squashed, "c:\\testcomponentpath" ); + res = reg_set_str( key_comp, prod_squashed, "c:\\msitest\\testcomponentpath" ); ok( res == ERROR_SUCCESS, "got %ld\n", res ); /* product value exists */ @@ -3014,8 +3027,8 @@ static void test_MsiGetComponentPathEx(void) size = MAX_PATH; state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size ); ok( state == INSTALLSTATE_ABSENT, "got %d\n", state ); - ok( !lstrcmpA( path, "c:\\testcomponentpath" ), "got %s\n", path ); - ok( size == 20, "got %lu\n", size ); + ok( !lstrcmpA( path, "c:\\msitest\\testcomponentpath" ), "got %s\n", path ); + ok( size == 28, "got %lu\n", size ); lstrcpyA( path_key, "Software\\Microsoft\\Windows\\CurrentVersion\\" ); lstrcatA( path_key, "Installer\\UserData\\S-1-5-18\\Products\\" ); @@ -3034,10 +3047,11 @@ static void test_MsiGetComponentPathEx(void) size = MAX_PATH; state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size ); ok( state == INSTALLSTATE_ABSENT, "got %d\n", state ); - ok( !lstrcmpA( path, "c:\\testcomponentpath"), "got %s\n", path ); - ok( size == 20, "got %lu\n", size ); + ok( !lstrcmpA( path, "c:\\msitest\\testcomponentpath"), "got %s\n", path ); + ok( size == 28, "got %lu\n", size ); - create_file( "c:\\testcomponentpath", 21 ); + CreateDirectoryA( "c:\\msitest", NULL ); + create_file( "c:\\msitest\\testcomponentpath", 21 ); /* file exists */ path[0] = 0; @@ -3045,14 +3059,14 @@ static void test_MsiGetComponentPathEx(void) state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size ); ok( state == INSTALLSTATE_MOREDATA, "got %d\n", state ); ok( !path[0], "got %s\n", path ); - todo_wine ok( size == 40, "got %lu\n", size ); + todo_wine ok( size == 56, "got %lu\n", size ); path[0] = 0; size = MAX_PATH; state = MsiGetComponentPathExA( prod, comp, NULL, MSIINSTALLCONTEXT_MACHINE, path, &size ); ok( state == INSTALLSTATE_LOCAL, "got %d\n", state ); - ok( !lstrcmpA( path, "c:\\testcomponentpath" ), "got %s\n", path ); - ok( size == 20, "got %lu\n", size ); + ok( !lstrcmpA( path, "c:\\msitest\\testcomponentpath" ), "got %s\n", path ); + ok( size == 28, "got %lu\n", size ); RegDeleteValueA( key_comp, prod_squashed ); RegDeleteKeyExA( key_comp, "", access & KEY_WOW64_64KEY, 0 ); @@ -3060,7 +3074,8 @@ static void test_MsiGetComponentPathEx(void) RegDeleteKeyExA( key_installprop, "", access & KEY_WOW64_64KEY, 0 ); RegCloseKey( key_comp ); RegCloseKey( key_installprop ); - DeleteFileA( "c:\\testcomponentpath" ); + DeleteFileA( "c:\\msitest\\testcomponentpath" ); + RemoveDirectoryA( "c:\\msitest" ); lstrcpyA( path_key, "Software\\Microsoft\\Installer\\Products\\" ); lstrcatA( path_key, prod_squashed ); @@ -3081,6 +3096,12 @@ static void test_MsiGetComponentPathEx(void) lstrcatA( path_key, comp_squashed ); res = RegCreateKeyExA( HKEY_LOCAL_MACHINE, path_key, 0, NULL, 0, access, NULL, &key_comp, NULL ); + if (res == ERROR_ACCESS_DENIED) + { + skip( "insufficient rights\n" ); + LocalFree( usersid ); + return; + } ok( res == ERROR_SUCCESS, "got %ld\n", res ); /* user unmanaged component key exists */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9739
From: Hans Leidekker <hans@codeweavers.com> --- dlls/msi/tests/package.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index cffc429fb82..b77be73b3a7 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -34,6 +34,8 @@ #include "wine/test.h" #include "utils.h" +static BOOL (WINAPI *pIsWow64Process2)(HANDLE, USHORT *, USHORT *); + static BOOL is_wow64; static const char msifile[] = "winetest-package.msi"; static const WCHAR msifileW[] = L"winetest-package.msi"; @@ -5458,10 +5460,13 @@ static void test_installprops(void) REGSAM access = KEY_ALL_ACCESS; SYSTEM_INFO si; INSTALLUILEVEL uilevel; + USHORT machine, native_machine = 0; if (is_wow64) access |= KEY_WOW64_64KEY; + if (pIsWow64Process2) pIsWow64Process2(GetCurrentProcess(), &machine, &native_machine); + lstrcpyA(path, CURR_DIR); if (!is_root(CURR_DIR)) lstrcatA(path, "\\"); lstrcatA(path, msifile); @@ -5645,7 +5650,10 @@ static void test_installprops(void) si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_ARM64) { sprintf(buf, "%d", si.wProcessorLevel); - check_prop(hpkg, "Intel", buf, 1, 0); + if (native_machine == IMAGE_FILE_MACHINE_ARM64) + check_prop(hpkg, "Intel", "0", 1, 0); + else + check_prop(hpkg, "Intel", buf, 1, 0); check_prop(hpkg, "MsiAMD64", buf, 1, 0); check_prop(hpkg, "Msix64", buf, 1, 0); sprintf(buf, "%d", LOBYTE(LOWORD(GetVersion())) * 100 + HIBYTE(LOWORD(GetVersion()))); @@ -9544,6 +9552,7 @@ START_TEST(package) if (!is_process_elevated()) restart_as_admin_elevated(); IsWow64Process(GetCurrentProcess(), &is_wow64); + pIsWow64Process2 = (void *)GetProcAddress(GetModuleHandleA("kernel32"), "IsWow64Process2"); GetCurrentDirectoryA(MAX_PATH, prev_path); GetTempPathA(MAX_PATH, temp_path); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9739
participants (2)
-
Hans Leidekker -
Hans Leidekker (@hans)