1
0
mirror of https://github.com/wine-mirror/wine synced 2024-06-29 06:14:34 +00:00

msado15: Implement _Recordset get/put MaxRecords.

This commit is contained in:
Alistair Leslie-Hughes 2024-06-24 18:59:50 +10:00 committed by Alexandre Julliard
parent 794e1f1884
commit c483e5d456
2 changed files with 28 additions and 5 deletions

View File

@ -51,6 +51,7 @@ struct recordset
IRowset *row_set;
EditModeEnum editmode;
LONG cache_size;
ADO_LONGPTR max_records;
VARIANT filter;
DBTYPE *columntypes;
@ -1532,14 +1533,20 @@ static HRESULT WINAPI recordset_put_LockType( _Recordset *iface, LockTypeEnum lo
static HRESULT WINAPI recordset_get_MaxRecords( _Recordset *iface, ADO_LONGPTR *max_records )
{
FIXME( "%p, %p\n", iface, max_records );
return E_NOTIMPL;
struct recordset *recordset = impl_from_Recordset( iface );
TRACE( "%p, %p\n", iface, max_records );
*max_records = recordset->max_records;
return S_OK;
}
static HRESULT WINAPI recordset_put_MaxRecords( _Recordset *iface, ADO_LONGPTR max_records )
{
FIXME( "%p, %Id\n", iface, max_records );
return E_NOTIMPL;
struct recordset *recordset = impl_from_Recordset( iface );
TRACE( "%p, %Id\n", iface, max_records );
recordset->max_records = max_records;
return S_OK;
}
static HRESULT WINAPI recordset_get_RecordCount( _Recordset *iface, ADO_LONGPTR *count )
@ -2800,6 +2807,7 @@ HRESULT Recordset_create( void **obj )
recordset->row_set = NULL;
recordset->editmode = adEditNone;
recordset->cache_size = 1;
recordset->max_records = 0;
VariantInit( &recordset->filter );
recordset->columntypes = NULL;
recordset->haccessors = NULL;

View File

@ -53,7 +53,7 @@ static void test_Recordset(void)
Properties *props;
Property *prop;
LONG count, state;
ADO_LONGPTR rec_count;
ADO_LONGPTR rec_count, max_records;
VARIANT missing, val, index;
CursorLocationEnum location;
CursorTypeEnum cursor;
@ -127,6 +127,21 @@ static void test_Recordset(void)
hr = _Recordset_put_CacheSize( recordset, 1 );
ok( hr == S_OK, "got %08lx\n", hr );
max_records = 0;
hr = _Recordset_get_MaxRecords( recordset, &max_records );
ok( hr == S_OK, "got %08lx\n", hr );
ok( max_records == 0, "got %Id\n", max_records );
hr = _Recordset_put_MaxRecords( recordset, 5 );
ok( hr == S_OK, "got %08lx\n", hr );
hr = _Recordset_get_MaxRecords( recordset, &max_records );
ok( hr == S_OK, "got %08lx\n", hr );
ok( max_records == 5, "got %Id\n", max_records );
hr = _Recordset_put_MaxRecords( recordset, 0 );
ok( hr == S_OK, "got %08lx\n", hr );
editmode = -1;
hr = _Recordset_get_EditMode( recordset, &editmode );
ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08lx\n", hr );