2024-07-17 23:30:03 -07:00
|
|
|
From c72487ac8ae2279f43da906df6ac430fa55e2ae9 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
|
2024-07-17 23:30:03 -07:00
|
|
|
Subject: [PATCH 06/15] odbc32: SQLGetDiagRec/W handle fallback function
|
2024-07-14 14:20:30 -07:00
|
|
|
|
|
|
|
---
|
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-17 23:30:03 -07:00
|
|
|
index 1f51ac2a27e..c4e1c046edc 100644
|
2024-07-14 14:20:30 -07:00
|
|
|
--- a/dlls/odbc32/proxyodbc.c
|
|
|
|
+++ b/dlls/odbc32/proxyodbc.c
|
2024-07-17 23:30:03 -07:00
|
|
|
@@ -1915,7 +1915,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-17 23:30:03 -07:00
|
|
|
@@ -4285,6 +4299,19 @@ static SQLRETURN get_diag_rec_win32_w( SQLSMALLINT handle_type, struct handle *h
|
2024-07-15 16:23:21 -07:00
|
|
|
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
|
|
|
|
|