Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/msado15/connection.c | 14 ++++++++++---- dlls/msado15/tests/msado15.c | 13 ++++++++++++- 2 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/dlls/msado15/connection.c b/dlls/msado15/connection.c index dbf0b03149..ef589ecb7d 100644 --- a/dlls/msado15/connection.c +++ b/dlls/msado15/connection.c @@ -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 ); diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c index f2c9789576..bb356ae5a8 100644 --- a/dlls/msado15/tests/msado15.c +++ b/dlls/msado15/tests/msado15.c @@ -197,7 +197,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 ); @@ -220,6 +220,17 @@ 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);
+ 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); + + 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); }