Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/msi/install.c | 9 +-------- dlls/msi/package.c | 5 ++--- dlls/msi/winemsi.idl | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/dlls/msi/install.c b/dlls/msi/install.c index 88b3ff5..3ac151d 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -561,18 +561,11 @@ BOOL WINAPI MsiGetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode) if (!package) { MSIHANDLE remote; - BOOL ret; - HRESULT hr;
if (!(remote = msi_get_remote(hInstall))) return FALSE;
- hr = remote_GetMode(remote, iRunMode, &ret); - - if (hr == S_OK) - return ret; - - return FALSE; + return remote_GetMode(remote, iRunMode); }
switch (iRunMode) diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 1790918..3ea5afc 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -2513,10 +2513,9 @@ UINT __cdecl remote_GetSourcePath(MSIHANDLE hinst, LPCWSTR folder, LPWSTR *value return r; }
-HRESULT __cdecl remote_GetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL *ret) +BOOL __cdecl remote_GetMode(MSIHANDLE hinst, MSIRUNMODE mode) { - *ret = MsiGetMode(hinst, mode); - return S_OK; + return MsiGetMode(hinst, mode); }
HRESULT __cdecl remote_SetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL state) diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 06db52e..7282c77 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -79,7 +79,7 @@ interface IWineMsiRemote UINT remote_GetTargetPath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [out, string] LPWSTR *value ); UINT remote_SetTargetPath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [in, string] LPCWSTR value ); UINT remote_GetSourcePath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [out, string] LPWSTR *value ); - HRESULT remote_GetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [out] BOOL *ret ); + BOOL remote_GetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode ); HRESULT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); HRESULT remote_GetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT remote_SetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [in] INSTALLSTATE state );
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/msi/install.c | 13 +------------ dlls/msi/package.c | 5 ++--- dlls/msi/tests/custom.c | 9 +++++++++ dlls/msi/winemsi.idl | 2 +- 4 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/dlls/msi/install.c b/dlls/msi/install.c index 3ac151d..17a0cd5 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -644,22 +644,11 @@ UINT WINAPI MsiSetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode, BOOL fState) if (!package) { MSIHANDLE remote; - HRESULT hr;
if (!(remote = msi_get_remote(hInstall))) return FALSE;
- hr = remote_SetMode(remote, iRunMode, fState); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_SetMode(remote, iRunMode, fState); }
switch (iRunMode) diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 3ea5afc..6d2610d 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -2518,10 +2518,9 @@ BOOL __cdecl remote_GetMode(MSIHANDLE hinst, MSIRUNMODE mode) return MsiGetMode(hinst, mode); }
-HRESULT __cdecl remote_SetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL state) +UINT __cdecl remote_SetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL state) { - UINT r = MsiSetMode(hinst, mode, state); - return HRESULT_FROM_WIN32(r); + return MsiSetMode(hinst, mode, state); }
HRESULT __cdecl remote_GetFeatureState(MSIHANDLE hinst, BSTR feature, diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index d596f1e..5f2ff5d 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -642,6 +642,14 @@ static void test_targetpath(MSIHANDLE hinst) ok(hinst, sz == srcsz, "got size %u\n", sz); }
+static void test_mode(MSIHANDLE hinst) +{ + UINT r; + + r = MsiSetMode(hinst, MSIRUNMODE_REBOOTATEND, FALSE); + ok(hinst, !r, "got %u\n", r); +} + /* 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) @@ -669,6 +677,7 @@ UINT WINAPI main_test(MSIHANDLE hinst) test_db(hinst); test_doaction(hinst); test_targetpath(hinst); + test_mode(hinst);
return ERROR_SUCCESS; } diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 7282c77..c4c7e88 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -80,7 +80,7 @@ interface IWineMsiRemote UINT remote_SetTargetPath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [in, string] LPCWSTR value ); UINT remote_GetSourcePath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [out, string] LPWSTR *value ); BOOL remote_GetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode ); - HRESULT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); + UINT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); HRESULT remote_GetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT remote_SetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [in] INSTALLSTATE state ); HRESULT remote_GetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action );
Hi,
While running your changed tests on Windows, 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=37958
Your paranoid android.
=== w7pro64 (64 bit custom) === The previous 1 run(s) terminated abnormally
Signed-off-by: Hans Leidekker hans@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/msi/install.c | 25 +++++++------------------ dlls/msi/package.c | 5 ++--- dlls/msi/tests/custom.c | 24 ++++++++++++++++++++++++ dlls/msi/winemsi.idl | 2 +- 4 files changed, 34 insertions(+), 22 deletions(-)
diff --git a/dlls/msi/install.c b/dlls/msi/install.c index 17a0cd5..706fdb4 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -964,33 +964,22 @@ UINT WINAPI MsiGetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature,
TRACE("%d %s %p %p\n", hInstall, debugstr_w(szFeature), piInstalled, piAction);
+ if (!szFeature) + return ERROR_UNKNOWN_FEATURE; + package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); if (!package) { MSIHANDLE remote; - HRESULT hr; - BSTR feature;
if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE;
- feature = SysAllocString(szFeature); - if (!feature) - return ERROR_OUTOFMEMORY; + /* FIXME: should use SEH */ + if (!piInstalled || !piAction) + return RPC_X_NULL_REF_POINTER;
- hr = remote_GetFeatureState(remote, feature, piInstalled, piAction); - - SysFreeString(feature); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_GetFeatureState(remote, szFeature, piInstalled, piAction); }
ret = MSI_GetFeatureStateW(package, szFeature, piInstalled, piAction); diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 6d2610d..ec05d43 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -2523,11 +2523,10 @@ UINT __cdecl remote_SetMode(MSIHANDLE hinst, MSIRUNMODE mode, BOOL state) return MsiSetMode(hinst, mode, state); }
-HRESULT __cdecl remote_GetFeatureState(MSIHANDLE hinst, BSTR feature, +UINT __cdecl remote_GetFeatureState(MSIHANDLE hinst, LPCWSTR feature, INSTALLSTATE *installed, INSTALLSTATE *action) { - UINT r = MsiGetFeatureStateW(hinst, feature, installed, action); - return HRESULT_FROM_WIN32(r); + return MsiGetFeatureStateW(hinst, feature, installed, action); }
HRESULT __cdecl remote_SetFeatureState(MSIHANDLE hinst, BSTR feature, INSTALLSTATE state) diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index 5f2ff5d..ef4e282 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -650,6 +650,29 @@ static void test_mode(MSIHANDLE hinst) ok(hinst, !r, "got %u\n", r); }
+static void test_feature_states(MSIHANDLE hinst) +{ + INSTALLSTATE state, action; + UINT r; + + r = MsiGetFeatureStateA(hinst, NULL, &state, &action); + ok(hinst, r == ERROR_UNKNOWN_FEATURE, "got %u\n", r); + + r = MsiGetFeatureStateA(hinst, "fake", &state, &action); + ok(hinst, r == ERROR_UNKNOWN_FEATURE, "got %u\n", r); + + r = MsiGetFeatureStateA(hinst, "One", NULL, &action); + ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r); + + r = MsiGetFeatureStateA(hinst, "One", &state, NULL); + ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r); + + r = MsiGetFeatureStateA(hinst, "One", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state); + ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); +} + /* 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) @@ -678,6 +701,7 @@ UINT WINAPI main_test(MSIHANDLE hinst) test_doaction(hinst); test_targetpath(hinst); test_mode(hinst); + test_feature_states(hinst);
return ERROR_SUCCESS; } diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index c4c7e88..091ef16 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -81,7 +81,7 @@ interface IWineMsiRemote UINT remote_GetSourcePath( [in] MSIHANDLE hinst, [in, string] LPCWSTR folder, [out, string] LPWSTR *value ); BOOL remote_GetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode ); UINT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); - HRESULT remote_GetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); + UINT remote_GetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT remote_SetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [in] INSTALLSTATE state ); HRESULT remote_GetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT remote_SetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [in] INSTALLSTATE state );
Hi,
While running your changed tests on Windows, 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=37959
Your paranoid android.
=== w7pro64 (64 bit custom) === The previous 1 run(s) terminated abnormally
Signed-off-by: Hans Leidekker hans@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/msi/install.c | 26 ++++---------------------- dlls/msi/package.c | 5 ++--- dlls/msi/tests/custom.c | 17 +++++++++++++++++ dlls/msi/winemsi.idl | 2 +- 4 files changed, 24 insertions(+), 26 deletions(-)
diff --git a/dlls/msi/install.c b/dlls/msi/install.c index 706fdb4..1ff3ad9 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -685,9 +685,6 @@ UINT WINAPI MsiSetFeatureStateA(MSIHANDLE hInstall, LPCSTR szFeature,
szwFeature = strdupAtoW(szFeature);
- if (!szwFeature) - return ERROR_FUNCTION_FAILED; - rc = MsiSetFeatureStateW(hInstall,szwFeature, iState);
msi_free(szwFeature); @@ -818,33 +815,18 @@ UINT WINAPI MsiSetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature,
TRACE("%s %i\n",debugstr_w(szFeature), iState);
+ if (!szFeature) + return ERROR_UNKNOWN_FEATURE; + package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); if (!package) { MSIHANDLE remote; - HRESULT hr; - BSTR feature;
if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE;
- feature = SysAllocString(szFeature); - if (!feature) - return ERROR_OUTOFMEMORY; - - hr = remote_SetFeatureState(remote, feature, iState); - - SysFreeString(feature); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_SetFeatureState(remote, szFeature, iState); }
rc = MSI_SetFeatureStateW(package,szFeature,iState); diff --git a/dlls/msi/package.c b/dlls/msi/package.c index ec05d43..f8b150b 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -2529,10 +2529,9 @@ UINT __cdecl remote_GetFeatureState(MSIHANDLE hinst, LPCWSTR feature, return MsiGetFeatureStateW(hinst, feature, installed, action); }
-HRESULT __cdecl remote_SetFeatureState(MSIHANDLE hinst, BSTR feature, INSTALLSTATE state) +UINT __cdecl remote_SetFeatureState(MSIHANDLE hinst, LPCWSTR feature, INSTALLSTATE state) { - UINT r = MsiSetFeatureStateW(hinst, feature, state); - return HRESULT_FROM_WIN32(r); + return MsiSetFeatureStateW(hinst, feature, state); }
HRESULT __cdecl remote_GetComponentState(MSIHANDLE hinst, BSTR component, diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index ef4e282..b30953a 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -671,6 +671,23 @@ static void test_feature_states(MSIHANDLE hinst) ok(hinst, !r, "got %u\n", r); ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state); ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); + + r = MsiSetFeatureStateA(hinst, NULL, INSTALLSTATE_ABSENT); + ok(hinst, r == ERROR_UNKNOWN_FEATURE, "got %u\n", r); + + r = MsiSetFeatureStateA(hinst, "One", INSTALLSTATE_ADVERTISED); + ok(hinst, !r, "got %u\n", r); + + r = MsiGetFeatureStateA(hinst, "One", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, action == INSTALLSTATE_ADVERTISED, "got action %d\n", action); + + r = MsiSetFeatureStateA(hinst, "One", INSTALLSTATE_LOCAL); + ok(hinst, !r, "got %u\n", r); + + r = MsiGetFeatureStateA(hinst, "One", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); }
/* Main test. Anything that doesn't depend on a specific install configuration diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 091ef16..8bdc10d 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -82,7 +82,7 @@ interface IWineMsiRemote BOOL remote_GetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode ); UINT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); UINT remote_GetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); - HRESULT remote_SetFeatureState( [in] MSIHANDLE hinst, [in] BSTR feature, [in] INSTALLSTATE state ); + UINT remote_SetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [in] INSTALLSTATE state ); HRESULT remote_GetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT remote_SetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [in] INSTALLSTATE state ); HRESULT remote_GetLanguage( [in] MSIHANDLE hinst, [out] LANGID *language );
Hi,
While running your changed tests on Windows, 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=37960
Your paranoid android.
=== w7pro64 (64 bit custom) === The previous 1 run(s) terminated abnormally
Signed-off-by: Hans Leidekker hans@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/msi/install.c | 25 +++++++------------------ dlls/msi/package.c | 5 ++--- dlls/msi/tests/custom.c | 31 +++++++++++++++++++++++++++++++ dlls/msi/winemsi.idl | 2 +- 4 files changed, 41 insertions(+), 22 deletions(-)
diff --git a/dlls/msi/install.c b/dlls/msi/install.c index 1ff3ad9..b19b647 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -1359,33 +1359,22 @@ UINT WINAPI MsiGetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, TRACE("%d %s %p %p\n", hInstall, debugstr_w(szComponent), piInstalled, piAction);
+ if (!szComponent) + return ERROR_UNKNOWN_COMPONENT; + package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); if (!package) { MSIHANDLE remote; - HRESULT hr; - BSTR component;
if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE;
- component = SysAllocString(szComponent); - if (!component) - return ERROR_OUTOFMEMORY; + /* FIXME: should use SEH */ + if (!piInstalled || !piAction) + return RPC_X_NULL_REF_POINTER;
- hr = remote_GetComponentState(remote, component, piInstalled, piAction); - - SysFreeString(component); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_GetComponentState(remote, szComponent, piInstalled, piAction); }
ret = MSI_GetComponentStateW( package, szComponent, piInstalled, piAction); diff --git a/dlls/msi/package.c b/dlls/msi/package.c index f8b150b..18b8601 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -2534,11 +2534,10 @@ UINT __cdecl remote_SetFeatureState(MSIHANDLE hinst, LPCWSTR feature, INSTALLSTA return MsiSetFeatureStateW(hinst, feature, state); }
-HRESULT __cdecl remote_GetComponentState(MSIHANDLE hinst, BSTR component, +UINT __cdecl remote_GetComponentState(MSIHANDLE hinst, LPCWSTR component, INSTALLSTATE *installed, INSTALLSTATE *action) { - UINT r = MsiGetComponentStateW(hinst, component, installed, action); - return HRESULT_FROM_WIN32(r); + return MsiGetComponentStateW(hinst, component, installed, action); }
HRESULT __cdecl remote_SetComponentState(MSIHANDLE hinst, BSTR component, INSTALLSTATE state) diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index b30953a..b2c9352 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -655,6 +655,8 @@ static void test_feature_states(MSIHANDLE hinst) INSTALLSTATE state, action; UINT r;
+ /* test feature states */ + r = MsiGetFeatureStateA(hinst, NULL, &state, &action); ok(hinst, r == ERROR_UNKNOWN_FEATURE, "got %u\n", r);
@@ -688,6 +690,35 @@ static void test_feature_states(MSIHANDLE hinst) r = MsiGetFeatureStateA(hinst, "One", &state, &action); ok(hinst, !r, "got %u\n", r); ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); + + /* test component states */ + + r = MsiGetComponentStateA(hinst, NULL, &state, &action); + ok(hinst, r == ERROR_UNKNOWN_COMPONENT, "got %u\n", r); + + r = MsiGetComponentStateA(hinst, "fake", &state, &action); + ok(hinst, r == ERROR_UNKNOWN_COMPONENT, "got %u\n", r); + + r = MsiGetComponentStateA(hinst, "One", NULL, &action); + ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r); + + r = MsiGetComponentStateA(hinst, "One", &state, NULL); + ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r); + + r = MsiGetComponentStateA(hinst, "One", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state); + ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); + + r = MsiGetComponentStateA(hinst, "dangler", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state); + ok(hinst, action == INSTALLSTATE_UNKNOWN, "got action %d\n", action); + + r = MsiGetComponentStateA(hinst, "component", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, state == INSTALLSTATE_UNKNOWN, "got state %d\n", state); + ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); }
/* Main test. Anything that doesn't depend on a specific install configuration diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 8bdc10d..5996487 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -83,7 +83,7 @@ interface IWineMsiRemote UINT remote_SetMode( [in] MSIHANDLE hinst, [in] MSIRUNMODE mode, [in] BOOL state ); UINT remote_GetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); UINT remote_SetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [in] INSTALLSTATE state ); - HRESULT remote_GetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); + UINT remote_GetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT remote_SetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [in] INSTALLSTATE state ); HRESULT remote_GetLanguage( [in] MSIHANDLE hinst, [out] LANGID *language ); HRESULT remote_SetInstallLevel( [in] MSIHANDLE hinst, [in] int level );
Hi,
While running your changed tests on Windows, 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=37961
Your paranoid android.
=== w7pro64 (64 bit custom) === The previous 1 run(s) terminated abnormally
Signed-off-by: Hans Leidekker hans@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/msi/install.c | 23 ++++------------------- dlls/msi/package.c | 5 ++--- dlls/msi/tests/custom.c | 19 +++++++++++++++++++ dlls/msi/winemsi.idl | 2 +- 4 files changed, 26 insertions(+), 23 deletions(-)
diff --git a/dlls/msi/install.c b/dlls/msi/install.c index b19b647..63ffbfe 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -1313,33 +1313,18 @@ UINT WINAPI MsiSetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, MSIPACKAGE* package; UINT ret;
+ if (!szComponent) + return ERROR_UNKNOWN_COMPONENT; + package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); if (!package) { MSIHANDLE remote; - HRESULT hr; - BSTR component;
if (!(remote = msi_get_remote(hInstall))) return ERROR_INVALID_HANDLE;
- component = SysAllocString(szComponent); - if (!component) - return ERROR_OUTOFMEMORY; - - hr = remote_SetComponentState(remote, component, iState); - - SysFreeString(component); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; + return remote_SetComponentState(remote, szComponent, iState); }
ret = MSI_SetComponentStateW(package, szComponent, iState); diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 18b8601..b1b2cb4 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -2540,10 +2540,9 @@ UINT __cdecl remote_GetComponentState(MSIHANDLE hinst, LPCWSTR component, return MsiGetComponentStateW(hinst, component, installed, action); }
-HRESULT __cdecl remote_SetComponentState(MSIHANDLE hinst, BSTR component, INSTALLSTATE state) +UINT __cdecl remote_SetComponentState(MSIHANDLE hinst, LPCWSTR component, INSTALLSTATE state) { - UINT r = MsiSetComponentStateW(hinst, component, state); - return HRESULT_FROM_WIN32(r); + return MsiSetComponentStateW(hinst, component, state); }
HRESULT __cdecl remote_GetLanguage(MSIHANDLE hinst, LANGID *language) diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index b2c9352..2f9ba5d 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -719,6 +719,25 @@ static void test_feature_states(MSIHANDLE hinst) ok(hinst, !r, "got %u\n", r); ok(hinst, state == INSTALLSTATE_UNKNOWN, "got state %d\n", state); ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); + + r = MsiSetComponentStateA(hinst, NULL, INSTALLSTATE_ABSENT); + ok(hinst, r == ERROR_UNKNOWN_COMPONENT, "got %u\n", r); + + r = MsiSetComponentStateA(hinst, "One", INSTALLSTATE_SOURCE); + ok(hinst, !r, "got %u\n", r); + + r = MsiGetComponentStateA(hinst, "One", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state); + ok(hinst, action == INSTALLSTATE_SOURCE, "got action %d\n", action); + + r = MsiSetComponentStateA(hinst, "One", INSTALLSTATE_LOCAL); + ok(hinst, !r, "got %u\n", r); + + r = MsiGetComponentStateA(hinst, "One", &state, &action); + ok(hinst, !r, "got %u\n", r); + ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state); + ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action); }
/* Main test. Anything that doesn't depend on a specific install configuration diff --git a/dlls/msi/winemsi.idl b/dlls/msi/winemsi.idl index 5996487..132f140 100644 --- a/dlls/msi/winemsi.idl +++ b/dlls/msi/winemsi.idl @@ -84,7 +84,7 @@ interface IWineMsiRemote UINT remote_GetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); UINT remote_SetFeatureState( [in] MSIHANDLE hinst, [in, string] LPCWSTR feature, [in] INSTALLSTATE state ); UINT remote_GetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); - HRESULT remote_SetComponentState( [in] MSIHANDLE hinst, [in] BSTR component, [in] INSTALLSTATE state ); + UINT remote_SetComponentState( [in] MSIHANDLE hinst, [in, string] LPCWSTR component, [in] INSTALLSTATE state ); HRESULT remote_GetLanguage( [in] MSIHANDLE hinst, [out] LANGID *language ); HRESULT remote_SetInstallLevel( [in] MSIHANDLE hinst, [in] int level ); HRESULT remote_FormatRecord( [in] MSIHANDLE hinst, [in] MSIHANDLE record, [out] BSTR *value );
Hi,
While running your changed tests on Windows, 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=37962
Your paranoid android.
=== w7pro64 (64 bit custom) === The previous 1 run(s) terminated abnormally
Signed-off-by: Hans Leidekker hans@codeweavers.com