msdasql: Support IRowsetInfo in IRowset interface.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6649396abe
commit
3c34f073c0
|
@ -412,6 +412,7 @@ static HRESULT WINAPI command_Cancel(ICommandText *iface)
|
|||
struct msdasql_rowset
|
||||
{
|
||||
IRowset IRowset_iface;
|
||||
IRowsetInfo IRowsetInfo_iface;
|
||||
LONG refs;
|
||||
};
|
||||
|
||||
|
@ -420,6 +421,11 @@ static inline struct msdasql_rowset *impl_from_IRowset( IRowset *iface )
|
|||
return CONTAINING_RECORD( iface, struct msdasql_rowset, IRowset_iface );
|
||||
}
|
||||
|
||||
static inline struct msdasql_rowset *impl_from_IRowsetInfo( IRowsetInfo *iface )
|
||||
{
|
||||
return CONTAINING_RECORD( iface, struct msdasql_rowset, IRowsetInfo_iface );
|
||||
}
|
||||
|
||||
static HRESULT WINAPI msdasql_rowset_QueryInterface(IRowset *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
struct msdasql_rowset *rowset = impl_from_IRowset( iface );
|
||||
|
@ -432,6 +438,10 @@ static HRESULT WINAPI msdasql_rowset_QueryInterface(IRowset *iface, REFIID riid,
|
|||
{
|
||||
*ppv = &rowset->IRowset_iface;
|
||||
}
|
||||
else if (IsEqualGUID(&IID_IRowsetInfo, riid))
|
||||
{
|
||||
*ppv = &rowset->IRowsetInfo_iface;
|
||||
}
|
||||
|
||||
if(*ppv)
|
||||
{
|
||||
|
@ -515,6 +525,58 @@ static const struct IRowsetVtbl msdasql_rowset_vtbl =
|
|||
msdasql_rowset_RestartPosition
|
||||
};
|
||||
|
||||
static HRESULT WINAPI rowset_info_QueryInterface(IRowsetInfo *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
struct msdasql_rowset *rowset = impl_from_IRowsetInfo( iface );
|
||||
return IRowset_QueryInterface(&rowset->IRowset_iface, riid, ppv);
|
||||
}
|
||||
|
||||
static ULONG WINAPI rowset_info_AddRef(IRowsetInfo *iface)
|
||||
{
|
||||
struct msdasql_rowset *rowset = impl_from_IRowsetInfo( iface );
|
||||
return IRowset_AddRef(&rowset->IRowset_iface);
|
||||
}
|
||||
|
||||
static ULONG WINAPI rowset_info_Release(IRowsetInfo *iface)
|
||||
{
|
||||
struct msdasql_rowset *rowset = impl_from_IRowsetInfo( iface );
|
||||
return IRowset_Release(&rowset->IRowset_iface);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI rowset_info_GetProperties(IRowsetInfo *iface, const ULONG count,
|
||||
const DBPROPIDSET propertyidsets[], ULONG *out_count, DBPROPSET **propertysets)
|
||||
{
|
||||
struct msdasql_rowset *rowset = impl_from_IRowsetInfo( iface );
|
||||
FIXME("%p, %ld, %p, %p, %p\n", rowset, count, propertyidsets, out_count, propertysets);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI rowset_info_GetReferencedRowset(IRowsetInfo *iface, DBORDINAL ordinal,
|
||||
REFIID riid, IUnknown **unk)
|
||||
{
|
||||
struct msdasql_rowset *rowset = impl_from_IRowsetInfo( iface );
|
||||
FIXME("%p, %ld, %s, %p\n", rowset, ordinal, debugstr_guid(riid), unk);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI rowset_info_GetSpecification(IRowsetInfo *iface, REFIID riid,
|
||||
IUnknown **specification)
|
||||
{
|
||||
struct msdasql_rowset *rowset = impl_from_IRowsetInfo( iface );
|
||||
FIXME("%p, %s, %p\n", rowset, debugstr_guid(riid), specification);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
struct IRowsetInfoVtbl rowset_info_vtbl =
|
||||
{
|
||||
rowset_info_QueryInterface,
|
||||
rowset_info_AddRef,
|
||||
rowset_info_Release,
|
||||
rowset_info_GetProperties,
|
||||
rowset_info_GetReferencedRowset,
|
||||
rowset_info_GetSpecification
|
||||
};
|
||||
|
||||
static HRESULT WINAPI command_Execute(ICommandText *iface, IUnknown *outer, REFIID riid,
|
||||
DBPARAMS *params, DBROWCOUNT *affected, IUnknown **rowset)
|
||||
{
|
||||
|
@ -529,6 +591,7 @@ static HRESULT WINAPI command_Execute(ICommandText *iface, IUnknown *outer, REFI
|
|||
return E_OUTOFMEMORY;
|
||||
|
||||
msrowset->IRowset_iface.lpVtbl = &msdasql_rowset_vtbl;
|
||||
msrowset->IRowsetInfo_iface.lpVtbl = &rowset_info_vtbl;
|
||||
msrowset->refs = 1;
|
||||
|
||||
if (affected)
|
||||
|
|
|
@ -222,6 +222,16 @@ static void test_command_dbsession(IUnknown *cmd, IUnknown *session)
|
|||
ICommandText_Release(comand_text);
|
||||
}
|
||||
|
||||
static void test_rowset_interfaces(IRowset *rowset)
|
||||
{
|
||||
IRowsetInfo *info;
|
||||
HRESULT hr;
|
||||
|
||||
hr = IRowset_QueryInterface(rowset, &IID_IRowsetInfo, (void**)&info);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
IRowsetInfo_Release(info);
|
||||
}
|
||||
|
||||
static void test_command_rowset(IUnknown *cmd)
|
||||
{
|
||||
ICommandText *comand_text;
|
||||
|
@ -258,6 +268,8 @@ static void test_command_rowset(IUnknown *cmd)
|
|||
hr = IUnknown_QueryInterface(unk, &IID_IRowset, (void**)&rowset);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
|
||||
test_rowset_interfaces(rowset);
|
||||
|
||||
IRowset_Release(rowset);
|
||||
IUnknown_Release(unk);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue