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

msdasql: Implement IRowsetInfo GetSpecification.

parent ff0f5e40
......@@ -426,6 +426,7 @@ struct msdasql_rowset
IColumnsInfo IColumnsInfo_iface;
IAccessor IAccessor_iface;
IColumnsRowset IColumnsRowset_iface;
IUnknown *caller;
LONG refs;
};
......@@ -524,6 +525,10 @@ static ULONG WINAPI msdasql_rowset_Release(IRowset *iface)
if (!refs)
{
TRACE( "destroying %p\n", rowset );
if (rowset->caller)
IUnknown_Release(rowset->caller);
heap_free( rowset );
}
return refs;
......@@ -618,8 +623,16 @@ static HRESULT WINAPI rowset_info_GetSpecification(IRowsetInfo *iface, REFIID ri
IUnknown **specification)
{
struct msdasql_rowset *rowset = impl_from_IRowsetInfo( iface );
FIXME("%p, %s, %p\n", rowset, debugstr_guid(riid), specification);
return E_NOTIMPL;
TRACE("%p, %s, %p\n", rowset, debugstr_guid(riid), specification);
if (!specification)
return E_INVALIDARG;
if (!rowset->caller)
return S_FALSE;
return IUnknown_QueryInterface(rowset->caller, riid, (void**)specification);
}
struct IRowsetInfoVtbl rowset_info_vtbl =
......@@ -798,6 +811,7 @@ static HRESULT WINAPI command_Execute(ICommandText *iface, IUnknown *outer, REFI
msrowset->IAccessor_iface.lpVtbl = &accessor_vtbl;
msrowset->IColumnsRowset_iface.lpVtbl = &columnrs_rs_vtbl;
msrowset->refs = 1;
ICommandText_QueryInterface(iface, &IID_IUnknown, (void**)&msrowset->caller);
if (affected)
*affected = 0; /* FIXME */
......
......@@ -293,17 +293,29 @@ static void test_command_dbsession(IUnknown *cmd, IUnknown *session)
ICommandText_Release(comand_text);
}
static void test_rowset_interfaces(IRowset *rowset)
static void test_rowset_interfaces(IRowset *rowset, ICommandText *commandtext)
{
IRowsetInfo *info;
IColumnsInfo *col_info;
IColumnsRowset *col_rs;
IAccessor *accessor;
ICommandText *specification = NULL;
IUnknown *unk;
HRESULT hr;
hr = IRowset_QueryInterface(rowset, &IID_IRowsetInfo, (void**)&info);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IRowsetInfo_GetSpecification(info, &IID_ICommandText, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
hr = IRowsetInfo_GetSpecification(info, &IID_ICommandText, (IUnknown**)&specification);
ok(hr == S_OK, "got 0x%08x\n", hr);
if (specification)
{
ok(commandtext == specification, "got 0x%08x\n", hr);
ICommandText_Release(specification);
}
IRowsetInfo_Release(info);
hr = IRowset_QueryInterface(rowset, &IID_IColumnsInfo, (void**)&col_info);
......@@ -364,7 +376,7 @@ 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);
test_rowset_interfaces(rowset, comand_text);
IRowset_Release(rowset);
IUnknown_Release(unk);
......
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