2024-07-15 16:23:21 -07:00
|
|
|
From aef32555c4c66db02760335f30ca060f83c7df9c Mon Sep 17 00:00:00 2001
|
2024-07-14 14:20:30 -07:00
|
|
|
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
|
|
|
Date: Fri, 12 Jul 2024 14:29:17 +1000
|
|
|
|
Subject: [PATCH] odbc32: SQLGetDiagRec/W handle fallback function
|
|
|
|
|
|
|
|
---
|
2024-07-15 16:23:21 -07:00
|
|
|
dlls/odbc32/proxyodbc.c | 29 ++++++++++++++++++++++++++++-
|
|
|
|
1 file changed, 28 insertions(+), 1 deletion(-)
|
2024-07-14 14:20:30 -07:00
|
|
|
|
|
|
|
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
2024-07-15 16:23:21 -07:00
|
|
|
index 7c34d905154..53c2cdb4362 100644
|
2024-07-14 14:20:30 -07:00
|
|
|
--- a/dlls/odbc32/proxyodbc.c
|
|
|
|
+++ b/dlls/odbc32/proxyodbc.c
|
2024-07-15 16:23:21 -07:00
|
|
|
@@ -1872,7 +1872,21 @@ SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMAL
|
2024-07-14 14:20:30 -07:00
|
|
|
}
|
|
|
|
else if (handle->win32_handle)
|
|
|
|
{
|
2024-07-15 16:23:21 -07:00
|
|
|
- ret = get_diag_rec_win32_a( HandleType, handle, RecNumber, SqlState, NativeError, MessageText, BufferLength,
|
|
|
|
+ /* ODBC v2.0 */
|
|
|
|
+ if (handle->win32_funcs->SQLError)
|
2024-07-14 14:20:30 -07:00
|
|
|
+ {
|
|
|
|
+ if (HandleType == SQL_HANDLE_ENV)
|
|
|
|
+ ret = handle->win32_funcs->SQLError(handle->win32_handle, SQL_NULL_HDBC, SQL_NULL_HSTMT,
|
|
|
|
+ SqlState, NativeError, MessageText, BufferLength, TextLength);
|
|
|
|
+ else if (HandleType == SQL_HANDLE_DBC)
|
|
|
|
+ ret = handle->win32_funcs->SQLError(SQL_NULL_HENV, handle->win32_handle, SQL_NULL_HSTMT,
|
|
|
|
+ SqlState, NativeError, MessageText, BufferLength, TextLength);
|
|
|
|
+ else if (HandleType == SQL_HANDLE_STMT)
|
|
|
|
+ ret = handle->win32_funcs->SQLError(SQL_NULL_HENV, SQL_NULL_HDBC, handle->win32_handle,
|
|
|
|
+ SqlState, NativeError, MessageText, BufferLength, TextLength);
|
|
|
|
+ }
|
2024-07-15 16:23:21 -07:00
|
|
|
+ else
|
|
|
|
+ ret = get_diag_rec_win32_a( HandleType, handle, RecNumber, SqlState, NativeError, MessageText, BufferLength,
|
|
|
|
TextLength );
|
2024-07-14 14:20:30 -07:00
|
|
|
}
|
|
|
|
|
2024-07-15 16:23:21 -07:00
|
|
|
@@ -4228,6 +4242,19 @@ static SQLRETURN get_diag_rec_win32_w( SQLSMALLINT handle_type, struct handle *h
|
|
|
|
if (handle->win32_funcs->SQLGetDiagRecW)
|
|
|
|
return handle->win32_funcs->SQLGetDiagRecW( handle_type, handle->win32_handle, rec_num, state, native_err,
|
|
|
|
msg, buflen, retlen );
|
|
|
|
+ else if (handle->win32_funcs->SQLErrorW)
|
|
|
|
+ {
|
|
|
|
+ /* ODBC v2 */
|
|
|
|
+ if (handle_type == SQL_HANDLE_ENV)
|
|
|
|
+ return handle->win32_funcs->SQLErrorW(handle->win32_handle, SQL_NULL_HDBC, SQL_NULL_HSTMT,
|
|
|
|
+ state, native_err, msg, buflen, retlen);
|
|
|
|
+ else if (handle_type == SQL_HANDLE_DBC)
|
|
|
|
+ return handle->win32_funcs->SQLErrorW(SQL_NULL_HENV, handle->win32_handle, SQL_NULL_HSTMT,
|
|
|
|
+ state, native_err, msg, buflen, retlen);
|
|
|
|
+ else if (handle_type == SQL_HANDLE_STMT)
|
|
|
|
+ return handle->win32_funcs->SQLErrorW(SQL_NULL_HENV, SQL_NULL_HDBC, handle->win32_handle,
|
|
|
|
+ state, native_err, msg, buflen, retlen);
|
|
|
|
+ }
|
|
|
|
if (handle->win32_funcs->SQLGetDiagRec) FIXME( "Unicode to ANSI conversion not handled\n" );
|
|
|
|
return SQL_ERROR;
|
|
|
|
}
|
2024-07-14 14:20:30 -07:00
|
|
|
--
|
|
|
|
2.43.0
|
|
|
|
|