From 52ea953c3395206435d5bd9eb9f3dbbebde47993 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Thu, 1 May 2025 08:10:04 +1000 Subject: [PATCH] odbc32: SQLPrepareW add ANSI fallback --- dlls/odbc32/proxyodbc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 416d5aa77fa..138ccb0f112 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -6274,10 +6274,17 @@ static SQLRETURN prepare_unix_w( struct statement *stmt, SQLWCHAR *statement, SQ static SQLRETURN prepare_win32_w( struct statement *stmt, SQLWCHAR *statement, SQLINTEGER len ) { + SQLRETURN ret = SQL_ERROR; + if (stmt->hdr.win32_funcs->SQLPrepareW) return stmt->hdr.win32_funcs->SQLPrepareW( stmt->hdr.win32_handle, statement, len ); - if (stmt->hdr.win32_funcs->SQLPrepare) FIXME( "Unicode to ANSI conversion not handled\n" ); - return SQL_ERROR; + if (stmt->hdr.win32_funcs->SQLPrepare) + { + SQLCHAR *statementA = (SQLCHAR*)strdupWtoA( statement ); + ret = stmt->hdr.win32_funcs->SQLPrepare( stmt->hdr.win32_handle, statementA, len ); + free(statementA); + } + return ret; } /************************************************************************* -- 2.50.1