Commit 2f4e22d0 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

msdasql: Add ISessionProperties to session.

parent 4ba940af
......@@ -39,6 +39,7 @@ struct msdasql_session
IUnknown session_iface;
IGetDataSource IGetDataSource_iface;
IOpenRowset IOpenRowset_iface;
ISessionProperties ISessionProperties_iface;
LONG refs;
};
......@@ -57,6 +58,11 @@ static inline struct msdasql_session *impl_from_IOpenRowset( IOpenRowset *iface
return CONTAINING_RECORD( iface, struct msdasql_session, IOpenRowset_iface );
}
static inline struct msdasql_session *impl_from_ISessionProperties( ISessionProperties *iface )
{
return CONTAINING_RECORD( iface, struct msdasql_session, ISessionProperties_iface );
}
static HRESULT WINAPI session_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
{
struct msdasql_session *session = impl_from_IUnknown( iface );
......@@ -79,6 +85,11 @@ static HRESULT WINAPI session_QueryInterface(IUnknown *iface, REFIID riid, void
TRACE("(%p)->(IID_IOpenRowset %p)\n", iface, ppv);
*ppv = &session->IOpenRowset_iface;
}
else if(IsEqualGUID(&IID_ISessionProperties, riid))
{
TRACE("(%p)->(IID_ISessionProperties %p)\n", iface, ppv);
*ppv = &session->ISessionProperties_iface;
}
if(*ppv)
{
......@@ -189,6 +200,52 @@ static const IOpenRowsetVtbl openrowsetVtbl =
openrowset_OpenRowset
};
static HRESULT WINAPI properties_QueryInterface(ISessionProperties *iface, REFIID riid, void **out)
{
struct msdasql_session *session = impl_from_ISessionProperties( iface );
return IUnknown_QueryInterface(&session->session_iface, riid, out);
}
static ULONG WINAPI properties_AddRef(ISessionProperties *iface)
{
struct msdasql_session *session = impl_from_ISessionProperties( iface );
return IUnknown_AddRef(&session->session_iface);
}
static ULONG WINAPI properties_Release(ISessionProperties *iface)
{
struct msdasql_session *session = impl_from_ISessionProperties( iface );
return IUnknown_Release(&session->session_iface);
}
static HRESULT WINAPI properties_GetProperties(ISessionProperties *iface, ULONG set_count,
const DBPROPIDSET id_sets[], ULONG *count, DBPROPSET **sets)
{
struct msdasql_session *session = impl_from_ISessionProperties( iface );
FIXME("%p %d %p %p %p\n", session, set_count, id_sets, count, sets);
return E_NOTIMPL;
}
static HRESULT WINAPI properties_SetProperties(ISessionProperties *iface, ULONG count,
DBPROPSET sets[])
{
struct msdasql_session *session = impl_from_ISessionProperties( iface );
FIXME("%p %d %p\n", session, count, sets);
return S_OK;
}
static const ISessionPropertiesVtbl propertiesVtbl =
{
properties_QueryInterface,
properties_AddRef,
properties_Release,
properties_GetProperties,
properties_SetProperties
};
HRESULT create_db_session(REFIID riid, void **unk)
{
struct msdasql_session *session;
......@@ -201,6 +258,7 @@ HRESULT create_db_session(REFIID riid, void **unk)
session->session_iface.lpVtbl = &unkfactoryVtbl;
session->IGetDataSource_iface.lpVtbl = &datasourceVtbl;
session->IOpenRowset_iface.lpVtbl = &openrowsetVtbl;
session->ISessionProperties_iface.lpVtbl = &propertiesVtbl;
session->refs = 1;
hr = IUnknown_QueryInterface(&session->session_iface, riid, unk);
......
......@@ -160,6 +160,7 @@ static void test_sessions(void)
IOpenRowset *openrowset = NULL;
IDBCreateCommand *create_command = NULL;
IGetDataSource *datasource = NULL;
ISessionProperties *session_props = NULL;
IUnknown *cmd = NULL;
HRESULT hr;
BSTR connect_str;
......@@ -208,6 +209,10 @@ static void test_sessions(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
IGetDataSource_Release(datasource);
hr = IUnknown_QueryInterface(session, &IID_ISessionProperties, (void**)&session_props);
ok(hr == S_OK, "got 0x%08x\n", hr);
ISessionProperties_Release(session_props);
hr = IUnknown_QueryInterface(session, &IID_IOpenRowset, (void**)&openrowset);
ok(hr == S_OK, "got 0x%08x\n", hr);
......
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