[PATCH v2 0/2] MR10010: odbc32 asci fallbacks.
-- v2: odbc32: SQLPrepareW add ansi fallback odbc32: SQLNativeSqlW add ansi fallback https://gitlab.winehq.org/wine/wine/-/merge_requests/10010
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> --- dlls/odbc32/proxyodbc.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index dbe080f424f..4cbcc7167e8 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -7800,11 +7800,33 @@ static SQLRETURN native_sql_unix_w( struct connection *con, SQLWCHAR *in_stateme static SQLRETURN native_sql_win32_w( struct connection *con, SQLWCHAR *in_statement, SQLINTEGER len, SQLWCHAR *out_statement, SQLINTEGER buflen, SQLINTEGER *retlen ) { + SQLRETURN ret = SQL_ERROR; + if (con->hdr.win32_funcs->SQLNativeSqlW) return con->hdr.win32_funcs->SQLNativeSqlW( con->hdr.win32_handle, in_statement, len, out_statement, buflen, retlen ); - if (con->hdr.win32_funcs->SQLNativeSql) FIXME( "Unicode to ANSI conversion not handled\n" ); - return SQL_ERROR; + if (con->hdr.win32_funcs->SQLNativeSql) + { + SQLCHAR *statement = strnWtoA( in_statement, len ); + SQLCHAR *out = NULL; + if (buflen) + out = malloc( buflen ); + + ret = con->hdr.win32_funcs->SQLNativeSql( con->hdr.win32_handle, statement, len, out, buflen, retlen ); + if(ret == SQL_SUCCESS) + { + if (out_statement) + { + MultiByteToWideChar( CP_ACP, 0, (const char *)out, len, out_statement, buflen ); + out_statement[buflen] = 0; + } + } + if (retlen) *retlen *= sizeof(WCHAR); + + free( statement ); + free( out ); + } + return ret; } /************************************************************************* -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10010
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> --- 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 4cbcc7167e8..272215f541e 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -6334,10 +6334,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 = strnWtoA( statement, len ); + ret = stmt->hdr.win32_funcs->SQLPrepare( stmt->hdr.win32_handle, statementA, len ); + free(statementA); + } + return ret; } /************************************************************************* -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10010
participants (2)
-
Alistair Leslie-Hughes -
Alistair Leslie-Hughes (@alesliehughes)