From: Christoph von Wittich Date: Mon, 16 Nov 2009 01:15:54 +0000 (+0000) Subject: sync msi winetest to wine 1.1.33 X-Git-Tag: ReactOS-0.3.11~39 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=4df398e191ecc982cb70fda7a83c0f623770b250 sync msi winetest to wine 1.1.33 svn path=/trunk/; revision=44192 --- diff --git a/rostests/winetests/msi/db.c b/rostests/winetests/msi/db.c index bfaba172945..19cd74cd646 100644 --- a/rostests/winetests/msi/db.c +++ b/rostests/winetests/msi/db.c @@ -1566,6 +1566,101 @@ static void test_binary(void) DeleteFile( msifile ); } +static void test_where_not_in_selected(void) +{ + MSIHANDLE hdb = 0, rec, view; + LPCSTR query; + UINT r; + + hdb = create_db(); + ok( hdb, "failed to create db\n"); + + r = run_query(hdb, 0, + "CREATE TABLE `IESTable` (" + "`Action` CHAR(64), " + "`Condition` CHAR(64), " + "`Sequence` LONG PRIMARY KEY `Sequence`)"); + ok( r == S_OK, "Cannot create IESTable table: %d\n", r); + + r = run_query(hdb, 0, + "CREATE TABLE `CATable` (" + "`Action` CHAR(64), " + "`Type` LONG PRIMARY KEY `Type`)"); + ok( r == S_OK, "Cannot create CATable table: %d\n", r); + + r = run_query(hdb, 0, "INSERT INTO `IESTable` " + "( `Action`, `Condition`, `Sequence`) " + "VALUES ( 'clean', 'cond4', 4)"); + ok( r == S_OK, "cannot add entry to IESTable table:%d\n", r ); + + r = run_query(hdb, 0, "INSERT INTO `IESTable` " + "( `Action`, `Condition`, `Sequence`) " + "VALUES ( 'depends', 'cond1', 1)"); + ok( r == S_OK, "cannot add entry to IESTable table:%d\n", r ); + + r = run_query(hdb, 0, "INSERT INTO `IESTable` " + "( `Action`, `Condition`, `Sequence`) " + "VALUES ( 'build', 'cond2', 2)"); + ok( r == S_OK, "cannot add entry to IESTable table:%d\n", r ); + + r = run_query(hdb, 0, "INSERT INTO `IESTable` " + "( `Action`, `Condition`, `Sequence`) " + "VALUES ( 'build2', 'cond6', 6)"); + ok( r == S_OK, "cannot add entry to IESTable table:%d\n", r ); + + r = run_query(hdb, 0, "INSERT INTO `IESTable` " + "( `Action`, `Condition`, `Sequence`) " + "VALUES ( 'build', 'cond3', 3)"); + ok(r == S_OK, "cannot add entry to IESTable table:%d\n", r ); + + r = run_query(hdb, 0, "INSERT INTO `CATable` " + "( `Action`, `Type` ) " + "VALUES ( 'build', 32)"); + ok(r == S_OK, "cannot add entry to CATable table:%d\n", r ); + + r = run_query(hdb, 0, "INSERT INTO `CATable` " + "( `Action`, `Type` ) " + "VALUES ( 'depends', 64)"); + ok(r == S_OK, "cannot add entry to CATable table:%d\n", r ); + + r = run_query(hdb, 0, "INSERT INTO `CATable` " + "( `Action`, `Type` ) " + "VALUES ( 'clean', 63)"); + ok(r == S_OK, "cannot add entry to CATable table:%d\n", r ); + + r = run_query(hdb, 0, "INSERT INTO `CATable` " + "( `Action`, `Type` ) " + "VALUES ( 'build2', 34)"); + ok(r == S_OK, "cannot add entry to CATable table:%d\n", r ); + query = "Select IESTable.Condition from CATable, IESTable where " + "CATable.Action = IESTable.Action and CATable.Type = 32"; + r = MsiDatabaseOpenView(hdb, query, &view); + ok( r == ERROR_SUCCESS, "failed to open view: %d\n", r ); + + r = MsiViewExecute(view, 0); + ok( r == ERROR_SUCCESS, "failed to execute view: %d\n", r ); + + r = MsiViewFetch(view, &rec); + ok( r == ERROR_SUCCESS, "failed to fetch view: %d\n", r ); + + ok( check_record( rec, 1, "cond2"), "wrong condition\n"); + + MsiCloseHandle( rec ); + r = MsiViewFetch(view, &rec); + ok( r == ERROR_SUCCESS, "failed to fetch view: %d\n", r ); + + ok( check_record( rec, 1, "cond3"), "wrong condition\n"); + + MsiCloseHandle( rec ); + MsiViewClose(view); + MsiCloseHandle(view); + + MsiCloseHandle( hdb ); + DeleteFile(msifile); + +} + + static void test_where(void) { MSIHANDLE hdb = 0, rec, view; @@ -8450,6 +8545,7 @@ START_TEST(db) test_longstrings(); test_streamtable(); test_binary(); + test_where_not_in_selected(); test_where(); test_msiimport(); test_binary_import(); diff --git a/rostests/winetests/msi/install.c b/rostests/winetests/msi/install.c index ed1ebc2d96f..c6fd1ca4701 100644 --- a/rostests/winetests/msi/install.c +++ b/rostests/winetests/msi/install.c @@ -35,6 +35,8 @@ static UINT (WINAPI *pMsiQueryComponentStateA) (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE*); +static UINT (WINAPI *pMsiSetExternalUIRecord) + (INSTALLUI_HANDLER_RECORD, DWORD, LPVOID, PINSTALLUI_HANDLER_RECORD); static UINT (WINAPI *pMsiSourceListEnumSourcesA) (LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPSTR, LPDWORD); static UINT (WINAPI *pMsiSourceListGetInfoA) @@ -172,7 +174,13 @@ static const CHAR environment_dat[] = "Environment\tName\tValue\tComponent_\n" "Var1\t=-MSITESTVAR1\t1\tOne\n" "Var2\tMSITESTVAR2\t1\tOne\n" "Var3\t=-MSITESTVAR3\t1\tOne\n" - "Var4\tMSITESTVAR4\t1\tOne\n"; + "Var4\tMSITESTVAR4\t1\tOne\n" + "Var5\t-MSITESTVAR5\t\tOne\n" + "Var6\tMSITESTVAR6\t\tOne\n" + "Var7\t!-MSITESTVAR7\t\tOne\n" + "Var8\t!-*MSITESTVAR8\t\tOne\n" + "Var9\t=-MSITESTVAR9\t\tOne\n" + "Var10\t=MSITESTVAR10\t\tOne\n"; static const CHAR condition_dat[] = "Feature_\tLevel\tCondition\n" "s38\ti2\tS255\n" @@ -1684,6 +1692,7 @@ static void init_functionpointers(void) trace("GetProcAddress(%s) failed\n", #func); GET_PROC(hmsi, MsiQueryComponentStateA); + GET_PROC(hmsi, MsiSetExternalUIRecord); GET_PROC(hmsi, MsiSourceListEnumSourcesA); GET_PROC(hmsi, MsiSourceListGetInfoA); @@ -3944,6 +3953,7 @@ static void test_publish_registeruser(void) DeleteFile(msifile); DeleteFile("msitest\\maximus"); RemoveDirectory("msitest"); + LocalFree(usersid); } static void test_publish_processcomponents(void) @@ -4068,6 +4078,7 @@ static void test_publish_processcomponents(void) DeleteFile(msifile); DeleteFile("msitest\\maximus"); RemoveDirectory("msitest"); + LocalFree(usersid); } static void test_publish(void) @@ -6605,6 +6616,24 @@ static void test_envvar(void) res = RegDeleteValueA(env, "MSITESTVAR4"); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + res = RegDeleteValueA(env, "MSITESTVAR5"); + ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); + + res = RegDeleteValueA(env, "MSITESTVAR6"); + ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); + + res = RegDeleteValueA(env, "MSITESTVAR7"); + ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); + + res = RegDeleteValueA(env, "MSITESTVAR8"); + ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); + + res = RegDeleteValueA(env, "MSITESTVAR9"); + ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); + + res = RegDeleteValueA(env, "MSITESTVAR10"); + ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res); + RegCloseKey(env); delete_pf("msitest\\cabout\\new\\five.txt", TRUE); @@ -6869,6 +6898,84 @@ static void test_file_in_use_cab(void) delete_test_files(); } +static INT CALLBACK handler_a(LPVOID context, UINT type, LPCSTR msg) +{ + return IDOK; +} + +static INT CALLBACK handler_w(LPVOID context, UINT type, LPCWSTR msg) +{ + return IDOK; +} + +static INT CALLBACK handler_record(LPVOID context, UINT type, MSIHANDLE record) +{ + return IDOK; +} + +static void test_MsiSetExternalUI(void) +{ + INSTALLUI_HANDLERA ret_a; + INSTALLUI_HANDLERW ret_w; + INSTALLUI_HANDLER_RECORD prev; + UINT error; + + ret_a = MsiSetExternalUIA(handler_a, INSTALLLOGMODE_ERROR, NULL); + ok(ret_a == NULL, "expected NULL, got %p\n", ret_a); + + ret_a = MsiSetExternalUIA(NULL, 0, NULL); + ok(ret_a == handler_a, "expected %p, got %p\n", handler_a, ret_a); + + /* Not present before Installer 3.1 */ + if (!pMsiSetExternalUIRecord) { + win_skip("MsiSetExternalUIRecord is not available\n"); + return; + } + + error = pMsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, &prev); + ok(!error, "MsiSetExternalUIRecord failed %u\n", error); + ok(prev == NULL, "expected NULL, got %p\n", prev); + + prev = (INSTALLUI_HANDLER_RECORD)0xdeadbeef; + error = pMsiSetExternalUIRecord(NULL, INSTALLLOGMODE_ERROR, NULL, &prev); + ok(!error, "MsiSetExternalUIRecord failed %u\n", error); + ok(prev == handler_record, "expected %p, got %p\n", handler_record, prev); + + ret_w = MsiSetExternalUIW(handler_w, INSTALLLOGMODE_ERROR, NULL); + ok(ret_w == NULL, "expected NULL, got %p\n", ret_w); + + ret_w = MsiSetExternalUIW(NULL, 0, NULL); + ok(ret_w == handler_w, "expected %p, got %p\n", handler_w, ret_w); + + ret_a = MsiSetExternalUIA(handler_a, INSTALLLOGMODE_ERROR, NULL); + ok(ret_a == NULL, "expected NULL, got %p\n", ret_a); + + ret_w = MsiSetExternalUIW(handler_w, INSTALLLOGMODE_ERROR, NULL); + ok(ret_w == NULL, "expected NULL, got %p\n", ret_w); + + prev = (INSTALLUI_HANDLER_RECORD)0xdeadbeef; + error = pMsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, &prev); + ok(!error, "MsiSetExternalUIRecord failed %u\n", error); + ok(prev == NULL, "expected NULL, got %p\n", prev); + + ret_a = MsiSetExternalUIA(NULL, 0, NULL); + ok(ret_a == NULL, "expected NULL, got %p\n", ret_a); + + ret_w = MsiSetExternalUIW(NULL, 0, NULL); + ok(ret_w == NULL, "expected NULL, got %p\n", ret_w); + + prev = (INSTALLUI_HANDLER_RECORD)0xdeadbeef; + error = pMsiSetExternalUIRecord(NULL, 0, NULL, &prev); + ok(!error, "MsiSetExternalUIRecord failed %u\n", error); + ok(prev == handler_record, "expected %p, got %p\n", handler_record, prev); + + error = pMsiSetExternalUIRecord(handler_record, INSTALLLOGMODE_ERROR, NULL, NULL); + ok(!error, "MsiSetExternalUIRecord failed %u\n", error); + + error = pMsiSetExternalUIRecord(NULL, 0, NULL, NULL); + ok(!error, "MsiSetExternalUIRecord failed %u\n", error); +} + START_TEST(install) { DWORD len; @@ -6957,6 +7064,7 @@ START_TEST(install) test_installed_prop(); test_file_in_use(); test_file_in_use_cab(); + test_MsiSetExternalUI(); DeleteFileA(log_file); diff --git a/rostests/winetests/msi/msi.c b/rostests/winetests/msi/msi.c index f25d5803628..8da34990006 100644 --- a/rostests/winetests/msi/msi.c +++ b/rostests/winetests/msi/msi.c @@ -1201,6 +1201,7 @@ static void test_MsiQueryFeatureState(void) RegCloseKey(compkey2); RegCloseKey(localkey); RegCloseKey(userkey); + LocalFree(usersid); } static void test_MsiQueryComponentState(void) @@ -1520,6 +1521,7 @@ static void test_MsiQueryComponentState(void) RegDeleteKeyA(compkey, ""); RegCloseKey(prodkey); RegCloseKey(compkey); + LocalFree(usersid); } static void test_MsiGetComponentPath(void) @@ -1872,6 +1874,7 @@ static void test_MsiGetComponentPath(void) RegCloseKey(prodkey); RegCloseKey(compkey); DeleteFileA("C:\\imapath"); + LocalFree(usersid); } static void test_MsiGetProductCode(void) @@ -2128,6 +2131,7 @@ static void test_MsiGetProductCode(void) RegDeleteValueA(compkey, prod2_squashed); RegDeleteKeyA(compkey, ""); RegCloseKey(compkey); + LocalFree(usersid); } static void test_MsiEnumClients(void) @@ -2314,6 +2318,7 @@ static void test_MsiEnumClients(void) RegDeleteValueA(compkey, prod2_squashed); RegDeleteKeyA(compkey, ""); RegCloseKey(compkey); + LocalFree(usersid); } static void get_version_info(LPSTR path, LPSTR *vercheck, LPDWORD verchecksz, @@ -3845,6 +3850,7 @@ static void test_MsiGetProductInfo(void) RegCloseKey(localkey); RegCloseKey(source); RegCloseKey(prodkey); + LocalFree(usersid); } static void test_MsiGetProductInfoEx(void) @@ -6582,6 +6588,7 @@ static void test_MsiGetProductInfoEx(void) RegDeleteValueA(prodkey, "HelpLink"); RegDeleteKeyA(prodkey, ""); RegCloseKey(prodkey); + LocalFree(usersid); } #define INIT_USERINFO() \ @@ -7161,6 +7168,7 @@ static void test_MsiGetUserInfo(void) RegCloseKey(userprod); RegDeleteKeyA(prodkey, ""); RegCloseKey(prodkey); + LocalFree(usersid); } static void test_MsiOpenProduct(void) @@ -7473,6 +7481,7 @@ static void test_MsiOpenProduct(void) RegCloseKey(prodkey); DeleteFileA(msifile); + LocalFree(usersid); } static void test_MsiEnumPatchesEx_usermanaged(LPCSTR usersid, LPCSTR expectedsid) @@ -9201,6 +9210,7 @@ static void test_MsiEnumPatchesEx(void) test_MsiEnumPatchesEx_userunmanaged(NULL, usersid); /* FIXME: Successfully test userunmanaged with a different user */ test_MsiEnumPatchesEx_machine(); + LocalFree(usersid); } static void test_MsiEnumPatches(void) @@ -9864,6 +9874,7 @@ static void test_MsiEnumPatches(void) RegCloseKey(udprod); RegDeleteKeyA(prodkey, ""); RegCloseKey(prodkey); + LocalFree(usersid); } static void test_MsiGetPatchInfoEx(void) @@ -10876,6 +10887,7 @@ static void test_MsiGetPatchInfoEx(void) RegCloseKey(props); RegDeleteKeyA(udprod, ""); RegCloseKey(udprod); + LocalFree(usersid); } static void test_MsiEnumProducts(void) diff --git a/rostests/winetests/msi/source.c b/rostests/winetests/msi/source.c index 5a51c66c3f8..fd983ae50f0 100644 --- a/rostests/winetests/msi/source.c +++ b/rostests/winetests/msi/source.c @@ -628,6 +628,7 @@ static void test_MsiSourceListGetInfo(void) RegDeleteKeyA(userkey, ""); RegCloseKey(hkey); RegCloseKey(userkey); + LocalFree(usersid); } static void test_MsiSourceListAddSourceEx(void) @@ -1605,6 +1606,7 @@ static void test_MsiSourceListEnumSources(void) RegCloseKey(source); RegDeleteKeyA(prodkey, ""); RegCloseKey(prodkey); + LocalFree(usersid); } static void test_MsiSourceListSetInfo(void) @@ -2015,6 +2017,7 @@ static void test_MsiSourceListSetInfo(void) RegCloseKey(source); RegDeleteKeyA(prodkey, ""); RegCloseKey(prodkey); + LocalFree(usersid); } static void test_MsiSourceListAddMediaDisk(void) @@ -2312,6 +2315,7 @@ static void test_MsiSourceListAddMediaDisk(void) RegCloseKey(source); RegDeleteKeyA(prodkey, ""); RegCloseKey(prodkey); + LocalFree(usersid); } static void test_MsiSourceListEnumMediaDisks(void) @@ -3114,6 +3118,7 @@ static void test_MsiSourceListEnumMediaDisks(void) RegCloseKey(source); RegDeleteKeyA(prodkey, ""); RegCloseKey(prodkey); + LocalFree(usersid); } static void test_MsiSourceListAddSource(void) @@ -3369,6 +3374,7 @@ static void test_MsiSourceListAddSource(void) RegCloseKey(source); RegDeleteKeyA(prodkey, ""); RegCloseKey(prodkey); + LocalFree(usersid); } START_TEST(source)