Commit bc4750ff authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Add the IWineMsiRemoteCustomAction interface.

parent f9001058
......@@ -26,8 +26,11 @@
#include "winerror.h"
#include "msidefs.h"
#include "winuser.h"
#include "objbase.h"
#include "oleauto.h"
#include "msipriv.h"
#include "msiserver.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wine/exception.h"
......@@ -1366,3 +1369,85 @@ void ACTION_FinishCustomActions(const MSIPACKAGE* package)
HeapFree( GetProcessHeap(), 0, wait_handles );
}
typedef struct _msi_custom_remote_impl {
const IWineMsiRemoteCustomActionVtbl *lpVtbl;
LONG refs;
} msi_custom_remote_impl;
static inline msi_custom_remote_impl* mcr_from_IWineMsiRemoteCustomAction( IWineMsiRemoteCustomAction* iface )
{
return (msi_custom_remote_impl*) iface;
}
static HRESULT WINAPI mcr_QueryInterface( IWineMsiRemoteCustomAction *iface,
REFIID riid,LPVOID *ppobj)
{
if( IsEqualCLSID( riid, &IID_IUnknown ) ||
IsEqualCLSID( riid, &IID_IWineMsiRemoteCustomAction ) )
{
IUnknown_AddRef( iface );
*ppobj = iface;
return S_OK;
}
return E_NOINTERFACE;
}
static ULONG WINAPI mcr_AddRef( IWineMsiRemoteCustomAction *iface )
{
msi_custom_remote_impl* This = mcr_from_IWineMsiRemoteCustomAction( iface );
return InterlockedIncrement( &This->refs );
}
static ULONG WINAPI mcr_Release( IWineMsiRemoteCustomAction *iface )
{
msi_custom_remote_impl* This = mcr_from_IWineMsiRemoteCustomAction( iface );
ULONG r;
r = InterlockedDecrement( &This->refs );
if (r == 0)
msi_free( This );
return r;
}
static HRESULT WINAPI mcr_GetActionInfo( IWineMsiRemoteCustomAction *iface, LPCGUID custom_action_guid,
MSIHANDLE *handle, BSTR *dll, BSTR *func, IWineMsiRemotePackage **remote_package )
{
msi_custom_action_info *info;
info = find_action_by_guid( custom_action_guid );
if (!info)
return E_FAIL;
*handle = alloc_msihandle( &info->package->hdr );
*dll = SysAllocString( info->source );
*func = SysAllocString( info->target );
return create_msi_remote_package( NULL, (LPVOID *)remote_package );
}
static const IWineMsiRemoteCustomActionVtbl msi_custom_remote_vtbl =
{
mcr_QueryInterface,
mcr_AddRef,
mcr_Release,
mcr_GetActionInfo,
};
HRESULT create_msi_custom_remote( IUnknown *pOuter, LPVOID *ppObj )
{
msi_custom_remote_impl* This;
This = msi_alloc( sizeof *This );
if (!This)
return E_OUTOFMEMORY;
This->lpVtbl = &msi_custom_remote_vtbl;
This->refs = 1;
*ppObj = This;
return S_OK;
}
......@@ -189,6 +189,7 @@ static const IClassFactoryVtbl MsiCF_Vtbl =
};
static IClassFactoryImpl MsiServer_CF = { &MsiCF_Vtbl, create_msiserver };
static IClassFactoryImpl WineMsiCustomRemote_CF = { &MsiCF_Vtbl, create_msi_custom_remote };
static IClassFactoryImpl WineMsiRemotePackage_CF = { &MsiCF_Vtbl, create_msi_remote_package };
/******************************************************************
......@@ -204,12 +205,10 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
return S_OK;
}
if( IsEqualCLSID (rclsid, &CLSID_IMsiServerMessage) ||
IsEqualCLSID (rclsid, &CLSID_IMsiServer) ||
IsEqualCLSID (rclsid, &CLSID_IMsiServerX1) ||
IsEqualCLSID (rclsid, &CLSID_IMsiServerX3) )
if ( IsEqualCLSID (rclsid, &CLSID_IWineMsiRemoteCustomAction) )
{
FIXME("create %s object\n", debugstr_guid( rclsid ));
*ppv = (LPVOID) &WineMsiCustomRemote_CF;
return S_OK;
}
if ( IsEqualCLSID (rclsid, &CLSID_IWineMsiRemotePackage) )
......@@ -218,6 +217,14 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
return S_OK;
}
if( IsEqualCLSID (rclsid, &CLSID_IMsiServerMessage) ||
IsEqualCLSID (rclsid, &CLSID_IMsiServer) ||
IsEqualCLSID (rclsid, &CLSID_IMsiServerX1) ||
IsEqualCLSID (rclsid, &CLSID_IMsiServerX3) )
{
FIXME("create %s object\n", debugstr_guid( rclsid ));
}
return CLASS_E_CLASSNOTAVAILABLE;
}
......
......@@ -512,6 +512,7 @@ DEFINE_GUID(CLSID_IMsiServerX3, 0x000C1094,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x0
DEFINE_GUID(CLSID_IMsiServerMessage, 0x000C101D,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
DEFINE_GUID(CLSID_IWineMsiRemoteCustomAction,0xBA26E6FA,0x4F27,0x4f56,0x95,0x3A,0x3F,0x90,0x27,0x20,0x18,0xAA);
DEFINE_GUID(CLSID_IWineMsiRemotePackage,0x902b3592,0x9d08,0x4dfd,0xa5,0x93,0xd0,0x7c,0x52,0x54,0x64,0x21);
/* handle unicode/ascii output in the Msi* API functions */
......@@ -535,6 +536,7 @@ UINT msi_strcpy_to_awstring( LPCWSTR str, awstring *awbuf, DWORD *sz );
/* msi server interface */
extern ITypeLib *get_msi_typelib( LPWSTR *path );
extern HRESULT create_msi_custom_remote( IUnknown *pOuter, LPVOID *ppObj );
extern HRESULT create_msi_remote_package( IUnknown *pOuter, LPVOID *ppObj );
/* handle functions */
......
......@@ -40,6 +40,17 @@ interface IWineMsiRemotePackage : IUnknown
HRESULT SetProperty( [in] BSTR *property, [in] BSTR *value );
}
[
uuid(56D58B64-8780-4c22-A8BC-8B0B29E4A9F8),
oleautomation,
object
]
interface IWineMsiRemoteCustomAction : IUnknown
{
HRESULT GetActionInfo( [in] LPCGUID guid, [out] MSIHANDLE *handle, [out] BSTR *dllname,
[out] BSTR *function, [out] IWineMsiRemotePackage **package );
}
[ uuid(000C1092-0000-0000-C000-000000000046), version(1.0) ]
library WindowsInstaller
{
......
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