You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Corrected Commit ascii to ANSI. Reset patch numbers. Convert SQL_C_WCHAR to SQL_CHAR when required for ANSI driver.
65 lines
2.4 KiB
Diff
65 lines
2.4 KiB
Diff
From 9afd532ca391aa96bde3afdebcccdb9bc486ae2c Mon Sep 17 00:00:00 2001
|
|
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
|
Date: Sat, 26 Apr 2025 12:33:23 +1000
|
|
Subject: [PATCH] odbc32: SQLDriverConnectW fallback to SQLDriverConnect when
|
|
required.
|
|
|
|
---
|
|
dlls/odbc32/proxyodbc.c | 37 +++++++++++++++++++++++++++++++++++--
|
|
1 file changed, 35 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
|
index 5d2c4a19915..56556bbdac9 100644
|
|
--- a/dlls/odbc32/proxyodbc.c
|
|
+++ b/dlls/odbc32/proxyodbc.c
|
|
@@ -6866,11 +6866,44 @@ static SQLRETURN driver_connect_win32_w( struct connection *con, SQLHWND window,
|
|
SQLSMALLINT len, SQLWCHAR *out_conn_str, SQLSMALLINT buflen, SQLSMALLINT *len2,
|
|
SQLUSMALLINT completion )
|
|
{
|
|
+ SQLRETURN ret = SQL_ERROR;
|
|
+
|
|
if (con->hdr.win32_funcs->SQLDriverConnectW)
|
|
return con->hdr.win32_funcs->SQLDriverConnectW( con->hdr.win32_handle, window, in_conn_str, len, out_conn_str,
|
|
buflen, len2, completion );
|
|
- if (con->hdr.win32_funcs->SQLDriverConnect) FIXME( "Unicode to ANSI conversion not handled\n" );
|
|
- return SQL_ERROR;
|
|
+ if (con->hdr.win32_funcs->SQLDriverConnect)
|
|
+ {
|
|
+ SQLCHAR *in = NULL, *out = NULL;
|
|
+ SQLSMALLINT in_len = 0, out_len = 0;
|
|
+
|
|
+ in_len = WideCharToMultiByte(CP_ACP, 0, in_conn_str, len, NULL, 0, NULL, NULL);
|
|
+ if (!(in = malloc(in_len + 1))) return SQL_ERROR;
|
|
+
|
|
+ WideCharToMultiByte(CP_ACP, 0, in_conn_str, len, (char *)in, in_len, NULL, NULL);
|
|
+ in[in_len] = 0;
|
|
+
|
|
+ if (out_conn_str && buflen > 0)
|
|
+ {
|
|
+ if (!(out = malloc(buflen)))
|
|
+ {
|
|
+ free(in);
|
|
+ return SQL_ERROR;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ ret = con->hdr.win32_funcs->SQLDriverConnect( con->hdr.win32_handle, window, in, in_len, out, buflen, &out_len, completion );
|
|
+
|
|
+ if (SQL_SUCCEEDED(ret) && out_conn_str && out)
|
|
+ {
|
|
+ MultiByteToWideChar(CP_ACP, 0, (char *)out, out_len, out_conn_str, buflen);
|
|
+ if (len2) *len2 = out_len;
|
|
+ }
|
|
+
|
|
+ free(in);
|
|
+ free(out);
|
|
+ }
|
|
+
|
|
+ return ret;
|
|
}
|
|
|
|
static SQLRETURN driver_connect_unix_w( struct connection *con, SQLHWND window, SQLWCHAR *in_conn_str, SQLSMALLINT len,
|
|
--
|
|
2.47.2
|
|
|