msi: Handle remote calls to MsiEvaluateCondition.
This commit is contained in:
parent
ba4919912c
commit
6b97f8905d
|
@ -20,6 +20,8 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
@ -29,12 +31,15 @@
|
|||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "wine/debug.h"
|
||||
#include "wine/unicode.h"
|
||||
|
||||
#include "msi.h"
|
||||
#include "msiquery.h"
|
||||
#include "objbase.h"
|
||||
#include "oleauto.h"
|
||||
|
||||
#include "msipriv.h"
|
||||
#include "msiserver.h"
|
||||
#include "wine/debug.h"
|
||||
#include "wine/unicode.h"
|
||||
|
||||
#define YYLEX_PARAM info
|
||||
#define YYPARSE_PARAM info
|
||||
|
@ -742,8 +747,39 @@ MSICONDITION WINAPI MsiEvaluateConditionW( MSIHANDLE hInstall, LPCWSTR szConditi
|
|||
UINT ret;
|
||||
|
||||
package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE);
|
||||
if( !package)
|
||||
return MSICONDITION_ERROR;
|
||||
if( !package )
|
||||
{
|
||||
HRESULT hr;
|
||||
BSTR condition;
|
||||
IWineMsiRemotePackage *remote_package;
|
||||
|
||||
remote_package = (IWineMsiRemotePackage *)msi_get_remote( hInstall );
|
||||
if (!remote_package)
|
||||
return MSICONDITION_ERROR;
|
||||
|
||||
condition = SysAllocString( szCondition );
|
||||
if (!condition)
|
||||
{
|
||||
IWineMsiRemotePackage_Release( remote_package );
|
||||
return ERROR_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
hr = IWineMsiRemotePackage_EvaluateCondition( remote_package, condition );
|
||||
|
||||
SysFreeString( condition );
|
||||
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_EvaluateConditionW( package, szCondition );
|
||||
msiobj_release( &package->hdr );
|
||||
return ret;
|
||||
|
|
|
@ -56,6 +56,7 @@ interface IWineMsiRemotePackage : IUnknown
|
|||
HRESULT GetLanguage( [out] LANGID *language );
|
||||
HRESULT SetInstallLevel( [in] int level );
|
||||
HRESULT FormatRecord( [in] MSIHANDLE record, [out] BSTR value, [out] DWORD *size );
|
||||
HRESULT EvaluateCondition( [in] BSTR condition );
|
||||
}
|
||||
|
||||
[
|
||||
|
|
|
@ -1692,6 +1692,13 @@ HRESULT WINAPI mrp_FormatRecord( IWineMsiRemotePackage *iface, MSIHANDLE record,
|
|||
return HRESULT_FROM_WIN32(r);
|
||||
}
|
||||
|
||||
HRESULT WINAPI mrp_EvaluateCondition( IWineMsiRemotePackage *iface, BSTR condition )
|
||||
{
|
||||
msi_remote_package_impl* This = mrp_from_IWineMsiRemotePackage( iface );
|
||||
UINT r = MsiEvaluateConditionW(This->package, (LPWSTR)condition);
|
||||
return HRESULT_FROM_WIN32(r);
|
||||
}
|
||||
|
||||
static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl =
|
||||
{
|
||||
mrp_QueryInterface,
|
||||
|
@ -1715,6 +1722,7 @@ static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl =
|
|||
mrp_GetLanguage,
|
||||
mrp_SetInstallLevel,
|
||||
mrp_FormatRecord,
|
||||
mrp_EvaluateCondition,
|
||||
};
|
||||
|
||||
HRESULT create_msi_remote_package( IUnknown *pOuter, LPVOID *ppObj )
|
||||
|
|
Loading…
Reference in New Issue