wine-staging/patches/odbc-remove-unixodbc/0010-odbc32-Foward-SQLSetConnectAttr-requets-onto-the-dri.patch

92 lines
3.3 KiB
Diff
Raw Normal View History

From 827ccc5a0ef8a1b1e1290d7225f25619ca11fcf0 Mon Sep 17 00:00:00 2001
2023-02-16 15:44:46 -08:00
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Mon, 6 Feb 2023 08:55:12 +1100
Subject: [PATCH] odbc32: Foward SQLSetConnectAttr requets onto the driver
2023-02-16 15:44:46 -08:00
---
dlls/odbc32/proxyodbc.c | 49 ++++++++++++++++++++++++++++++++++++-----
1 file changed, 44 insertions(+), 5 deletions(-)
2023-02-16 15:44:46 -08:00
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index e816caa0daa..00822d9d263 100644
2023-02-16 15:44:46 -08:00
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -1042,11 +1042,40 @@ SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount)
SQLRETURN WINAPI SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value,
SQLINTEGER StringLength)
{
- SQLRETURN ret = SQL_ERROR;
+ struct SQLHDBC_data *hdbc = ConnectionHandle;
+ SQLRETURN ret = SQL_SUCCESS;
- FIXME("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value,
+ TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value,
StringLength);
+ if (hdbc->type != SQL_HANDLE_DBC)
+ {
+ WARN("Wrong handle type %d\n", hdbc->type);
+ return SQL_ERROR;
+ }
+
+ switch(Attribute)
+ {
+ case SQL_ATTR_LOGIN_TIMEOUT:
+ if (Value)
+ hdbc->login_timeout = (intptr_t)Value;
+ else
+ hdbc->login_timeout = 0;
+ break;
+ default:
+ if (hdbc->pSQLSetConnectAttr)
+ ret = hdbc->pSQLSetConnectAttr(hdbc->driver_hdbc, Attribute, Value, StringLength);
+ else if(hdbc->pSQLSetConnectOption)
+ ret = hdbc->pSQLSetConnectOption(hdbc->driver_hdbc, Attribute, (SQLULEN)Value);
+ else
+ {
+ FIXME("Unsupported Attribute %d\n", Attribute);
+ ret = SQL_ERROR;
+ }
+ }
+
+ TRACE("ret %d\n", ret);
+
return ret;
}
@@ -1802,6 +1831,7 @@ SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribu
2023-02-16 15:44:46 -08:00
SQLINTEGER StringLength)
{
struct SQLHDBC_data *hdbc = ConnectionHandle;
+ SQLRETURN ret = SQL_SUCCESS;
TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value,
StringLength);
@@ -1821,11 +1851,20 @@ SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribu
2023-02-16 15:44:46 -08:00
hdbc->login_timeout = 0;
break;
default:
- FIXME("Unhandle attribute %d\n", Attribute);
- return SQL_ERROR;
+ if (hdbc->pSQLSetConnectAttrW)
+ ret = hdbc->pSQLSetConnectAttrW(hdbc->driver_hdbc, Attribute, Value, StringLength);
+ else if(hdbc->pSQLSetConnectOptionW)
+ ret = hdbc->pSQLSetConnectOptionW(hdbc->driver_hdbc, Attribute, (SQLULEN)Value);
2023-02-16 15:44:46 -08:00
+ else
+ {
+ FIXME("Unsupported Attribute %d\n", Attribute);
+ ret = SQL_ERROR;
+ }
}
- return SQL_SUCCESS;
+ TRACE("ret %d\n", ret);
+
+ return ret;
}
/*************************************************************************
--
2.43.0
2023-02-16 15:44:46 -08:00