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

83 lines
3.2 KiB
Diff
Raw Normal View History

2023-02-16 15:44:46 -08:00
From 721fddbb419b2bdaf710c023b9d33851b77e1684 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 09/42] 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 ebb6b53d62d..6e4e1a68011 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -911,7 +911,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);
@@ -924,11 +926,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;
}
/*************************************************************************
@@ -1973,7 +1983,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);
@@ -1986,11 +1998,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.39.1