[PATCH 0/3] MR10010: odbc32 asci fallbacks.
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> --- dlls/odbc32/proxyodbc.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index dbe080f424f..d48c60ec7a2 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -6106,11 +6106,21 @@ static SQLRETURN describe_col_win32_w( struct statement *stmt, SQLUSMALLINT col_ SQLSMALLINT buf_len, SQLSMALLINT *name_len, SQLSMALLINT *data_type, SQLULEN *col_size, SQLSMALLINT *decimal_digits, SQLSMALLINT *nullable ) { + SQLRETURN ret = SQL_ERROR; + if (stmt->hdr.win32_funcs->SQLDescribeColW) return stmt->hdr.win32_funcs->SQLDescribeColW( stmt->hdr.win32_handle, col_number, col_name, buf_len, name_len, data_type, col_size, decimal_digits, nullable ); - if (stmt->hdr.win32_funcs->SQLDescribeCol) FIXME( "Unicode to ANSI conversion not handled\n" ); - return SQL_ERROR; + if (stmt->hdr.win32_funcs->SQLDescribeCol) + { + SQLCHAR *name = (SQLCHAR*)strdupWA( (WCHAR*)col_name ); + + ret = stmt->hdr.win32_funcs->SQLDescribeCol( stmt->hdr.win32_handle, col_number, name, buf_len, name_len, + data_type, col_size, decimal_digits, nullable); + + free(name); + } + return ret; } /************************************************************************* -- GitLab 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 d48c60ec7a2..47af6ecc80f 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -7810,11 +7810,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 = (SQLCHAR *)strdupWA( (WCHAR *)in_statement ); + 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 47af6ecc80f..9896024107d 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -6344,10 +6344,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 *)strdupWA( statement ); + 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
This assumes that A and W lengths are the same, and that doesn't sound right. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10010#note_128518
participants (3)
-
Alistair Leslie-Hughes -
Alistair Leslie-Hughes (@alesliehughes) -
Nikolay Sivov (@nsivov)