msado15: Implement _Recordset_get_BOF and _Recordset_get_EOF.
Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
435d0924eb
commit
55020bf239
|
@ -772,8 +772,12 @@ static HRESULT WINAPI recordset_get_ActiveConnection( _Recordset *iface, VARIANT
|
|||
|
||||
static HRESULT WINAPI recordset_get_BOF( _Recordset *iface, VARIANT_BOOL *bof )
|
||||
{
|
||||
FIXME( "%p, %p\n", iface, bof );
|
||||
return E_NOTIMPL;
|
||||
struct recordset *recordset = impl_from_Recordset( iface );
|
||||
|
||||
TRACE( "%p, %p\n", recordset, bof );
|
||||
|
||||
*bof = (recordset->index < 0) ? VARIANT_TRUE : VARIANT_FALSE;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI recordset_get_Bookmark( _Recordset *iface, VARIANT *bookmark )
|
||||
|
@ -814,8 +818,12 @@ static HRESULT WINAPI recordset_put_CursorType( _Recordset *iface, CursorTypeEnu
|
|||
|
||||
static HRESULT WINAPI recordset_get_EOF( _Recordset *iface, VARIANT_BOOL *eof )
|
||||
{
|
||||
FIXME( "%p, %p\n", iface, eof );
|
||||
return E_NOTIMPL;
|
||||
struct recordset *recordset = impl_from_Recordset( iface );
|
||||
|
||||
TRACE( "%p, %p\n", recordset, eof );
|
||||
|
||||
*eof = (!recordset->count || recordset->index >= recordset->count) ? VARIANT_TRUE : VARIANT_FALSE;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI recordset_get_Fields( _Recordset *iface, Fields **obj )
|
||||
|
|
|
@ -25,6 +25,20 @@
|
|||
|
||||
#define MAKE_ADO_HRESULT( err ) MAKE_HRESULT( SEVERITY_ERROR, FACILITY_CONTROL, err )
|
||||
|
||||
static BOOL is_bof( _Recordset *recordset )
|
||||
{
|
||||
VARIANT_BOOL bof = VARIANT_FALSE;
|
||||
_Recordset_get_BOF( recordset, &bof );
|
||||
return bof == VARIANT_TRUE;
|
||||
}
|
||||
|
||||
static BOOL is_eof( _Recordset *recordset )
|
||||
{
|
||||
VARIANT_BOOL eof = VARIANT_FALSE;
|
||||
_Recordset_get_EOF( recordset, &eof );
|
||||
return eof == VARIANT_TRUE;
|
||||
}
|
||||
|
||||
static LONG get_refs_field( Field *field )
|
||||
{
|
||||
Field_AddRef( field );
|
||||
|
@ -122,6 +136,8 @@ static void test_Recordset(void)
|
|||
|
||||
hr = _Recordset_Open( recordset, missing, missing, adOpenStatic, adLockBatchOptimistic, adCmdUnspecified );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( is_eof( recordset ), "not eof\n" );
|
||||
ok( is_bof( recordset ), "not bof\n" );
|
||||
|
||||
state = -1;
|
||||
hr = _Recordset_get_State( recordset, &state );
|
||||
|
@ -130,6 +146,8 @@ static void test_Recordset(void)
|
|||
|
||||
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" );
|
||||
|
||||
hr = _Recordset_Close( recordset );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
|
|
Loading…
Reference in New Issue