msi: Support remote calls to MsiEnumComponentCosts.

This commit is contained in:
Hans Leidekker 2011-05-02 16:02:40 +02:00 committed by Alexandre Julliard
parent b4a7a30b18
commit cc517f2b38
3 changed files with 40 additions and 2 deletions

View File

@ -32,6 +32,7 @@
#include "msidefs.h"
#include "msiquery.h"
#include "msipriv.h"
#include "msiserver.h"
#include "wincrypt.h"
#include "winver.h"
#include "winuser.h"
@ -1839,7 +1840,32 @@ UINT WINAPI MsiEnumComponentCostsW( MSIHANDLE handle, LPCWSTR component, DWORD i
state, drive, buflen, cost, temp);
if (!drive || !buflen || !cost || !temp) return ERROR_INVALID_PARAMETER;
if (!(package = msihandle2msiinfo( handle, MSIHANDLETYPE_PACKAGE ))) return ERROR_INVALID_HANDLE;
if (!(package = msihandle2msiinfo( handle, MSIHANDLETYPE_PACKAGE )))
{
HRESULT hr;
IWineMsiRemotePackage *remote_package;
BSTR bname;
if (!(remote_package = (IWineMsiRemotePackage *)msi_get_remote( handle )))
return ERROR_INVALID_HANDLE;
bname = SysAllocString( component );
if (!bname)
{
IWineMsiRemotePackage_Release( remote_package );
return ERROR_OUTOFMEMORY;
}
hr = IWineMsiRemotePackage_EnumComponentCosts( remote_package, bname, index, state, drive, buflen, cost, temp );
IWineMsiRemotePackage_Release( remote_package );
SysFreeString( bname );
if (FAILED(hr))
{
if (HRESULT_FACILITY(hr) == FACILITY_WIN32) return HRESULT_CODE(hr);
return ERROR_FUNCTION_FAILED;
}
return ERROR_SUCCESS;
}
if (!msi_get_property_int( package->db, szCostingComplete, 0 ))
{
msiobj_release( &package->hdr );

View File

@ -72,7 +72,9 @@ interface IWineMsiRemotePackage : IUnknown
HRESULT SetInstallLevel( [in] int level );
HRESULT FormatRecord( [in] MSIHANDLE record, [out] BSTR *value );
HRESULT EvaluateCondition( [in] BSTR condition );
HRESULT GetFeatureCost( [in] BSTR feature, [in] INT cost_tree, [in] INSTALLSTATE state, [out] INT *cost);
HRESULT GetFeatureCost( [in] BSTR feature, [in] INT cost_tree, [in] INSTALLSTATE state, [out] INT *cost );
HRESULT EnumComponentCosts( [in] BSTR component, [in] DWORD index, [in] INSTALLSTATE state,
[out, size_is(*buflen)] BSTR drive, [in, out] DWORD *buflen, [out] INT *cost, [out] INT *temp );
}
[

View File

@ -2534,6 +2534,15 @@ static HRESULT WINAPI mrp_GetFeatureCost( IWineMsiRemotePackage *iface, BSTR fea
return HRESULT_FROM_WIN32(r);
}
static HRESULT WINAPI mrp_EnumComponentCosts( IWineMsiRemotePackage *iface, BSTR component,
DWORD index, INSTALLSTATE state, BSTR drive,
DWORD *buflen, INT *cost, INT *temp )
{
msi_remote_package_impl* This = impl_from_IWineMsiRemotePackage( iface );
UINT r = MsiEnumComponentCostsW(This->package, component, index, state, drive, buflen, cost, temp);
return HRESULT_FROM_WIN32(r);
}
static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl =
{
mrp_QueryInterface,
@ -2560,6 +2569,7 @@ static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl =
mrp_FormatRecord,
mrp_EvaluateCondition,
mrp_GetFeatureCost,
mrp_EnumComponentCosts
};
HRESULT create_msi_remote_package( IUnknown *pOuter, LPVOID *ppObj )