msado15: Implement IConnectionPointContainer_FindConnectionPoint.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49303
Signed-off-by: Aaro Altonen <a.altonen@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Aaro Altonen 2020-06-01 14:42:18 +03:00 committed by Alexandre Julliard
parent a8b647d8f8
commit a1222a3595
2 changed files with 42 additions and 2 deletions

View File

@ -23,6 +23,7 @@
#include "initguid.h"
#include "ocidl.h"
#include "objbase.h"
#include "olectl.h"
#include "msado15_backcompat.h"
#include "wine/debug.h"
@ -455,8 +456,20 @@ static HRESULT WINAPI connpointcontainer_FindConnectionPoint( IConnectionPointCo
REFIID riid, IConnectionPoint **point )
{
struct connection *connection = impl_from_IConnectionPointContainer( iface );
FIXME( "%p, %s, %p\n", connection, debugstr_guid( riid ), point );
return E_NOTIMPL;
TRACE( "%p, %s %p\n", connection, debugstr_guid( riid ), point );
if (!point) return E_POINTER;
if (IsEqualIID( riid, connection->cp_connev.riid ))
{
*point = &connection->cp_connev.IConnectionPoint_iface;
IConnectionPoint_AddRef( *point );
return S_OK;
}
FIXME( "unsupported connection point %s\n", debugstr_guid( riid ) );
return CONNECT_E_NOCONNECTION;
}
static const struct IConnectionPointContainerVtbl connpointcontainer_vtbl =

View File

@ -20,6 +20,7 @@
#define COBJMACROS
#include <initguid.h>
#include <oledb.h>
#include <olectl.h>
#include <msado15_backcompat.h>
#include "wine/test.h"
@ -805,10 +806,36 @@ static void test_Command(void)
_Command_Release( command );
}
static void test_ConnectionPoint(void)
{
HRESULT hr;
ULONG refs;
IConnectionPoint *point;
IConnectionPointContainer *pointcontainer;
hr = CoCreateInstance( &CLSID_Connection, NULL, CLSCTX_INPROC_SERVER,
&IID_IConnectionPointContainer, (void**)&pointcontainer );
hr = IConnectionPointContainer_FindConnectionPoint( pointcontainer, &DIID_ConnectionEvents, NULL );
ok( hr == E_POINTER, "got %08x\n", hr );
hr = IConnectionPointContainer_FindConnectionPoint( pointcontainer, &DIID_RecordsetEvents, &point );
ok( hr == CONNECT_E_NOCONNECTION, "got %08x\n", hr );
hr = IConnectionPointContainer_FindConnectionPoint( pointcontainer, &DIID_ConnectionEvents, &point );
ok( hr == S_OK, "got %08x\n", hr );
refs = IConnectionPoint_Release( point );
ok( refs == 1, "got %u", refs );
IConnectionPointContainer_Release( pointcontainer );
}
START_TEST(msado15)
{
CoInitialize( NULL );
test_Connection();
test_ConnectionPoint();
test_Fields();
test_Recordset();
test_Stream();