Module: wine Branch: master Commit: 916690636890f8ffe474031c48d328e4f6d94a82 URL: https://source.winehq.org/git/wine.git/?a=commit;h=916690636890f8ffe474031c4...
Author: Alistair Leslie-Hughes leslie_alistair@hotmail.com Date: Mon Oct 25 20:34:32 2021 +1100
msdasql: Support IDBProperties interface.
Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/msdasql/msdasql_main.c | 75 +++++++++++++++++++++++++++++++++++++++++++ dlls/oledb32/tests/database.c | 4 +-- 2 files changed, 77 insertions(+), 2 deletions(-)
diff --git a/dlls/msdasql/msdasql_main.c b/dlls/msdasql/msdasql_main.c index 91978ad9c1a..31830e7025b 100644 --- a/dlls/msdasql/msdasql_main.c +++ b/dlls/msdasql/msdasql_main.c @@ -23,6 +23,7 @@ #include "windef.h" #include "winbase.h" #include "objbase.h" +#include "oledb.h" #include "rpcproxy.h" #include "wine/debug.h"
@@ -102,6 +103,7 @@ HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, void **ppv ) struct msdasql { IUnknown MSDASQL_iface; + IDBProperties IDBProperties_iface;
LONG ref; }; @@ -111,6 +113,11 @@ static inline struct msdasql *impl_from_IUnknown(IUnknown *iface) return CONTAINING_RECORD(iface, struct msdasql, MSDASQL_iface); }
+static inline struct msdasql *impl_from_IDBProperties(IDBProperties *iface) +{ + return CONTAINING_RECORD(iface, struct msdasql, IDBProperties_iface); +} + static HRESULT WINAPI msdsql_QueryInterface(IUnknown *iface, REFIID riid, void **out) { struct msdasql *provider = impl_from_IUnknown(iface); @@ -122,6 +129,10 @@ static HRESULT WINAPI msdsql_QueryInterface(IUnknown *iface, REFIID riid, void * { *out = &provider->MSDASQL_iface; } + else if(IsEqualGUID(riid, &IID_IDBProperties)) + { + *out = &provider->IDBProperties_iface; + } else { FIXME("(%s, %p)\n", debugstr_guid(riid), out); @@ -165,6 +176,69 @@ static const IUnknownVtbl msdsql_vtbl = msdsql_Release };
+static HRESULT WINAPI dbprops_QueryInterface(IDBProperties *iface, REFIID riid, void **ppvObject) +{ + struct msdasql *provider = impl_from_IDBProperties(iface); + + return IUnknown_QueryInterface(&provider->MSDASQL_iface, riid, ppvObject); +} + +static ULONG WINAPI dbprops_AddRef(IDBProperties *iface) +{ + struct msdasql *provider = impl_from_IDBProperties(iface); + + return IUnknown_AddRef(&provider->MSDASQL_iface); +} + +static ULONG WINAPI dbprops_Release(IDBProperties *iface) +{ + struct msdasql *provider = impl_from_IDBProperties(iface); + + return IUnknown_Release(&provider->MSDASQL_iface); +} + +static HRESULT WINAPI dbprops_GetProperties(IDBProperties *iface, ULONG cPropertyIDSets, + const DBPROPIDSET rgPropertyIDSets[], ULONG *pcPropertySets, DBPROPSET **prgPropertySets) +{ + struct msdasql *provider = impl_from_IDBProperties(iface); + + FIXME("(%p)->(%d %p %p %p)\n", provider, cPropertyIDSets, rgPropertyIDSets, pcPropertySets, prgPropertySets); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dbprops_GetPropertyInfo(IDBProperties *iface, ULONG cPropertyIDSets, + const DBPROPIDSET rgPropertyIDSets[], ULONG *pcPropertyInfoSets, + DBPROPINFOSET **prgPropertyInfoSets, OLECHAR **ppDescBuffer) +{ + struct msdasql *provider = impl_from_IDBProperties(iface); + + FIXME("(%p)->(%d %p %p %p %p)\n", provider, cPropertyIDSets, rgPropertyIDSets, pcPropertyInfoSets, + prgPropertyInfoSets, ppDescBuffer); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dbprops_SetProperties(IDBProperties *iface, ULONG cPropertySets, + DBPROPSET rgPropertySets[]) +{ + struct msdasql *provider = impl_from_IDBProperties(iface); + + FIXME("(%p)->(%d %p)\n", provider, cPropertySets, rgPropertySets); + + return E_NOTIMPL; +} + +static const struct IDBPropertiesVtbl dbprops_vtbl = +{ + dbprops_QueryInterface, + dbprops_AddRef, + dbprops_Release, + dbprops_GetProperties, + dbprops_GetPropertyInfo, + dbprops_SetProperties +}; + static HRESULT create_msdasql_provider(REFIID riid, void **ppv) { struct msdasql *provider; @@ -175,6 +249,7 @@ static HRESULT create_msdasql_provider(REFIID riid, void **ppv) return E_OUTOFMEMORY;
provider->MSDASQL_iface.lpVtbl = &msdsql_vtbl; + provider->IDBProperties_iface.lpVtbl = &dbprops_vtbl; provider->ref = 1;
hr = IUnknown_QueryInterface(&provider->MSDASQL_iface, riid, ppv); diff --git a/dlls/oledb32/tests/database.c b/dlls/oledb32/tests/database.c index 1897d57623f..3baa91b87a4 100644 --- a/dlls/oledb32/tests/database.c +++ b/dlls/oledb32/tests/database.c @@ -994,7 +994,7 @@ static void test_odbc_provider(void) };
hr = CoCreateInstance( &CLSID_MSDASQL, NULL, CLSCTX_ALL, &IID_IDBProperties, (void **)&props); - todo_wine ok(hr == S_OK, "Failed to create object 0x%08x\n", hr); + ok(hr == S_OK, "Failed to create object 0x%08x\n", hr); if (FAILED(hr)) { return; @@ -1006,7 +1006,7 @@ static void test_odbc_provider(void)
infocount = 0; hr = IDBProperties_GetPropertyInfo(props, 1, &propidset, &infocount, &propinfoset, &desc); - ok(hr == S_OK, "got 0x%08x\n", hr); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); if (hr == S_OK) { ULONG i;