Commit b9b45981 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

msi: Allocate the remote handle on the server side.

parent d26336a9
......@@ -490,7 +490,7 @@ static void handle_msi_break( LPCWSTR target )
DebugBreak();
}
static UINT get_action_info( const GUID *guid, INT *type, MSIHANDLE *handle,
static UINT get_action_info( const GUID *guid, INT *type,
BSTR *dll, BSTR *funcname,
IWineMsiRemotePackage **package )
{
......@@ -513,7 +513,7 @@ static UINT get_action_info( const GUID *guid, INT *type, MSIHANDLE *handle,
return ERROR_FUNCTION_FAILED;
}
r = IWineMsiRemoteCustomAction_GetActionInfo( rca, guid, type, handle, dll, funcname, package );
r = IWineMsiRemoteCustomAction_GetActionInfo( rca, guid, type, dll, funcname, package );
IWineMsiRemoteCustomAction_Release( rca );
if (FAILED(r))
{
......@@ -550,7 +550,7 @@ static inline UINT CUSTOMPROC_wrapper( MsiCustomActionEntryPoint proc, MSIHANDLE
static DWORD ACTION_CallDllFunction( const GUID *guid )
{
MsiCustomActionEntryPoint fn;
MSIHANDLE hPackage, handle;
MSIHANDLE hPackage;
HANDLE hModule;
LPSTR proc;
UINT r = ERROR_FUNCTION_FAILED;
......@@ -560,7 +560,7 @@ static DWORD ACTION_CallDllFunction( const GUID *guid )
TRACE("%s\n", debugstr_guid( guid ));
r = get_action_info( guid, &type, &handle, &dll, &function, &remote_package );
r = get_action_info( guid, &type, &dll, &function, &remote_package );
if (r != ERROR_SUCCESS)
return r;
......@@ -579,7 +579,6 @@ static DWORD ACTION_CallDllFunction( const GUID *guid )
hPackage = alloc_msi_remote_handle( (IUnknown *)remote_package );
if (hPackage)
{
IWineMsiRemotePackage_SetMsiHandle( remote_package, handle );
TRACE("calling %s\n", debugstr_w( function ) );
handle_msi_break( function );
......@@ -608,7 +607,6 @@ static DWORD ACTION_CallDllFunction( const GUID *guid )
IWineMsiRemotePackage_Release( remote_package );
SysFreeString( dll );
SysFreeString( function );
MsiCloseHandle( handle );
return r;
}
......@@ -1428,21 +1426,22 @@ static ULONG WINAPI mcr_Release( IWineMsiRemoteCustomAction *iface )
}
static HRESULT WINAPI mcr_GetActionInfo( IWineMsiRemoteCustomAction *iface, LPCGUID custom_action_guid,
INT *type, MSIHANDLE *handle, BSTR *dll, BSTR *func, IWineMsiRemotePackage **remote_package )
INT *type, BSTR *dll, BSTR *func, IWineMsiRemotePackage **remote_package )
{
msi_custom_action_info *info;
MSIHANDLE handle;
info = find_action_by_guid( custom_action_guid );
if (!info)
return E_FAIL;
*type = info->type;
*handle = alloc_msihandle( &info->package->hdr );
handle = alloc_msihandle( &info->package->hdr );
*dll = SysAllocString( info->source );
*func = SysAllocString( info->target );
release_custom_action_data( info );
return create_msi_remote_package( NULL, (LPVOID *)remote_package );
return create_msi_remote_package( handle, remote_package );
}
static const IWineMsiRemoteCustomActionVtbl msi_custom_remote_vtbl =
......
......@@ -38,6 +38,8 @@
#include "wine/list.h"
#include "wine/debug.h"
#include "msiserver.h"
static const BOOL is_64bit = sizeof(void *) > sizeof(int);
BOOL is_wow64 DECLSPEC_HIDDEN;
......@@ -733,7 +735,7 @@ UINT msi_strcpy_to_awstring(const WCHAR *, int, awstring *, DWORD *) DECLSPEC_HI
/* msi server interface */
extern HRESULT create_msi_custom_remote( IUnknown *pOuter, LPVOID *ppObj ) DECLSPEC_HIDDEN;
extern HRESULT create_msi_remote_package( IUnknown *pOuter, LPVOID *ppObj ) DECLSPEC_HIDDEN;
extern HRESULT create_msi_remote_package( MSIHANDLE handle, IWineMsiRemotePackage **package ) DECLSPEC_HIDDEN;
extern HRESULT create_msi_remote_database( IUnknown *pOuter, LPVOID *ppObj ) DECLSPEC_HIDDEN;
extern IUnknown *msi_get_remote(MSIHANDLE handle) DECLSPEC_HIDDEN;
......
......@@ -56,7 +56,6 @@ interface IWineMsiRemoteDatabase : IUnknown
]
interface IWineMsiRemotePackage : IUnknown
{
HRESULT SetMsiHandle( [in] MSIHANDLE handle );
HRESULT GetActiveDatabase( [out] MSIHANDLE *handle );
HRESULT GetProperty( [in] BSTR property, [out, size_is(*size)] BSTR value, [in, out] DWORD *size );
HRESULT SetProperty( [in] BSTR property, [in] BSTR value );
......@@ -88,7 +87,7 @@ interface IWineMsiRemotePackage : IUnknown
]
interface IWineMsiRemoteCustomAction : IUnknown
{
HRESULT GetActionInfo( [in] LPCGUID guid, [out] INT *type, [out] MSIHANDLE *handle, [out] BSTR *dllname,
HRESULT GetActionInfo( [in] LPCGUID guid, [out] INT *type, [out] BSTR *dllname,
[out] BSTR *function, [out] IWineMsiRemotePackage **package );
}
......
......@@ -2561,13 +2561,6 @@ static ULONG WINAPI mrp_Release( IWineMsiRemotePackage *iface )
return r;
}
static HRESULT WINAPI mrp_SetMsiHandle( IWineMsiRemotePackage *iface, MSIHANDLE handle )
{
msi_remote_package_impl* This = impl_from_IWineMsiRemotePackage( iface );
This->package = handle;
return S_OK;
}
static HRESULT WINAPI mrp_GetActiveDatabase( IWineMsiRemotePackage *iface, MSIHANDLE *handle )
{
msi_remote_package_impl* This = impl_from_IWineMsiRemotePackage( iface );
......@@ -2756,7 +2749,6 @@ static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl =
mrp_QueryInterface,
mrp_AddRef,
mrp_Release,
mrp_SetMsiHandle,
mrp_GetActiveDatabase,
mrp_GetProperty,
mrp_SetProperty,
......@@ -2780,7 +2772,7 @@ static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl =
mrp_EnumComponentCosts
};
HRESULT create_msi_remote_package( IUnknown *pOuter, LPVOID *ppObj )
HRESULT create_msi_remote_package( MSIHANDLE handle, IWineMsiRemotePackage **ppObj )
{
msi_remote_package_impl* This;
......@@ -2789,7 +2781,7 @@ HRESULT create_msi_remote_package( IUnknown *pOuter, LPVOID *ppObj )
return E_OUTOFMEMORY;
This->IWineMsiRemotePackage_iface.lpVtbl = &msi_remote_package_vtbl;
This->package = 0;
This->package = handle;
This->refs = 1;
*ppObj = &This->IWineMsiRemotePackage_iface;
......
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