msado15: Implement _Connection_get_CommandTimeout and _Connection_put_CommandTimeout.
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
131cfe0b65
commit
dade5b7eb7
|
@ -36,6 +36,7 @@ struct connection
|
|||
LONG refs;
|
||||
|
||||
ObjectStateEnum state;
|
||||
LONG timeout;
|
||||
};
|
||||
|
||||
static inline struct connection *impl_from_Connection( _Connection *iface )
|
||||
|
@ -126,14 +127,18 @@ static HRESULT WINAPI connection_put_ConnectionString( _Connection *iface, BSTR
|
|||
|
||||
static HRESULT WINAPI connection_get_CommandTimeout( _Connection *iface, LONG *timeout )
|
||||
{
|
||||
FIXME( "%p, %p\n", iface, timeout );
|
||||
return E_NOTIMPL;
|
||||
struct connection *connection = impl_from_Connection( iface );
|
||||
TRACE( "%p, %p\n", connection, timeout );
|
||||
*timeout = connection->timeout;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI connection_put_CommandTimeout( _Connection *iface, LONG timeout )
|
||||
{
|
||||
FIXME( "%p, %d\n", iface, timeout );
|
||||
return E_NOTIMPL;
|
||||
struct connection *connection = impl_from_Connection( iface );
|
||||
TRACE( "%p, %d\n", connection, timeout );
|
||||
connection->timeout = timeout;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI connection_get_ConnectionTimeout( _Connection *iface, LONG *timeout )
|
||||
|
@ -342,6 +347,7 @@ HRESULT Connection_create( void **obj )
|
|||
connection->Connection_iface.lpVtbl = &connection_vtbl;
|
||||
connection->refs = 1;
|
||||
connection->state = adStateClosed;
|
||||
connection->timeout = 30;
|
||||
|
||||
*obj = &connection->Connection_iface;
|
||||
TRACE( "returning iface %p\n", *obj );
|
||||
|
|
|
@ -286,7 +286,7 @@ static void test_Connection(void)
|
|||
_Connection *connection;
|
||||
IRunnableObject *runtime;
|
||||
ISupportErrorInfo *errorinfo;
|
||||
LONG state;
|
||||
LONG state, timeout;
|
||||
|
||||
hr = CoCreateInstance(&CLSID_Connection, NULL, CLSCTX_INPROC_SERVER, &IID__Connection, (void**)&connection);
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
|
@ -310,6 +310,19 @@ if (0) /* Crashes on windows */
|
|||
ok(hr == S_OK, "Failed to get state, hr 0x%08x\n", hr);
|
||||
ok(state == adStateClosed, "Unexpected state value 0x%08x\n", state);
|
||||
|
||||
timeout = 0;
|
||||
hr = _Connection_get_CommandTimeout(connection, &timeout);
|
||||
ok(hr == S_OK, "Failed to get state, hr 0x%08x\n", hr);
|
||||
ok(timeout == 30, "Unexpected timeout value %d\n", timeout);
|
||||
|
||||
hr = _Connection_put_CommandTimeout(connection, 300);
|
||||
ok(hr == S_OK, "Failed to get state, hr 0x%08x\n", hr);
|
||||
|
||||
timeout = 0;
|
||||
hr = _Connection_get_CommandTimeout(connection, &timeout);
|
||||
ok(hr == S_OK, "Failed to get state, hr 0x%08x\n", hr);
|
||||
ok(timeout == 300, "Unexpected timeout value %d\n", timeout);
|
||||
|
||||
_Connection_Release(connection);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue