msado15: Implement _Recordset get_CursorLocation and 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-01-23 23:43:38 +00:00 committed by Alexandre Julliard
parent c1d51031ef
commit 7d51008ecf
2 changed files with 22 additions and 4 deletions

View File

@ -43,6 +43,7 @@ struct recordset
LONG allocated;
LONG index;
VARIANT *data;
CursorLocationEnum cursor_location;
};
struct fields
@ -1229,14 +1230,24 @@ static HRESULT WINAPI recordset_CancelBatch( _Recordset *iface, AffectEnum affec
static HRESULT WINAPI recordset_get_CursorLocation( _Recordset *iface, CursorLocationEnum *cursor_loc )
{
FIXME( "%p, %p\n", iface, cursor_loc );
return E_NOTIMPL;
struct recordset *recordset = impl_from_Recordset( iface );
TRACE( "%p, %p\n", iface, cursor_loc );
*cursor_loc = recordset->cursor_location;
return S_OK;
}
static HRESULT WINAPI recordset_put_CursorLocation( _Recordset *iface, CursorLocationEnum cursor_loc )
{
FIXME( "%p, %u\n", iface, cursor_loc );
return E_NOTIMPL;
struct recordset *recordset = impl_from_Recordset( iface );
TRACE( "%p, %u\n", iface, cursor_loc );
recordset->cursor_location = cursor_loc;
return S_OK;
}
static HRESULT WINAPI recordset_NextRecordset( _Recordset *iface, VARIANT *records_affected, _Recordset **record_set )
@ -1524,6 +1535,7 @@ HRESULT Recordset_create( void **obj )
recordset->ISupportErrorInfo_iface.lpVtbl = &recordset_supporterrorinfo_vtbl;
recordset->refs = 1;
recordset->index = -1;
recordset->cursor_location = adUseServer;
*obj = &recordset->Recordset_iface;
TRACE( "returning iface %p\n", *obj );

View File

@ -65,6 +65,7 @@ static void test_Recordset(void)
Field *field;
LONG refs, count, state;
VARIANT missing, val, index;
CursorLocationEnum location;
BSTR name;
HRESULT hr;
@ -132,6 +133,11 @@ static void test_Recordset(void)
ok( hr == S_OK, "got %08x\n", hr );
ok( state == adStateClosed, "got %d\n", state );
location = -1;
hr = _Recordset_get_CursorLocation( recordset, &location );
ok( hr == S_OK, "got %08x\n", hr );
ok( location == adUseServer, "got %d\n", location );
VariantInit( &missing );
hr = _Recordset_AddNew( recordset, missing, missing );
ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08x\n", hr );