wine-staging/patches/odbc-remove-unixodbc/0010-odbc32-Foward-SQLGetInfo-W-requests-onto-the-driver.patch

83 lines
3.2 KiB
Diff
Raw Normal View History

From 55674ad31123cfdcf664d8f1c28710185aa0388d 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:47:46 +1100
Subject: [PATCH] odbc32: Foward SQLGetInfo/W requests onto the driver
2023-02-16 15:44:46 -08:00
---
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
2023-02-16 15:44:46 -08:00
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -902,7 +902,9 @@ SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT Function
2023-02-16 15:44:46 -08:00
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
2023-02-16 15:44:46 -08:00
*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
2023-02-16 15:44:46 -08:00
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
2023-02-16 15:44:46 -08:00
*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
2023-02-16 15:44:46 -08:00