wine-staging/patches/odbc-remove-unixodbc/0010-odbc32-Foward-SQLGetInfo-W-requests-onto-the-driver.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

83 lines
3.2 KiB
Diff

From 55674ad31123cfdcf664d8f1c28710185aa0388d Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Mon, 6 Feb 2023 08:47:46 +1100
Subject: [PATCH] odbc32: Foward SQLGetInfo/W requests onto the driver
---
dlls/odbc32/proxyodbc.c | 32 ++++++++++++++++++++++++++------
1 file changed, 26 insertions(+), 6 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index 30baf1866a4..50083a23e25 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -902,7 +902,9 @@ SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT Function
SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue,
SQLSMALLINT BufferLength, SQLSMALLINT *StringLength)
{
+ struct SQLHDBC_data *connection = ConnectionHandle;
char *ptr = InfoValue;
+ SQLRETURN ret = SQL_SUCCESS;
TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle,
InfoType, InfoValue, BufferLength, StringLength);
@@ -915,11 +917,19 @@ SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQL
*StringLength = strlen(ptr);
break;
default:
- FIXME("Unsupported type %d\n", InfoType);
- return SQL_ERROR;
+ if (connection->pSQLGetInfo)
+ ret = connection->pSQLGetInfo(connection->driver_hdbc, InfoType, InfoValue,
+ BufferLength, StringLength);
+ else
+ {
+ FIXME("Unsupported type %d\n", InfoType);
+ ret = SQL_ERROR;
+ }
}
- return SQL_SUCCESS;
+ TRACE("ret %d\n", ret);
+
+ return ret;
}
/*************************************************************************
@@ -1994,7 +2004,9 @@ SQLRETURN WINAPI SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Opt
SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue,
SQLSMALLINT BufferLength, SQLSMALLINT *StringLength)
{
+ struct SQLHDBC_data *connection = ConnectionHandle;
WCHAR *ptr = InfoValue;
+ SQLRETURN ret = SQL_SUCCESS;
TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle,
InfoType, InfoValue, BufferLength, StringLength);
@@ -2007,11 +2019,19 @@ SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQ
*StringLength = wcslen(ptr);
break;
default:
- FIXME("Unsupported type %d\n", InfoType);
- return SQL_ERROR;
+ if (connection->pSQLGetInfoW)
+ ret = connection->pSQLGetInfoW(connection->driver_hdbc, InfoType, InfoValue,
+ BufferLength, StringLength);
+ else
+ {
+ FIXME("Unsupported type %d\n", InfoType);
+ ret = SQL_ERROR;
+ }
}
- return SQL_SUCCESS;
+ TRACE("ret %d\n", ret);
+
+ return ret;
}
/*************************************************************************
--
2.43.0