diff --git a/dlls/msado15/connection.c b/dlls/msado15/connection.c index 357834a95fe..2773850236d 100644 --- a/dlls/msado15/connection.c +++ b/dlls/msado15/connection.c @@ -55,6 +55,7 @@ struct connection WCHAR *datasource; WCHAR *provider; ConnectModeEnum mode; + CursorLocationEnum location; struct connection_point cp_connev; }; @@ -325,14 +326,22 @@ static HRESULT WINAPI connection_put_Attributes( _Connection *iface, LONG attr ) static HRESULT WINAPI connection_get_CursorLocation( _Connection *iface, CursorLocationEnum *cursor_loc ) { - FIXME( "%p, %p\n", iface, cursor_loc ); - return E_NOTIMPL; + struct connection *connection = impl_from_Connection( iface ); + + TRACE( "%p, %p\n", iface, cursor_loc ); + + *cursor_loc = connection->location; + return S_OK; } static HRESULT WINAPI connection_put_CursorLocation( _Connection *iface, CursorLocationEnum cursor_loc ) { - FIXME( "%p, %u\n", iface, cursor_loc ); - return E_NOTIMPL; + struct connection *connection = impl_from_Connection( iface ); + + TRACE( "%p, %u\n", iface, cursor_loc ); + + connection->location = cursor_loc; + return S_OK; } static HRESULT WINAPI connection_get_Mode( _Connection *iface, ConnectModeEnum *mode ) @@ -674,6 +683,7 @@ HRESULT Connection_create( void **obj ) connection->datasource = NULL; connection->provider = SysAllocString(L"MSDASQL"); connection->mode = adModeUnknown; + connection->location = adUseServer; 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 8e8553c3b8d..efcee58c561 100644 --- a/dlls/msado15/tests/msado15.c +++ b/dlls/msado15/tests/msado15.c @@ -676,6 +676,7 @@ static void test_Connection(void) LONG state, timeout; BSTR str, str2, str3; ConnectModeEnum mode; + CursorLocationEnum location; hr = CoCreateInstance(&CLSID_Connection, NULL, CLSCTX_INPROC_SERVER, &IID__Connection, (void**)&connection); ok( hr == S_OK, "got %08x\n", hr ); @@ -719,6 +720,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); + location = 0; + hr = _Connection_get_CursorLocation(connection, &location); + ok(hr == S_OK, "Failed, hr 0x%08x\n", hr); + ok(location == adUseServer, "Unexpected location value %d\n", location); + + hr = _Connection_put_CursorLocation(connection, adUseClient); + ok(hr == S_OK, "Failed, hr 0x%08x\n", hr); + + location = 0; + hr = _Connection_get_CursorLocation(connection, &location); + ok(hr == S_OK, "Failed, hr 0x%08x\n", hr); + ok(location == adUseClient, "Unexpected location value %d\n", location); + + hr = _Connection_put_CursorLocation(connection, adUseServer); + ok(hr == S_OK, "Failed, hr 0x%08x\n", hr); + mode = 0xdeadbeef; hr = _Connection_get_Mode(connection, &mode); ok(hr == S_OK, "Failed to get state, hr 0x%08x\n", hr);