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

msdasql: Add IAccessor to rowset.

parent 60c97a57
...@@ -414,6 +414,7 @@ struct msdasql_rowset ...@@ -414,6 +414,7 @@ struct msdasql_rowset
IRowset IRowset_iface; IRowset IRowset_iface;
IRowsetInfo IRowsetInfo_iface; IRowsetInfo IRowsetInfo_iface;
IColumnsInfo IColumnsInfo_iface; IColumnsInfo IColumnsInfo_iface;
IAccessor IAccessor_iface;
LONG refs; LONG refs;
}; };
...@@ -432,6 +433,11 @@ static inline struct msdasql_rowset *rowset_impl_from_IColumnsInfo( IColumnsInfo ...@@ -432,6 +433,11 @@ static inline struct msdasql_rowset *rowset_impl_from_IColumnsInfo( IColumnsInfo
return CONTAINING_RECORD( iface, struct msdasql_rowset, IColumnsInfo_iface ); return CONTAINING_RECORD( iface, struct msdasql_rowset, IColumnsInfo_iface );
} }
static inline struct msdasql_rowset *impl_from_IAccessor ( IAccessor *iface )
{
return CONTAINING_RECORD( iface, struct msdasql_rowset, IAccessor_iface );
}
static HRESULT WINAPI msdasql_rowset_QueryInterface(IRowset *iface, REFIID riid, void **ppv) static HRESULT WINAPI msdasql_rowset_QueryInterface(IRowset *iface, REFIID riid, void **ppv)
{ {
struct msdasql_rowset *rowset = impl_from_IRowset( iface ); struct msdasql_rowset *rowset = impl_from_IRowset( iface );
...@@ -452,6 +458,10 @@ static HRESULT WINAPI msdasql_rowset_QueryInterface(IRowset *iface, REFIID riid, ...@@ -452,6 +458,10 @@ static HRESULT WINAPI msdasql_rowset_QueryInterface(IRowset *iface, REFIID riid,
{ {
*ppv = &rowset->IColumnsInfo_iface; *ppv = &rowset->IColumnsInfo_iface;
} }
else if(IsEqualGUID(&IID_IAccessor, riid))
{
*ppv = &rowset->IAccessor_iface;
}
if(*ppv) if(*ppv)
{ {
...@@ -630,6 +640,66 @@ static struct IColumnsInfoVtbl rowset_columninfo_vtbll = ...@@ -630,6 +640,66 @@ static struct IColumnsInfoVtbl rowset_columninfo_vtbll =
rowset_colsinfo_MapColumnIDs rowset_colsinfo_MapColumnIDs
}; };
static HRESULT WINAPI rowset_accessor_QueryInterface(IAccessor *iface, REFIID riid, void **out)
{
struct msdasql_rowset *rowset = impl_from_IAccessor( iface );
return IRowset_QueryInterface(&rowset->IRowset_iface, riid, out);
}
static ULONG WINAPI rowset_accessor_AddRef(IAccessor *iface)
{
struct msdasql_rowset *rowset = impl_from_IAccessor( iface );
return IRowset_AddRef(&rowset->IRowset_iface);
}
static ULONG WINAPI rowset_accessor_Release(IAccessor *iface)
{
struct msdasql_rowset *rowset = impl_from_IAccessor( iface );
return IRowset_Release(&rowset->IRowset_iface);
}
static HRESULT WINAPI rowset_accessor_AddRefAccessor(IAccessor *iface, HACCESSOR accessor, DBREFCOUNT *count)
{
struct msdasql_rowset *rowset = impl_from_IAccessor( iface );
FIXME("%p, %lu, %p\n", rowset, accessor, count);
return E_NOTIMPL;
}
static HRESULT WINAPI rowset_accessor_CreateAccessor(IAccessor *iface, DBACCESSORFLAGS flags,
DBCOUNTITEM count, const DBBINDING bindings[], DBLENGTH row_size, HACCESSOR *accessor,
DBBINDSTATUS status[])
{
struct msdasql_rowset *rowset = impl_from_IAccessor( iface );
FIXME("%p 0x%08x, %lu, %p, %lu, %p, %p\n", rowset, flags, count, bindings, row_size, accessor, status);
return E_NOTIMPL;
}
static HRESULT WINAPI rowset_accessor_GetBindings(IAccessor *iface, HACCESSOR accessor,
DBACCESSORFLAGS *flags, DBCOUNTITEM *count, DBBINDING **bindings)
{
struct msdasql_rowset *rowset = impl_from_IAccessor( iface );
FIXME("%p %lu, %p, %p, %p\n", rowset, accessor, flags, count, bindings);
return E_NOTIMPL;
}
static HRESULT WINAPI rowset_accessor_ReleaseAccessor(IAccessor *iface, HACCESSOR accessor, DBREFCOUNT *count)
{
struct msdasql_rowset *rowset = impl_from_IAccessor( iface );
FIXME("%p, %lu, %p\n", rowset, accessor, count);
return E_NOTIMPL;
}
struct IAccessorVtbl accessor_vtbl =
{
rowset_accessor_QueryInterface,
rowset_accessor_AddRef,
rowset_accessor_Release,
rowset_accessor_AddRefAccessor,
rowset_accessor_CreateAccessor,
rowset_accessor_GetBindings,
rowset_accessor_ReleaseAccessor
};
static HRESULT WINAPI command_Execute(ICommandText *iface, IUnknown *outer, REFIID riid, static HRESULT WINAPI command_Execute(ICommandText *iface, IUnknown *outer, REFIID riid,
DBPARAMS *params, DBROWCOUNT *affected, IUnknown **rowset) DBPARAMS *params, DBROWCOUNT *affected, IUnknown **rowset)
{ {
...@@ -646,6 +716,7 @@ static HRESULT WINAPI command_Execute(ICommandText *iface, IUnknown *outer, REFI ...@@ -646,6 +716,7 @@ static HRESULT WINAPI command_Execute(ICommandText *iface, IUnknown *outer, REFI
msrowset->IRowset_iface.lpVtbl = &msdasql_rowset_vtbl; msrowset->IRowset_iface.lpVtbl = &msdasql_rowset_vtbl;
msrowset->IRowsetInfo_iface.lpVtbl = &rowset_info_vtbl; msrowset->IRowsetInfo_iface.lpVtbl = &rowset_info_vtbl;
msrowset->IColumnsInfo_iface.lpVtbl = &rowset_columninfo_vtbll; msrowset->IColumnsInfo_iface.lpVtbl = &rowset_columninfo_vtbll;
msrowset->IAccessor_iface.lpVtbl = &accessor_vtbl;
msrowset->refs = 1; msrowset->refs = 1;
if (affected) if (affected)
......
...@@ -226,6 +226,7 @@ static void test_rowset_interfaces(IRowset *rowset) ...@@ -226,6 +226,7 @@ static void test_rowset_interfaces(IRowset *rowset)
{ {
IRowsetInfo *info; IRowsetInfo *info;
IColumnsInfo *col_info; IColumnsInfo *col_info;
IAccessor *accessor;
HRESULT hr; HRESULT hr;
hr = IRowset_QueryInterface(rowset, &IID_IRowsetInfo, (void**)&info); hr = IRowset_QueryInterface(rowset, &IID_IRowsetInfo, (void**)&info);
...@@ -235,6 +236,10 @@ static void test_rowset_interfaces(IRowset *rowset) ...@@ -235,6 +236,10 @@ static void test_rowset_interfaces(IRowset *rowset)
hr = IRowset_QueryInterface(rowset, &IID_IColumnsInfo, (void**)&col_info); hr = IRowset_QueryInterface(rowset, &IID_IColumnsInfo, (void**)&col_info);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
IColumnsInfo_Release(col_info); IColumnsInfo_Release(col_info);
hr = IRowset_QueryInterface(rowset, &IID_IAccessor, (void**)&accessor);
ok(hr == S_OK, "got 0x%08x\n", hr);
IAccessor_Release(accessor);
} }
static void test_command_rowset(IUnknown *cmd) static void test_command_rowset(IUnknown *cmd)
......
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