Commit 82b0066f authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Handle remote calls to MsiSetComponentState.

parent 254e27ad
...@@ -964,7 +964,29 @@ UINT WINAPI MsiSetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, ...@@ -964,7 +964,29 @@ UINT WINAPI MsiSetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent,
package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
if (!package) if (!package)
return ERROR_INVALID_HANDLE; {
HRESULT hr;
IWineMsiRemotePackage *remote_package;
remote_package = (IWineMsiRemotePackage *)msi_get_remote(hInstall);
if (!remote_package)
return ERROR_INVALID_HANDLE;
hr = IWineMsiRemotePackage_SetComponentState(remote_package, (BSTR *)szComponent, iState);
IWineMsiRemotePackage_Release(remote_package);
if (FAILED(hr))
{
if (HRESULT_FACILITY(hr) == FACILITY_WIN32)
return HRESULT_CODE(hr);
return ERROR_FUNCTION_FAILED;
}
return ERROR_SUCCESS;
}
ret = MSI_SetComponentStateW(package, szComponent, iState); ret = MSI_SetComponentStateW(package, szComponent, iState);
msiobj_release(&package->hdr); msiobj_release(&package->hdr);
return ret; return ret;
......
...@@ -51,6 +51,7 @@ interface IWineMsiRemotePackage : IUnknown ...@@ -51,6 +51,7 @@ interface IWineMsiRemotePackage : IUnknown
HRESULT GetFeatureState( [in] BSTR *feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT GetFeatureState( [in] BSTR *feature, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action );
HRESULT SetFeatureState( [in] BSTR *feature, [in] INSTALLSTATE state ); HRESULT SetFeatureState( [in] BSTR *feature, [in] INSTALLSTATE state );
HRESULT GetComponentState( [in] BSTR *component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action ); HRESULT GetComponentState( [in] BSTR *component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action );
HRESULT SetComponentState( [in] BSTR *component, [in] INSTALLSTATE state );
} }
[ [
......
...@@ -1641,6 +1641,13 @@ HRESULT WINAPI mrp_GetComponentState( IWineMsiRemotePackage *iface, BSTR *compon ...@@ -1641,6 +1641,13 @@ HRESULT WINAPI mrp_GetComponentState( IWineMsiRemotePackage *iface, BSTR *compon
return HRESULT_FROM_WIN32(r); return HRESULT_FROM_WIN32(r);
} }
HRESULT WINAPI mrp_SetComponentState( IWineMsiRemotePackage *iface, BSTR *component, INSTALLSTATE state )
{
msi_remote_package_impl* This = mrp_from_IWineMsiRemotePackage( iface );
UINT r = MsiSetFeatureStateW(This->package, (LPWSTR)component, state);
return HRESULT_FROM_WIN32(r);
}
static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl = static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl =
{ {
mrp_QueryInterface, mrp_QueryInterface,
...@@ -1660,6 +1667,7 @@ static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl = ...@@ -1660,6 +1667,7 @@ static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl =
mrp_GetFeatureState, mrp_GetFeatureState,
mrp_SetFeatureState, mrp_SetFeatureState,
mrp_GetComponentState, mrp_GetComponentState,
mrp_SetComponentState,
}; };
HRESULT create_msi_remote_package( IUnknown *pOuter, LPVOID *ppObj ) HRESULT create_msi_remote_package( IUnknown *pOuter, LPVOID *ppObj )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment