From: Hans Leidekker hans@codeweavers.com
--- dlls/odbc32/odbc32.spec | 44 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/dlls/odbc32/odbc32.spec b/dlls/odbc32/odbc32.spec index f94eaabea26..c42bf55c3eb 100644 --- a/dlls/odbc32/odbc32.spec +++ b/dlls/odbc32/odbc32.spec @@ -5,16 +5,16 @@ 5 stdcall SQLCancel(long) 6 stdcall SQLColAttributes(long long long ptr long ptr ptr) 7 stdcall SQLConnect(long str long str long str long) - 8 stdcall SQLDescribeCol(long long str long ptr ptr ptr ptr ptr) + 8 stdcall SQLDescribeCol(long long ptr long ptr ptr ptr ptr ptr) 9 stdcall SQLDisconnect(long) - 10 stdcall SQLError(long long long str ptr str long ptr) + 10 stdcall SQLError(long long long ptr ptr ptr long ptr) 11 stdcall SQLExecDirect(long str long) 12 stdcall SQLExecute(long) 13 stdcall SQLFetch(long) 14 stdcall SQLFreeConnect(long) 15 stdcall SQLFreeEnv(long) 16 stdcall SQLFreeStmt(long long ) - 17 stdcall SQLGetCursorName(long str long ptr) + 17 stdcall SQLGetCursorName(long ptr long ptr) 18 stdcall SQLNumResultCols(long ptr) 19 stdcall SQLPrepare(long str long) 20 stdcall SQLRowCount(long ptr) @@ -31,14 +31,14 @@ 31 stdcall SQLFreeHandle(long long) 32 stdcall SQLGetConnectAttr(long long ptr long ptr) 33 stdcall SQLGetDescField(long long long ptr long ptr) - 34 stdcall SQLGetDescRec(long long str long ptr ptr ptr ptr ptr ptr ptr) + 34 stdcall SQLGetDescRec(long long ptr long ptr ptr ptr ptr ptr ptr ptr) 35 stdcall SQLGetDiagField(long long long long ptr long ptr) - 36 stdcall SQLGetDiagRec(long long long str ptr str long ptr) + 36 stdcall SQLGetDiagRec(long long long ptr ptr ptr long ptr) 37 stdcall SQLGetEnvAttr(long long ptr long ptr) 38 stdcall SQLGetStmtAttr(long long ptr long ptr) 39 stdcall SQLSetConnectAttr(long long ptr long) 40 stdcall SQLColumns(long str long str long str long str long) - 41 stdcall SQLDriverConnect(long long str long str long ptr long) + 41 stdcall SQLDriverConnect(long long str long ptr long ptr long) 42 stdcall SQLGetConnectOption(long long ptr) 43 stdcall SQLGetData(long long long ptr long ptr) 44 stdcall SQLGetFunctions(long long ptr) @@ -52,14 +52,14 @@ 52 stdcall SQLSpecialColumns(long long str long str long str long long long) 53 stdcall SQLStatistics(long str long str long str long long long) 54 stdcall SQLTables(long str long str long str long str long) - 55 stdcall SQLBrowseConnect(long str long str long ptr) + 55 stdcall SQLBrowseConnect(long str long ptr long ptr) 56 stdcall SQLColumnPrivileges(long str long str long str long str long) - 57 stdcall SQLDataSources(long long str long ptr str long ptr) + 57 stdcall SQLDataSources(long long str long ptr ptr long ptr) 58 stdcall SQLDescribeParam(long long ptr ptr ptr ptr) 59 stdcall SQLExtendedFetch(long long long ptr ptr) 60 stdcall SQLForeignKeys(long str long str long str long str long str long str long) 61 stdcall SQLMoreResults(long) - 62 stdcall SQLNativeSql(long str long str long ptr) + 62 stdcall SQLNativeSql(long str long ptr long ptr) 63 stdcall SQLNumParams(long ptr) 64 stdcall SQLParamOptions(long long ptr) 65 stdcall SQLPrimaryKeys(long str long str long str long) @@ -68,7 +68,7 @@ 68 stdcall SQLSetPos(long long long long) 69 stdcall SQLSetScrollOptions(long long long long) 70 stdcall SQLTablePrivileges(long str long str long str long) - 71 stdcall SQLDrivers(long long str long ptr str long ptr) + 71 stdcall SQLDrivers(long long str long ptr ptr long ptr) 72 stdcall SQLBindParameter(long long long long long long long ptr long ptr) 73 stdcall SQLSetDescField(long long long ptr long) 74 stdcall SQLSetDescRec(long long long long long long long ptr ptr ptr) @@ -88,22 +88,22 @@ 90 stub ODBCSharedVSFlag 106 stdcall SQLColAttributesW(long long long ptr long ptr ptr) 107 stdcall SQLConnectW(long wstr long wstr long wstr long) -108 stdcall SQLDescribeColW(long long wstr long ptr ptr ptr ptr ptr) -110 stdcall SQLErrorW(long long long wstr ptr wstr long ptr) -111 stdcall SQLExecDirectW(long wstr long) -117 stdcall SQLGetCursorNameW(long wstr long ptr) +108 stdcall SQLDescribeColW(long long ptr long ptr ptr ptr ptr ptr) +110 stdcall SQLErrorW(long long long ptr ptr ptr long ptr) +111 stdcall SQLExecDirectW(long ptr long) +117 stdcall SQLGetCursorNameW(long ptr long ptr) 119 stdcall SQLPrepareW(long wstr long) 121 stdcall SQLSetCursorNameW(long wstr long) 127 stdcall SQLColAttributeW(long long long ptr long ptr ptr) 132 stdcall SQLGetConnectAttrW(long long ptr long ptr) 133 stdcall SQLGetDescFieldW(long long long ptr long ptr) -134 stdcall SQLGetDescRecW(long long wstr long ptr ptr ptr ptr ptr ptr ptr) +134 stdcall SQLGetDescRecW(long long ptr long ptr ptr ptr ptr ptr ptr ptr) 135 stdcall SQLGetDiagFieldW(long long long long ptr long ptr) -136 stdcall SQLGetDiagRecW(long long long wstr ptr wstr long ptr) +136 stdcall SQLGetDiagRecW(long long long ptr ptr ptr long ptr) 138 stdcall SQLGetStmtAttrW(long long ptr long ptr) 139 stdcall SQLSetConnectAttrW(long long ptr long) 140 stdcall SQLColumnsW(long wstr long wstr long wstr long wstr long) -141 stdcall SQLDriverConnectW(long long wstr long wstr long ptr long) +141 stdcall SQLDriverConnectW(long long wstr long ptr long ptr long) 142 stdcall SQLGetConnectOptionW(long long ptr) 145 stdcall SQLGetInfoW(long long ptr long ptr) 147 stdcall SQLGetTypeInfoW(long long) @@ -111,16 +111,16 @@ 152 stdcall SQLSpecialColumnsW(long long wstr long wstr long wstr long long long) 153 stdcall SQLStatisticsW(long wstr long wstr long wstr long long long) 154 stdcall SQLTablesW(long wstr long wstr long wstr long wstr long) -155 stdcall SQLBrowseConnectW(long wstr long wstr long ptr) +155 stdcall SQLBrowseConnectW(long wstr long ptr long ptr) 156 stdcall SQLColumnPrivilegesW(long wstr long wstr long wstr long wstr long) -157 stdcall SQLDataSourcesW(long long wstr long ptr wstr long ptr) +157 stdcall SQLDataSourcesW(long long wstr long ptr ptr long ptr) 160 stdcall SQLForeignKeysW(long wstr long wstr long wstr long wstr long wstr long wstr long) -162 stdcall SQLNativeSqlW(long wstr long wstr long ptr) +162 stdcall SQLNativeSqlW(long wstr long ptr long ptr) 165 stdcall SQLPrimaryKeysW(long wstr long wstr long wstr long) 166 stdcall SQLProcedureColumnsW(long wstr long wstr long wstr long wstr long) 167 stdcall SQLProceduresW(long wstr long wstr long wstr long) 170 stdcall SQLTablePrivilegesW(long wstr long wstr long wstr long) -171 stdcall SQLDriversW(long long wstr long ptr wstr long ptr) +171 stdcall SQLDriversW(long long wstr long ptr ptr long ptr) 173 stdcall SQLSetDescFieldW(long long long ptr long) 176 stdcall SQLSetStmtAttrW(long long ptr long) 206 stub SQLColAttributesA @@ -150,7 +150,7 @@ 254 stub SQLTablesA 255 stub SQLBrowseConnectA 256 stub SQLColumnPrivilegesA -257 stdcall SQLDataSourcesA(long long str long ptr str long ptr) +257 stdcall SQLDataSourcesA(long long str long ptr ptr long ptr) 260 stub SQLForeignKeysA 262 stub SQLNativeSqlA 265 stub SQLPrimaryKeysA
From: Hans Leidekker hans@codeweavers.com
--- dlls/odbc32/proxyodbc.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 957584af008..76b17cd4ed0 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -338,32 +338,20 @@ static const struct win32_funcs *load_driver( const WCHAR *filename ) { HMODULE module; struct win32_driver *driver; - WCHAR *ptr, *path = wcsdup( filename ); + WCHAR *ptr; UINT32 i;
for (i = 0; i < win32_drivers.count; i++) { - if (!wcsicmp( filename, win32_drivers.drivers[i]->filename )) - { - free( path ); - return &win32_drivers.drivers[i]->funcs; - } + if (!wcsicmp( filename, win32_drivers.drivers[i]->filename )) return &win32_drivers.drivers[i]->funcs; }
- if (!(driver = malloc( sizeof(*driver) + (wcslen(filename) + 1) * sizeof(WCHAR) ))) - { - free( path ); - return NULL; - } + if (!(driver = malloc( sizeof(*driver) + (wcslen(filename) + 1) * sizeof(WCHAR) ))) return NULL; ptr = (WCHAR *)(driver + 1); wcscpy( ptr, filename ); driver->filename = ptr;
- if ((ptr = wcsrchr( path, '\' )) || (ptr = wcsrchr( path, '/' ))) *ptr = 0; - SetDllDirectoryW( path ); - module = LoadLibraryW( filename ); - SetDllDirectoryW( NULL ); - free( path ); + module = LoadLibraryExW( filename, NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS ); if (!module) { free( driver );
From: Hans Leidekker hans@codeweavers.com
--- dlls/odbc32/proxyodbc.c | 100 +++++++++++++++++++++++++++++++++------- 1 file changed, 84 insertions(+), 16 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 76b17cd4ed0..421c5352403 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -3276,6 +3276,57 @@ SQLRETURN WINAPI SQLBindParameter(SQLHSTMT StatementHandle, SQLUSMALLINT Paramet return ret; }
+static WCHAR *strnAtoW( const SQLCHAR *str, int in_len ) +{ + WCHAR *ret = NULL; + if (str) + { + int len = MultiByteToWideChar( CP_ACP, 0, (const char *)str, in_len, NULL, 0 ); + if ((ret = malloc( (len + 1) * sizeof(WCHAR) ))) + { + MultiByteToWideChar( CP_ACP, 0, (const char *)str, in_len, ret, len ); + ret[len] = 0; + } + } + return ret; +} + +static SQLRETURN driver_connect_win32_a( struct handle *handle, SQLHWND window, SQLCHAR *in_conn_str, + SQLSMALLINT inlen, SQLCHAR *out_conn_str, SQLSMALLINT buflen, + SQLSMALLINT *outlen, SQLUSMALLINT completion ) +{ + SQLRETURN ret = SQL_ERROR; + SQLWCHAR *in, *out = NULL; + SQLSMALLINT lenW; + + if (handle->win32_funcs->SQLDriverConnect) + return handle->win32_funcs->SQLDriverConnect( handle->win32_handle, window, in_conn_str, inlen, out_conn_str, + buflen, outlen, completion ); + + if (!(in = strnAtoW( in_conn_str, inlen ))) return SQL_ERROR; + if (!(out = malloc( buflen * sizeof(WCHAR) ))) goto done; + ret = handle->win32_funcs->SQLDriverConnectW( handle->win32_handle, window, in, inlen, out, buflen, &lenW, + completion ); + if (SUCCESS( ret )) + { + int len = WideCharToMultiByte( CP_ACP, 0, out, -1, (char *)out_conn_str, buflen, NULL, NULL ); + if (outlen) *outlen = len - 1; + } +done: + free( in ); + free( out ); + return ret; +} + +static SQLRETURN driver_connect_unix_a( struct handle *handle, SQLHWND window, SQLCHAR *in_conn_str, SQLSMALLINT len, + SQLCHAR *out_conn_str, SQLSMALLINT buflen, SQLSMALLINT *len2, + SQLUSMALLINT completion ) +{ + struct SQLDriverConnect_params params = { handle->unix_handle, window, in_conn_str, len, out_conn_str, buflen, + len2, completion }; + return ODBC_CALL( SQLDriverConnect, ¶ms ); +} + /************************************************************************* * SQLDriverConnect [ODBC32.041] */ @@ -3287,8 +3338,8 @@ SQLRETURN WINAPI SQLDriverConnect(SQLHDBC ConnectionHandle, SQLHWND WindowHandle WCHAR *datasource = NULL, *filename = NULL, *connection_string = strdupAW( (const char *)InConnectionString ); SQLRETURN ret = SQL_ERROR;
- TRACE("(ConnectionHandle %p, WindowHandle %p, InConnectionString %s, Length %d, OutConnectionString, %p," - " BufferLength, %d, Length2 %p, DriverCompletion %d)\n", ConnectionHandle, WindowHandle, + TRACE("(ConnectionHandle %p, WindowHandle %p, InConnectionString %s, Length %d, OutConnectionString %p," + " BufferLength %d, Length2 %p, DriverCompletion %d)\n", ConnectionHandle, WindowHandle, debugstr_an((const char *)InConnectionString, Length), Length, OutConnectionString, BufferLength, Length2, DriverCompletion);
@@ -3318,20 +3369,18 @@ SQLRETURN WINAPI SQLDriverConnect(SQLHDBC ConnectionHandle, SQLHWND WindowHandle if (!SUCCESS((ret = create_env( handle->parent, FALSE )))) goto done; if (!SUCCESS((ret = create_con( handle )))) goto done;
- ret = handle->win32_funcs->SQLDriverConnect( handle->win32_handle, WindowHandle, InConnectionString, Length, - OutConnectionString, BufferLength, Length2, DriverCompletion ); + ret = driver_connect_win32_a( handle, WindowHandle, InConnectionString, Length, OutConnectionString, + BufferLength, Length2, DriverCompletion ); } else { - struct SQLDriverConnect_params params = { 0, WindowHandle, InConnectionString, Length, OutConnectionString, - BufferLength, Length2, DriverCompletion }; - TRACE( "using Unix driver %s\n", debugstr_w(filename) ); + if (!SUCCESS((ret = create_env( handle->parent, TRUE )))) goto done; if (!SUCCESS((ret = create_con( handle )))) goto done;
- params.ConnectionHandle = handle->unix_handle; - ret = ODBC_CALL( SQLDriverConnect, ¶ms ); + ret = driver_connect_unix_a( handle, WindowHandle, InConnectionString, Length, OutConnectionString, + BufferLength, Length2, DriverCompletion ); }
done: @@ -4013,6 +4062,27 @@ SQLRETURN WINAPI SQLColumnsW(SQLHSTMT StatementHandle, WCHAR *CatalogName, SQLSM return ret; }
+static SQLRETURN driver_connect_win32_w( struct handle *handle, SQLHWND window, SQLWCHAR *in_conn_str, + SQLSMALLINT len, SQLWCHAR *out_conn_str, SQLSMALLINT buflen, SQLSMALLINT *len2, + SQLUSMALLINT completion ) +{ + if (handle->win32_funcs->SQLDriverConnectW) + return handle->win32_funcs->SQLDriverConnectW( handle->win32_handle, window, in_conn_str, len, out_conn_str, + buflen, len2, completion ); + + if (handle->win32_funcs->SQLDriverConnect) FIXME( "Unicode to ANSI conversion not handled\n" ); + return SQL_ERROR; +} + +static SQLRETURN driver_connect_unix_w( struct handle *handle, SQLHWND window, SQLWCHAR *in_conn_str, SQLSMALLINT len, + SQLWCHAR *out_conn_str, SQLSMALLINT buflen, SQLSMALLINT *len2, + SQLUSMALLINT completion ) +{ + struct SQLDriverConnectW_params params = { handle->unix_handle, window, in_conn_str, len, out_conn_str, buflen, + len2, completion }; + return ODBC_CALL( SQLDriverConnectW, ¶ms ); +} + /************************************************************************* * SQLDriverConnectW [ODBC32.141] */ @@ -4055,20 +4125,18 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl if (!SUCCESS((ret = create_env( handle->parent, FALSE )))) goto done; if (!SUCCESS((ret = create_con( handle )))) goto done;
- ret = handle->win32_funcs->SQLDriverConnectW( handle->win32_handle, WindowHandle, InConnectionString, Length, - OutConnectionString, BufferLength, Length2, DriverCompletion ); + ret = driver_connect_win32_w( handle, WindowHandle, InConnectionString, Length, OutConnectionString, + BufferLength, Length2, DriverCompletion ); } else { - struct SQLDriverConnectW_params params = { 0, WindowHandle, InConnectionString, Length, OutConnectionString, - BufferLength, Length2, DriverCompletion }; - TRACE( "using Unix driver %s\n", debugstr_w(filename) ); + if (!SUCCESS((ret = create_env( handle->parent, TRUE )))) goto done; if (!SUCCESS((ret = create_con( handle )))) goto done;
- params.ConnectionHandle = handle->unix_handle; - ret = ODBC_CALL( SQLDriverConnectW, ¶ms ); + ret = driver_connect_unix_w( handle, WindowHandle, InConnectionString, Length, OutConnectionString, + BufferLength, Length2, DriverCompletion); }
done:
From: Hans Leidekker hans@codeweavers.com
--- dlls/odbc32/proxyodbc.c | 73 ++++++++++++++++++++++++++++++++++------- 1 file changed, 62 insertions(+), 11 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 421c5352403..3b747b5a12b 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -1730,6 +1730,40 @@ SQLRETURN WINAPI SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSM return ret; }
+static SQLRETURN get_diag_rec_unix_a( SQLSMALLINT handle_type, struct handle *handle, SQLSMALLINT rec_num, + SQLCHAR *state, SQLINTEGER *native_err, SQLCHAR *msg, SQLSMALLINT buflen, + SQLSMALLINT *retlen ) +{ + struct SQLGetDiagRec_params params = { handle_type, handle->unix_handle, rec_num, state, native_err, msg, + buflen, retlen }; + return ODBC_CALL( SQLGetDiagRec, ¶ms ); +} + +static SQLRETURN get_diag_rec_win32_a( SQLSMALLINT handle_type, struct handle *handle, SQLSMALLINT rec_num, + SQLCHAR *state, SQLINTEGER *native_err, SQLCHAR *msg, SQLSMALLINT buflen, + SQLSMALLINT *retlen ) +{ + SQLRETURN ret = SQL_ERROR; + SQLWCHAR stateW[6], *msgW = NULL; + SQLSMALLINT lenW; + + if (handle->win32_funcs->SQLGetDiagRec) + return handle->win32_funcs->SQLGetDiagRec( handle_type, handle->win32_handle, rec_num, state, native_err, + msg, buflen, retlen ); + + if (!(msgW = malloc( buflen * sizeof(WCHAR) ))) return SQL_ERROR; + ret = handle->win32_funcs->SQLGetDiagRecW( handle_type, handle->win32_handle, rec_num, stateW, native_err, + msgW, buflen, &lenW ); + if (SUCCESS( ret )) + { + int len = WideCharToMultiByte( CP_ACP, 0, msgW, -1, (char *)msg, buflen, NULL, NULL ); + if (retlen) *retlen = len - 1; + WideCharToMultiByte( CP_ACP, 0, stateW, -1, (char *)state, 6, NULL, NULL ); + } + free( msgW ); + return ret; +} + /************************************************************************* * SQLGetDiagRec [ODBC32.036] */ @@ -1748,14 +1782,13 @@ SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMAL
if (handle->unix_handle) { - struct SQLGetDiagRec_params params = { HandleType, handle->unix_handle, RecNumber, SqlState, NativeError, - MessageText, BufferLength, TextLength }; - ret = ODBC_CALL( SQLGetDiagRec, ¶ms ); + ret = get_diag_rec_unix_a( HandleType, handle, RecNumber, SqlState, NativeError, MessageText, BufferLength, + TextLength ); } else if (handle->win32_handle) { - ret = handle->win32_funcs->SQLGetDiagRec( HandleType, handle->win32_handle, RecNumber, SqlState, NativeError, - MessageText, BufferLength, TextLength ); + ret = get_diag_rec_win32_a( HandleType, handle, RecNumber, SqlState, NativeError, MessageText, BufferLength, + TextLength ); }
TRACE("Returning %d\n", ret); @@ -3917,6 +3950,26 @@ SQLRETURN WINAPI SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLS return ret; }
+static SQLRETURN get_diag_rec_unix_w( SQLSMALLINT handle_type, struct handle *handle, SQLSMALLINT rec_num, + SQLWCHAR *state, SQLINTEGER *native_err, SQLWCHAR *msg, SQLSMALLINT buflen, + SQLSMALLINT *retlen ) +{ + struct SQLGetDiagRecW_params params = { handle_type, handle->unix_handle, rec_num, state, native_err, msg, + buflen, retlen }; + return ODBC_CALL( SQLGetDiagRecW, ¶ms ); +} + +static SQLRETURN get_diag_rec_win32_w( SQLSMALLINT handle_type, struct handle *handle, SQLSMALLINT rec_num, + SQLWCHAR *state, SQLINTEGER *native_err, SQLWCHAR *msg, SQLSMALLINT buflen, + SQLSMALLINT *retlen ) +{ + if (handle->win32_funcs->SQLGetDiagRecW) + return handle->win32_funcs->SQLGetDiagRecW( handle_type, handle->win32_handle, rec_num, state, native_err, + msg, buflen, retlen ); + if (handle->win32_funcs->SQLGetDiagRec) FIXME( "Unicode to ANSI conversion not handled\n" ); + return SQL_ERROR; +} + /************************************************************************* * SQLGetDiagRecW [ODBC32.136] */ @@ -3935,14 +3988,13 @@ SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMA
if (handle->unix_handle) { - struct SQLGetDiagRecW_params params = { HandleType, handle->unix_handle, RecNumber, SqlState, NativeError, - MessageText, BufferLength, TextLength }; - ret = ODBC_CALL( SQLGetDiagRecW, ¶ms ); + ret = get_diag_rec_unix_w( HandleType, handle, RecNumber, SqlState, NativeError, MessageText, BufferLength, + TextLength ); } else if (handle->win32_handle) { - ret = handle->win32_funcs->SQLGetDiagRecW( HandleType, handle->win32_handle, RecNumber, SqlState, NativeError, - MessageText, BufferLength, TextLength ); + ret = get_diag_rec_win32_w( HandleType, handle, RecNumber, SqlState, NativeError, MessageText, BufferLength, + TextLength ); }
TRACE("Returning %d\n", ret); @@ -4069,7 +4121,6 @@ static SQLRETURN driver_connect_win32_w( struct handle *handle, SQLHWND window, if (handle->win32_funcs->SQLDriverConnectW) return handle->win32_funcs->SQLDriverConnectW( handle->win32_handle, window, in_conn_str, len, out_conn_str, buflen, len2, completion ); - if (handle->win32_funcs->SQLDriverConnect) FIXME( "Unicode to ANSI conversion not handled\n" ); return SQL_ERROR; }
From: Hans Leidekker hans@codeweavers.com
--- dlls/odbc32/proxyodbc.c | 107 +++++++++++++++++++++++++++++----------- 1 file changed, 78 insertions(+), 29 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 3b747b5a12b..eb54490a789 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -2650,6 +2650,57 @@ static WCHAR *get_datasource( const WCHAR *connection_string ) return ret; }
+static WCHAR *strnAtoW( const SQLCHAR *str, int len ) +{ + WCHAR *ret; + int lenW; + + if (!str) return NULL; + + if (len == SQL_NTS) len = strlen( (const char *)str ); + lenW = MultiByteToWideChar( CP_ACP, 0, (const char *)str, len, NULL, 0 ); + if ((ret = malloc( (lenW + 1) * sizeof(WCHAR) ))) + { + MultiByteToWideChar( CP_ACP, 0, (const char *)str, len, ret, lenW ); + ret[lenW] = 0; + } + return ret; +} + +static SQLRETURN browse_connect_win32_a( struct handle *handle, SQLCHAR *in_conn_str, SQLSMALLINT inlen, + SQLCHAR *out_conn_str, SQLSMALLINT buflen, SQLSMALLINT *outlen ) +{ + SQLRETURN ret = SQL_ERROR; + SQLWCHAR *in = NULL, *out = NULL; + SQLSMALLINT lenW; + + if (handle->win32_funcs->SQLBrowseConnect) + return handle->win32_funcs->SQLBrowseConnect( handle->win32_handle, in_conn_str, inlen, out_conn_str, + buflen, outlen ); + if (handle->win32_funcs->SQLBrowseConnectW) + { + if (!(in = strnAtoW( in_conn_str, inlen ))) return SQL_ERROR; + if (!(out = malloc( buflen * sizeof(WCHAR) ))) goto done; + ret = handle->win32_funcs->SQLBrowseConnectW( handle->win32_handle, in, inlen, out, buflen, &lenW ); + if (SUCCESS( ret )) + { + int len = WideCharToMultiByte( CP_ACP, 0, out, -1, (char *)out_conn_str, buflen, NULL, NULL ); + if (outlen) *outlen = len - 1; + } + } +done: + free( in ); + free( out ); + return ret; +} + +static SQLRETURN browse_connect_unix_a( struct handle *handle, SQLCHAR *in_conn_str, SQLSMALLINT len, + SQLCHAR *out_conn_str, SQLSMALLINT buflen, SQLSMALLINT *len2 ) +{ + struct SQLBrowseConnect_params params = { handle->unix_handle, in_conn_str, len, out_conn_str, buflen, len2 }; + return ODBC_CALL( SQLBrowseConnect, ¶ms ); +} + /************************************************************************* * SQLBrowseConnect [ODBC32.055] */ @@ -2690,20 +2741,18 @@ SQLRETURN WINAPI SQLBrowseConnect(SQLHDBC ConnectionHandle, SQLCHAR *InConnectio if (!SUCCESS((ret = create_env( handle->parent, FALSE )))) goto done; if (!SUCCESS((ret = create_con( handle )))) goto done;
- ret = handle->win32_funcs->SQLBrowseConnect( handle->win32_handle, InConnectionString, StringLength1, - OutConnectionString, BufferLength, StringLength2 ); + ret = browse_connect_win32_a( handle, InConnectionString, StringLength1, OutConnectionString, + BufferLength, StringLength2 ); } else { - struct SQLBrowseConnect_params params = { 0, InConnectionString, StringLength1, OutConnectionString, - BufferLength, StringLength2 }; - TRACE( "using Unix driver %s\n", debugstr_w(filename) ); + if (!SUCCESS((ret = create_env( handle->parent, TRUE )))) goto done; if (!SUCCESS((ret = create_con( handle )))) goto done;
- params.ConnectionHandle = handle->unix_handle; - ret = ODBC_CALL( SQLBrowseConnect, ¶ms ); + ret = browse_connect_unix_a( handle, InConnectionString, StringLength1, OutConnectionString, + BufferLength, StringLength2 ); }
done: @@ -3309,21 +3358,6 @@ SQLRETURN WINAPI SQLBindParameter(SQLHSTMT StatementHandle, SQLUSMALLINT Paramet return ret; }
-static WCHAR *strnAtoW( const SQLCHAR *str, int in_len ) -{ - WCHAR *ret = NULL; - if (str) - { - int len = MultiByteToWideChar( CP_ACP, 0, (const char *)str, in_len, NULL, 0 ); - if ((ret = malloc( (len + 1) * sizeof(WCHAR) ))) - { - MultiByteToWideChar( CP_ACP, 0, (const char *)str, in_len, ret, len ); - ret[len] = 0; - } - } - return ret; -} - static SQLRETURN driver_connect_win32_a( struct handle *handle, SQLHWND window, SQLCHAR *in_conn_str, SQLSMALLINT inlen, SQLCHAR *out_conn_str, SQLSMALLINT buflen, SQLSMALLINT *outlen, SQLUSMALLINT completion ) @@ -4423,6 +4457,23 @@ SQLRETURN WINAPI SQLTablesW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQL return ret; }
+static SQLRETURN browse_connect_win32_w( struct handle *handle, SQLWCHAR *in_conn_str, SQLSMALLINT len, + SQLWCHAR *out_conn_str, SQLSMALLINT buflen, SQLSMALLINT *len2 ) +{ + if (handle->win32_funcs->SQLBrowseConnectW) + return handle->win32_funcs->SQLBrowseConnectW( handle->win32_handle, in_conn_str, len, out_conn_str, + buflen, len2 ); + if (handle->win32_funcs->SQLBrowseConnect) FIXME( "Unicode to ANSI conversion not handled\n" ); + return SQL_ERROR; +} + +static SQLRETURN browse_connect_unix_w( struct handle *handle, SQLWCHAR *in_conn_str, SQLSMALLINT len, + SQLWCHAR *out_conn_str, SQLSMALLINT buflen, SQLSMALLINT *len2 ) +{ + struct SQLBrowseConnectW_params params = { handle->unix_handle, in_conn_str, len, out_conn_str, buflen, len2 }; + return ODBC_CALL( SQLBrowseConnectW, ¶ms ); +} + /************************************************************************* * SQLBrowseConnectW [ODBC32.155] */ @@ -4463,20 +4514,18 @@ SQLRETURN WINAPI SQLBrowseConnectW(SQLHDBC ConnectionHandle, SQLWCHAR *InConnect if (!SUCCESS((ret = create_env( handle->parent, FALSE )))) goto done; if (!SUCCESS((ret = create_con( handle )))) goto done;
- ret = handle->win32_funcs->SQLBrowseConnectW( handle->win32_handle, InConnectionString, StringLength1, - OutConnectionString, BufferLength, StringLength2 ); + ret = browse_connect_win32_w( handle, InConnectionString, StringLength1, OutConnectionString, BufferLength, + StringLength2 ); } else { - struct SQLBrowseConnectW_params params = { 0, InConnectionString, StringLength1, OutConnectionString, - BufferLength, StringLength2 }; - TRACE( "using Unix driver %s\n", debugstr_w(filename) ); + if (!SUCCESS((ret = create_env( handle->parent, TRUE )))) goto done; if (!SUCCESS((ret = create_con( handle )))) goto done;
- params.ConnectionHandle = handle->unix_handle; - ret = ODBC_CALL( SQLBrowseConnectW, ¶ms ); + ret = browse_connect_unix_w( handle, InConnectionString, StringLength1, OutConnectionString, BufferLength, + StringLength2 ); }
done:
From: Hans Leidekker hans@codeweavers.com
--- dlls/odbc32/proxyodbc.c | 106 ++++++++++++++++++++++++++++++++-------- 1 file changed, 85 insertions(+), 21 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index eb54490a789..e04af6b914b 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -2789,6 +2789,52 @@ SQLRETURN WINAPI SQLBulkOperations(SQLHSTMT StatementHandle, SQLSMALLINT Operati return ret; }
+static SQLRETURN col_attributes_unix_a( struct handle *handle, SQLUSMALLINT col, SQLUSMALLINT field_id, + SQLPOINTER char_attrs, SQLSMALLINT buflen, SQLSMALLINT *retlen, + SQLLEN *num_attrs ) +{ + SQLRETURN ret; + INT64 attrs; + struct SQLColAttributes_params params = { handle->unix_handle, col, field_id, char_attrs, buflen, retlen, &attrs }; + if (SUCCESS((ret = ODBC_CALL( SQLColAttributes, ¶ms )))) *num_attrs = attrs; + return ret; +} + +static SQLRETURN col_attributes_win32_a( struct handle *handle, SQLUSMALLINT col, SQLUSMALLINT field_id, + SQLPOINTER char_attrs, SQLSMALLINT buflen, SQLSMALLINT *retlen, + SQLLEN *num_attrs ) +{ + SQLRETURN ret = SQL_ERROR; + + if (handle->win32_funcs->SQLColAttributes) + { + return handle->win32_funcs->SQLColAttributes( handle->win32_handle, col, field_id, char_attrs, buflen, + retlen, num_attrs ); + } + else if (handle->win32_funcs->SQLColAttributesW) + { + if (buflen < 0) + ret = handle->win32_funcs->SQLColAttributesW( handle->win32_handle, col, field_id, char_attrs, buflen, + retlen, num_attrs ); + else + { + SQLWCHAR *strW; + SQLSMALLINT lenW; + + if (!(strW = malloc( buflen * sizeof(WCHAR) ))) return SQL_ERROR; + ret = handle->win32_funcs->SQLColAttributesW( handle->win32_handle, col, field_id, strW, buflen, &lenW, + num_attrs ); + if (SUCCESS( ret )) + { + int len = WideCharToMultiByte( CP_ACP, 0, strW, -1, char_attrs, buflen, NULL, NULL ); + if (retlen) *retlen = len - 1; + } + free( strW ); + } + } + return ret; +} + /************************************************************************* * SQLColAttributes [ODBC32.006] */ @@ -2807,16 +2853,13 @@ SQLRETURN WINAPI SQLColAttributes(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnN
if (handle->unix_handle) { - INT64 attrs; - struct SQLColAttributes_params params = { handle->unix_handle, ColumnNumber, FieldIdentifier, - CharacterAttributes, BufferLength, StringLength, &attrs }; - if (SUCCESS((ret = ODBC_CALL( SQLColAttributes, ¶ms )))) *NumericAttributes = attrs; + ret = col_attributes_unix_a( handle, ColumnNumber, FieldIdentifier, CharacterAttributes, BufferLength, + StringLength, NumericAttributes ); } else if (handle->win32_handle) { - ret = handle->win32_funcs->SQLColAttributes( handle->win32_handle, ColumnNumber, FieldIdentifier, - CharacterAttributes, BufferLength, StringLength, - NumericAttributes ); + ret = col_attributes_win32_a( handle, ColumnNumber, FieldIdentifier, CharacterAttributes, BufferLength, + StringLength, NumericAttributes ); }
TRACE("Returning %d\n", ret); @@ -3515,6 +3558,37 @@ static BOOL SQLColAttributes_KnownStringAttribute(SQLUSMALLINT fDescType) return FALSE; }
+static SQLRETURN col_attributes_unix_w( struct handle *handle, SQLUSMALLINT col, SQLUSMALLINT field_id, + SQLPOINTER char_attrs, SQLSMALLINT buflen, SQLSMALLINT *retlen, + SQLLEN *num_attrs ) +{ + SQLRETURN ret; + INT64 attrs; + struct SQLColAttributesW_params params = { handle->unix_handle, col, field_id, char_attrs, buflen, retlen, + &attrs }; + + if (SUCCESS((ret = ODBC_CALL( SQLColAttributesW, ¶ms )))) *num_attrs = attrs; + + if (ret == SQL_SUCCESS && SQLColAttributes_KnownStringAttribute(field_id) && char_attrs && + retlen && *retlen != wcslen( char_attrs ) * sizeof(WCHAR)) + { + TRACE("CHEAT: resetting name length for ADO\n"); + *retlen = wcslen( char_attrs ) * sizeof(WCHAR); + } + return ret; +} + +static SQLRETURN col_attributes_win32_w( struct handle *handle, SQLUSMALLINT col, SQLUSMALLINT field_id, + SQLPOINTER char_attrs, SQLSMALLINT buflen, SQLSMALLINT *retlen, + SQLLEN *num_attrs ) +{ + if (handle->win32_funcs->SQLColAttributesW) + return handle->win32_funcs->SQLColAttributesW( handle->win32_handle, col, field_id, char_attrs, buflen, + retlen, num_attrs ); + if (handle->win32_funcs->SQLColAttributes) FIXME( "Unicode to ANSI conversion not handled\n" ); + return SQL_ERROR; +} + /************************************************************************* * SQLColAttributesW [ODBC32.106] */ @@ -3533,23 +3607,13 @@ SQLRETURN WINAPI SQLColAttributesW(SQLHSTMT StatementHandle, SQLUSMALLINT Column
if (handle->unix_handle) { - INT64 attrs; - struct SQLColAttributesW_params params = { handle->unix_handle, ColumnNumber, FieldIdentifier, - CharacterAttributes, BufferLength, StringLength, &attrs }; - if (SUCCESS((ret = ODBC_CALL( SQLColAttributesW, ¶ms )))) *NumericAttributes = attrs; - - if (ret == SQL_SUCCESS && SQLColAttributes_KnownStringAttribute(FieldIdentifier) && CharacterAttributes && - StringLength && *StringLength != wcslen(CharacterAttributes) * 2) - { - TRACE("CHEAT: resetting name length for ADO\n"); - *StringLength = wcslen(CharacterAttributes) * 2; - } + ret = col_attributes_unix_w( handle, ColumnNumber, FieldIdentifier, CharacterAttributes, BufferLength, + StringLength, NumericAttributes ); } else if (handle->win32_handle) { - ret = handle->win32_funcs->SQLColAttributesW( handle->win32_handle, ColumnNumber, FieldIdentifier, - CharacterAttributes, BufferLength, StringLength, - NumericAttributes ); + ret = col_attributes_win32_w( handle, ColumnNumber, FieldIdentifier, CharacterAttributes, BufferLength, + StringLength, NumericAttributes ); }
TRACE("Returning %d\n", ret);
From: Hans Leidekker hans@codeweavers.com
--- dlls/odbc32/proxyodbc.c | 106 +++++++++++++++++++++++++++++++--------- 1 file changed, 84 insertions(+), 22 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index e04af6b914b..995b30a3713 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -662,6 +662,52 @@ SQLRETURN WINAPI SQLCloseCursor(SQLHSTMT StatementHandle) return ret; }
+static SQLRETURN col_attribute_unix_a( struct handle *handle, SQLUSMALLINT col, SQLUSMALLINT field_id, + SQLPOINTER char_attr, SQLSMALLINT buflen, SQLSMALLINT *retlen, + SQLLEN *num_attr ) +{ + SQLRETURN ret; + INT64 attr; + struct SQLColAttribute_params params = { handle->unix_handle, col, field_id, char_attr, buflen, retlen, &attr }; + if (SUCCESS((ret = ODBC_CALL( SQLColAttribute, ¶ms )))) *num_attr = attr; + return ret; +} + +static SQLRETURN col_attribute_win32_a( struct handle *handle, SQLUSMALLINT col, SQLUSMALLINT field_id, + SQLPOINTER char_attr, SQLSMALLINT buflen, SQLSMALLINT *retlen, + SQLLEN *num_attr ) +{ + SQLRETURN ret = SQL_ERROR; + + if (handle->win32_funcs->SQLColAttribute) + { + return handle->win32_funcs->SQLColAttribute( handle->win32_handle, col, field_id, char_attr, buflen, + retlen, num_attr ); + } + else if (handle->win32_funcs->SQLColAttributeW) + { + if (buflen < 0) + ret = handle->win32_funcs->SQLColAttributeW( handle->win32_handle, col, field_id, char_attr, buflen, + retlen, num_attr ); + else + { + SQLWCHAR *strW; + SQLSMALLINT lenW; + + if (!(strW = malloc( buflen * sizeof(WCHAR) ))) return SQL_ERROR; + ret = handle->win32_funcs->SQLColAttributeW( handle->win32_handle, col, field_id, strW, buflen, &lenW, + num_attr ); + if (SUCCESS( ret )) + { + int len = WideCharToMultiByte( CP_ACP, 0, strW, -1, char_attr, buflen, NULL, NULL ); + if (retlen) *retlen = len - 1; + } + free( strW ); + } + } + return ret; +} + /************************************************************************* * SQLColAttribute [ODBC32.027] */ @@ -680,16 +726,13 @@ SQLRETURN WINAPI SQLColAttribute(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNu
if (handle->unix_handle) { - INT64 num_attr = 0; - struct SQLColAttribute_params params = { handle->unix_handle, ColumnNumber, FieldIdentifier, - CharacterAttribute, BufferLength, StringLength, &num_attr }; - if (SUCCESS(( ret = ODBC_CALL( SQLColAttribute, ¶ms ))) && NumericAttribute) - *NumericAttribute = num_attr; + ret = col_attribute_unix_a( handle, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength, + StringLength, NumericAttribute ); } else if (handle->win32_handle) { - ret = handle->win32_funcs->SQLColAttribute( handle->win32_handle, ColumnNumber, FieldIdentifier, - CharacterAttribute, BufferLength, StringLength, NumericAttribute ); + ret = col_attribute_win32_a( handle, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength, + StringLength, NumericAttribute ); }
TRACE("Returning %d\n", ret); @@ -3862,6 +3905,36 @@ SQLRETURN WINAPI SQLSetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, return ret; }
+static SQLRETURN col_attribute_unix_w( struct handle *handle, SQLUSMALLINT col, SQLUSMALLINT field_id, + SQLPOINTER char_attr, SQLSMALLINT buflen, SQLSMALLINT *retlen, + SQLLEN *num_attr ) +{ + SQLRETURN ret; + INT64 attr; + struct SQLColAttributeW_params params = { handle->unix_handle, col, field_id, char_attr, buflen, retlen, &attr }; + + if (SUCCESS((ret = ODBC_CALL( SQLColAttributeW, ¶ms )))) *num_attr = attr; + + if (ret == SQL_SUCCESS && SQLColAttributes_KnownStringAttribute(field_id) && char_attr && + retlen && *retlen != wcslen( char_attr ) * sizeof(WCHAR)) + { + TRACE("CHEAT: resetting name length for ADO\n"); + *retlen = wcslen( char_attr ) * sizeof(WCHAR); + } + return ret; +} + +static SQLRETURN col_attribute_win32_w( struct handle *handle, SQLUSMALLINT col, SQLUSMALLINT field_id, + SQLPOINTER char_attr, SQLSMALLINT buflen, SQLSMALLINT *retlen, + SQLLEN *num_attr ) +{ + if (handle->win32_funcs->SQLColAttributeW) + return handle->win32_funcs->SQLColAttributeW( handle->win32_handle, col, field_id, char_attr, buflen, + retlen, num_attr ); + if (handle->win32_funcs->SQLColAttribute) FIXME( "Unicode to ANSI conversion not handled\n" ); + return SQL_ERROR; +} + /************************************************************************* * SQLColAttributeW [ODBC32.127] */ @@ -3881,24 +3954,13 @@ SQLRETURN WINAPI SQLColAttributeW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnN
if (handle->unix_handle) { - INT64 attr; - struct SQLColAttributeW_params params = { handle->unix_handle, ColumnNumber, FieldIdentifier, - CharacterAttribute, BufferLength, StringLength, &attr }; - - if (SUCCESS((ret = ODBC_CALL( SQLColAttributeW, ¶ms ))) && NumericAttribute) *NumericAttribute = attr; - - if (ret == SQL_SUCCESS && CharacterAttribute != NULL && SQLColAttributes_KnownStringAttribute(FieldIdentifier) && - StringLength && *StringLength != wcslen(CharacterAttribute) * 2) - { - TRACE("CHEAT: resetting name length for ADO\n"); - *StringLength = wcslen(CharacterAttribute) * 2; - } + ret = col_attribute_unix_w( handle, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength, + StringLength, NumericAttribute ); } else if (handle->win32_handle) { - ret = handle->win32_funcs->SQLColAttributeW( handle->win32_handle, ColumnNumber, FieldIdentifier, - CharacterAttribute, BufferLength, StringLength, - NumericAttribute ); + ret = col_attribute_win32_w( handle, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength, + StringLength, NumericAttribute ); }
TRACE("Returning %d\n", ret);
From: Hans Leidekker hans@codeweavers.com
String length may be SQL_NTS(-3) which means the string is null-terminated. --- dlls/odbc32/proxyodbc.c | 178 ++++++++++++++++++------------------- dlls/odbc32/tests/odbc32.c | 3 +- 2 files changed, 91 insertions(+), 90 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 995b30a3713..7d8a5d04f9a 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -739,6 +739,12 @@ SQLRETURN WINAPI SQLColAttribute(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNu return ret; }
+static const char *debugstr_sqlstr( const SQLCHAR *str, SQLSMALLINT len ) +{ + if (len == SQL_NTS) len = strlen( (const char *)str ); + return wine_dbgstr_an( (const char *)str, len ); +} + /************************************************************************* * SQLColumns [ODBC32.040] */ @@ -751,10 +757,9 @@ SQLRETURN WINAPI SQLColumns(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLS
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," " NameLength3 %d, ColumnName %s, NameLength4 %d)\n", StatementHandle, - debugstr_an((const char *)CatalogName, NameLength1), NameLength1, - debugstr_an((const char *)SchemaName, NameLength2), NameLength2, - debugstr_an((const char *)TableName, NameLength3), NameLength3, - debugstr_an((const char *)ColumnName, NameLength4), NameLength4); + debugstr_sqlstr(CatalogName, NameLength1), NameLength1, debugstr_sqlstr(SchemaName, NameLength2), + NameLength2, debugstr_sqlstr(TableName, NameLength3), NameLength3, + debugstr_sqlstr(ColumnName, NameLength4), NameLength4);
if (!handle) return SQL_INVALID_HANDLE;
@@ -944,9 +949,8 @@ SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSM
TRACE("(ConnectionHandle %p, ServerName %s, NameLength1 %d, UserName %s, NameLength2 %d, Authentication %s," " NameLength3 %d)\n", ConnectionHandle, - debugstr_an((const char *)ServerName, NameLength1), NameLength1, - debugstr_an((const char *)UserName, NameLength2), NameLength2, - debugstr_an((const char *)Authentication, NameLength3), NameLength3); + debugstr_sqlstr(ServerName, NameLength1), NameLength1, debugstr_sqlstr(UserName, NameLength2), + NameLength2, debugstr_sqlstr(Authentication, NameLength3), NameLength3);
if (!handle) return SQL_INVALID_HANDLE;
@@ -1219,9 +1223,9 @@ SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, S
if (SUCCESS( ret )) { - TRACE(" SqlState %s\n", debugstr_an((const char *)SqlState, 5)); + TRACE(" SqlState %s\n", debugstr_sqlstr(SqlState, 5)); TRACE(" Error %d\n", *NativeError); - TRACE(" MessageText %s\n", debugstr_an((const char *)MessageText, *TextLength)); + TRACE(" MessageText %s\n", debugstr_sqlstr(MessageText, *TextLength)); } TRACE("Returning %d\n", ret); return ret; @@ -1236,7 +1240,7 @@ SQLRETURN WINAPI SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLRETURN ret = SQL_ERROR;
TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, - debugstr_an((const char *)StatementText, TextLength), TextLength); + debugstr_sqlstr(StatementText, TextLength), TextLength);
if (!handle) return SQL_INVALID_HANDLE;
@@ -2104,7 +2108,7 @@ SQLRETURN WINAPI SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQ SQLRETURN ret = SQL_ERROR;
TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, - debugstr_an((const char *)StatementText, TextLength), TextLength); + debugstr_sqlstr(StatementText, TextLength), TextLength);
if (!handle) return SQL_INVALID_HANDLE;
@@ -2260,7 +2264,7 @@ SQLRETURN WINAPI SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLRETURN ret = SQL_ERROR;
TRACE("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle, - debugstr_an((const char *)CursorName, NameLength), NameLength); + debugstr_sqlstr(CursorName, NameLength), NameLength);
if (!handle) return SQL_INVALID_HANDLE;
@@ -2549,9 +2553,8 @@ SQLRETURN WINAPI SQLSpecialColumns(SQLHSTMT StatementHandle, SQLUSMALLINT Identi
TRACE("(StatementHandle %p, IdentifierType %d, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d," " TableName %s, NameLength3 %d, Scope %d, Nullable %d)\n", StatementHandle, IdentifierType, - debugstr_an((const char *)CatalogName, NameLength1), NameLength1, - debugstr_an((const char *)SchemaName, NameLength2), NameLength2, - debugstr_an((const char *)TableName, NameLength3), NameLength3, Scope, Nullable); + debugstr_sqlstr(CatalogName, NameLength1), NameLength1, debugstr_sqlstr(SchemaName, NameLength2), + NameLength2, debugstr_sqlstr(TableName, NameLength3), NameLength3, Scope, Nullable);
if (!handle) return SQL_INVALID_HANDLE;
@@ -2583,9 +2586,8 @@ SQLRETURN WINAPI SQLStatistics(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, S
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d SchemaName %s, NameLength2 %d, TableName %s" " NameLength3 %d, Unique %d, Reserved %d)\n", StatementHandle, - debugstr_an((const char *)CatalogName, NameLength1), NameLength1, - debugstr_an((const char *)SchemaName, NameLength2), NameLength2, - debugstr_an((const char *)TableName, NameLength3), NameLength3, Unique, Reserved); + debugstr_sqlstr(CatalogName, NameLength1), NameLength1, debugstr_sqlstr(SchemaName, NameLength2), + NameLength2, debugstr_sqlstr(TableName, NameLength3), NameLength3, Unique, Reserved);
if (!handle) return SQL_INVALID_HANDLE;
@@ -2617,10 +2619,9 @@ SQLRETURN WINAPI SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSM
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," " NameLength3 %d, TableType %s, NameLength4 %d)\n", StatementHandle, - debugstr_an((const char *)CatalogName, NameLength1), NameLength1, - debugstr_an((const char *)SchemaName, NameLength2), NameLength2, - debugstr_an((const char *)TableName, NameLength3), NameLength3, - debugstr_an((const char *)TableType, NameLength4), NameLength4); + debugstr_sqlstr(CatalogName, NameLength1), NameLength1, debugstr_sqlstr(SchemaName, NameLength2), + NameLength2, debugstr_sqlstr(TableName, NameLength3), NameLength3, debugstr_sqlstr(TableType, NameLength4), + NameLength4);
if (!handle) return SQL_INVALID_HANDLE;
@@ -2755,7 +2756,7 @@ SQLRETURN WINAPI SQLBrowseConnect(SQLHDBC ConnectionHandle, SQLCHAR *InConnectio SQLRETURN ret = SQL_ERROR;
TRACE("(ConnectionHandle %p, InConnectionString %s, StringLength1 %d, OutConnectionString %p, BufferLength, %d, " - "StringLength2 %p)\n", ConnectionHandle, debugstr_an((const char *)InConnectionString, StringLength1), + "StringLength2 %p)\n", ConnectionHandle, debugstr_sqlstr(InConnectionString, StringLength1), StringLength1, OutConnectionString, BufferLength, StringLength2);
if (!handle) return SQL_INVALID_HANDLE; @@ -2921,10 +2922,9 @@ SQLRETURN WINAPI SQLColumnPrivileges(SQLHSTMT StatementHandle, SQLCHAR *CatalogN
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," " NameLength3 %d, ColumnName %s, NameLength4 %d)\n", StatementHandle, - debugstr_an((const char *)CatalogName, NameLength1), NameLength1, - debugstr_an((const char *)SchemaName, NameLength2), NameLength2, - debugstr_an((const char *)TableName, NameLength3), NameLength3, - debugstr_an((const char *)ColumnName, NameLength4), NameLength4); + debugstr_sqlstr(CatalogName, NameLength1), NameLength1, debugstr_sqlstr(SchemaName, NameLength2), + NameLength2, debugstr_sqlstr(TableName, NameLength3), NameLength3, debugstr_sqlstr(ColumnName, NameLength4), + NameLength4);
if (!handle) return SQL_INVALID_HANDLE;
@@ -3021,12 +3021,10 @@ SQLRETURN WINAPI SQLForeignKeys(SQLHSTMT StatementHandle, SQLCHAR *PkCatalogName TRACE("(StatementHandle %p, PkCatalogName %s, NameLength1 %d, PkSchemaName %s, NameLength2 %d," " PkTableName %s, NameLength3 %d, FkCatalogName %s, NameLength4 %d, FkSchemaName %s," " NameLength5 %d, FkTableName %s, NameLength6 %d)\n", StatementHandle, - debugstr_an((const char *)PkCatalogName, NameLength1), NameLength1, - debugstr_an((const char *)PkSchemaName, NameLength2), NameLength2, - debugstr_an((const char *)PkTableName, NameLength3), NameLength3, - debugstr_an((const char *)FkCatalogName, NameLength4), NameLength4, - debugstr_an((const char *)FkSchemaName, NameLength5), NameLength5, - debugstr_an((const char *)FkTableName, NameLength6), NameLength6); + debugstr_sqlstr(PkCatalogName, NameLength1), NameLength1, debugstr_sqlstr(PkSchemaName, NameLength2), + NameLength2, debugstr_sqlstr(PkTableName, NameLength3), NameLength3, + debugstr_sqlstr(FkCatalogName, NameLength4), NameLength4, debugstr_sqlstr(FkSchemaName, NameLength5), + NameLength5, debugstr_sqlstr(FkTableName, NameLength6), NameLength6);
if (!handle) return SQL_INVALID_HANDLE;
@@ -3084,8 +3082,8 @@ SQLRETURN WINAPI SQLNativeSql(SQLHDBC ConnectionHandle, SQLCHAR *InStatementText SQLRETURN ret = SQL_ERROR;
TRACE("(ConnectionHandle %p, InStatementText %s, TextLength1 %d, OutStatementText %p, BufferLength, %d, " - "TextLength2 %p)\n", ConnectionHandle, debugstr_an((const char *)InStatementText, TextLength1), - TextLength1, OutStatementText, BufferLength, TextLength2); + "TextLength2 %p)\n", ConnectionHandle, debugstr_sqlstr(InStatementText, TextLength1), TextLength1, + OutStatementText, BufferLength, TextLength2);
if (!handle) return SQL_INVALID_HANDLE;
@@ -3171,9 +3169,8 @@ SQLRETURN WINAPI SQLPrimaryKeys(SQLHSTMT StatementHandle, SQLCHAR *CatalogName,
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," " NameLength3 %d)\n", StatementHandle, - debugstr_an((const char *)CatalogName, NameLength1), NameLength1, - debugstr_an((const char *)SchemaName, NameLength2), NameLength2, - debugstr_an((const char *)TableName, NameLength3), NameLength3); + debugstr_sqlstr(CatalogName, NameLength1), NameLength1, debugstr_sqlstr(SchemaName, NameLength2), + NameLength2, debugstr_sqlstr(TableName, NameLength3), NameLength3);
if (!handle) return SQL_INVALID_HANDLE;
@@ -3205,10 +3202,9 @@ SQLRETURN WINAPI SQLProcedureColumns(SQLHSTMT StatementHandle, SQLCHAR *CatalogN
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, ProcName %s," " NameLength3 %d, ColumnName %s, NameLength4 %d)\n", StatementHandle, - debugstr_an((const char *)CatalogName, NameLength1), NameLength1, - debugstr_an((const char *)SchemaName, NameLength2), NameLength2, - debugstr_an((const char *)ProcName, NameLength3), NameLength3, - debugstr_an((const char *)ColumnName, NameLength4), NameLength4); + debugstr_sqlstr(CatalogName, NameLength1), NameLength1, debugstr_sqlstr(SchemaName, NameLength2), + NameLength2, debugstr_sqlstr(ProcName, NameLength3), NameLength3, debugstr_sqlstr(ColumnName, NameLength4), + NameLength4);
if (!handle) return SQL_INVALID_HANDLE;
@@ -3240,9 +3236,8 @@ SQLRETURN WINAPI SQLProcedures(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, S
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, ProcName %s," " NameLength3 %d)\n", StatementHandle, - debugstr_an((const char *)CatalogName, NameLength1), NameLength1, - debugstr_an((const char *)SchemaName, NameLength2), NameLength2, - debugstr_an((const char *)ProcName, NameLength3), NameLength3); + debugstr_sqlstr(CatalogName, NameLength1), NameLength1, debugstr_sqlstr(SchemaName, NameLength2), + NameLength2, debugstr_sqlstr(ProcName, NameLength3), NameLength3);
if (!handle) return SQL_INVALID_HANDLE;
@@ -3303,9 +3298,8 @@ SQLRETURN WINAPI SQLTablePrivileges(SQLHSTMT StatementHandle, SQLCHAR *CatalogNa
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," "NameLength3 %d)\n", StatementHandle, - debugstr_an((const char *)CatalogName, NameLength1), NameLength1, - debugstr_an((const char *)SchemaName, NameLength2), NameLength2, - debugstr_an((const char *)TableName, NameLength3), NameLength3); + debugstr_sqlstr(CatalogName, NameLength1), NameLength1, debugstr_sqlstr(SchemaName, NameLength2), + NameLength2, debugstr_sqlstr(TableName, NameLength3), NameLength3);
if (!handle) return SQL_INVALID_HANDLE;
@@ -3493,7 +3487,7 @@ SQLRETURN WINAPI SQLDriverConnect(SQLHDBC ConnectionHandle, SQLHWND WindowHandle
TRACE("(ConnectionHandle %p, WindowHandle %p, InConnectionString %s, Length %d, OutConnectionString %p," " BufferLength %d, Length2 %p, DriverCompletion %d)\n", ConnectionHandle, WindowHandle, - debugstr_an((const char *)InConnectionString, Length), Length, OutConnectionString, BufferLength, + debugstr_sqlstr(InConnectionString, Length), Length, OutConnectionString, BufferLength, Length2, DriverCompletion);
if (!handle) return SQL_INVALID_HANDLE; @@ -3663,6 +3657,12 @@ SQLRETURN WINAPI SQLColAttributesW(SQLHSTMT StatementHandle, SQLUSMALLINT Column return ret; }
+static const char *debugstr_sqlwstr( const SQLWCHAR *str, SQLSMALLINT len ) +{ + if (len == SQL_NTS) len = wcslen( (const WCHAR *)str ); + return wine_dbgstr_wn( (const WCHAR *)str, len ); +} + /************************************************************************* * SQLConnectW [ODBC32.107] */ @@ -3675,8 +3675,9 @@ SQLRETURN WINAPI SQLConnectW(SQLHDBC ConnectionHandle, WCHAR *ServerName, SQLSMA SQLRETURN ret = SQL_ERROR;
TRACE("(ConnectionHandle %p, ServerName %s, NameLength1 %d, UserName %s, NameLength2 %d, Authentication %s," - " NameLength3 %d)\n", ConnectionHandle, debugstr_wn(ServerName, NameLength1), NameLength1, - debugstr_wn(UserName, NameLength2), NameLength2, debugstr_wn(Authentication, NameLength3), NameLength3); + " NameLength3 %d)\n", ConnectionHandle, debugstr_sqlwstr(ServerName, NameLength1), NameLength1, + debugstr_sqlwstr(UserName, NameLength2), NameLength2, debugstr_sqlwstr(Authentication, NameLength3), + NameLength3);
if (!handle) return SQL_INVALID_HANDLE;
@@ -3788,9 +3789,9 @@ SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle,
if (SUCCESS(ret )) { - TRACE(" SqlState %s\n", debugstr_wn(SqlState, 5)); + TRACE(" SqlState %s\n", debugstr_sqlwstr(SqlState, 5)); TRACE(" Error %d\n", *NativeError); - TRACE(" MessageText %s\n", debugstr_wn(MessageText, *TextLength)); + TRACE(" MessageText %s\n", debugstr_sqlwstr(MessageText, *TextLength)); } TRACE("Returning %d\n", ret); return ret; @@ -3805,7 +3806,7 @@ SQLRETURN WINAPI SQLExecDirectW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLRETURN ret = SQL_ERROR;
TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, - debugstr_wn(StatementText, TextLength), TextLength); + debugstr_sqlwstr(StatementText, TextLength), TextLength);
if (!handle) return SQL_INVALID_HANDLE;
@@ -3860,7 +3861,7 @@ SQLRETURN WINAPI SQLPrepareW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQL SQLRETURN ret = SQL_ERROR;
TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, - debugstr_wn(StatementText, TextLength), TextLength); + debugstr_sqlwstr(StatementText, TextLength), TextLength);
if (!handle) return SQL_INVALID_HANDLE;
@@ -3887,7 +3888,7 @@ SQLRETURN WINAPI SQLSetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, SQLRETURN ret = SQL_ERROR;
TRACE("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle, - debugstr_wn(CursorName, NameLength), NameLength); + debugstr_sqlwstr(CursorName, NameLength), NameLength);
if (!handle) return SQL_INVALID_HANDLE;
@@ -4253,8 +4254,9 @@ SQLRETURN WINAPI SQLColumnsW(SQLHSTMT StatementHandle, WCHAR *CatalogName, SQLSM
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," " NameLength3 %d, ColumnName %s, NameLength4 %d)\n", StatementHandle, - debugstr_wn(CatalogName, NameLength1), NameLength1, debugstr_wn(SchemaName, NameLength2), NameLength2, - debugstr_wn(TableName, NameLength3), NameLength3, debugstr_wn(ColumnName, NameLength4), NameLength4); + debugstr_sqlwstr(CatalogName, NameLength1), NameLength1, debugstr_sqlwstr(SchemaName, NameLength2), + NameLength2, debugstr_sqlwstr(TableName, NameLength3), NameLength3, debugstr_sqlwstr(ColumnName, NameLength4), + NameLength4);
if (!handle) return SQL_INVALID_HANDLE;
@@ -4307,7 +4309,7 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl
TRACE("(ConnectionHandle %p, WindowHandle %p, InConnectionString %s, Length %d, OutConnectionString %p," " BufferLength %d, Length2 %p, DriverCompletion %d)\n", ConnectionHandle, WindowHandle, - debugstr_wn(InConnectionString, Length), Length, OutConnectionString, BufferLength, Length2, + debugstr_sqlwstr(InConnectionString, Length), Length, OutConnectionString, BufferLength, Length2, DriverCompletion);
if (!handle) return SQL_INVALID_HANDLE; @@ -4495,8 +4497,8 @@ SQLRETURN WINAPI SQLSpecialColumnsW(SQLHSTMT StatementHandle, SQLUSMALLINT Ident
TRACE("(StatementHandle %p, IdentifierType %d, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d," " TableName %s, NameLength3 %d, Scope %d, Nullable %d)\n", StatementHandle, IdentifierType, - debugstr_wn(CatalogName, NameLength1), NameLength1, debugstr_wn(SchemaName, NameLength2), NameLength2, - debugstr_wn(TableName, NameLength3), NameLength3, Scope, Nullable); + debugstr_sqlwstr(CatalogName, NameLength1), NameLength1, debugstr_sqlwstr(SchemaName, NameLength2), + NameLength2, debugstr_sqlwstr(TableName, NameLength3), NameLength3, Scope, Nullable);
if (!handle) return SQL_INVALID_HANDLE;
@@ -4529,8 +4531,8 @@ SQLRETURN WINAPI SQLStatisticsW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName,
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d SchemaName %s, NameLength2 %d, TableName %s" " NameLength3 %d, Unique %d, Reserved %d)\n", StatementHandle, - debugstr_wn(CatalogName, NameLength1), NameLength1, debugstr_wn(SchemaName, NameLength2), NameLength2, - debugstr_wn(TableName, NameLength3), NameLength3, Unique, Reserved); + debugstr_sqlwstr(CatalogName, NameLength1), NameLength1, debugstr_sqlwstr(SchemaName, NameLength2), + NameLength2, debugstr_sqlwstr(TableName, NameLength3), NameLength3, Unique, Reserved);
if (!handle) return SQL_INVALID_HANDLE;
@@ -4562,8 +4564,9 @@ SQLRETURN WINAPI SQLTablesW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQL
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," " NameLength3 %d, TableType %s, NameLength4 %d)\n", StatementHandle, - debugstr_wn(CatalogName, NameLength1), NameLength1, debugstr_wn(SchemaName, NameLength2), NameLength2, - debugstr_wn(TableName, NameLength3), NameLength3, debugstr_wn(TableType, NameLength4), NameLength4); + debugstr_sqlwstr(CatalogName, NameLength1), NameLength1, debugstr_sqlwstr(SchemaName, NameLength2), + NameLength2, debugstr_sqlwstr(TableName, NameLength3), NameLength3, debugstr_sqlwstr(TableType, NameLength4), + NameLength4);
if (!handle) return SQL_INVALID_HANDLE;
@@ -4611,7 +4614,7 @@ SQLRETURN WINAPI SQLBrowseConnectW(SQLHDBC ConnectionHandle, SQLWCHAR *InConnect SQLRETURN ret = SQL_ERROR;
TRACE("(ConnectionHandle %p, InConnectionString %s, StringLength1 %d, OutConnectionString %p, BufferLength %d, " - "StringLength2 %p)\n", ConnectionHandle, debugstr_wn(InConnectionString, StringLength1), StringLength1, + "StringLength2 %p)\n", ConnectionHandle, debugstr_sqlwstr(InConnectionString, StringLength1), StringLength1, OutConnectionString, BufferLength, StringLength2);
if (!handle) return SQL_INVALID_HANDLE; @@ -4673,10 +4676,9 @@ SQLRETURN WINAPI SQLColumnPrivilegesW(SQLHSTMT StatementHandle, SQLWCHAR *Catalo
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," " NameLength3 %d, ColumnName %s, NameLength3 %d)\n", StatementHandle, - debugstr_wn(CatalogName, NameLength1), NameLength1, - debugstr_wn(SchemaName, NameLength2), NameLength2, - debugstr_wn(TableName, NameLength3), NameLength3, - debugstr_wn(ColumnName, NameLength4), NameLength4); + debugstr_sqlwstr(CatalogName, NameLength1), NameLength1, debugstr_sqlwstr(SchemaName, NameLength2), + NameLength2, debugstr_sqlwstr(TableName, NameLength3), NameLength3, debugstr_sqlwstr(ColumnName, NameLength4), + NameLength4);
if (!handle) return SQL_INVALID_HANDLE;
@@ -4779,12 +4781,10 @@ SQLRETURN WINAPI SQLForeignKeysW(SQLHSTMT StatementHandle, SQLWCHAR *PkCatalogNa TRACE("(StatementHandle %p, PkCatalogName %s, NameLength1 %d, PkSchemaName %s, NameLength2 %d," " PkTableName %s, NameLength3 %d, FkCatalogName %s, NameLength4 %d, FkSchemaName %s," " NameLength5 %d, FkTableName %s, NameLength6 %d)\n", StatementHandle, - debugstr_wn(PkCatalogName, NameLength1), NameLength1, - debugstr_wn(PkSchemaName, NameLength2), NameLength2, - debugstr_wn(PkTableName, NameLength3), NameLength3, - debugstr_wn(FkCatalogName, NameLength4), NameLength4, - debugstr_wn(FkSchemaName, NameLength5), NameLength5, - debugstr_wn(FkTableName, NameLength6), NameLength6); + debugstr_sqlwstr(PkCatalogName, NameLength1), NameLength1, debugstr_sqlwstr(PkSchemaName, NameLength2), + NameLength2, debugstr_sqlwstr(PkTableName, NameLength3), NameLength3, + debugstr_sqlwstr(FkCatalogName, NameLength4), NameLength4, debugstr_sqlwstr(FkSchemaName, NameLength5), + NameLength5, debugstr_sqlwstr(FkTableName, NameLength6), NameLength6);
if (!handle) return SQL_INVALID_HANDLE;
@@ -4816,7 +4816,7 @@ SQLRETURN WINAPI SQLNativeSqlW(SQLHDBC ConnectionHandle, SQLWCHAR *InStatementTe SQLRETURN ret = SQL_ERROR;
TRACE("(ConnectionHandle %p, InStatementText %s, TextLength1 %d, OutStatementText %p, BufferLength %d, " - "TextLength2 %p)\n", ConnectionHandle, debugstr_wn(InStatementText, TextLength1), TextLength1, + "TextLength2 %p)\n", ConnectionHandle, debugstr_sqlwstr(InStatementText, TextLength1), TextLength1, OutStatementText, BufferLength, TextLength2);
if (!handle) return SQL_INVALID_HANDLE; @@ -4848,10 +4848,9 @@ SQLRETURN WINAPI SQLPrimaryKeysW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName SQLRETURN ret = SQL_ERROR;
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," - " NameLength3 %d)\n", StatementHandle, - debugstr_wn(CatalogName, NameLength1), NameLength1, - debugstr_wn(SchemaName, NameLength2), NameLength2, - debugstr_wn(TableName, NameLength3), NameLength3); + " NameLength3 %d)\n", StatementHandle, debugstr_sqlwstr(CatalogName, NameLength1), NameLength1, + debugstr_sqlwstr(SchemaName, NameLength2), NameLength2, debugstr_sqlwstr(TableName, NameLength3), + NameLength3);
if (!handle) return SQL_INVALID_HANDLE;
@@ -4883,10 +4882,9 @@ SQLRETURN WINAPI SQLProcedureColumnsW(SQLHSTMT StatementHandle, SQLWCHAR *Catalo
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, ProcName %s," " NameLength3 %d, ColumnName %s, NameLength4 %d)\n", StatementHandle, - debugstr_wn(CatalogName, NameLength1), NameLength1, - debugstr_wn(SchemaName, NameLength2), NameLength2, - debugstr_wn(ProcName, NameLength3), NameLength3, - debugstr_wn(ColumnName, NameLength4), NameLength4); + debugstr_sqlwstr(CatalogName, NameLength1), NameLength1, debugstr_sqlwstr(SchemaName, NameLength2), + NameLength2, debugstr_sqlwstr(ProcName, NameLength3), NameLength3, debugstr_sqlwstr(ColumnName, NameLength4), + NameLength4);
if (!handle) return SQL_INVALID_HANDLE;
@@ -4917,8 +4915,9 @@ SQLRETURN WINAPI SQLProceduresW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLRETURN ret = SQL_ERROR;
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, ProcName %s," - " NameLength3 %d)\n", StatementHandle, debugstr_wn(CatalogName, NameLength1), NameLength1, - debugstr_wn(SchemaName, NameLength2), NameLength2, debugstr_wn(ProcName, NameLength3), NameLength3); + " NameLength3 %d)\n", StatementHandle, debugstr_sqlwstr(CatalogName, NameLength1), NameLength1, + debugstr_sqlwstr(SchemaName, NameLength2), NameLength2, debugstr_sqlwstr(ProcName, NameLength3), + NameLength3);
if (!handle) return SQL_INVALID_HANDLE;
@@ -4949,8 +4948,9 @@ SQLRETURN WINAPI SQLTablePrivilegesW(SQLHSTMT StatementHandle, SQLWCHAR *Catalog SQLRETURN ret = SQL_ERROR;
TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," - " NameLength3 %d)\n", StatementHandle, debugstr_wn(CatalogName, NameLength1), NameLength1, - debugstr_wn(SchemaName, NameLength2), NameLength2, debugstr_wn(TableName, NameLength3), NameLength3); + " NameLength3 %d)\n", StatementHandle, debugstr_sqlwstr(CatalogName, NameLength1), NameLength1, + debugstr_sqlwstr(SchemaName, NameLength2), NameLength2, debugstr_sqlwstr(TableName, NameLength3), + NameLength3);
if (!handle) return SQL_INVALID_HANDLE;
diff --git a/dlls/odbc32/tests/odbc32.c b/dlls/odbc32/tests/odbc32.c index 8282e5a47ea..f960ab5aabe 100644 --- a/dlls/odbc32/tests/odbc32.c +++ b/dlls/odbc32/tests/odbc32.c @@ -119,7 +119,8 @@ static void test_SQLConnect( void ) ok( len == strlen(str), "got %d\n", len ); trace( "version %s\n", str );
- ret = SQLConnect( con, (SQLCHAR *)"winetest", 8, (SQLCHAR *)"winetest", 8, (SQLCHAR *)"winetest", 8 ); + ret = SQLConnect( con, (SQLCHAR *)"winetest", SQL_NTS, (SQLCHAR *)"winetest", SQL_NTS, (SQLCHAR *)"winetest", + SQL_NTS ); if (ret == SQL_ERROR) diag( con, SQL_HANDLE_DBC ); if (ret != SQL_SUCCESS) {
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=147109
Your paranoid android.
=== debian11b (64 bit WoW report) ===
ddraw: ddraw1.c:3645: Test failed: Expected (0,0)-(640,480), got (-32000,-32000)-(-31840,-31969).
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 00000000032800E2, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032