From 6f1a4fa8e2315c3d60706967db7a3399a6817724 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Fri, 13 Dec 2019 15:52:27 +0100 Subject: [PATCH] msado15: Implement _Recordset_get_RecordCount. Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/msado15/recordset.c | 8 ++++++-- dlls/msado15/tests/msado15.c | 10 ++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c index e7c7cdc409c..bb089cfded7 100644 --- a/dlls/msado15/recordset.c +++ b/dlls/msado15/recordset.c @@ -873,8 +873,12 @@ static HRESULT WINAPI recordset_put_MaxRecords( _Recordset *iface, LONG max_reco static HRESULT WINAPI recordset_get_RecordCount( _Recordset *iface, LONG *count ) { - FIXME( "%p, %p\n", iface, count ); - return E_NOTIMPL; + struct recordset *recordset = impl_from_Recordset( iface ); + + TRACE( "%p, %p\n", recordset, count ); + + *count = recordset->count; + return S_OK; } static HRESULT WINAPI recordset_putref_Source( _Recordset *iface, IDispatch *source ) diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c index bac1c34a46c..04ca338dd84 100644 --- a/dlls/msado15/tests/msado15.c +++ b/dlls/msado15/tests/msado15.c @@ -144,11 +144,21 @@ static void test_Recordset(void) ok( hr == S_OK, "got %08x\n", hr ); ok( state == adStateOpen, "got %d\n", state ); + count = -1; + hr = _Recordset_get_RecordCount( recordset, &count ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !count, "got %d\n", count ); + hr = _Recordset_AddNew( recordset, missing, missing ); ok( hr == S_OK, "got %08x\n", hr ); ok( !is_eof( recordset ), "eof\n" ); ok( !is_bof( recordset ), "bof\n" ); + count = -1; + hr = _Recordset_get_RecordCount( recordset, &count ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( count == 1, "got %d\n", count ); + hr = _Recordset_Close( recordset ); ok( hr == S_OK, "got %08x\n", hr );