Commit db509cf4 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

msado15: Implement _Recordset get/put Bookmark.

parent 25f5734e
......@@ -1029,14 +1029,28 @@ static HRESULT WINAPI recordset_get_BOF( _Recordset *iface, VARIANT_BOOL *bof )
static HRESULT WINAPI recordset_get_Bookmark( _Recordset *iface, VARIANT *bookmark )
{
FIXME( "%p, %p\n", iface, bookmark );
return E_NOTIMPL;
struct recordset *recordset = impl_from_Recordset( iface );
TRACE( "%p, %p\n", iface, bookmark );
if (recordset->state == adStateClosed) return MAKE_ADO_HRESULT( adErrObjectClosed );
if (recordset->index < 0) return MAKE_ADO_HRESULT( adErrNoCurrentRecord );
V_VT(bookmark) = VT_I4;
V_I4(bookmark) = recordset->index;
return S_OK;
}
static HRESULT WINAPI recordset_put_Bookmark( _Recordset *iface, VARIANT bookmark )
{
FIXME( "%p, %s\n", iface, debugstr_variant(&bookmark) );
return E_NOTIMPL;
struct recordset *recordset = impl_from_Recordset( iface );
TRACE( "%p, %s\n", iface, debugstr_variant(&bookmark) );
if (recordset->state == adStateClosed) return MAKE_ADO_HRESULT( adErrObjectClosed );
if (V_VT(&bookmark) != VT_I4) return MAKE_ADO_HRESULT( adErrInvalidArgument );
recordset->index = V_I4(&bookmark);
return S_OK;
}
static HRESULT WINAPI recordset_get_CacheSize( _Recordset *iface, LONG *size )
......
......@@ -74,6 +74,7 @@ static void test_Recordset(void)
CursorTypeEnum cursor;
BSTR name;
HRESULT hr;
VARIANT bookmark;
hr = CoCreateInstance( &CLSID_Recordset, NULL, CLSCTX_INPROC_SERVER, &IID__Recordset, (void **)&recordset );
ok( hr == S_OK, "got %08x\n", hr );
......@@ -153,6 +154,14 @@ static void test_Recordset(void)
ok( hr == S_OK, "got %08x\n", hr );
ok( cursor == adOpenForwardOnly, "got %d\n", cursor );
VariantInit( &bookmark );
hr = _Recordset_get_Bookmark( recordset, &bookmark );
ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08x\n", hr );
VariantInit( &bookmark );
hr = _Recordset_put_Bookmark( recordset, bookmark );
ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08x\n", hr );
VariantInit( &missing );
hr = _Recordset_AddNew( recordset, missing, missing );
ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08x\n", hr );
......@@ -188,6 +197,14 @@ static void test_Recordset(void)
ok( hr == S_OK, "got %08x\n", hr );
ok( state == adStateOpen, "got %d\n", state );
VariantInit( &bookmark );
hr = _Recordset_get_Bookmark( recordset, &bookmark );
ok( hr == MAKE_ADO_HRESULT( adErrNoCurrentRecord ), "got %08x\n", hr );
VariantInit( &bookmark );
hr = _Recordset_put_Bookmark( recordset, bookmark );
ok( hr == MAKE_ADO_HRESULT( adErrInvalidArgument ), "got %08x\n", hr );
count = -1;
hr = _Recordset_get_RecordCount( recordset, &count );
ok( hr == S_OK, "got %08x\n", hr );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment