Alistair Leslie-Hughes : msado15: Implement _Recordset get/put CursorType.
Alexandre Julliard
julliard at winehq.org
Thu Oct 22 15:27:31 CDT 2020
Module: wine
Branch: master
Commit: 7287bd50077ce5d187e5435e9192ffcdc73e2d3d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=7287bd50077ce5d187e5435e9192ffcdc73e2d3d
Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Thu Oct 22 14:46:20 2020 +0200
msado15: Implement _Recordset get/put CursorType.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 );
More information about the wine-cvs
mailing list