Commit dade5b7e authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

msado15: Implement _Connection_get_CommandTimeout and _Connection_put_CommandTimeout.

parent 131cfe0b
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment