msado15: Implement _Connection get/put CursorLocation.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2020-10-09 18:57:14 +11:00 committed by Alexandre Julliard
parent 3d2add846c
commit 4a987b30e7
2 changed files with 31 additions and 4 deletions

View File

@ -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;

View File

@ -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);