Alistair Leslie-Hughes : msdasql: Implement IRowsetInfo GetSpecification.
Alexandre Julliard
julliard at winehq.org
Mon Nov 15 16:01:28 CST 2021
Module: wine
Branch: master
Commit: 26c4a1edc78d6822c709aa755e5b938454336e18
URL: https://source.winehq.org/git/wine.git/?a=commit;h=26c4a1edc78d6822c709aa755e5b938454336e18
Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Sun Nov 14 17:12:34 2021 +1100
msdasql: Implement IRowsetInfo GetSpecification.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/msdasql/session.c | 18 ++++++++++++++++--
dlls/msdasql/tests/provider.c | 16 ++++++++++++++--
2 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/dlls/msdasql/session.c b/dlls/msdasql/session.c
index 6e9c4b680e9..82693115b8a 100644
--- a/dlls/msdasql/session.c
+++ b/dlls/msdasql/session.c
@@ -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 */
diff --git a/dlls/msdasql/tests/provider.c b/dlls/msdasql/tests/provider.c
index 353e2ec58c8..b0e13b72589 100644
--- a/dlls/msdasql/tests/provider.c
+++ b/dlls/msdasql/tests/provider.c
@@ -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);
More information about the wine-cvs
mailing list