msi: Handle remote calls to MsiSetInstallLevel.

This commit is contained in:
James Hawkins 2007-07-03 19:20:48 -07:00 committed by Alexandre Julliard
parent 569ea392a7
commit c6741d83c6
3 changed files with 33 additions and 3 deletions

View File

@ -1100,9 +1100,30 @@ UINT WINAPI MsiSetInstallLevel(MSIHANDLE hInstall, int iInstallLevel)
TRACE("%ld %i\n", hInstall, iInstallLevel);
package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
if ( !package )
return ERROR_INVALID_HANDLE;
package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
if (!package)
{
HRESULT hr;
IWineMsiRemotePackage *remote_package;
remote_package = (IWineMsiRemotePackage *)msi_get_remote(hInstall);
if (!remote_package)
return ERROR_INVALID_HANDLE;
hr = IWineMsiRemotePackage_SetInstallLevel(remote_package, iInstallLevel);
IWineMsiRemotePackage_Release(remote_package);
if (FAILED(hr))
{
if (HRESULT_FACILITY(hr) == FACILITY_WIN32)
return HRESULT_CODE(hr);
return ERROR_FUNCTION_FAILED;
}
return ERROR_SUCCESS;
}
r = MSI_SetInstallLevel( package, iInstallLevel );

View File

@ -54,6 +54,7 @@ interface IWineMsiRemotePackage : IUnknown
HRESULT GetComponentState( [in] BSTR *component, [out] INSTALLSTATE *installed, [out] INSTALLSTATE *action );
HRESULT SetComponentState( [in] BSTR *component, [in] INSTALLSTATE state );
HRESULT GetLanguage( [out] LANGID *language );
HRESULT SetInstallLevel( [in] int level );
}
[

View File

@ -1655,6 +1655,13 @@ HRESULT WINAPI mrp_GetLanguage( IWineMsiRemotePackage *iface, LANGID *language )
return S_OK;
}
HRESULT WINAPI mrp_SetInstallLevel( IWineMsiRemotePackage *iface, int level )
{
msi_remote_package_impl* This = mrp_from_IWineMsiRemotePackage( iface );
UINT r = MsiSetInstallLevel(This->package, level);
return HRESULT_FROM_WIN32(r);
}
static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl =
{
mrp_QueryInterface,
@ -1676,6 +1683,7 @@ static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl =
mrp_GetComponentState,
mrp_SetComponentState,
mrp_GetLanguage,
mrp_SetInstallLevel,
};
HRESULT create_msi_remote_package( IUnknown *pOuter, LPVOID *ppObj )