msado15: Add IConnectionPointContainer stub to _Connection.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49272 Signed-off-by: Aaro Altonen <a.altonen@hotmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6870f13704
commit
93dfc9b60e
|
@ -20,6 +20,8 @@
|
|||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#define COBJMACROS
|
||||
#include "initguid.h"
|
||||
#include "ocidl.h"
|
||||
#include "objbase.h"
|
||||
#include "msado15_backcompat.h"
|
||||
|
||||
|
@ -32,12 +34,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(msado15);
|
|||
|
||||
struct connection
|
||||
{
|
||||
_Connection Connection_iface;
|
||||
ISupportErrorInfo ISupportErrorInfo_iface;
|
||||
LONG refs;
|
||||
ObjectStateEnum state;
|
||||
LONG timeout;
|
||||
WCHAR *datasource;
|
||||
_Connection Connection_iface;
|
||||
ISupportErrorInfo ISupportErrorInfo_iface;
|
||||
IConnectionPointContainer IConnectionPointContainer_iface;
|
||||
LONG refs;
|
||||
ObjectStateEnum state;
|
||||
LONG timeout;
|
||||
WCHAR *datasource;
|
||||
};
|
||||
|
||||
static inline struct connection *impl_from_Connection( _Connection *iface )
|
||||
|
@ -50,6 +53,11 @@ static inline struct connection *impl_from_ISupportErrorInfo( ISupportErrorInfo
|
|||
return CONTAINING_RECORD( iface, struct connection, ISupportErrorInfo_iface );
|
||||
}
|
||||
|
||||
static inline struct connection *impl_from_IConnectionPointContainer( IConnectionPointContainer *iface )
|
||||
{
|
||||
return CONTAINING_RECORD( iface, struct connection, IConnectionPointContainer_iface );
|
||||
}
|
||||
|
||||
static ULONG WINAPI connection_AddRef( _Connection *iface )
|
||||
{
|
||||
struct connection *connection = impl_from_Connection( iface );
|
||||
|
@ -83,6 +91,10 @@ static HRESULT WINAPI connection_QueryInterface( _Connection *iface, REFIID riid
|
|||
{
|
||||
*obj = &connection->ISupportErrorInfo_iface;
|
||||
}
|
||||
else if (IsEqualGUID( riid, &IID_IConnectionPointContainer ))
|
||||
{
|
||||
*obj = &connection->IConnectionPointContainer_iface;
|
||||
}
|
||||
else
|
||||
{
|
||||
FIXME( "interface %s not implemented\n", debugstr_guid(riid) );
|
||||
|
@ -397,6 +409,50 @@ static const struct ISupportErrorInfoVtbl support_error_vtbl =
|
|||
supporterror_InterfaceSupportsErrorInfo
|
||||
};
|
||||
|
||||
static HRESULT WINAPI connpointcontainer_QueryInterface( IConnectionPointContainer *iface,
|
||||
REFIID riid, void **obj )
|
||||
{
|
||||
struct connection *connection = impl_from_IConnectionPointContainer( iface );
|
||||
return connection_QueryInterface( &connection->Connection_iface, riid, obj );
|
||||
}
|
||||
|
||||
static ULONG WINAPI connpointcontainer_AddRef( IConnectionPointContainer *iface )
|
||||
{
|
||||
struct connection *connection = impl_from_IConnectionPointContainer( iface );
|
||||
return connection_AddRef( &connection->Connection_iface );
|
||||
}
|
||||
|
||||
static ULONG WINAPI connpointcontainer_Release( IConnectionPointContainer *iface )
|
||||
{
|
||||
struct connection *connection = impl_from_IConnectionPointContainer( iface );
|
||||
return connection_Release( &connection->Connection_iface );
|
||||
}
|
||||
|
||||
static HRESULT WINAPI connpointcontainer_EnumConnectionPoints( IConnectionPointContainer *iface,
|
||||
IEnumConnectionPoints **points )
|
||||
{
|
||||
struct connection *connection = impl_from_IConnectionPointContainer( iface );
|
||||
FIXME( "%p, %p\n", connection, points );
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI connpointcontainer_FindConnectionPoint( IConnectionPointContainer *iface,
|
||||
REFIID riid, IConnectionPoint **point )
|
||||
{
|
||||
struct connection *connection = impl_from_IConnectionPointContainer( iface );
|
||||
FIXME( "%p, %s, %p\n", connection, debugstr_guid( riid ), point );
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static const struct IConnectionPointContainerVtbl connpointcontainer_vtbl =
|
||||
{
|
||||
connpointcontainer_QueryInterface,
|
||||
connpointcontainer_AddRef,
|
||||
connpointcontainer_Release,
|
||||
connpointcontainer_EnumConnectionPoints,
|
||||
connpointcontainer_FindConnectionPoint
|
||||
};
|
||||
|
||||
HRESULT Connection_create( void **obj )
|
||||
{
|
||||
struct connection *connection;
|
||||
|
@ -404,6 +460,7 @@ HRESULT Connection_create( void **obj )
|
|||
if (!(connection = heap_alloc( sizeof(*connection) ))) return E_OUTOFMEMORY;
|
||||
connection->Connection_iface.lpVtbl = &connection_vtbl;
|
||||
connection->ISupportErrorInfo_iface.lpVtbl = &support_error_vtbl;
|
||||
connection->IConnectionPointContainer_iface.lpVtbl = &connpointcontainer_vtbl;
|
||||
connection->refs = 1;
|
||||
connection->state = adStateClosed;
|
||||
connection->timeout = 30;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include <stdarg.h>
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "initguid.h"
|
||||
#define COBJMACROS
|
||||
#include "objbase.h"
|
||||
#include "rpcproxy.h"
|
||||
|
|
|
@ -666,6 +666,7 @@ static void test_Connection(void)
|
|||
_Connection *connection;
|
||||
IRunnableObject *runtime;
|
||||
ISupportErrorInfo *errorinfo;
|
||||
IConnectionPointContainer *pointcontainer;
|
||||
LONG state, timeout;
|
||||
BSTR str, str2;
|
||||
|
||||
|
@ -679,6 +680,10 @@ static void test_Connection(void)
|
|||
ok(hr == S_OK, "Failed to get ISupportErrorInfo interface\n");
|
||||
ISupportErrorInfo_Release(errorinfo);
|
||||
|
||||
hr = _Connection_QueryInterface(connection, &IID_IConnectionPointContainer, (void**)&pointcontainer);
|
||||
ok(hr == S_OK, "Failed to get IConnectionPointContainer interface %08x\n", hr);
|
||||
IConnectionPointContainer_Release(pointcontainer);
|
||||
|
||||
if (0) /* Crashes on windows */
|
||||
{
|
||||
hr = _Connection_get_State(connection, NULL);
|
||||
|
|
Loading…
Reference in New Issue