msado15: Support ADORecordsetConstruction in _Recordset.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2020-11-20 19:16:25 +11:00 committed by Alexandre Julliard
parent 255270373e
commit 8049e4dbc9
2 changed files with 128 additions and 5 deletions

View File

@ -35,6 +35,7 @@ struct fields;
struct recordset
{
_Recordset Recordset_iface;
ADORecordsetConstruction ADORecordsetConstruction_iface;
ISupportErrorInfo ISupportErrorInfo_iface;
LONG refs;
LONG state;
@ -739,6 +740,11 @@ static inline struct recordset *impl_from_Recordset( _Recordset *iface )
return CONTAINING_RECORD( iface, struct recordset, Recordset_iface );
}
static inline struct recordset *impl_from_ADORecordsetConstruction( ADORecordsetConstruction *iface )
{
return CONTAINING_RECORD( iface, struct recordset, ADORecordsetConstruction_iface );
}
static ULONG WINAPI recordset_AddRef( _Recordset *iface )
{
struct recordset *recordset = impl_from_Recordset( iface );
@ -798,6 +804,10 @@ static HRESULT WINAPI recordset_QueryInterface( _Recordset *iface, REFIID riid,
{
*obj = &recordset->ISupportErrorInfo_iface;
}
else if (IsEqualGUID( riid, &IID_ADORecordsetConstruction ))
{
*obj = &recordset->ADORecordsetConstruction_iface;
}
else if (IsEqualGUID( riid, &IID_IRunnableObject ))
{
TRACE("IID_IRunnableObject not supported returning NULL\n");
@ -1545,6 +1555,118 @@ static const ISupportErrorInfoVtbl recordset_supporterrorinfo_vtbl =
recordset_supporterrorinfo_InterfaceSupportsErrorInfo
};
static HRESULT WINAPI rsconstruction_QueryInterface(ADORecordsetConstruction *iface,
REFIID riid, void **obj)
{
struct recordset *recordset = impl_from_ADORecordsetConstruction( iface );
return _Recordset_QueryInterface( &recordset->Recordset_iface, riid, obj );
}
static ULONG WINAPI rsconstruction_AddRef(ADORecordsetConstruction *iface)
{
struct recordset *recordset = impl_from_ADORecordsetConstruction( iface );
return _Recordset_AddRef( &recordset->Recordset_iface );
}
static ULONG WINAPI rsconstruction_Release(ADORecordsetConstruction *iface)
{
struct recordset *recordset = impl_from_ADORecordsetConstruction( iface );
return _Recordset_Release( &recordset->Recordset_iface );
}
static HRESULT WINAPI rsconstruction_GetTypeInfoCount(ADORecordsetConstruction *iface, UINT *pctinfo)
{
struct recordset *recordset = impl_from_ADORecordsetConstruction( iface );
TRACE( "%p, %p\n", recordset, pctinfo );
*pctinfo = 1;
return S_OK;
}
static HRESULT WINAPI rsconstruction_GetTypeInfo(ADORecordsetConstruction *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
struct recordset *recordset = impl_from_ADORecordsetConstruction( iface );
FIXME( "%p %u %u %p\n", recordset, iTInfo, lcid, ppTInfo );
return E_NOTIMPL;
}
static HRESULT WINAPI rsconstruction_GetIDsOfNames(ADORecordsetConstruction *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
struct recordset *recordset = impl_from_ADORecordsetConstruction( iface );
FIXME( "%p %s %p %u %u %p\n", recordset, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId );
return E_NOTIMPL;
}
static HRESULT WINAPI rsconstruction_Invoke(ADORecordsetConstruction *iface, DISPID dispIdMember,
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
struct recordset *recordset = impl_from_ADORecordsetConstruction( iface );
FIXME( "%p %d %s %d %d %p %p %p %p\n", recordset, dispIdMember, debugstr_guid(riid),
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr );
return E_NOTIMPL;
}
static HRESULT WINAPI rsconstruction_get_Rowset(ADORecordsetConstruction *iface, IUnknown **row_set)
{
struct recordset *recordset = impl_from_ADORecordsetConstruction( iface );
FIXME( "%p, %p\n", recordset, row_set );
return E_NOTIMPL;
}
static HRESULT WINAPI rsconstruction_put_Rowset(ADORecordsetConstruction *iface, IUnknown *row_set)
{
struct recordset *recordset = impl_from_ADORecordsetConstruction( iface );
FIXME( "%p, %p\n", recordset, row_set );
return E_NOTIMPL;
}
static HRESULT WINAPI rsconstruction_get_Chapter(ADORecordsetConstruction *iface, LONG *chapter)
{
struct recordset *recordset = impl_from_ADORecordsetConstruction( iface );
FIXME( "%p, %p\n", recordset, chapter );
return E_NOTIMPL;
}
static HRESULT WINAPI rsconstruction_put_Chapter(ADORecordsetConstruction *iface, LONG chapter)
{
struct recordset *recordset = impl_from_ADORecordsetConstruction( iface );
FIXME( "%p, %d\n", recordset, chapter );
return E_NOTIMPL;
}
static HRESULT WINAPI rsconstruction_get_RowPosition(ADORecordsetConstruction *iface, IUnknown **row_pos)
{
struct recordset *recordset = impl_from_ADORecordsetConstruction( iface );
FIXME( "%p, %p\n", recordset, row_pos );
return E_NOTIMPL;
}
static HRESULT WINAPI rsconstruction_put_RowPosition(ADORecordsetConstruction *iface, IUnknown *row_pos)
{
struct recordset *recordset = impl_from_ADORecordsetConstruction( iface );
FIXME( "%p, %p\n", recordset, row_pos );
return E_NOTIMPL;
}
static const ADORecordsetConstructionVtbl rsconstruction_vtbl =
{
rsconstruction_QueryInterface,
rsconstruction_AddRef,
rsconstruction_Release,
rsconstruction_GetTypeInfoCount,
rsconstruction_GetTypeInfo,
rsconstruction_GetIDsOfNames,
rsconstruction_Invoke,
rsconstruction_get_Rowset,
rsconstruction_put_Rowset,
rsconstruction_get_Chapter,
rsconstruction_put_Chapter,
rsconstruction_get_RowPosition,
rsconstruction_put_RowPosition
};
HRESULT Recordset_create( void **obj )
{
struct recordset *recordset;
@ -1552,6 +1674,7 @@ HRESULT Recordset_create( void **obj )
if (!(recordset = heap_alloc_zero( sizeof(*recordset) ))) return E_OUTOFMEMORY;
recordset->Recordset_iface.lpVtbl = &recordset_vtbl;
recordset->ISupportErrorInfo_iface.lpVtbl = &recordset_supporterrorinfo_vtbl;
recordset->ADORecordsetConstruction_iface.lpVtbl = &rsconstruction_vtbl;
recordset->refs = 1;
recordset->index = -1;
recordset->cursor_location = adUseServer;

View File

@ -566,7 +566,7 @@ static void test_ADORecordsetConstruction(void)
ok( hr == S_OK, "got %08x\n", hr );
hr = _Recordset_QueryInterface( recordset, &IID_ADORecordsetConstruction, (void**)&construct );
todo_wine ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08x\n", hr );
if (FAILED(hr))
{
goto done;
@ -585,18 +585,18 @@ static void test_ADORecordsetConstruction(void)
todo_wine ok( hr == S_OK, "got %08x\n", hr );
ref = get_refcount( rowset );
ok( ref == 2, "got %d\n", ref );
todo_wine ok( ref == 2, "got %d\n", ref );
hr = _Recordset_get_Fields( recordset, &fields );
ok( hr == S_OK, "got %08x\n", hr );
ok( fields != NULL, "NULL value\n");
ref = get_refcount( rowset );
ok( ref == 2, "got %d\n", ref );
todo_wine ok( ref == 2, "got %d\n", ref );
count = -1;
hr = Fields_get_Count( fields, &count );
ok( count == 1, "got %d\n", count );
todo_wine ok( count == 1, "got %d\n", count );
if (count > 0)
{
VARIANT index;
@ -623,7 +623,7 @@ static void test_ADORecordsetConstruction(void)
}
ref = get_refcount(rowset);
ok( ref == 2, "got %d\n", ref );
todo_wine ok( ref == 2, "got %d\n", ref );
Fields_Release(fields);