wine-staging/patches/odbc-remove-unixodbc/0040-odbc32-Pass-ODBC-version-when-creating-driver-enviro.patch
Alistair Leslie-Hughes 14f63f40e7 Updated odbc-remove-unixodbc patchset
Instead of removing unixODBC completely. Creating an wine ODBC driver for unixODBC.
This way native and unixODBC drivers can be used.

This is a WIP.
2024-06-23 17:08:33 +10:00

34 lines
1.4 KiB
Diff

From 014cadef9d41657c315f140daa0cbed19d43f02a Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 8 Feb 2023 09:03:40 +1100
Subject: [PATCH] odbc32: Pass ODBC version when creating driver environment
---
dlls/odbc32/proxyodbc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index cf3455c45b4..6e02d37548c 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -2654,11 +2654,15 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl
if (connection->pSQLAllocHandle)
{
connection->pSQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &connection->driver_env);
- connection->pSQLAllocHandle(SQL_HANDLE_DBC, connection->driver_env, &connection->driver_hdbc);
if (connection->pSQLGetEnvAttr)
connection->pSQLGetEnvAttr(connection->driver_env, SQL_ATTR_ODBC_VERSION, &connection->driver_ver, 0, NULL);
+ if (connection->pSQLSetEnvAttr)
+ connection->pSQLSetEnvAttr(connection->driver_env, SQL_ATTR_ODBC_VERSION,
+ (SQLPOINTER)connection->environment->version, 0);
+
+ connection->pSQLAllocHandle(SQL_HANDLE_DBC, connection->driver_env, &connection->driver_hdbc);
}
/* ODBC 2.x */
else if(connection->pSQLAllocConnect && connection->pSQLAllocEnv)
--
2.43.0