msado15: Implement _Recordset get/put CursorType.

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-22 14:46:20 +02:00 committed by Alexandre Julliard
parent 6488613a3a
commit 7287bd5007
2 changed files with 20 additions and 4 deletions

View File

@ -44,6 +44,7 @@ struct recordset
LONG index;
VARIANT *data;
CursorLocationEnum cursor_location;
CursorTypeEnum cursor_type;
};
struct fields
@ -910,14 +911,22 @@ static HRESULT WINAPI recordset_put_CacheSize( _Recordset *iface, LONG size )
static HRESULT WINAPI recordset_get_CursorType( _Recordset *iface, CursorTypeEnum *cursor_type )
{
FIXME( "%p, %p\n", iface, cursor_type );
return E_NOTIMPL;
struct recordset *recordset = impl_from_Recordset( iface );
TRACE( "%p, %p\n", iface, cursor_type );
*cursor_type = recordset->cursor_type;
return S_OK;
}
static HRESULT WINAPI recordset_put_CursorType( _Recordset *iface, CursorTypeEnum cursor_type )
{
FIXME( "%p, %d\n", iface, cursor_type );
return E_NOTIMPL;
struct recordset *recordset = impl_from_Recordset( iface );
TRACE( "%p, %d\n", iface, cursor_type );
recordset->cursor_type = cursor_type;
return S_OK;
}
static HRESULT WINAPI recordset_get_EOF( _Recordset *iface, VARIANT_BOOL *eof )
@ -1546,6 +1555,7 @@ HRESULT Recordset_create( void **obj )
recordset->refs = 1;
recordset->index = -1;
recordset->cursor_location = adUseServer;
recordset->cursor_type = adOpenForwardOnly;
*obj = &recordset->Recordset_iface;
TRACE( "returning iface %p\n", *obj );

View File

@ -68,6 +68,7 @@ static void test_Recordset(void)
LONG refs, count, state;
VARIANT missing, val, index;
CursorLocationEnum location;
CursorTypeEnum cursor;
BSTR name;
HRESULT hr;
@ -144,6 +145,11 @@ static void test_Recordset(void)
ok( hr == S_OK, "got %08x\n", hr );
ok( location == adUseServer, "got %d\n", location );
cursor = adOpenUnspecified;
hr = _Recordset_get_CursorType( recordset, &cursor );
ok( hr == S_OK, "got %08x\n", hr );
ok( cursor == adOpenForwardOnly, "got %d\n", cursor );
VariantInit( &missing );
hr = _Recordset_AddNew( recordset, missing, missing );
ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08x\n", hr );