wine-staging/patches/odbc32-fixes/0001-odbc32-SQLFreeHandle-handle-ODBC-v2-drivers.patch
Alistair Leslie-Hughes ad13b6a9e1 Added odbc32-fixes patchset
This fixes issue with the current odcb32 for writing to database
and support for ODBC v2.0.

This is a replacement for odbc-remove-unixodbc as ODBC32 now supports both unixODBC and native drivers.
2024-07-15 07:21:29 +10:00

47 lines
1.6 KiB
Diff

From 45cc0ee874528258d34e21063cf514ccf40a9865 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 12 Jul 2024 13:42:26 +1000
Subject: [PATCH] odbc32: SQLFreeHandle handle ODBC v2 drivers
---
dlls/odbc32/proxyodbc.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index 957584af008..9a4f08440ea 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -1454,7 +1454,28 @@ SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle)
}
else if (handle->win32_handle)
{
- ret = handle->win32_funcs->SQLFreeHandle( HandleType, handle->win32_handle );
+ if (handle->win32_funcs->SQLFreeHandle)
+ {
+ ret = handle->win32_funcs->SQLFreeHandle( HandleType, handle->win32_handle );
+ }
+ else
+ {
+ /* ODBC v2 */
+ if (HandleType == SQL_HANDLE_DBC)
+ {
+ if (handle->win32_funcs->SQLFreeConnect)
+ ret = handle->win32_funcs->SQLFreeConnect(handle->win32_handle);
+ else
+ ERR("Failed to free connection HANDLE\n");
+ }
+ else if (HandleType == SQL_HANDLE_STMT)
+ {
+ if (handle->win32_funcs->SQLFreeStmt)
+ ret = handle->win32_funcs->SQLFreeStmt(handle->win32_handle, SQL_CLOSE);
+ else
+ ERR("Failed to free statement HANDLE\n");
+ }
+ }
}
RegCloseKey( handle->drivers_key );
--
2.43.0