Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/msado15/connection.c | 18 ++++++++++++++---- dlls/msado15/tests/msado15.c | 17 +++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/dlls/msado15/connection.c b/dlls/msado15/connection.c index 8d69e019852..eb116fc30ed 100644 --- a/dlls/msado15/connection.c +++ b/dlls/msado15/connection.c @@ -54,6 +54,7 @@ struct connection LONG timeout; WCHAR *datasource; WCHAR *provider; + ConnectModeEnum mode; struct connection_point cp_connev; };
@@ -336,14 +337,22 @@ static HRESULT WINAPI connection_put_CursorLocation( _Connection *iface, CursorL
static HRESULT WINAPI connection_get_Mode( _Connection *iface, ConnectModeEnum *mode ) { - FIXME( "%p, %p\n", iface, mode ); - return E_NOTIMPL; + struct connection *connection = impl_from_Connection( iface ); + + TRACE( "%p, %p\n", iface, mode ); + + *mode = connection->mode; + return S_OK; }
static HRESULT WINAPI connection_put_Mode( _Connection *iface, ConnectModeEnum mode ) { - FIXME( "%p, %u\n", iface, mode ); - return E_NOTIMPL; + struct connection *connection = impl_from_Connection( iface ); + + TRACE( "%p, %u\n", iface, mode ); + + connection->mode = mode; + return S_OK; }
static HRESULT WINAPI connection_get_Provider( _Connection *iface, BSTR *str ) @@ -665,6 +674,7 @@ HRESULT Connection_create( void **obj ) connection->timeout = 30; connection->datasource = NULL; connection->provider = SysAllocString(L"MSDASQL"); + connection->mode = adModeUnknown;
connection->cp_connev.conn = connection; connection->cp_connev.riid = &DIID_ConnectionEvents; diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c index 26c5c07a9d5..a532091fd7e 100644 --- a/dlls/msado15/tests/msado15.c +++ b/dlls/msado15/tests/msado15.c @@ -675,6 +675,7 @@ static void test_Connection(void) IConnectionPointContainer *pointcontainer; LONG state, timeout; BSTR str, str2, str3; + ConnectModeEnum mode;
hr = CoCreateInstance(&CLSID_Connection, NULL, CLSCTX_INPROC_SERVER, &IID__Connection, (void**)&connection); ok( hr == S_OK, "got %08x\n", hr ); @@ -718,6 +719,22 @@ if (0) /* Crashes on windows */ ok(hr == S_OK, "Failed to get state, hr 0x%08x\n", hr); ok(timeout == 300, "Unexpected timeout value %d\n", timeout);
+ mode = adModeUnknown; + hr = _Connection_get_Mode(connection, &mode); + ok(hr == S_OK, "Failed to get state, hr 0x%08x\n", hr); + ok(mode == adModeUnknown, "Unexpected mode value %d\n", mode); + + hr = _Connection_put_Mode(connection, adModeShareDenyNone); + ok(hr == S_OK, "Failed to get state, hr 0x%08x\n", hr); + + mode = adModeUnknown; + hr = _Connection_get_Mode(connection, &mode); + ok(hr == S_OK, "Failed to get state, hr 0x%08x\n", hr); + ok(mode == adModeShareDenyNone, "Unexpected mode value %d\n", mode); + + hr = _Connection_put_Mode(connection, adModeUnknown); + ok(hr == S_OK, "Failed to get state, hr 0x%08x\n", hr); + /* Default */ str = (BSTR)0xdeadbeef; hr = _Connection_get_Provider(connection, &str);