msado15: Add ISupportErrorInfo support to _Connection.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
cf7a432df5
commit
23b50cac89
|
@ -32,11 +32,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(msado15);
|
|||
|
||||
struct connection
|
||||
{
|
||||
_Connection Connection_iface;
|
||||
LONG refs;
|
||||
|
||||
ObjectStateEnum state;
|
||||
LONG timeout;
|
||||
_Connection Connection_iface;
|
||||
ISupportErrorInfo ISupportErrorInfo_iface;
|
||||
LONG refs;
|
||||
ObjectStateEnum state;
|
||||
LONG timeout;
|
||||
};
|
||||
|
||||
static inline struct connection *impl_from_Connection( _Connection *iface )
|
||||
|
@ -44,6 +44,11 @@ static inline struct connection *impl_from_Connection( _Connection *iface )
|
|||
return CONTAINING_RECORD( iface, struct connection, Connection_iface );
|
||||
}
|
||||
|
||||
static inline struct connection *impl_from_ISupportErrorInfo( ISupportErrorInfo *iface )
|
||||
{
|
||||
return CONTAINING_RECORD( iface, struct connection, ISupportErrorInfo_iface );
|
||||
}
|
||||
|
||||
static ULONG WINAPI connection_AddRef( _Connection *iface )
|
||||
{
|
||||
struct connection *connection = impl_from_Connection( iface );
|
||||
|
@ -64,13 +69,18 @@ static ULONG WINAPI connection_Release( _Connection *iface )
|
|||
|
||||
static HRESULT WINAPI connection_QueryInterface( _Connection *iface, REFIID riid, void **obj )
|
||||
{
|
||||
TRACE( "%p, %s, %p\n", iface, debugstr_guid(riid), obj );
|
||||
struct connection *connection = impl_from_Connection( iface );
|
||||
TRACE( "%p, %s, %p\n", connection, debugstr_guid(riid), obj );
|
||||
|
||||
if (IsEqualGUID( riid, &IID__Connection ) || IsEqualGUID( riid, &IID_IDispatch ) ||
|
||||
IsEqualGUID( riid, &IID_IUnknown ))
|
||||
{
|
||||
*obj = iface;
|
||||
}
|
||||
else if(IsEqualGUID( riid, &IID_ISupportErrorInfo ))
|
||||
{
|
||||
*obj = &connection->ISupportErrorInfo_iface;
|
||||
}
|
||||
else
|
||||
{
|
||||
FIXME( "interface %s not implemented\n", debugstr_guid(riid) );
|
||||
|
@ -339,12 +349,46 @@ static const struct _ConnectionVtbl connection_vtbl =
|
|||
connection_Cancel
|
||||
};
|
||||
|
||||
static HRESULT WINAPI supporterror_QueryInterface( ISupportErrorInfo *iface, REFIID riid, void **obj )
|
||||
{
|
||||
struct connection *connection = impl_from_ISupportErrorInfo( iface );
|
||||
return connection_QueryInterface( &connection->Connection_iface, riid, obj );
|
||||
}
|
||||
|
||||
static ULONG WINAPI supporterror_AddRef( ISupportErrorInfo *iface )
|
||||
{
|
||||
struct connection *connection = impl_from_ISupportErrorInfo( iface );
|
||||
return connection_AddRef( &connection->Connection_iface );
|
||||
}
|
||||
|
||||
static ULONG WINAPI supporterror_Release( ISupportErrorInfo *iface )
|
||||
{
|
||||
struct connection *connection = impl_from_ISupportErrorInfo( iface );
|
||||
return connection_Release( &connection->Connection_iface );
|
||||
}
|
||||
|
||||
static HRESULT WINAPI supporterror_InterfaceSupportsErrorInfo( ISupportErrorInfo *iface, REFIID riid )
|
||||
{
|
||||
struct connection *connection = impl_from_ISupportErrorInfo( iface );
|
||||
FIXME( "%p, %s\n", connection, debugstr_guid(riid) );
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
static const struct ISupportErrorInfoVtbl support_error_vtbl =
|
||||
{
|
||||
supporterror_QueryInterface,
|
||||
supporterror_AddRef,
|
||||
supporterror_Release,
|
||||
supporterror_InterfaceSupportsErrorInfo
|
||||
};
|
||||
|
||||
HRESULT Connection_create( void **obj )
|
||||
{
|
||||
struct connection *connection;
|
||||
|
||||
if (!(connection = heap_alloc( sizeof(*connection) ))) return E_OUTOFMEMORY;
|
||||
connection->Connection_iface.lpVtbl = &connection_vtbl;
|
||||
connection->ISupportErrorInfo_iface.lpVtbl = &support_error_vtbl;
|
||||
connection->refs = 1;
|
||||
connection->state = adStateClosed;
|
||||
connection->timeout = 30;
|
||||
|
|
|
@ -414,9 +414,8 @@ static void test_Connection(void)
|
|||
ok(hr == E_NOINTERFACE, "Unexpected IRunnableObject interface\n");
|
||||
|
||||
hr = _Connection_QueryInterface(connection, &IID_ISupportErrorInfo, (void**)&errorinfo);
|
||||
todo_wine ok(hr == S_OK, "Failed to get ISupportErrorInfo interface\n");
|
||||
if (hr == S_OK)
|
||||
ISupportErrorInfo_Release(errorinfo);
|
||||
ok(hr == S_OK, "Failed to get ISupportErrorInfo interface\n");
|
||||
ISupportErrorInfo_Release(errorinfo);
|
||||
|
||||
if (0) /* Crashes on windows */
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue