Alistair Leslie-Hughes : msado15: Implement _Connection get/put CursorLocation.

Alexandre Julliard julliard at winehq.org
Fri Oct 9 16:00:44 CDT 2020


Module: wine
Branch: master
Commit: 4a987b30e7b5b3f0934c86ddd4790762c2351f37
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=4a987b30e7b5b3f0934c86ddd4790762c2351f37

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Fri Oct  9 18:57:14 2020 +1100

msado15: Implement _Connection get/put CursorLocation.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 357834a95f..2773850236 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 8e8553c3b8..efcee58c56 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);




More information about the wine-cvs mailing list