[PATCH v2] msado15: Implement _Recordset get/put CursorType
From: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> v2: Fix cursor_typo ;) Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> --- dlls/msado15/recordset.c | 18 ++++++++++++++---- dlls/msado15/tests/msado15.c | 6 ++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c index a5096e5c4ff..e3dd83a4309 100644 --- a/dlls/msado15/recordset.c +++ b/dlls/msado15/recordset.c @@ -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 ); diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c index adf9fb30bc2..e95df49c2c2 100644 --- a/dlls/msado15/tests/msado15.c +++ b/dlls/msado15/tests/msado15.c @@ -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 ); -- 2.28.0
participants (1)
-
Hans Leidekker