wine-staging/patches/odbc32-fixes/0009-odbc32-SQLSetConnectAttr-W-handle-fallback-function.patch

47 lines
1.8 KiB
Diff
Raw Normal View History

From 20bf2dea9241d387c9415d816ea96e1947d8a710 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 12 Jul 2024 14:55:47 +1000
Subject: [PATCH 09/15] odbc32: SQLSetConnectAttr/W handle fallback function
---
dlls/odbc32/proxyodbc.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index 462661f43de..e24557fbb11 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -2301,7 +2301,13 @@ SQLRETURN WINAPI SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribut
}
else if (handle->win32_handle)
{
- ret = handle->win32_funcs->SQLSetConnectAttr( handle->win32_handle, Attribute, Value, StringLength );
+ if(handle->win32_funcs->SQLSetConnectOption)
+ ret = handle->win32_funcs->SQLSetConnectAttr( handle->win32_handle, Attribute, Value, StringLength );
+ else if(handle->win32_funcs->SQLSetConnectOption)
+ {
+ /* ODBC v2 */
+ ret = handle->win32_funcs->SQLSetConnectOption( handle->win32_handle, Attribute, (SQLULEN)Value );
+ }
}
else
{
@@ -4429,7 +4435,13 @@ SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribu
}
else if (handle->win32_handle)
{
- ret = handle->win32_funcs->SQLSetConnectAttrW( handle->win32_handle, Attribute, Value, StringLength );
+ if (handle->win32_funcs->SQLSetConnectAttrW)
+ ret = handle->win32_funcs->SQLSetConnectAttrW( handle->win32_handle, Attribute, Value, StringLength );
+ else if(handle->win32_funcs->SQLSetConnectOptionW)
+ {
+ /* ODBC v2 */
+ ret = handle->win32_funcs->SQLSetConnectOptionW( handle->win32_handle, Attribute, (SQLULEN)Value );
+ }
}
else
{
--
2.43.0