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

msado15: Implement _Connection get/put CursorLocation.

parent 3d2add84
......@@ -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;
......
......@@ -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);
......
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