1
0
mirror of https://github.com/wine-mirror/wine synced 2024-06-29 06:14:34 +00:00

msi/tests: Get rid of workarounds for old Windows versions.

This commit is contained in:
Hans Leidekker 2024-04-05 16:25:09 +02:00 committed by Alexandre Julliard
parent a6eb51f0e5
commit 738ec82855
10 changed files with 2191 additions and 4093 deletions

View File

@ -29,7 +29,6 @@
#include <msidefs.h>
#include <msi.h>
#include <fci.h>
#include <srrestoreptapi.h>
#include <wtypes.h>
#include <shellapi.h>
#include <winsvc.h>
@ -40,23 +39,6 @@
#include "utils.h"
#include "typelib.h"
static UINT (WINAPI *pMsiQueryComponentStateA)
(LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE *);
static UINT (WINAPI *pMsiSourceListEnumSourcesA)
(LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPSTR, LPDWORD);
static UINT (WINAPI *pMsiSourceListGetInfoA)
(LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, LPCSTR, LPSTR, LPDWORD);
static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
(LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
static UINT (WINAPI *pMsiQueryFeatureStateExA)
(LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE *);
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA *, STATEMGRSTATUS *);
static BOOL is_wow64;
static const BOOL is_64bit = sizeof(void *) > sizeof(int);
@ -2372,33 +2354,6 @@ static const msi_table rep_tables[] =
/* make the max size large so there is only one cab file */
#define MEDIA_SIZE 0x7FFFFFFF
static void init_functionpointers(void)
{
HMODULE hmsi = GetModuleHandleA("msi.dll");
HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
HMODULE hsrclient = LoadLibraryA("srclient.dll");
#define GET_PROC(mod, func) \
p ## func = (void*)GetProcAddress(mod, #func); \
if(!p ## func) \
trace("GetProcAddress(%s) failed\n", #func);
GET_PROC(hmsi, MsiQueryComponentStateA);
GET_PROC(hmsi, MsiSourceListEnumSourcesA);
GET_PROC(hmsi, MsiSourceListGetInfoA);
GET_PROC(hmsi, MsiGetComponentPathExA);
GET_PROC(hmsi, MsiQueryFeatureStateExA);
GET_PROC(hadvapi32, RegDeleteKeyExA)
GET_PROC(hkernel32, IsWow64Process)
GET_PROC(hsrclient, SRRemoveRestorePoint);
GET_PROC(hsrclient, SRSetRestorePointA);
#undef GET_PROC
}
static char *get_user_sid(void)
{
HANDLE token;
@ -2454,34 +2409,6 @@ static void delete_test_files(void)
RemoveDirectoryA("msitest");
}
static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
{
RESTOREPOINTINFOA spec;
spec.dwEventType = event_type;
spec.dwRestorePtType = APPLICATION_INSTALL;
spec.llSequenceNumber = status->llSequenceNumber;
lstrcpyA(spec.szDescription, "msitest restore point");
return pSRSetRestorePointA(&spec, status);
}
static void remove_restore_point(DWORD seq_number)
{
DWORD res;
res = pSRRemoveRestorePoint(seq_number);
if (res != ERROR_SUCCESS)
trace("Failed to remove the restore point : %#lx\n", res);
}
static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
{
if (pRegDeleteKeyExA)
return pRegDeleteKeyExA( key, subkey, access, 0 );
return RegDeleteKeyA( key, subkey );
}
static void delete_pfmsitest_files(void)
{
SHFILEOPSTRUCTA shfl;
@ -3115,9 +3042,9 @@ static void test_publish_product(void)
if (!res)
CHECK_DEL_REG_STR(patches, "AllPatches", "");
delete_key(patches, "", access);
RegDeleteKeyExA(patches, "", access, 0);
RegCloseKey(patches);
delete_key(hkey, "", access);
RegDeleteKeyExA(hkey, "", access, 0);
RegCloseKey(hkey);
currentuser:
@ -3194,9 +3121,9 @@ currentuser:
if (!res)
CHECK_DEL_REG_STR(patches, "AllPatches", "");
delete_key(patches, "", access);
RegDeleteKeyExA(patches, "", access, 0);
RegCloseKey(patches);
delete_key(hkey, "", access);
RegDeleteKeyExA(hkey, "", access, 0);
RegCloseKey(hkey);
machprod:
@ -3227,7 +3154,7 @@ machprod:
CHECK_DEL_REG_STR(net, "1", temp);
res = delete_key(net, "", access);
res = RegDeleteKeyExA(net, "", access, 0);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
RegCloseKey(net);
@ -3236,13 +3163,13 @@ machprod:
CHECK_DEL_REG_STR(media, "1", "DISK1;");
res = delete_key(media, "", access);
res = RegDeleteKeyExA(media, "", access, 0);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
RegCloseKey(media);
res = delete_key(sourcelist, "", access);
res = RegDeleteKeyExA(sourcelist, "", access, 0);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
RegCloseKey(sourcelist);
res = delete_key(hkey, "", access);
res = RegDeleteKeyExA(hkey, "", access, 0);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
RegCloseKey(hkey);
@ -3251,7 +3178,7 @@ machprod:
CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", "");
res = delete_key(hkey, "", access);
res = RegDeleteKeyExA(hkey, "", access, 0);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
RegCloseKey(hkey);
@ -3327,7 +3254,7 @@ static void test_publish_features(void)
RegDeleteValueA(hkey, "feature");
RegDeleteValueA(hkey, "montecristo");
delete_key(hkey, "", access);
RegDeleteKeyExA(hkey, "", access, 0);
RegCloseKey(hkey);
sprintf(keypath, udfeatpath, usersid);
@ -3339,10 +3266,10 @@ static void test_publish_features(void)
RegDeleteValueA(hkey, "feature");
RegDeleteValueA(hkey, "montecristo");
delete_key(hkey, "", access);
RegDeleteKeyExA(hkey, "", access, 0);
RegCloseKey(hkey);
sprintf(keypath, udpridpath, usersid);
delete_key(HKEY_LOCAL_MACHINE, keypath, access);
RegDeleteKeyExA(HKEY_LOCAL_MACHINE, keypath, access, 0);
/* PublishFeatures, machine */
r = MsiInstallProductA(msifile, "PUBLISH_FEATURES=1 ALLUSERS=1");
@ -3363,7 +3290,7 @@ static void test_publish_features(void)
RegDeleteValueA(hkey, "feature");
RegDeleteValueA(hkey, "montecristo");
delete_key(hkey, "", access);
RegDeleteKeyExA(hkey, "", access, 0);
RegCloseKey(hkey);
sprintf(keypath, udfeatpath, "S-1-5-18");
@ -3375,10 +3302,10 @@ static void test_publish_features(void)
RegDeleteValueA(hkey, "feature");
RegDeleteValueA(hkey, "montecristo");
delete_key(hkey, "", access);
RegDeleteKeyExA(hkey, "", access, 0);
RegCloseKey(hkey);
sprintf(keypath, udpridpath, "S-1-5-18");
delete_key(HKEY_LOCAL_MACHINE, keypath, access);
RegDeleteKeyExA(HKEY_LOCAL_MACHINE, keypath, access, 0);
error:
DeleteFileA(msifile);
@ -3510,10 +3437,10 @@ static void test_register_user(void)
RegDeleteValueA(props, "ProductID");
RegDeleteValueA(props, "RegCompany");
RegDeleteValueA(props, "RegOwner");
delete_key(props, "", access);
RegDeleteKeyExA(props, "", access, 0);
RegCloseKey(props);
sprintf(keypath, keypridfmt, usersid);
delete_key(HKEY_LOCAL_MACHINE, keypath, access);
RegDeleteKeyExA(HKEY_LOCAL_MACHINE, keypath, access, 0);
/* RegisterUser, machine */
r = MsiInstallProductA(msifile, "REGISTER_USER=1 ALLUSERS=1");
@ -3532,10 +3459,10 @@ static void test_register_user(void)
RegDeleteValueA(props, "ProductID");
RegDeleteValueA(props, "RegCompany");
RegDeleteValueA(props, "RegOwner");
delete_key(props, "", access);
RegDeleteKeyExA(props, "", access, 0);
RegCloseKey(props);
sprintf(keypath, keypridfmt, "S-1-5-18");
delete_key(HKEY_LOCAL_MACHINE, keypath, access);
RegDeleteKeyExA(HKEY_LOCAL_MACHINE, keypath, access, 0);
error:
free(company);
@ -3612,7 +3539,7 @@ static void test_process_components(void)
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
delete_key(comp, "", access);
RegDeleteKeyExA(comp, "", access, 0);
RegCloseKey(comp);
sprintf(keypath, keyfmt, usersid, "241C3DA58FECD0945B9687D408766058");
@ -3630,7 +3557,7 @@ static void test_process_components(void)
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
delete_key(comp, "", access);
RegDeleteKeyExA(comp, "", access, 0);
RegCloseKey(comp);
/* ProcessComponents, machine */
@ -3654,7 +3581,7 @@ static void test_process_components(void)
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
delete_key(comp, "", access);
RegDeleteKeyExA(comp, "", access, 0);
RegCloseKey(comp);
sprintf(keypath, keyfmt, "S-1-5-18", "241C3DA58FECD0945B9687D408766058");
@ -3672,7 +3599,7 @@ static void test_process_components(void)
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
RegDeleteValueA(comp, "84A88FD7F6998CE40A22FB59F6B9C2BB");
delete_key(comp, "", access);
RegDeleteKeyExA(comp, "", access, 0);
RegCloseKey(comp);
error:
@ -3695,11 +3622,6 @@ static void test_publish(void)
REGSAM access = KEY_ALL_ACCESS;
DWORD error, type, size;
if (!pMsiQueryFeatureStateExA)
{
win_skip("MsiQueryFeatureStateExA is not available\n");
return;
}
if (!is_process_elevated())
{
skip("process is limited\n");
@ -3736,7 +3658,7 @@ static void test_publish(void)
state = 0xdead;
SetLastError(0xdeadbeef);
r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state);
r = MsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state);
error = GetLastError();
ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
ok(state == 0xdead, "got %d\n", state);
@ -3744,7 +3666,7 @@ static void test_publish(void)
state = 0xdead;
SetLastError(0xdeadbeef);
r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state);
r = MsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state);
error = GetLastError();
ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
ok(state == 0xdead, "got %d\n", state);
@ -3752,7 +3674,7 @@ static void test_publish(void)
state = 0xdead;
SetLastError(0xdeadbeef);
r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state);
r = MsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state);
error = GetLastError();
ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
ok(state == 0xdead, "got %d\n", state);
@ -3764,7 +3686,7 @@ static void test_publish(void)
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
@ -3792,7 +3714,7 @@ static void test_publish(void)
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
@ -3815,7 +3737,7 @@ static void test_publish(void)
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_UNKNOWN_COMPONENT, "Expected ERROR_UNKNOWN_COMPONENT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
@ -3874,7 +3796,7 @@ static void test_publish(void)
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
@ -3896,7 +3818,7 @@ static void test_publish(void)
state = 0xdead;
SetLastError(0xdeadbeef);
r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state);
r = MsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_MACHINE, "feature", &state);
error = GetLastError();
ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
ok(state == 0xdead, "got %d\n", state);
@ -3904,7 +3826,7 @@ static void test_publish(void)
state = 0xdead;
SetLastError(0xdeadbeef);
r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state);
r = MsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERMANAGED, "feature", &state);
error = GetLastError();
ok(r == ERROR_UNKNOWN_PRODUCT, "got %u\n", r);
ok(state == 0xdead, "got %d\n", state);
@ -3912,7 +3834,7 @@ static void test_publish(void)
state = 0xdead;
SetLastError(0xdeadbeef);
r = pMsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state);
r = MsiQueryFeatureStateExA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, "feature", &state);
error = GetLastError();
ok(r == ERROR_SUCCESS, "got %u\n", r);
ok(state == INSTALLSTATE_LOCAL, "got %d\n", state);
@ -3921,7 +3843,7 @@ static void test_publish(void)
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
@ -3979,7 +3901,7 @@ static void test_publish(void)
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
@ -4002,7 +3924,7 @@ static void test_publish(void)
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
@ -4060,7 +3982,7 @@ static void test_publish(void)
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
@ -4118,7 +4040,7 @@ static void test_publish(void)
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
@ -4176,7 +4098,7 @@ static void test_publish(void)
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
@ -4199,7 +4121,7 @@ static void test_publish(void)
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(state == INSTALLSTATE_LOCAL, "Expected INSTALLSTATE_LOCAL, got %d\n", state);
@ -4265,7 +4187,7 @@ static void test_publish(void)
state = MsiQueryFeatureStateA(prodcode, "montecristo");
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
r = pMsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
r = MsiQueryComponentStateA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
"{DF2CBABC-3BCC-47E5-A998-448D1C0C895B}", &state);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(state == INSTALLSTATE_UNKNOWN, "Expected INSTALLSTATE_UNKNOWN, got %d\n", state);
@ -4292,11 +4214,6 @@ static void test_publish_sourcelist(void)
CHAR path[MAX_PATH];
CHAR prodcode[] = "{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}";
if (!pMsiSourceListEnumSourcesA || !pMsiSourceListGetInfoA)
{
win_skip("MsiSourceListEnumSourcesA and/or MsiSourceListGetInfoA are not available\n");
return;
}
if (!is_process_elevated())
{
skip("process is limited\n");
@ -4323,16 +4240,16 @@ static void test_publish_sourcelist(void)
/* nothing published */
size = MAX_PATH;
lstrcpyA(value, "aaa");
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(size == MAX_PATH, "got %lu\n", size);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
size = MAX_PATH;
lstrcpyA(value, "aaa");
r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(size == MAX_PATH, "got %lu\n", size);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
@ -4345,16 +4262,16 @@ static void test_publish_sourcelist(void)
/* after RegisterProduct */
size = MAX_PATH;
lstrcpyA(value, "aaa");
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(size == MAX_PATH, "got %lu\n", size);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
size = MAX_PATH;
lstrcpyA(value, "aaa");
r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(size == MAX_PATH, "got %lu\n", size);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
@ -4367,16 +4284,16 @@ static void test_publish_sourcelist(void)
/* after ProcessComponents */
size = MAX_PATH;
lstrcpyA(value, "aaa");
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(size == MAX_PATH, "got %lu\n", size);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
size = MAX_PATH;
lstrcpyA(value, "aaa");
r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(size == MAX_PATH, "got %lu\n", size);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
@ -4389,16 +4306,16 @@ static void test_publish_sourcelist(void)
/* after PublishFeatures */
size = MAX_PATH;
lstrcpyA(value, "aaa");
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(size == MAX_PATH, "got %lu\n", size);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
size = MAX_PATH;
lstrcpyA(value, "aaa");
r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_UNKNOWN_PRODUCT, "Expected ERROR_UNKNOWN_PRODUCT, got %d\n", r);
ok(size == MAX_PATH, "got %lu\n", size);
ok(!lstrcmpA(value, "aaa"), "Expected \"aaa\", got \"%s\"\n", value);
@ -4411,24 +4328,24 @@ static void test_publish_sourcelist(void)
/* after PublishProduct */
size = MAX_PATH;
lstrcpyA(value, "aaa");
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_PACKAGENAMEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "msitest.msi"), "Expected 'msitest.msi', got %s\n", value);
ok(size == 11, "Expected 11, got %lu\n", size);
size = MAX_PATH;
lstrcpyA(value, "aaa");
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_MEDIAPACKAGEPATHA, value, &size);
r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_MEDIAPACKAGEPATHA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
ok(size == 0, "Expected 0, got %lu\n", size);
size = MAX_PATH;
lstrcpyA(value, "aaa");
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_DISKPROMPTA, value, &size);
r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_DISKPROMPTA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, ""), "Expected \"\", got \"%s\"\n", value);
ok(size == 0, "Expected 0, got %lu\n", size);
@ -4438,40 +4355,40 @@ static void test_publish_sourcelist(void)
size = MAX_PATH;
lstrcpyA(value, "aaa");
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDSOURCEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
ok(size == lstrlenA(path), "Expected %d, got %lu\n", lstrlenA(path), size);
size = MAX_PATH;
lstrcpyA(value, "aaa");
r = pMsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA, value, &size);
r = MsiSourceListGetInfoA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT, INSTALLPROPERTY_LASTUSEDTYPEA, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, "n"), "Expected \"n\", got \"%s\"\n", value);
ok(size == 1, "Expected 1, got %lu\n", size);
size = MAX_PATH;
lstrcpyA(value, "aaa");
r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_URL, 0, value, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
size = MAX_PATH;
lstrcpyA(value, "aaa");
r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 0, value, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(value, path), "Expected \"%s\", got \"%s\"\n", path, value);
ok(size == lstrlenA(path), "Expected %d, got %lu\n", lstrlenA(path), size);
size = MAX_PATH;
lstrcpyA(value, "aaa");
r = pMsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 1, value, &size);
r = MsiSourceListEnumSourcesA(prodcode, NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
MSICODE_PRODUCT | MSISOURCETYPE_NETWORK, 1, value, &size);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
ok(!lstrcmpA(value, "aaa"), "Expected value to be unchanged, got %s\n", value);
ok(size == MAX_PATH, "Expected MAX_PATH, got %lu\n", size);
@ -5810,10 +5727,7 @@ static void test_publish_components(void)
"english.txt", INSTALLMODE_DEFAULT, NULL, &size);
ok(r == ERROR_SUCCESS, "MsiProvideQualifiedComponent returned %d\n", r);
if (pRegDeleteKeyExA)
res = pRegDeleteKeyExA(HKEY_LOCAL_MACHINE, keypath2, KEY_WOW64_64KEY, 0);
else
res = RegDeleteKeyA(HKEY_LOCAL_MACHINE, keypath2);
res = RegDeleteKeyExA(HKEY_LOCAL_MACHINE, keypath2, KEY_WOW64_64KEY, 0);
ok(res == ERROR_SUCCESS, "RegDeleteKey failed %ld\n", res);
res = RegCreateKeyA(HKEY_CURRENT_USER, keypath, &key);
@ -6581,16 +6495,12 @@ START_TEST(action)
{
DWORD len;
char temp_path[MAX_PATH], prev_path[MAX_PATH], log_file[MAX_PATH];
STATEMGRSTATUS status;
BOOL ret = FALSE;
if (!is_process_elevated()) restart_as_admin_elevated();
init_functionpointers();
subtest("custom");
if (pIsWow64Process)
pIsWow64Process(GetCurrentProcess(), &is_wow64);
IsWow64Process(GetCurrentProcess(), &is_wow64);
GetCurrentDirectoryA(MAX_PATH, prev_path);
GetTempPathA(MAX_PATH, temp_path);
@ -6605,18 +6515,6 @@ START_TEST(action)
ok(get_system_dirs(), "failed to retrieve system dirs\n");
ok(get_user_dirs(), "failed to retrieve user dirs\n");
/* Create a restore point ourselves so we circumvent the multitude of restore points
* that would have been created by all the installation and removal tests.
*
* This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
* creation of restore points.
*/
if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
{
memset(&status, 0, sizeof(status));
ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
}
/* Create only one log file and don't append. We have to pass something
* for the log mode for this to work. The logfile needs to have an absolute
* path otherwise we still end up with some extra logfiles as some tests
@ -6660,13 +6558,5 @@ START_TEST(action)
test_remove_existing_products();
DeleteFileA(log_file);
if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
{
ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
if (ret)
remove_restore_point(status.llSequenceNumber);
}
SetCurrentDirectoryA(prev_path);
}

View File

@ -36,9 +36,6 @@
static BOOL is_wow64;
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
static const char *msifile = "winetest-automation.msi";
@ -191,29 +188,6 @@ static const msi_summary_info summary_info[] =
ADD_INFO_FILETIME(PID_LASTPRINTED, &systemtime)
};
static void init_functionpointers(void)
{
HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
#define GET_PROC(dll, func) \
p ## func = (void *)GetProcAddress(dll, #func); \
if(!p ## func) \
trace("GetProcAddress(%s) failed\n", #func);
GET_PROC(hadvapi32, RegDeleteKeyExA)
GET_PROC(hkernel32, IsWow64Process)
#undef GET_PROC
}
static LONG delete_key_portable( HKEY key, LPCSTR subkey, REGSAM access )
{
if (pRegDeleteKeyExA)
return pRegDeleteKeyExA( key, subkey, access, 0 );
return RegDeleteKeyA( key, subkey );
}
/*
* Database Helpers
*/
@ -2259,7 +2233,7 @@ static UINT delete_registry_key(HKEY hkeyParent, LPCSTR subkey, REGSAM access)
RegCloseKey(hkey);
free(string);
delete_key_portable(hkeyParent, subkey, access);
RegDeleteKeyExA(hkeyParent, subkey, access, 0);
return ERROR_SUCCESS;
}
@ -2439,13 +2413,13 @@ static void test_Installer_InstallProduct(void)
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
/* Remove registry keys written by RegisterProduct standard action */
res = delete_key_portable(HKEY_LOCAL_MACHINE,
res = RegDeleteKeyExA(HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{837450fa-a39b-4bc8-b321-08b393f784b3}",
KEY_WOW64_32KEY);
KEY_WOW64_32KEY, 0);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
res = delete_key_portable(HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UpgradeCodes\\D8E760ECA1E276347B43E42BDBDA5656", access);
res = RegDeleteKeyExA(HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UpgradeCodes\\D8E760ECA1E276347B43E42BDBDA5656", access, 0);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
res = find_registry_key(HKEY_LOCAL_MACHINE,
@ -2456,8 +2430,8 @@ static void test_Installer_InstallProduct(void)
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
RegCloseKey(hkey);
res = delete_key_portable(HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\Products\\af054738b93a8cb43b12803b397f483b", access);
res = RegDeleteKeyExA(HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\Products\\af054738b93a8cb43b12803b397f483b", access, 0);
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %ld\n", res);
/* Remove registry keys written by PublishProduct standard action */
@ -2624,12 +2598,9 @@ START_TEST(automation)
CLSID clsid;
IUnknown *pUnk;
init_functionpointers();
if (!is_process_elevated()) restart_as_admin_elevated();
if (pIsWow64Process)
pIsWow64Process(GetCurrentProcess(), &is_wow64);
IsWow64Process(GetCurrentProcess(), &is_wow64);
GetSystemTimeAsFileTime(&systemtime);
@ -2666,6 +2637,5 @@ START_TEST(automation)
}
OleUninitialize();
SetCurrentDirectoryA(prev_path);
}

View File

@ -1128,9 +1128,7 @@ static void test_invalid_functions(MSIHANDLE hinst)
ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
r = MsiCreateTransformSummaryInfoA(db, db, "bogus.mst", 0, 0);
todo_wine ok(hinst, r == ERROR_INSTALL_PACKAGE_OPEN_FAILED ||
r == ERROR_INSTALL_PACKAGE_INVALID /* winxp */,
"got %u\n", r);
todo_wine ok(hinst, r == ERROR_INSTALL_PACKAGE_OPEN_FAILED, "got %u\n", r);
GetCurrentDirectoryA(sizeof(path), path);
r = MsiDatabaseExportA(db, "Test", path, "bogus.idt");

View File

@ -29,7 +29,6 @@
#include <msi.h>
#include <fci.h>
#include <objidl.h>
#include <srrestoreptapi.h>
#include <shlobj.h>
#include <winsvc.h>
#include <shellapi.h>
@ -37,21 +36,6 @@
#include "wine/test.h"
#include "utils.h"
static UINT (WINAPI *pMsiQueryComponentStateA)
(LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, INSTALLSTATE*);
static UINT (WINAPI *pMsiSourceListEnumSourcesA)
(LPCSTR, LPCSTR, MSIINSTALLCONTEXT, DWORD, DWORD, LPSTR, LPDWORD);
static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)
(LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
static BOOL (WINAPI *pWow64DisableWow64FsRedirection)(void **);
static BOOL (WINAPI *pWow64RevertWow64FsRedirection)(void *);
static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
static BOOL is_wow64;
static const BOOL is_64bit = sizeof(void *) > sizeof(int);
@ -2224,33 +2208,6 @@ static int CDECL fci_delete(char *pszFile, int *err, void *pv)
return 0;
}
static void init_functionpointers(void)
{
HMODULE hmsi = GetModuleHandleA("msi.dll");
HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
HMODULE hsrclient = LoadLibraryA("srclient.dll");
#define GET_PROC(mod, func) \
p ## func = (void*)GetProcAddress(mod, #func); \
if(!p ## func) \
trace("GetProcAddress(%s) failed\n", #func);
GET_PROC(hmsi, MsiQueryComponentStateA);
GET_PROC(hmsi, MsiSourceListEnumSourcesA);
GET_PROC(hmsi, MsiGetComponentPathExA);
GET_PROC(hadvapi32, RegDeleteKeyExA)
GET_PROC(hkernel32, IsWow64Process)
GET_PROC(hkernel32, Wow64DisableWow64FsRedirection);
GET_PROC(hkernel32, Wow64RevertWow64FsRedirection);
GET_PROC(hsrclient, SRRemoveRestorePoint);
GET_PROC(hsrclient, SRSetRestorePointA);
#undef GET_PROC
}
BOOL is_process_elevated(void)
{
HANDLE token;
@ -2711,34 +2668,6 @@ void create_database_wordcount(const CHAR *name, const msi_table *tables, int nu
free( nameW );
}
static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
{
RESTOREPOINTINFOA spec;
spec.dwEventType = event_type;
spec.dwRestorePtType = APPLICATION_INSTALL;
spec.llSequenceNumber = status->llSequenceNumber;
lstrcpyA(spec.szDescription, "msitest restore point");
return pSRSetRestorePointA(&spec, status);
}
static void remove_restore_point(DWORD seq_number)
{
DWORD res;
res = pSRRemoveRestorePoint(seq_number);
if (res != ERROR_SUCCESS)
trace("Failed to remove the restore point: %#lx\n", res);
}
static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
{
if (pRegDeleteKeyExA)
return pRegDeleteKeyExA( key, subkey, access, 0 );
return RegDeleteKeyA( key, subkey );
}
static void test_MsiInstallProduct(void)
{
UINT r;
@ -2813,7 +2742,7 @@ static void test_MsiInstallProduct(void)
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
ok(!lstrcmpA(path, "OrderTestValue"), "Expected OrderTestValue, got %s\n", path);
delete_key(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", access);
RegDeleteKeyExA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", access, 0);
/* not published, reinstall */
r = MsiInstallProductA(msifile, NULL);
@ -5282,7 +5211,7 @@ static void process_pending_renames(HKEY hkey)
else
{
fileret = DeleteFileA(src);
ok(fileret || broken(!fileret) /* win2k3 */, "Failed to delete file %s (%lu)\n", src, GetLastError());
ok(fileret, "Failed to delete file %s (%lu)\n", src, GetLastError());
}
}
@ -5504,7 +5433,7 @@ static void test_feature_override(void)
ok(!delete_pf("msitest\\preselected.txt", TRUE), "file not removed\n");
ok(!delete_pf("msitest", FALSE), "directory not removed\n");
delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", access);
RegDeleteKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", access, 0);
error:
DeleteFileA("msitest\\override.txt");
@ -5890,7 +5819,7 @@ static void test_mixed_package(void)
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS|KEY_WOW64_32KEY, &hkey);
ok(res == ERROR_FILE_NOT_FOUND || broken(!res), "32-bit component key not removed\n");
ok(res == ERROR_FILE_NOT_FOUND, "32-bit component key not removed\n");
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS|KEY_WOW64_64KEY, &hkey);
ok(res == ERROR_FILE_NOT_FOUND, "64-bit component key not removed\n");
@ -5953,7 +5882,7 @@ static void test_mixed_package(void)
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS|KEY_WOW64_32KEY, &hkey);
ok(res == ERROR_FILE_NOT_FOUND || broken(!res), "32-bit component key not removed\n");
ok(res == ERROR_FILE_NOT_FOUND, "32-bit component key not removed\n");
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS|KEY_WOW64_64KEY, &hkey);
ok(res == ERROR_FILE_NOT_FOUND, "64-bit component key not removed\n");
@ -6189,7 +6118,7 @@ static void test_wow64(void)
goto error;
}
pWow64DisableWow64FsRedirection(&cookie);
Wow64DisableWow64FsRedirection(&cookie);
ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n");
ok(!delete_pf("msitest\\cabout\\new", FALSE), "Directory created\n");
@ -6215,7 +6144,7 @@ static void test_wow64(void)
ok(delete_pf_native("msitest\\filename", TRUE), "File not installed\n");
ok(delete_pf_native("msitest", FALSE), "Directory not created\n");
pWow64RevertWow64FsRedirection(cookie);
Wow64RevertWow64FsRedirection(cookie);
error:
delete_test_files();
@ -6256,16 +6185,12 @@ START_TEST(install)
{
DWORD len;
char temp_path[MAX_PATH], prev_path[MAX_PATH], log_file[MAX_PATH];
STATEMGRSTATUS status;
BOOL ret = FALSE;
if (!is_process_elevated()) restart_as_admin_elevated();
init_functionpointers();
subtest("custom");
if (pIsWow64Process)
pIsWow64Process(GetCurrentProcess(), &is_wow64);
IsWow64Process(GetCurrentProcess(), &is_wow64);
GetCurrentDirectoryA(MAX_PATH, prev_path);
GetTempPathA(MAX_PATH, temp_path);
@ -6280,18 +6205,6 @@ START_TEST(install)
ok(get_system_dirs(), "failed to retrieve system dirs\n");
ok(get_user_dirs(), "failed to retrieve user dirs\n");
/* Create a restore point ourselves so we circumvent the multitude of restore points
* that would have been created by all the installation and removal tests.
*
* This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
* creation of restore points.
*/
if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
{
memset(&status, 0, sizeof(status));
ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
}
/* Create only one log file and don't append. We have to pass something
* for the log mode for this to work. The logfile needs to have an absolute
* path otherwise we still end up with some extra logfiles as some tests
@ -6301,8 +6214,7 @@ START_TEST(install)
lstrcatA(log_file, "\\msitest.log");
MsiEnableLogA(INSTALLLOGMODE_FATALEXIT, log_file, 0);
if (pSRSetRestorePointA) /* test has side-effects on win2k3 that cause failures in following tests */
test_MsiInstallProduct();
test_MsiInstallProduct();
test_MsiSetComponentState();
test_packagecoltypes();
test_continuouscabs();
@ -6349,15 +6261,6 @@ START_TEST(install)
test_source_resolution();
DeleteFileA(customdll);
DeleteFileA(log_file);
if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
{
ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
if (ret)
remove_restore_point(status.llSequenceNumber);
}
SetCurrentDirectoryA(prev_path);
}

File diff suppressed because it is too large Load Diff

View File

@ -38,43 +38,6 @@ static BOOL is_wow64;
static const char msifile[] = "winetest-package.msi";
static const WCHAR msifileW[] = L"winetest-package.msi";
static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)(LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
static LONG (WINAPI *pRegDeleteKeyExW)(HKEY, LPCWSTR, REGSAM, DWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD);
static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*);
static void init_functionpointers(void)
{
HMODULE hmsi = GetModuleHandleA("msi.dll");
HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll");
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
HMODULE hsrclient = LoadLibraryA("srclient.dll");
#define GET_PROC(mod, func) \
p ## func = (void*)GetProcAddress(mod, #func);
GET_PROC(hmsi, MsiGetComponentPathExA);
GET_PROC(hadvapi32, RegDeleteKeyExA)
GET_PROC(hadvapi32, RegDeleteKeyExW)
GET_PROC(hkernel32, IsWow64Process)
GET_PROC(hsrclient, SRRemoveRestorePoint);
GET_PROC(hsrclient, SRSetRestorePointA);
#undef GET_PROC
}
static LONG delete_key( HKEY key, LPCSTR subkey, REGSAM access )
{
if (pRegDeleteKeyExA)
return pRegDeleteKeyExA( key, subkey, access, 0 );
return RegDeleteKeyA( key, subkey );
}
static char *get_user_sid(void)
{
HANDLE token;
@ -138,12 +101,7 @@ static LSTATUS package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey, REGSAM acce
}
if (lpszSubKey)
{
if (pRegDeleteKeyExW)
ret = pRegDeleteKeyExW(hKey, lpszSubKey, access, 0);
else
ret = RegDeleteKeyW(hKey, lpszSubKey);
}
ret = RegDeleteKeyExW(hKey, lpszSubKey, access, 0);
else
while (TRUE)
{
@ -977,27 +935,6 @@ done:
return ret;
}
static BOOL notify_system_change(DWORD event_type, STATEMGRSTATUS *status)
{
RESTOREPOINTINFOA spec;
spec.dwEventType = event_type;
spec.dwRestorePtType = APPLICATION_INSTALL;
spec.llSequenceNumber = status->llSequenceNumber;
lstrcpyA(spec.szDescription, "msitest restore point");
return pSRSetRestorePointA(&spec, status);
}
static void remove_restore_point(DWORD seq_number)
{
DWORD res;
res = pSRRemoveRestorePoint(seq_number);
if (res != ERROR_SUCCESS)
trace("Failed to remove the restore point: %#lx\n", res);
}
static BOOL is_root(const char *path)
{
return (isalpha(path[0]) && path[1] == ':' && path[2] == '\\' && !path[3]);
@ -2038,20 +1975,16 @@ static void test_condition(void)
ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
r = MsiEvaluateConditionW(hpkg, L"\"a\x30a\"<\"\xe5\"");
ok( r == MSICONDITION_TRUE || broken(r == MSICONDITION_FALSE),
"wrong return val (%d)\n", r);
ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
r = MsiEvaluateConditionW(hpkg, L"\"a\x30a\">\"\xe5\"");
ok( r == MSICONDITION_FALSE || broken(r == MSICONDITION_TRUE),
"wrong return val (%d)\n", r);
ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
r = MsiEvaluateConditionW(hpkg, L"\"a\x30a\"<>\"\xe5\"");
ok( r == MSICONDITION_TRUE || broken(r == MSICONDITION_FALSE),
"wrong return val (%d)\n", r);
ok( r == MSICONDITION_TRUE, "wrong return val (%d)\n", r);
r = MsiEvaluateConditionW(hpkg, L"\"a\x30a\"=\"\xe5\"");
ok( r == MSICONDITION_FALSE || broken(r == MSICONDITION_TRUE),
"wrong return val (%d)\n", r);
ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
MsiCloseHandle( hpkg );
DeleteFileA(msifile);
@ -2991,7 +2924,6 @@ static void test_states(void)
MSIHANDLE hpkg, hprod;
UINT r;
MSIHANDLE hdb;
BOOL is_broken;
char value[MAX_PATH];
DWORD size;
@ -3528,8 +3460,7 @@ static void test_states(void)
/* reinstall the product */
r = MsiInstallProductA(msifile3, "REINSTALL=ALL");
is_broken = (r == ERROR_INSTALL_FAILURE);
ok(r == ERROR_SUCCESS || broken(is_broken) /* win2k3 */, "Expected ERROR_SUCCESS, got %d\n", r);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}", "five");
ok(state == INSTALLSTATE_UNKNOWN, "state = %d\n", state);
@ -3701,8 +3632,7 @@ static void test_states(void)
MsiCloseHandle( hpkg );
r = MsiInstallProductA(msifile, "");
ok(r == ERROR_SUCCESS || (is_broken && r == ERROR_INSTALL_FAILURE) /* win2k3 */,
"Expected ERROR_SUCCESS, got %d\n", r);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}", "one");
ok(state == INSTALLSTATE_SOURCE, "state = %d\n", state);
state = MsiQueryFeatureStateA("{7262AC98-EEBD-4364-8CE3-D654F6A425B9}", "two");
@ -4040,8 +3970,8 @@ 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);
RegDeleteKeyExA(HKEY_LOCAL_MACHINE, "Software\\Winetest_msi", KEY_WOW64_32KEY, 0);
RegDeleteKeyExA(HKEY_LOCAL_MACHINE, "Software\\Winetest_msi", KEY_WOW64_64KEY, 0);
}
static void test_appsearch_complocator(void)
@ -4332,9 +4262,7 @@ static void test_appsearch_reglocator(void)
users = 0;
res = RegCreateKeyA(HKEY_USERS, "S-1-5-18\\Software\\Wine", &users);
ok(res == ERROR_SUCCESS ||
broken(res == ERROR_INVALID_PARAMETER),
"Expected ERROR_SUCCESS, got %ld\n", res);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
if (res == ERROR_SUCCESS)
{
@ -7955,6 +7883,7 @@ static void test_MsiGetProductProperty(void)
skip("Not enough rights to perform tests\n");
RegDeleteKeyA(prodkey, "");
RegCloseKey(prodkey);
DeleteFileA(msifile);
return;
}
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
@ -7965,12 +7894,16 @@ static void test_MsiGetProductProperty(void)
lstrcpyA(val, path);
lstrcatA(val, "\\");
lstrcatA(val, msifile);
res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ,
(const BYTE *)val, lstrlenA(val) + 1);
res = RegSetValueExA(props, "LocalPackage", 0, REG_SZ, (const BYTE *)val, lstrlenA(val) + 1);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
hprod = 0xdeadbeef;
r = MsiOpenProductA(prodcode, &hprod);
if (r == ERROR_UNKNOWN_PRODUCT)
{
win_skip("broken result, skipping tests\n");
goto done;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(hprod != 0 && hprod != 0xdeadbeef, "Expected a valid product handle\n");
@ -8191,13 +8124,13 @@ static void test_MsiGetProductProperty(void)
"Expected %d, got %lu\n", lstrlenW(prodcodeW), size);
MsiCloseHandle(hprod);
done:
RegDeleteValueA(props, "LocalPackage");
delete_key(props, "", access);
RegDeleteKeyExA(props, "", access, 0);
RegCloseKey(props);
delete_key(userkey, "", access);
RegDeleteKeyExA(userkey, "", access, 0);
RegCloseKey(userkey);
delete_key(prodkey, "", access);
RegDeleteKeyExA(prodkey, "", access, 0);
RegCloseKey(prodkey);
DeleteFileA(msifile);
}
@ -9560,16 +9493,11 @@ static void test_top_level_action(void)
START_TEST(package)
{
char temp_path[MAX_PATH], prev_path[MAX_PATH];
STATEMGRSTATUS status;
BOOL ret = FALSE;
DWORD len;
if (!is_process_elevated()) restart_as_admin_elevated();
init_functionpointers();
if (pIsWow64Process)
pIsWow64Process(GetCurrentProcess(), &is_wow64);
IsWow64Process(GetCurrentProcess(), &is_wow64);
GetCurrentDirectoryA(MAX_PATH, prev_path);
GetTempPathA(MAX_PATH, temp_path);
@ -9581,18 +9509,6 @@ START_TEST(package)
if (len && (CURR_DIR[len - 1] == '\\'))
CURR_DIR[len - 1] = 0;
/* Create a restore point ourselves so we circumvent the multitude of restore points
* that would have been created by all the installation and removal tests.
*
* This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
* creation of restore points.
*/
if (pSRSetRestorePointA && !pMsiGetComponentPathExA)
{
memset(&status, 0, sizeof(status));
ret = notify_system_change(BEGIN_NESTED_SYSTEM_CHANGE, &status);
}
test_createpackage();
test_doaction();
test_gettargetpath_bad();
@ -9631,12 +9547,5 @@ START_TEST(package)
test_controlevent();
test_top_level_action();
if (pSRSetRestorePointA && !pMsiGetComponentPathExA && ret)
{
ret = notify_system_change(END_NESTED_SYSTEM_CHANGE, &status);
if (ret)
remove_restore_point(status.llSequenceNumber);
}
SetCurrentDirectoryA(prev_path);
}

View File

@ -32,12 +32,6 @@
#include "wine/test.h"
#include "utils.h"
static UINT (WINAPI *pMsiApplyPatchA)( LPCSTR, LPCSTR, INSTALLTYPE, LPCSTR );
static UINT (WINAPI *pMsiGetPatchInfoExA)( LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT,
LPCSTR, LPSTR, DWORD * );
static UINT (WINAPI *pMsiEnumPatchesExA)( LPCSTR, LPCSTR, DWORD, DWORD, DWORD, LPSTR,
LPSTR, MSIINSTALLCONTEXT *, LPSTR, LPDWORD );
static const char *msifile = "winetest-patch.msi";
static const char *mspfile = "winetest-patch.msp";
static const WCHAR msifileW[] = L"winetest-patch.msi";
@ -146,22 +140,6 @@ static const struct msi_table tables[] =
ADD_TABLE( condition )
};
static void init_function_pointers( void )
{
HMODULE hmsi = GetModuleHandleA( "msi.dll" );
#define GET_PROC( mod, func ) \
p ## func = (void *)GetProcAddress( mod, #func ); \
if (!p ## func) \
trace( "GetProcAddress(%s) failed\n", #func );
GET_PROC( hmsi, MsiApplyPatchA );
GET_PROC( hmsi, MsiGetPatchInfoExA );
GET_PROC( hmsi, MsiEnumPatchesExA );
#undef GET_PROC
}
static BOOL get_program_files_dir( char *buf, char *buf2 )
{
HKEY hkey;
@ -691,11 +669,6 @@ static void test_simple_patch( void )
WCHAR pathW[MAX_PATH];
MSIHANDLE hpackage, hdb, hview, hrec;
if (!pMsiApplyPatchA)
{
win_skip("MsiApplyPatchA is not available\n");
return;
}
if (!is_process_elevated())
{
skip("process is limited\n");
@ -774,14 +747,7 @@ static void test_simple_patch( void )
MsiCloseHandle( hpackage );
r = MsiApplyPatchA( mspfile, NULL, INSTALLTYPE_DEFAULT, NULL );
ok( r == ERROR_SUCCESS || broken( r == ERROR_PATCH_PACKAGE_INVALID ), /* version 2.0 */
"expected ERROR_SUCCESS, got %u\n", r );
if (r == ERROR_PATCH_PACKAGE_INVALID)
{
win_skip("Windows Installer < 3.0 detected\n");
goto uninstall;
}
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
size = get_pf_file_size( "msitest\\patch.txt" );
ok( size == 1002, "expected 1002, got %lu\n", size );
@ -857,7 +823,6 @@ static void test_simple_patch( void )
MsiCloseHandle( hview );
MsiCloseHandle( hdb );
uninstall:
size = sizeof(path);
r = MsiGetProductInfoA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
"InstallSource", path, &size );
@ -1030,11 +995,6 @@ static void test_system_tables( void )
const char *query;
MSIHANDLE hproduct, hdb, hview, hrec;
if (!pMsiApplyPatchA)
{
win_skip("MsiApplyPatchA is not available\n");
return;
}
if (!is_process_elevated())
{
skip("process is limited\n");
@ -1112,14 +1072,7 @@ static void test_system_tables( void )
MsiCloseHandle( hproduct );
r = MsiApplyPatchA( mspfile, NULL, INSTALLTYPE_DEFAULT, NULL );
ok( r == ERROR_SUCCESS || broken( r == ERROR_PATCH_PACKAGE_INVALID ), /* version 2.0 */
"expected ERROR_SUCCESS, got %u\n", r );
if (r == ERROR_PATCH_PACKAGE_INVALID)
{
win_skip("Windows Installer < 3.0 detected\n");
goto uninstall;
}
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
r = MsiOpenProductA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}", &hproduct );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
@ -1203,7 +1156,6 @@ static void test_system_tables( void )
MsiCloseHandle( hdb );
MsiCloseHandle( hproduct );
uninstall:
r = MsiInstallProductA( msifile, "REMOVE=ALL" );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
@ -1220,11 +1172,6 @@ static void test_patch_registration( void )
DWORD size;
char buffer[MAX_PATH], patch_code[39];
if (!pMsiApplyPatchA || !pMsiGetPatchInfoExA || !pMsiEnumPatchesExA)
{
win_skip("required functions not available\n");
return;
}
if (!is_process_elevated())
{
skip("process is limited\n");
@ -1247,67 +1194,59 @@ static void test_patch_registration( void )
}
r = MsiApplyPatchA( mspfile, NULL, INSTALLTYPE_DEFAULT, NULL );
ok( r == ERROR_SUCCESS || broken( r == ERROR_PATCH_PACKAGE_INVALID ), /* version 2.0 */
"expected ERROR_SUCCESS, got %u\n", r );
if (r == ERROR_PATCH_PACKAGE_INVALID)
{
win_skip("Windows Installer < 3.0 detected\n");
goto uninstall;
}
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
buffer[0] = 0;
size = sizeof(buffer);
r = pMsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
"{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
INSTALLPROPERTY_LOCALPACKAGEA, buffer, &size );
r = MsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
"{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
INSTALLPROPERTY_LOCALPACKAGEA, buffer, &size );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
ok( buffer[0], "buffer empty\n" );
buffer[0] = 0;
size = sizeof(buffer);
r = pMsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
"{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
NULL, MSIINSTALLCONTEXT_MACHINE,
INSTALLPROPERTY_LOCALPACKAGEA, buffer, &size );
r = MsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
"{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
NULL, MSIINSTALLCONTEXT_MACHINE,
INSTALLPROPERTY_LOCALPACKAGEA, buffer, &size );
ok( r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT, got %u\n", r );
buffer[0] = 0;
size = sizeof(buffer);
r = pMsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
"{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
r = MsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
"{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
NULL, MSIINSTALLCONTEXT_USERMANAGED,
INSTALLPROPERTY_LOCALPACKAGEA, buffer, &size );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
ok( !buffer[0], "got %s\n", buffer );
r = pMsiEnumPatchesExA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
NULL, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_APPLIED,
0, patch_code, NULL, NULL, NULL, NULL );
r = MsiEnumPatchesExA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
NULL, MSIINSTALLCONTEXT_USERUNMANAGED, MSIPATCHSTATE_APPLIED,
0, patch_code, NULL, NULL, NULL, NULL );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
ok( !strcmp( patch_code, "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}" ), "wrong patch code\n" );
r = pMsiEnumPatchesExA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_APPLIED,
0, patch_code, NULL, NULL, NULL, NULL );
r = MsiEnumPatchesExA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
NULL, MSIINSTALLCONTEXT_MACHINE, MSIPATCHSTATE_APPLIED,
0, patch_code, NULL, NULL, NULL, NULL );
ok( r == ERROR_NO_MORE_ITEMS, "expected ERROR_NO_MORE_ITEMS, got %u\n", r );
r = pMsiEnumPatchesExA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
NULL, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
0, patch_code, NULL, NULL, NULL, NULL );
r = MsiEnumPatchesExA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
NULL, MSIINSTALLCONTEXT_USERMANAGED, MSIPATCHSTATE_APPLIED,
0, patch_code, NULL, NULL, NULL, NULL );
ok( r == ERROR_NO_MORE_ITEMS, "expected ERROR_NO_MORE_ITEMS, got %u\n", r );
uninstall:
r = MsiInstallProductA( msifile, "REMOVE=ALL" );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
buffer[0] = 0;
size = sizeof(buffer);
r = pMsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
"{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
INSTALLPROPERTY_LOCALPACKAGEA, buffer, &size );
r = MsiGetPatchInfoExA( "{0F96CDC0-4CDF-4304-B283-7B9264889EF7}",
"{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
NULL, MSIINSTALLCONTEXT_USERUNMANAGED,
INSTALLPROPERTY_LOCALPACKAGEA, buffer, &size );
ok( r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT, got %u\n", r );
cleanup:
@ -1324,8 +1263,6 @@ START_TEST(patch)
if (!is_process_elevated()) restart_as_admin_elevated();
init_function_pointers();
GetCurrentDirectoryA( MAX_PATH, prev_path );
GetTempPathA( MAX_PATH, temp_path );
SetCurrentDirectoryA( temp_path );

View File

@ -349,7 +349,7 @@ static void test_msirecord(void)
ok(r == ERROR_SUCCESS, "failed to add stream to record\n");
r = MsiRecordReadStream(h, 1, buf, NULL);
ok(r == ERROR_INVALID_PARAMETER, "should return error\n");
DeleteFileA(filename); /* Windows 98 doesn't like this at all, so don't check return. */
DeleteFileA(filename);
r = MsiRecordReadStream(h, 1, NULL, NULL);
ok(r == ERROR_INVALID_PARAMETER, "should return error\n");
sz = sizeof buf;

File diff suppressed because it is too large Load Diff

View File

@ -602,7 +602,7 @@ USERINFOSTATE WINAPI MsiGetUserInfoA(LPCSTR, LPSTR, LPDWORD, LPSTR, LPDWORD, LPS
USERINFOSTATE WINAPI MsiGetUserInfoW(LPCWSTR, LPWSTR, LPDWORD, LPWSTR, LPDWORD, LPWSTR, LPDWORD);
#define MsiGetUserInfo WINELIB_NAME_AW(MsiGetUserInfo)
UINT WINAPI MsiProvidedComponentA(LPCSTR, LPCSTR, LPCSTR, DWORD, LPSTR, LPDWORD);
UINT WINAPI MsiProvideComponentA(LPCSTR, LPCSTR, LPCSTR, DWORD, LPSTR, LPDWORD);
UINT WINAPI MsiProvideComponentW(LPCWSTR, LPCWSTR, LPCWSTR, DWORD, LPWSTR, LPDWORD);
#define MsiProvideComponent WINELIB_NAME_AW(MsiProvideComponent)