From 14f63f40e7c87dc87ca1dc64aaa66f344bada4da Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Sun, 23 Jun 2024 17:08:28 +1000 Subject: [PATCH] Updated odbc-remove-unixodbc patchset Instead of removing unixODBC completely. Creating an wine ODBC driver for unixODBC. This way native and unixODBC drivers can be used. This is a WIP. --- .../0001-odbc32-Remove-unixODBC-support.patch | 7065 --------------- ...ke-an-ODBC-driver-for-unixODBC-usage.patch | 8033 +++++++++++++++++ .../0002-wineodbc-Register-as-Driver.patch | 54 + ...32-Implement-SQLAllocEnv-SQLFreeEnv.patch} | 8 +- ...L_ATTR_CONNECTION_POOLING-in-SQLGet.patch} | 8 +- ...ch => 0005-odbc32-Add-initial-tests.patch} | 8 +- ...06-odbc32-Implement-SQLAllocConnect.patch} | 8 +- ...nfo-W-support-InfoType-SQL_ODBC_VER.patch} | 8 +- ...L_ATTR_LOGIN_TIMEOUT-in-SQLSetConne.patch} | 9 +- ...-odbc32-Implement-SQLDriverConnectW.patch} | 2 +- ...LGetInfo-W-requests-onto-the-driver.patch} | 16 +- ...SetConnectAttr-requets-onto-the-dri.patch} | 10 +- ...LGetFunctions-requets-onto-the-driv.patch} | 10 +- ...LGetConnectAttr-W-requets-onto-the-.patch} | 8 +- ...d-SQLDisconnect-request-onto-driver.patch} | 10 +- ... 0015-odbc32-Implement-SQLAllocStmt.patch} | 12 +- ...-SQLSetStmtAttr-W-request-to-driver.patch} | 8 +- ...SQLParamOptions-request-onto-driver.patch} | 10 +- ...SQLExecDirect-W-request-onto-driver.patch} | 16 +- ...orward-SQLGetStmtAttr-W-onto-driver.patch} | 12 +- ...c32-Forward-SQLRowCount-onto-driver.patch} | 10 +- ...orward-SQLNumResultCols-onto-driver.patch} | 10 +- ...-SQLMoreResults-request-onto-driver.patch} | 10 +- ...QLDescribeCol-w-request-onto-driver.patch} | 12 +- ...LColAttributes-W-request-onto-drive.patch} | 14 +- ...-SQLNativeSql-W-request-onto-driver.patch} | 12 +- ...rd-SQLPrepare-W-request-onto-driver.patch} | 24 +- ...> 0027-odbc32-Implement-SQLFreeStmt.patch} | 10 +- ...ward-SQLBindCol-requets-onto-driver.patch} | 10 +- ...QLExtendedFetch-request-onto-driver.patch} | 10 +- ...ward-SQLExecute-request-onto-driver.patch} | 10 +- ...LGetDiagField-W-request-onto-driver.patch} | 8 +- ...Attr-store-some-driver-HDESC-values.patch} | 14 +- ...QLSetDescFieldW-request-onto-driver.patch} | 8 +- ...ward-SQLGetData-request-onto-driver.patch} | 2 +- ...QLGetTypeInfo-W-request-onto-driver.patch} | 12 +- ...QLBindParameter-request-onto-driver.patch} | 6 +- ...ard-SQLTransact-request-onto-driver.patch} | 10 +- ...-SQLGetDiagRecW-request-onto-driver.patch} | 6 +- ...ttr-Support-SQL_ATTR_ODBC_VERSION-a.patch} | 14 +- ...version-when-creating-driver-enviro.patch} | 14 +- ...-convert-to-ODBC2-types-if-required.patch} | 10 +- ...042-odbc32-Implement-SQLAllocHandle.patch} | 10 +- ...ard-SQLConnectW-request-onto-driver.patch} | 10 +- ...LColAttribute-W-request-onto-driver.patch} | 8 +- ...ard-SQLGetDiagRec-request-to-driver.patch} | 6 +- ...d-SQLPrimaryKeysW-request-to-driver.patch} | 8 +- ...rd-SQLStatisticsW-request-to-driver.patch} | 8 +- ...bc32-Forward-SQLError-W-onto-driver.patch} | 8 +- ...0049-odbc32-Implement-SQLFreeHandle.patch} | 2 +- 50 files changed, 8325 insertions(+), 7286 deletions(-) delete mode 100644 patches/odbc-remove-unixodbc/0001-odbc32-Remove-unixODBC-support.patch create mode 100644 patches/odbc-remove-unixodbc/0001-wineodbc-Make-an-ODBC-driver-for-unixODBC-usage.patch create mode 100644 patches/odbc-remove-unixodbc/0002-wineodbc-Register-as-Driver.patch rename patches/odbc-remove-unixodbc/{0002-odbc32-Implement-SQLAllocEnv-SQLFreeEnv.patch => 0003-odbc32-Implement-SQLAllocEnv-SQLFreeEnv.patch} (91%) rename patches/odbc-remove-unixodbc/{0003-odbc32-Support-SQL_ATTR_CONNECTION_POOLING-in-SQLGet.patch => 0004-odbc32-Support-SQL_ATTR_CONNECTION_POOLING-in-SQLGet.patch} (95%) rename patches/odbc-remove-unixodbc/{0004-odbc32-Add-initial-tests.patch => 0005-odbc32-Add-initial-tests.patch} (93%) rename patches/odbc-remove-unixodbc/{0005-odbc32-Implement-SQLAllocConnect.patch => 0006-odbc32-Implement-SQLAllocConnect.patch} (92%) rename patches/odbc-remove-unixodbc/{0006-odbc32-SQLGetInfo-W-support-InfoType-SQL_ODBC_VER.patch => 0007-odbc32-SQLGetInfo-W-support-InfoType-SQL_ODBC_VER.patch} (93%) rename patches/odbc-remove-unixodbc/{0007-odbc32-Support-SQL_ATTR_LOGIN_TIMEOUT-in-SQLSetConne.patch => 0008-odbc32-Support-SQL_ATTR_LOGIN_TIMEOUT-in-SQLSetConne.patch} (91%) rename patches/odbc-remove-unixodbc/{0008-odbc32-Implement-SQLDriverConnectW.patch => 0009-odbc32-Implement-SQLDriverConnectW.patch} (99%) rename patches/odbc-remove-unixodbc/{0009-odbc32-Foward-SQLGetInfo-W-requests-onto-the-driver.patch => 0010-odbc32-Foward-SQLGetInfo-W-requests-onto-the-driver.patch} (86%) rename patches/odbc-remove-unixodbc/{0010-odbc32-Foward-SQLSetConnectAttr-requets-onto-the-dri.patch => 0011-odbc32-Foward-SQLSetConnectAttr-requets-onto-the-dri.patch} (91%) rename patches/odbc-remove-unixodbc/{0011-odbc32-Forward-SQLGetFunctions-requets-onto-the-driv.patch => 0012-odbc32-Forward-SQLGetFunctions-requets-onto-the-driv.patch} (79%) rename patches/odbc-remove-unixodbc/{0012-odbc32-Forward-SQLGetConnectAttr-W-requets-onto-the-.patch => 0013-odbc32-Forward-SQLGetConnectAttr-W-requets-onto-the-.patch} (92%) rename patches/odbc-remove-unixodbc/{0013-odbc32-Foward-SQLDisconnect-request-onto-driver.patch => 0014-odbc32-Foward-SQLDisconnect-request-onto-driver.patch} (79%) rename patches/odbc-remove-unixodbc/{0014-odbc32-Implement-SQLAllocStmt.patch => 0015-odbc32-Implement-SQLAllocStmt.patch} (87%) rename patches/odbc-remove-unixodbc/{0015-odbc32-Forward-SQLSetStmtAttr-W-request-to-driver.patch => 0016-odbc32-Forward-SQLSetStmtAttr-W-request-to-driver.patch} (91%) rename patches/odbc-remove-unixodbc/{0016-odbc32-Forward-SQLParamOptions-request-onto-driver.patch => 0017-odbc32-Forward-SQLParamOptions-request-onto-driver.patch} (80%) rename patches/odbc-remove-unixodbc/{0017-odbc32-Forward-SQLExecDirect-W-request-onto-driver.patch => 0018-odbc32-Forward-SQLExecDirect-W-request-onto-driver.patch} (83%) rename patches/odbc-remove-unixodbc/{0018-odbc32-Forward-SQLGetStmtAttr-W-onto-driver.patch => 0019-odbc32-Forward-SQLGetStmtAttr-W-onto-driver.patch} (89%) rename patches/odbc-remove-unixodbc/{0019-odbc32-Forward-SQLRowCount-onto-driver.patch => 0020-odbc32-Forward-SQLRowCount-onto-driver.patch} (81%) rename patches/odbc-remove-unixodbc/{0020-odbc32-Forward-SQLNumResultCols-onto-driver.patch => 0021-odbc32-Forward-SQLNumResultCols-onto-driver.patch} (81%) rename patches/odbc-remove-unixodbc/{0021-odbc32-Forward-SQLMoreResults-request-onto-driver.patch => 0022-odbc32-Forward-SQLMoreResults-request-onto-driver.patch} (79%) rename patches/odbc-remove-unixodbc/{0022-odbc32-Forward-SQLDescribeCol-w-request-onto-driver.patch => 0023-odbc32-Forward-SQLDescribeCol-w-request-onto-driver.patch} (90%) rename patches/odbc-remove-unixodbc/{0023-odbc32-Forward-SQLColAttributes-W-request-onto-drive.patch => 0024-odbc32-Forward-SQLColAttributes-W-request-onto-drive.patch} (89%) rename patches/odbc-remove-unixodbc/{0024-odbc32-Forward-SQLNativeSql-W-request-onto-driver.patch => 0025-odbc32-Forward-SQLNativeSql-W-request-onto-driver.patch} (88%) rename patches/odbc-remove-unixodbc/{0025-odbc32-Forward-SQLPrepare-W-request-onto-driver.patch => 0026-odbc32-Forward-SQLPrepare-W-request-onto-driver.patch} (83%) rename patches/odbc-remove-unixodbc/{0026-odbc32-Implement-SQLFreeStmt.patch => 0027-odbc32-Implement-SQLFreeStmt.patch} (82%) rename patches/odbc-remove-unixodbc/{0027-odbc32-Forward-SQLBindCol-requets-onto-driver.patch => 0028-odbc32-Forward-SQLBindCol-requets-onto-driver.patch} (85%) rename patches/odbc-remove-unixodbc/{0028-odbc32-Forward-SQLExtendedFetch-request-onto-driver.patch => 0029-odbc32-Forward-SQLExtendedFetch-request-onto-driver.patch} (84%) rename patches/odbc-remove-unixodbc/{0029-odbc32-Forward-SQLExecute-request-onto-driver.patch => 0030-odbc32-Forward-SQLExecute-request-onto-driver.patch} (79%) rename patches/odbc-remove-unixodbc/{0030-odbc32-Forward-SQLGetDiagField-W-request-onto-driver.patch => 0031-odbc32-Forward-SQLGetDiagField-W-request-onto-driver.patch} (92%) rename patches/odbc-remove-unixodbc/{0031-odbc32-SQLGetStmtAttr-store-some-driver-HDESC-values.patch => 0032-odbc32-SQLGetStmtAttr-store-some-driver-HDESC-values.patch} (94%) rename patches/odbc-remove-unixodbc/{0032-odbc32-Forward-SQLSetDescFieldW-request-onto-driver.patch => 0033-odbc32-Forward-SQLSetDescFieldW-request-onto-driver.patch} (86%) rename patches/odbc-remove-unixodbc/{0033-odbc32-Forward-SQLGetData-request-onto-driver.patch => 0034-odbc32-Forward-SQLGetData-request-onto-driver.patch} (97%) rename patches/odbc-remove-unixodbc/{0034-odbc32-Forward-SQLGetTypeInfo-W-request-onto-driver.patch => 0035-odbc32-Forward-SQLGetTypeInfo-W-request-onto-driver.patch} (85%) rename patches/odbc-remove-unixodbc/{0035-odbc32-Forward-SQLBindParameter-request-onto-driver.patch => 0036-odbc32-Forward-SQLBindParameter-request-onto-driver.patch} (93%) rename patches/odbc-remove-unixodbc/{0036-odbc32-Forward-SQLTransact-request-onto-driver.patch => 0037-odbc32-Forward-SQLTransact-request-onto-driver.patch} (83%) rename patches/odbc-remove-unixodbc/{0037-odbc32-Forward-SQLGetDiagRecW-request-onto-driver.patch => 0038-odbc32-Forward-SQLGetDiagRecW-request-onto-driver.patch} (93%) rename patches/odbc-remove-unixodbc/{0038-odbc32-SQLGetEnvAttr-Support-SQL_ATTR_ODBC_VERSION-a.patch => 0039-odbc32-SQLGetEnvAttr-Support-SQL_ATTR_ODBC_VERSION-a.patch} (80%) rename patches/odbc-remove-unixodbc/{0039-odbc32-Pass-ODBC-version-when-creating-driver-enviro.patch => 0040-odbc32-Pass-ODBC-version-when-creating-driver-enviro.patch} (76%) rename patches/odbc-remove-unixodbc/{0040-odbc32-SQLBindCol-convert-to-ODBC2-types-if-required.patch => 0041-odbc32-SQLBindCol-convert-to-ODBC2-types-if-required.patch} (82%) rename patches/odbc-remove-unixodbc/{0041-odbc32-Implement-SQLAllocHandle.patch => 0042-odbc32-Implement-SQLAllocHandle.patch} (81%) rename patches/odbc-remove-unixodbc/{0042-odbc32-Forward-SQLConnectW-request-onto-driver.patch => 0043-odbc32-Forward-SQLConnectW-request-onto-driver.patch} (88%) rename patches/odbc-remove-unixodbc/{0043-odbc32-Forward-SQLColAttribute-W-request-onto-driver.patch => 0044-odbc32-Forward-SQLColAttribute-W-request-onto-driver.patch} (96%) rename patches/odbc-remove-unixodbc/{0044-odbc32-Forward-SQLGetDiagRec-request-to-driver.patch => 0045-odbc32-Forward-SQLGetDiagRec-request-to-driver.patch} (93%) rename patches/odbc-remove-unixodbc/{0045-odbc32-Forward-SQLPrimaryKeysW-request-to-driver.patch => 0046-odbc32-Forward-SQLPrimaryKeysW-request-to-driver.patch} (90%) rename patches/odbc-remove-unixodbc/{0046-odbc32-Forward-SQLStatisticsW-request-to-driver.patch => 0047-odbc32-Forward-SQLStatisticsW-request-to-driver.patch} (90%) rename patches/odbc-remove-unixodbc/{0047-odbc32-Forward-SQLError-W-onto-driver.patch => 0048-odbc32-Forward-SQLError-W-onto-driver.patch} (91%) rename patches/odbc-remove-unixodbc/{0048-odbc32-Implement-SQLFreeHandle.patch => 0049-odbc32-Implement-SQLFreeHandle.patch} (96%) diff --git a/patches/odbc-remove-unixodbc/0001-odbc32-Remove-unixODBC-support.patch b/patches/odbc-remove-unixodbc/0001-odbc32-Remove-unixODBC-support.patch deleted file mode 100644 index fde6c6df..00000000 --- a/patches/odbc-remove-unixodbc/0001-odbc32-Remove-unixODBC-support.patch +++ /dev/null @@ -1,7065 +0,0 @@ -From dbeaccad253f7854796985efcb59d50e80b387ff Mon Sep 17 00:00:00 2001 -From: Alistair Leslie-Hughes -Date: Thu, 2 Feb 2023 14:20:44 +1100 -Subject: [PATCH] odbc32: Remove unixODBC support - ---- - configure.ac | 10 - - dlls/odbc32/Makefile.in | 5 +- - dlls/odbc32/proxyodbc.c | 2145 +++++------------------ - dlls/odbc32/unixlib.c | 3673 --------------------------------------- - 4 files changed, 419 insertions(+), 5414 deletions(-) - delete mode 100644 dlls/odbc32/unixlib.c - -diff --git a/configure.ac b/configure.ac -index 4c6578f49e4..915c6d48b38 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1428,16 +1428,6 @@ WINE_NOTICE_WITH(pcsclite,[test "x$PCSCLITE_LIBS" = x], - [libpcsclite not found, smart cards won't be supported.], - [enable_winscard]) - --dnl **** Check for libodbc **** --if test "x$with_odbc" != "xno" --then -- WINE_PACKAGE_FLAGS(ODBC,[odbc],[-lodbc],,, -- [AC_CHECK_LIB(odbc,SQLConnect,[:],[ODBC_LIBS=""],[$ODBC_LIBS])]) --fi --WINE_NOTICE_WITH(odbc,[test "x$ODBC_LIBS" = x], -- [libodbc not found, ODBC won't be supported.], -- [enable_odbc32]) -- - dnl **** Check for inotify **** - if test "x$with_inotify" != "xno" - then -diff --git a/dlls/odbc32/Makefile.in b/dlls/odbc32/Makefile.in -index 0ec0ae8eaf4..a42f1473d67 100644 ---- a/dlls/odbc32/Makefile.in -+++ b/dlls/odbc32/Makefile.in -@@ -1,10 +1,7 @@ - MODULE = odbc32.dll --UNIXLIB = odbc32.so - IMPORTLIB = odbc32 - IMPORTS = advapi32 --UNIX_LIBS = $(ODBC_LIBS) - - SOURCES = \ - proxyodbc.c \ -- rsrc.rc \ -- unixlib.c -+ rsrc.rc -diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 47e0aff0b18..89e4545f068 100644 ---- a/dlls/odbc32/proxyodbc.c -+++ b/dlls/odbc32/proxyodbc.c -@@ -40,46 +40,19 @@ - #include "sql.h" - #include "sqltypes.h" - #include "sqlext.h" --#include "unixlib.h" - - WINE_DEFAULT_DEBUG_CHANNEL(odbc); --WINE_DECLARE_DEBUG_CHANNEL(winediag); - --#define ODBC_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params ) -- --static BOOL is_wow64; -- --static struct handle *alloc_handle( void ) --{ -- struct handle *ret; -- if (!(ret = calloc( 1, sizeof(*ret) ))) return NULL; -- ret->row_count = 1; -- return ret; --} - - /************************************************************************* - * SQLAllocConnect [ODBC32.001] - */ - SQLRETURN WINAPI SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionHandle) - { -- struct SQLAllocConnect_params params; -- struct handle *con, *env = EnvironmentHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(EnvironmentHandle %p, ConnectionHandle %p)\n", EnvironmentHandle, ConnectionHandle); -- -- *ConnectionHandle = 0; -- if (!(con = alloc_handle())) return SQL_ERROR; -- -- params.EnvironmentHandle = env->unix_handle; -- if (SUCCESS((ret = ODBC_CALL( SQLAllocConnect, ¶ms )))) -- { -- con->unix_handle = params.ConnectionHandle; -- *ConnectionHandle = con; -- } -- else free( con ); -- -- TRACE("Returning %d, ConnectionHandle %p\n", ret, *ConnectionHandle); -+ FIXME("(EnvironmentHandle %p, ConnectionHandle %p)\n", EnvironmentHandle, ConnectionHandle); -+ *ConnectionHandle = SQL_NULL_HDBC; - return ret; - } - -@@ -88,23 +61,12 @@ SQLRETURN WINAPI SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionH - */ - SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle) - { -- struct SQLAllocEnv_params params; -- struct handle *env; -- SQLRETURN ret; -- -- TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle); -+ SQLRETURN ret = SQL_ERROR; - -- *EnvironmentHandle = 0; -- if (!(env = alloc_handle())) return SQL_ERROR; -+ FIXME("(EnvironmentHandle %p)\n", EnvironmentHandle); - -- if (SUCCESS((ret = ODBC_CALL( SQLAllocEnv, ¶ms )))) -- { -- env->unix_handle = params.EnvironmentHandle; -- *EnvironmentHandle = env; -- } -- else free( env ); -+ *EnvironmentHandle = SQL_NULL_HENV; - -- TRACE("Returning %d, EnvironmentHandle %p\n", ret, *EnvironmentHandle); - return ret; - } - -@@ -113,25 +75,11 @@ SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle) - */ - SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle) - { -- struct SQLAllocHandle_params params; -- struct handle *output, *input = InputHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); -+ FIXME("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); - - *OutputHandle = 0; -- if (!(output = alloc_handle())) return SQL_ERROR; -- -- params.HandleType = HandleType; -- params.InputHandle = input ? input->unix_handle : 0; -- if (SUCCESS((ret = ODBC_CALL( SQLAllocHandle, ¶ms )))) -- { -- output->unix_handle = params.OutputHandle; -- *OutputHandle = output; -- } -- else free( output ); -- -- TRACE("Returning %d, OutputHandle %p\n", ret, *OutputHandle); - return ret; - } - -@@ -140,24 +88,11 @@ SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, S - */ - SQLRETURN WINAPI SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandle) - { -- struct SQLAllocStmt_params params; -- struct handle *stmt, *con = ConnectionHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(ConnectionHandle %p, StatementHandle %p)\n", ConnectionHandle, StatementHandle); -+ FIXME("(ConnectionHandle %p, StatementHandle %p)\n", ConnectionHandle, StatementHandle); - -- *StatementHandle = 0; -- if (!(stmt = alloc_handle())) return SQL_ERROR; -- -- params.ConnectionHandle = con->unix_handle; -- if (SUCCESS((ret = ODBC_CALL( SQLAllocStmt, ¶ms )))) -- { -- stmt->unix_handle = params.StatementHandle; -- *StatementHandle = stmt; -- } -- else free( stmt ); -- -- TRACE ("Returning %d, StatementHandle %p\n", ret, *StatementHandle); -+ *StatementHandle = SQL_NULL_HSTMT; - return ret; - } - -@@ -166,25 +101,11 @@ SQLRETURN WINAPI SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandl - */ - SQLRETURN WINAPI SQLAllocHandleStd(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle) - { -- struct SQLAllocHandleStd_params params; -- struct handle *output, *input = InputHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); -+ FIXME("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); - - *OutputHandle = 0; -- if (!(output = alloc_handle())) return SQL_ERROR; -- -- params.HandleType = HandleType; -- params.InputHandle = input ? input->unix_handle : 0; -- if (SUCCESS((ret = ODBC_CALL( SQLAllocHandleStd, ¶ms )))) -- { -- output->unix_handle = params.OutputHandle; -- *OutputHandle = output; -- } -- else free( output ); -- -- TRACE ("Returning %d, OutputHandle %p\n", ret, *OutputHandle); - return ret; - } - -@@ -197,51 +118,17 @@ static const char *debugstr_sqllen( SQLLEN len ) - #endif - } - --#define MAX_BINDING_PARAMS 1024 --static BOOL alloc_binding( struct param_binding *binding, USHORT type, UINT column, UINT row_count ) --{ -- if (column > MAX_BINDING_PARAMS) -- { -- FIXME( "increase maximum number of parameters\n" ); -- return FALSE; -- } -- if (!binding->param && !(binding->param = calloc( MAX_BINDING_PARAMS, sizeof(*binding->param)))) return FALSE; -- -- if (!(binding->param[column - 1].len = calloc( row_count, sizeof(UINT64) ))) return FALSE; -- binding->param[column - 1].type = type; -- binding->count = column; -- return TRUE; --} -- - /************************************************************************* - * SQLBindCol [ODBC32.004] - */ - SQLRETURN WINAPI SQLBindCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, - SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind) - { -- struct SQLBindCol_params params = { 0, ColumnNumber, TargetType, TargetValue, BufferLength }; -- struct handle *handle = StatementHandle; -- UINT i = ColumnNumber - 1; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", -+ FIXME("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", - StatementHandle, ColumnNumber, TargetType, TargetValue, debugstr_sqllen(BufferLength), StrLen_or_Ind); - -- if (!handle) return SQL_INVALID_HANDLE; -- if (!ColumnNumber) -- { -- FIXME( "column 0 not handled\n" ); -- return SQL_ERROR; -- } -- if (!alloc_binding( &handle->bind_col, SQL_PARAM_INPUT_OUTPUT, ColumnNumber, handle->row_count )) return SQL_ERROR; -- handle->bind_col.param[i].col.target_type = TargetType; -- handle->bind_col.param[i].col.target_value = TargetValue; -- handle->bind_col.param[i].col.buffer_length = BufferLength; -- -- params.StatementHandle = handle->unix_handle; -- if (StrLen_or_Ind) params.StrLen_or_Ind = handle->bind_col.param[i].len; -- if (SUCCESS(( ret = ODBC_CALL( SQLBindCol, ¶ms )))) handle->bind_col.param[i].ptr = StrLen_or_Ind; -- TRACE ("Returning %d\n", ret); - return ret; - } - -@@ -261,34 +148,12 @@ SQLRETURN WINAPI SQLBindParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNu - SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale, - SQLPOINTER ParameterValue, SQLLEN *StrLen_or_Ind) - { -- struct SQLBindParam_params params = { 0, ParameterNumber, ValueType, ParameterType, LengthPrecision, -- ParameterScale, ParameterValue }; -- struct handle *handle = StatementHandle; -- UINT i = ParameterNumber - 1; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s," -+ FIXME("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s," - " ParameterScale %d, ParameterValue %p, StrLen_or_Ind %p)\n", StatementHandle, ParameterNumber, ValueType, - ParameterType, debugstr_sqlulen(LengthPrecision), ParameterScale, ParameterValue, StrLen_or_Ind); - -- if (!handle) return SQL_INVALID_HANDLE; -- if (!ParameterNumber) -- { -- FIXME( "parameter 0 not handled\n" ); -- return SQL_ERROR; -- } -- if (!alloc_binding( &handle->bind_param, SQL_PARAM_INPUT, ParameterNumber, handle->row_count )) return SQL_ERROR; -- handle->bind_param.param[i].param.value_type = ValueType; -- handle->bind_param.param[i].param.parameter_type = ParameterType; -- handle->bind_param.param[i].param.length_precision = LengthPrecision; -- handle->bind_param.param[i].param.parameter_scale = ParameterScale; -- handle->bind_param.param[i].param.parameter_value = ParameterValue; -- -- params.StatementHandle = handle->unix_handle; -- params.StrLen_or_Ind = handle->bind_param.param[i].len; -- *(UINT64 *)params.StrLen_or_Ind = *StrLen_or_Ind; -- if (SUCCESS(( ret = ODBC_CALL( SQLBindParam, ¶ms )))) handle->bind_param.param[i].ptr = StrLen_or_Ind; -- TRACE ("Returning %d\n", ret); - return ret; - } - -@@ -297,17 +162,10 @@ SQLRETURN WINAPI SQLBindParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNu - */ - SQLRETURN WINAPI SQLCancel(SQLHSTMT StatementHandle) - { -- struct SQLCancel_params params; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p)\n", StatementHandle); -+ FIXME("(StatementHandle %p)\n", StatementHandle); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLCancel, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -316,43 +174,27 @@ SQLRETURN WINAPI SQLCancel(SQLHSTMT StatementHandle) - */ - SQLRETURN WINAPI SQLCloseCursor(SQLHSTMT StatementHandle) - { -- struct SQLCloseCursor_params params; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -- -- TRACE("(StatementHandle %p)\n", StatementHandle); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(StatementHandle %p)\n", StatementHandle); - -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLCloseCursor, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLColAttribute [ODBC32.027] - */ --SQLRETURN WINAPI SQLColAttribute(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, -- SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, -+SQLRETURN WINAPI SQLColAttribute(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, -+ SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttribute, -+ SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, - SQLLEN *NumericAttribute) - { -- struct SQLColAttribute_params params = { 0, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength, -- StringLength }; -- struct handle *handle = StatementHandle; -- INT64 num_attr = 0; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttribute %p, BufferLength %d," -+ FIXME("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttribute %p, BufferLength %d," - " StringLength %p, NumericAttribute %p)\n", StatementHandle, ColumnNumber, FieldIdentifier, - CharacterAttribute, BufferLength, StringLength, NumericAttribute); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- params.NumericAttribute = &num_attr; -- if (SUCCESS(( ret = ODBC_CALL( SQLColAttribute, ¶ms ))) && NumericAttribute) *NumericAttribute = num_attr; -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -363,23 +205,15 @@ SQLRETURN WINAPI SQLColumns(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLS - SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, - SQLSMALLINT NameLength3, SQLCHAR *ColumnName, SQLSMALLINT NameLength4) - { -- struct SQLColumns_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, -- NameLength3, ColumnName, NameLength4 }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," -+ FIXME("(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); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLColumns, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -390,21 +224,14 @@ SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSM - SQLCHAR *UserName, SQLSMALLINT NameLength2, SQLCHAR *Authentication, - SQLSMALLINT NameLength3) - { -- struct SQLConnect_params params = { 0, ServerName, NameLength1, UserName, NameLength2, Authentication, NameLength3 }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(ConnectionHandle %p, ServerName %s, NameLength1 %d, UserName %s, NameLength2 %d, Authentication %s," -+ FIXME("(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); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLConnect, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -413,18 +240,10 @@ SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSM - */ - SQLRETURN WINAPI SQLCopyDesc(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle) - { -- struct SQLCopyDesc_params params; -- struct handle *source = SourceDescHandle, *target = TargetDescHandle; -- SQLRETURN ret; -- -- TRACE("(SourceDescHandle %p, TargetDescHandle %p)\n", SourceDescHandle, TargetDescHandle); -+ SQLRETURN ret = SQL_ERROR; - -- if (!source || !target) return SQL_INVALID_HANDLE; -+ FIXME("(SourceDescHandle %p, TargetDescHandle %p)\n", SourceDescHandle, TargetDescHandle); - -- params.SourceDescHandle = source->unix_handle; -- params.TargetDescHandle = target->unix_handle; -- ret = ODBC_CALL( SQLCopyDesc, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -435,28 +254,12 @@ SQLRETURN WINAPI SQLDataSources(SQLHENV EnvironmentHandle, SQLUSMALLINT Directio - SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, SQLCHAR *Description, - SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2) - { -- struct SQLDataSources_params params = { 0, Direction, ServerName, BufferLength1, NameLength1, Description, -- BufferLength2, NameLength2 }; -- struct handle *handle = EnvironmentHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_NO_DATA; - -- TRACE("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p," -+ FIXME("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p," - " BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle, Direction, ServerName, BufferLength1, - NameLength1, Description, BufferLength2, NameLength2); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.EnvironmentHandle = handle->unix_handle; -- if (SUCCESS((ret = ODBC_CALL( SQLDataSources, ¶ms ))) && TRACE_ON(odbc)) -- { -- if (ServerName && NameLength1 && *NameLength1 > 0) -- TRACE(" DataSource %s", debugstr_an((const char *)ServerName, *NameLength1)); -- if (Description && NameLength2 && *NameLength2 > 0) -- TRACE(" Description %s", debugstr_an((const char *)Description, *NameLength2)); -- TRACE("\n"); -- } -- -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -464,8 +267,13 @@ SQLRETURN WINAPI SQLDataSourcesA(SQLHENV EnvironmentHandle, SQLUSMALLINT Directi - SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, SQLCHAR *Description, - SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2) - { -- return SQLDataSources( EnvironmentHandle, Direction, ServerName, BufferLength1, NameLength1, Description, -- BufferLength2, NameLength2 ); -+ SQLRETURN ret = SQL_NO_DATA; -+ -+ FIXME("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p," -+ " BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle, Direction, ServerName, BufferLength1, -+ NameLength1, Description, BufferLength2, NameLength2); -+ -+ return ret; - } - - /************************************************************************* -@@ -475,36 +283,12 @@ SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNum - SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType, - SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) - { -- struct SQLDescribeCol_params params = { 0, ColumnNumber, ColumnName, BufferLength, NameLength, DataType, -- NULL, DecimalDigits, Nullable }; -- struct handle *handle = StatementHandle; -- UINT64 size; -- SQLSMALLINT dummy; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," -+ FIXME("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," - " ColumnSize %p, DecimalDigits %p, Nullable %p)\n", StatementHandle, ColumnNumber, ColumnName, - BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- if (!params.NameLength) params.NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ -- params.ColumnSize = &size; -- if (SUCCESS((ret = ODBC_CALL( SQLDescribeCol, ¶ms )))) -- { -- if (ColumnName && NameLength) TRACE(" ColumnName %s\n", debugstr_an((const char *)ColumnName, *NameLength)); -- if (DataType) TRACE(" DataType %d\n", *DataType); -- if (ColumnSize) -- { -- *ColumnSize = size; -- TRACE(" ColumnSize %s\n", debugstr_sqlulen(*ColumnSize)); -- } -- if (DecimalDigits) TRACE(" DecimalDigits %d\n", *DecimalDigits); -- if (Nullable) TRACE(" Nullable %d\n", *Nullable); -- } -- -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -513,17 +297,10 @@ SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNum - */ - SQLRETURN WINAPI SQLDisconnect(SQLHDBC ConnectionHandle) - { -- struct SQLDisconnect_params params; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(ConnectionHandle %p)\n", ConnectionHandle); -+ FIXME("(ConnectionHandle %p)\n", ConnectionHandle); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLDisconnect, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -532,17 +309,10 @@ SQLRETURN WINAPI SQLDisconnect(SQLHDBC ConnectionHandle) - */ - SQLRETURN WINAPI SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType) - { -- struct SQLEndTran_params params = { HandleType, 0, CompletionType }; -- struct handle *handle = Handle; -- SQLRETURN ret; -- -- TRACE("(HandleType %d, Handle %p, CompletionType %d)\n", HandleType, Handle, CompletionType); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(HandleType %d, Handle %p, CompletionType %d)\n", HandleType, Handle, CompletionType); - -- params.Handle = handle->unix_handle; -- ret = ODBC_CALL( SQLEndTran, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -550,28 +320,15 @@ SQLRETURN WINAPI SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLIN - * SQLError [ODBC32.010] - */ - SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, -- SQLCHAR *SqlState, SQLINTEGER *NativeError, SQLCHAR *MessageText, -+ SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText, - SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) - { -- struct SQLError_params params = { 0, 0, 0, SqlState, NativeError, MessageText, BufferLength, TextLength }; -- struct handle *env = EnvironmentHandle, *con = ConnectionHandle, *stmt = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, SqlState %p, NativeError %p," -+ FIXME("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, Sqlstate %p, NativeError %p," - " MessageText %p, BufferLength %d, TextLength %p)\n", EnvironmentHandle, ConnectionHandle, -- StatementHandle, SqlState, NativeError, MessageText, BufferLength, TextLength); -+ StatementHandle, Sqlstate, NativeError, MessageText, BufferLength, TextLength); - -- if (env) params.EnvironmentHandle = env->unix_handle; -- if (con) params.ConnectionHandle = con->unix_handle; -- if (stmt) params.StatementHandle = stmt->unix_handle; -- if (SUCCESS((ret = ODBC_CALL( SQLError, ¶ms )))) -- { -- TRACE(" SqlState %s\n", debugstr_an((const char *)SqlState, 5)); -- TRACE(" Error %d\n", *NativeError); -- TRACE(" MessageText %s\n", debugstr_an((const char *)MessageText, *TextLength)); -- } -- -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -580,98 +337,23 @@ SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, S - */ - SQLRETURN WINAPI SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength) - { -- struct SQLExecDirect_params params = { 0, StatementText, TextLength }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, -+ FIXME("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, - debugstr_an((const char *)StatementText, TextLength), TextLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLExecDirect, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - --static void len_to_user( SQLLEN *ptr, UINT8 *len, UINT row_count, UINT width ) --{ -- UINT i; -- for (i = 0; i < row_count; i++) -- { -- *ptr++ = *(SQLLEN *)(len + i * width); -- } --} -- --static void len_from_user( UINT8 *len, SQLLEN *ptr, UINT row_count, UINT width ) --{ -- UINT i; -- for (i = 0; i < row_count; i++) -- { -- *(SQLLEN *)(len + i * width) = *ptr++; -- } --} -- --static void update_result_lengths( struct handle *handle, USHORT type ) --{ -- UINT i, width = sizeof(void *) == 8 ? 8 : is_wow64 ? 8 : 4; -- -- switch (type) -- { -- case SQL_PARAM_OUTPUT: -- for (i = 0; i < handle->bind_col.count; i++) -- { -- len_to_user( handle->bind_col.param[i].ptr, handle->bind_col.param[i].len, handle->row_count, width ); -- } -- for (i = 0; i < handle->bind_param.count; i++) -- { -- len_to_user( handle->bind_param.param[i].ptr, handle->bind_param.param[i].len, handle->row_count, width ); -- } -- for (i = 0; i < handle->bind_parameter.count; i++) -- { -- if (handle->bind_parameter.param[i].type != SQL_PARAM_OUTPUT && -- handle->bind_parameter.param[i].type != SQL_PARAM_INPUT_OUTPUT) continue; -- -- len_to_user( handle->bind_parameter.param[i].ptr, handle->bind_parameter.param[i].len, handle->row_count, width ); -- } -- break; -- -- case SQL_PARAM_INPUT: -- for (i = 0; i < handle->bind_col.count; i++) -- { -- len_from_user( handle->bind_col.param[i].len, handle->bind_col.param[i].ptr, handle->row_count, width ); -- } -- /* FIXME: handle bind_param */ -- for (i = 0; i < handle->bind_parameter.count; i++) -- { -- if (handle->bind_parameter.param[i].type != SQL_PARAM_INPUT && -- handle->bind_parameter.param[i].type != SQL_PARAM_INPUT_OUTPUT) continue; -- -- len_from_user( handle->bind_parameter.param[i].len, handle->bind_parameter.param[i].ptr, handle->row_count, width ); -- } -- -- default: break; -- } --} -- - /************************************************************************* - * SQLExecute [ODBC32.012] - */ - SQLRETURN WINAPI SQLExecute(SQLHSTMT StatementHandle) - { -- struct SQLExecute_params params; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p)\n", StatementHandle); -+ FIXME("(StatementHandle %p)\n", StatementHandle); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- update_result_lengths( handle, SQL_PARAM_INPUT ); -- if (SUCCESS(( ret = ODBC_CALL( SQLExecute, ¶ms )))) update_result_lengths( handle, SQL_PARAM_OUTPUT ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -680,17 +362,10 @@ SQLRETURN WINAPI SQLExecute(SQLHSTMT StatementHandle) - */ - SQLRETURN WINAPI SQLFetch(SQLHSTMT StatementHandle) - { -- struct SQLFetch_params params; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -- -- TRACE("(StatementHandle %p)\n", StatementHandle); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(StatementHandle %p)\n", StatementHandle); - -- params.StatementHandle = handle->unix_handle; -- if (SUCCESS(( ret = ODBC_CALL( SQLFetch, ¶ms )))) update_result_lengths( handle, SQL_PARAM_OUTPUT ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -699,18 +374,11 @@ SQLRETURN WINAPI SQLFetch(SQLHSTMT StatementHandle) - */ - SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset) - { -- struct SQLFetchScroll_params params = { 0, FetchOrientation, FetchOffset }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, FetchOrientation %d, FetchOffset %s)\n", StatementHandle, FetchOrientation, -+ FIXME("(StatementHandle %p, FetchOrientation %d, FetchOffset %s)\n", StatementHandle, FetchOrientation, - debugstr_sqllen(FetchOffset)); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- if (SUCCESS(( ret = ODBC_CALL( SQLFetchScroll, ¶ms )))) update_result_lengths( handle, SQL_PARAM_OUTPUT ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -719,18 +387,10 @@ SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrien - */ - SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle) - { -- struct SQLFreeConnect_params params; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -- -- TRACE("(ConnectionHandle %p)\n", ConnectionHandle); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(ConnectionHandle %p)\n", ConnectionHandle); - -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLFreeConnect, ¶ms ); -- free( handle ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -739,59 +399,22 @@ SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle) - */ - SQLRETURN WINAPI SQLFreeEnv(SQLHENV EnvironmentHandle) - { -- struct SQLFreeEnv_params params; -- struct handle *handle = EnvironmentHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle); -+ FIXME("(EnvironmentHandle %p)\n", EnvironmentHandle); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.EnvironmentHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLFreeEnv, ¶ms ); -- free( handle ); -- TRACE("Returning %d\n", ret); - return ret; - } - --static void free_bindings( struct handle *handle ) --{ -- if (handle->bind_col.param) -- { -- free( handle->bind_col.param->len ); -- free( handle->bind_col.param ); -- } -- if (handle->bind_param.param) -- { -- free( handle->bind_param.param->len ); -- free( handle->bind_param.param ); -- } -- if (handle->bind_parameter.param) -- { -- free( handle->bind_parameter.param->len ); -- free( handle->bind_parameter.param ); -- } --} -- - /************************************************************************* - * SQLFreeHandle [ODBC32.031] - */ - SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) - { -- struct SQLFreeHandle_params params; -- struct handle *handle = Handle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(HandleType %d, Handle %p)\n", HandleType, Handle); -+ FIXME("(HandleType %d, Handle %p)\n", HandleType, Handle); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.HandleType = HandleType; -- params.Handle = handle->unix_handle; -- ret = ODBC_CALL( SQLFreeHandle, ¶ms ); -- free_bindings( handle ); -- free( handle ); -- TRACE ("Returning %d\n", ret); - return ret; - } - -@@ -800,20 +423,10 @@ SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) - */ - SQLRETURN WINAPI SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option) - { -- struct SQLFreeStmt_params params; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -- -- TRACE("(StatementHandle %p, Option %d)\n", StatementHandle, Option); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(StatementHandle %p, Option %d)\n", StatementHandle, Option); - -- params.StatementHandle = handle->unix_handle; -- params.Option = Option; -- ret = ODBC_CALL( SQLFreeStmt, ¶ms ); -- free_bindings( handle ); -- free( handle ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -823,18 +436,11 @@ SQLRETURN WINAPI SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option) - SQLRETURN WINAPI SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER BufferLength, SQLINTEGER *StringLength) - { -- struct SQLGetConnectAttr_params params = { 0, Attribute, Value, BufferLength, StringLength }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, -+ FIXME("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, - Attribute, Value, BufferLength, StringLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetConnectAttr, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -843,17 +449,10 @@ SQLRETURN WINAPI SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribut - */ - SQLRETURN WINAPI SQLGetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value) - { -- struct SQLGetConnectOption_params params = { 0, Option, Value }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -- -- TRACE("(ConnectionHandle %p, Option %d, Value %p)\n", ConnectionHandle, Option, Value); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(ConnectionHandle %p, Option %d, Value %p)\n", ConnectionHandle, Option, Value); - -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetConnectOption, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -863,18 +462,11 @@ SQLRETURN WINAPI SQLGetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Opti - SQLRETURN WINAPI SQLGetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT BufferLength, - SQLSMALLINT *NameLength) - { -- struct SQLGetCursorName_params params = { 0, CursorName, BufferLength, NameLength }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle, CursorName, -+ FIXME("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle, CursorName, - BufferLength, NameLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetCursorName, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -884,20 +476,11 @@ SQLRETURN WINAPI SQLGetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, - SQLRETURN WINAPI SQLGetData(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, - SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind) - { -- struct SQLGetData_params params = { 0, ColumnNumber, TargetType, TargetValue, BufferLength }; -- struct handle *handle = StatementHandle; -- INT64 len; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", -+ FIXME("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", - StatementHandle, ColumnNumber, TargetType, TargetValue, debugstr_sqllen(BufferLength), StrLen_or_Ind); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- params.StrLen_or_Ind = &len; -- if (SUCCESS((ret = ODBC_CALL( SQLGetData, ¶ms )))) *StrLen_or_Ind = len; -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -907,18 +490,11 @@ SQLRETURN WINAPI SQLGetData(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, - SQLRETURN WINAPI SQLGetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, - SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) - { -- struct SQLGetDescField_params params = { 0, RecNumber, FieldIdentifier, Value, BufferLength, StringLength }; -- struct handle *handle = DescriptorHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n", -+ FIXME("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n", - DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength, StringLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.DescriptorHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetDescField, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -930,22 +506,12 @@ SQLRETURN WINAPI SQLGetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, - SQLSMALLINT *SubType, SQLLEN *Length, SQLSMALLINT *Precision, - SQLSMALLINT *Scale, SQLSMALLINT *Nullable) - { -- struct SQLGetDescRec_params params = { 0, RecNumber, Name, BufferLength, StringLength, Type, SubType, NULL, -- Precision, Scale, Nullable }; -- struct handle *handle = DescriptorHandle; -- INT64 len; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p," -+ FIXME("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p," - " Length %p, Precision %p, Scale %p, Nullable %p)\n", DescriptorHandle, RecNumber, Name, BufferLength, - StringLength, Type, SubType, Length, Precision, Scale, Nullable); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.DescriptorHandle = handle->unix_handle; -- params.Length = &len; -- if (SUCCESS((ret = ODBC_CALL( SQLGetDescRec, ¶ms )))) *Length = len; -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -956,19 +522,11 @@ SQLRETURN WINAPI SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSM - SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, - SQLSMALLINT *StringLength) - { -- struct SQLGetDiagField_params params = { HandleType, 0, RecNumber, DiagIdentifier, DiagInfo, BufferLength, -- StringLength }; -- struct handle *handle = Handle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_NO_DATA; - -- TRACE("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," -+ FIXME("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," - " StringLength %p)\n", HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.Handle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetDiagField, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -976,23 +534,15 @@ SQLRETURN WINAPI SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSM - * SQLGetDiagRec [ODBC32.036] - */ - SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, -- SQLCHAR *SqlState, SQLINTEGER *NativeError, SQLCHAR *MessageText, -+ SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText, - SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) - { -- struct SQLGetDiagRec_params params = { HandleType, 0, RecNumber, SqlState, NativeError, MessageText, -- BufferLength, TextLength }; -- struct handle *handle = Handle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_NO_DATA; - -- TRACE("(HandleType %d, Handle %p, RecNumber %d, SqlState %p, NativeError %p, MessageText %p, BufferLength %d," -- " TextLength %p)\n", HandleType, Handle, RecNumber, SqlState, NativeError, MessageText, BufferLength, -+ FIXME("(HandleType %d, Handle %p, RecNumber %d, Sqlstate %p, NativeError %p, MessageText %p, BufferLength %d," -+ " TextLength %p)\n", HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength, - TextLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.Handle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetDiagRec, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1002,18 +552,11 @@ SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMAL - SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER BufferLength, SQLINTEGER *StringLength) - { -- struct SQLGetEnvAttr_params params = { 0, Attribute, Value, BufferLength, StringLength }; -- struct handle *handle = EnvironmentHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(EnvironmentHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", -+ FIXME("(EnvironmentHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", - EnvironmentHandle, Attribute, Value, BufferLength, StringLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.EnvironmentHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetEnvAttr, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1022,17 +565,10 @@ SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, - */ - SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported) - { -- struct SQLGetFunctions_params params = { 0, FunctionId, Supported }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -- -- TRACE("(ConnectionHandle %p, FunctionId %d, Supported %p)\n", ConnectionHandle, FunctionId, Supported); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(ConnectionHandle %p, FunctionId %d, Supported %p)\n", ConnectionHandle, FunctionId, Supported); - -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetFunctions, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1042,18 +578,11 @@ SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT Function - SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, - SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) - { -- struct SQLGetInfo_params params = { 0, InfoType, InfoValue, BufferLength, StringLength }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, -+ FIXME("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, - InfoType, InfoValue, BufferLength, StringLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetInfo, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1063,11 +592,9 @@ SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQL - SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER BufferLength, SQLINTEGER *StringLength) - { -- struct SQLGetStmtAttr_params params = { 0, Attribute, Value, BufferLength, StringLength }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, -+ FIXME("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, - Attribute, Value, BufferLength, StringLength); - - if (!Value) -@@ -1076,11 +603,6 @@ SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, - return SQL_ERROR; - } - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetStmtAttr, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1089,17 +611,10 @@ SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, - */ - SQLRETURN WINAPI SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLPOINTER Value) - { -- struct SQLGetStmtOption_params params = { 0, Option, Value }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, Option %d, Value %p)\n", StatementHandle, Option, Value); -+ FIXME("(StatementHandle %p, Option %d, Value %p)\n", StatementHandle, Option, Value); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetStmtOption, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1108,17 +623,10 @@ SQLRETURN WINAPI SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, - */ - SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) - { -- struct SQLGetTypeInfo_params params = { 0, DataType }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -- -- TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); - -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetTypeInfo, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1127,17 +635,10 @@ SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) - */ - SQLRETURN WINAPI SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnCount) - { -- struct SQLNumResultCols_params params = { 0, ColumnCount }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, ColumnCount %p)\n", StatementHandle, ColumnCount); -+ FIXME("(StatementHandle %p, ColumnCount %p)\n", StatementHandle, ColumnCount); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLNumResultCols, ¶ms ); -- TRACE("Returning %d ColumnCount %d\n", ret, *ColumnCount); - return ret; - } - -@@ -1146,17 +647,10 @@ SQLRETURN WINAPI SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnC - */ - SQLRETURN WINAPI SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value) - { -- struct SQLParamData_params params = { 0, Value }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -- -- TRACE("(StatementHandle %p, Value %p)\n", StatementHandle, Value); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(StatementHandle %p, Value %p)\n", StatementHandle, Value); - -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLParamData, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1165,18 +659,11 @@ SQLRETURN WINAPI SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value) - */ - SQLRETURN WINAPI SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength) - { -- struct SQLPrepare_params params = { 0, StatementText, TextLength }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, -+ FIXME("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, - debugstr_an((const char *)StatementText, TextLength), TextLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLPrepare, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1185,17 +672,10 @@ SQLRETURN WINAPI SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQ - */ - SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN StrLen_or_Ind) - { -- struct SQLPutData_params params = { 0, Data, StrLen_or_Ind }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -- -- TRACE("(StatementHandle %p, Data %p, StrLen_or_Ind %s)\n", StatementHandle, Data, debugstr_sqllen(StrLen_or_Ind)); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(StatementHandle %p, Data %p, StrLen_or_Ind %s)\n", StatementHandle, Data, debugstr_sqllen(StrLen_or_Ind)); - -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLPutData, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1204,23 +684,10 @@ SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN St - */ - SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount) - { -- struct SQLRowCount_params params; -- struct handle *handle = StatementHandle; -- INT64 count; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, RowCount %p)\n", StatementHandle, RowCount); -+ FIXME("(StatementHandle %p, RowCount %p)\n", StatementHandle, RowCount); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- params.RowCount = &count; -- if (SUCCESS((ret = ODBC_CALL( SQLRowCount, ¶ms ))) && RowCount) -- { -- *RowCount = count; -- TRACE(" RowCount %s\n", debugstr_sqllen(*RowCount)); -- } -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1230,18 +697,11 @@ SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount) - SQLRETURN WINAPI SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER StringLength) - { -- struct SQLSetConnectAttr_params params = { 0, Attribute, Value, StringLength }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value, -+ FIXME("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value, - StringLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLSetConnectAttr, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1250,17 +710,10 @@ SQLRETURN WINAPI SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribut - */ - SQLRETURN WINAPI SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value) - { -- struct SQLSetConnectOption_params params = { 0, Option, Value }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle, Option, debugstr_sqlulen(Value)); -+ FIXME("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle, Option, debugstr_sqlulen(Value)); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLSetConnectOption, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1269,18 +722,11 @@ SQLRETURN WINAPI SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Opti - */ - SQLRETURN WINAPI SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT NameLength) - { -- struct SQLSetCursorName_params params = { 0, CursorName, NameLength }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle, -+ FIXME("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle, - debugstr_an((const char *)CursorName, NameLength), NameLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLSetCursorName, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1290,18 +736,11 @@ SQLRETURN WINAPI SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, - SQLRETURN WINAPI SQLSetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, - SQLPOINTER Value, SQLINTEGER BufferLength) - { -- struct SQLSetDescField_params params = { 0, RecNumber, FieldIdentifier, Value, BufferLength }; -- struct handle *handle = DescriptorHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle, -+ FIXME("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle, - RecNumber, FieldIdentifier, Value, BufferLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.DescriptorHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLSetDescField, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1312,26 +751,12 @@ SQLRETURN WINAPI SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, - SQLSMALLINT SubType, SQLLEN Length, SQLSMALLINT Precision, SQLSMALLINT Scale, - SQLPOINTER Data, SQLLEN *StringLength, SQLLEN *Indicator) - { -- struct SQLSetDescRec_params params = { 0, RecNumber, Type, SubType, Length, Precision, Scale, Data }; -- struct handle *handle = DescriptorHandle; -- INT64 stringlen, indicator; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(DescriptorHandle %p, RecNumber %d, Type %d, SubType %d, Length %s, Precision %d, Scale %d, Data %p," -+ FIXME("(DescriptorHandle %p, RecNumber %d, Type %d, SubType %d, Length %s, Precision %d, Scale %d, Data %p," - " StringLength %p, Indicator %p)\n", DescriptorHandle, RecNumber, Type, SubType, debugstr_sqllen(Length), - Precision, Scale, Data, StringLength, Indicator); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.DescriptorHandle = handle->unix_handle; -- params.StringLength = &stringlen; -- params.Indicator = &indicator; -- if (SUCCESS((ret = ODBC_CALL( SQLSetDescRec, ¶ms )))) -- { -- *StringLength = stringlen; -- *Indicator = indicator; -- } -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1341,16 +766,11 @@ SQLRETURN WINAPI SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, - SQLRETURN WINAPI SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER StringLength) - { -- struct SQLSetEnvAttr_params params = { 0, Attribute, Value, StringLength }; -- struct handle *handle = EnvironmentHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(EnvironmentHandle %p, Attribute %d, Value %p, StringLength %d)\n", EnvironmentHandle, Attribute, Value, -+ FIXME("(EnvironmentHandle %p, Attribute %d, Value %p, StringLength %d)\n", EnvironmentHandle, Attribute, Value, - StringLength); - -- params.EnvironmentHandle = handle ? handle->unix_handle : 0; -- ret = ODBC_CALL( SQLSetEnvAttr, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1361,132 +781,26 @@ SQLRETURN WINAPI SQLSetParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNum - SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale, - SQLPOINTER ParameterValue, SQLLEN *StrLen_or_Ind) - { -- struct SQLSetParam_params params = { 0, ParameterNumber, ValueType, ParameterType, LengthPrecision, ParameterScale, -- ParameterValue }; -- struct handle *handle = StatementHandle; -- INT64 len; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s," -+ FIXME("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s," - " ParameterScale %d, ParameterValue %p, StrLen_or_Ind %p)\n", StatementHandle, ParameterNumber, ValueType, - ParameterType, debugstr_sqlulen(LengthPrecision), ParameterScale, ParameterValue, StrLen_or_Ind); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- params.StrLen_or_Ind = &len; -- if (SUCCESS((ret = ODBC_CALL( SQLSetParam, ¶ms )))) *StrLen_or_Ind = len; -- TRACE("Returning %d\n", ret); - return ret; - } - --static BOOL resize_result_lengths( struct handle *handle, UINT size ) --{ -- UINT i; -- for (i = 0; i < handle->bind_col.count; i++) -- { -- UINT8 *tmp; -- if (!handle->bind_col.param[i].ptr) continue; -- if (!(tmp = realloc( handle->bind_col.param[i].len, size * sizeof(UINT64) ))) return FALSE; -- if (tmp != handle->bind_col.param[i].len) -- { -- struct SQLBindCol_params params; -- -- params.StatementHandle = handle->unix_handle; -- params.ColumnNumber = i + 1; -- params.TargetType = handle->bind_col.param[i].col.target_type; -- params.TargetValue = handle->bind_col.param[i].col.target_value; -- params.BufferLength = handle->bind_col.param[i].col.buffer_length; -- params.StrLen_or_Ind = tmp; -- if (!SUCCESS(ODBC_CALL( SQLBindCol, ¶ms ))) -- { -- free( tmp ); -- return FALSE; -- } -- } -- handle->bind_col.param[i].len = tmp; -- } -- for (i = 0; i < handle->bind_param.count; i++) -- { -- UINT8 *tmp; -- if (!handle->bind_param.param[i].ptr) continue; -- if (!(tmp = realloc( handle->bind_param.param[i].len, size * sizeof(UINT64) ))) return FALSE; -- if (tmp != handle->bind_param.param[i].len) -- { -- struct SQLBindParam_params params; -- -- params.StatementHandle = handle->unix_handle; -- params.ParameterNumber = i + 1; -- params.ValueType = handle->bind_param.param[i].param.value_type; -- params.ParameterType = handle->bind_param.param[i].param.parameter_type; -- params.LengthPrecision = handle->bind_param.param[i].param.length_precision; -- params.ParameterScale = handle->bind_param.param[i].param.parameter_scale; -- params.ParameterValue = handle->bind_param.param[i].param.parameter_value; -- params.StrLen_or_Ind = tmp; -- if (!SUCCESS(ODBC_CALL( SQLBindParam, ¶ms ))) -- { -- free( tmp ); -- return FALSE; -- } -- } -- handle->bind_param.param[i].len = tmp; -- } -- for (i = 0; i < handle->bind_parameter.count; i++) -- { -- UINT8 *tmp; -- if (!(tmp = realloc( handle->bind_parameter.param[i].len, size * sizeof(UINT64) ))) return FALSE; -- if (tmp != handle->bind_parameter.param[i].len) -- { -- struct SQLBindParameter_params params; -- -- params.StatementHandle = handle->unix_handle; -- params.ParameterNumber = i + 1; -- params.InputOutputType = handle->bind_parameter.param[i].parameter.input_output_type; -- params.ValueType = handle->bind_parameter.param[i].parameter.value_type; -- params.ParameterType = handle->bind_parameter.param[i].parameter.parameter_type; -- params.ColumnSize = handle->bind_parameter.param[i].parameter.column_size; -- params.DecimalDigits = handle->bind_parameter.param[i].parameter.decimal_digits; -- params.ParameterValue = handle->bind_parameter.param[i].parameter.parameter_value; -- params.BufferLength = handle->bind_parameter.param[i].parameter.buffer_length; -- params.StrLen_or_Ind = tmp; -- if (!SUCCESS(ODBC_CALL( SQLBindParameter, ¶ms ))) -- { -- free( tmp ); -- return FALSE; -- } -- } -- handle->bind_parameter.param[i].len = tmp; -- } -- return TRUE; --} -- - /************************************************************************* - * SQLSetStmtAttr [ODBC32.076] - */ - SQLRETURN WINAPI SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER StringLength) - { -- struct SQLSetStmtAttr_params params = { 0, Attribute, Value, StringLength }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value, -+ FIXME("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value, - StringLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- if (SUCCESS((ret = ODBC_CALL( SQLSetStmtAttr, ¶ms )))) -- { -- SQLULEN row_count = (SQLULEN)Value; -- if (Attribute == SQL_ATTR_ROW_ARRAY_SIZE && row_count != handle->row_count) -- { -- TRACE( "resizing result length array\n" ); -- if (!resize_result_lengths( handle, row_count )) ret = SQL_ERROR; -- else handle->row_count = row_count; -- } -- } -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1495,17 +809,10 @@ SQLRETURN WINAPI SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, - */ - SQLRETURN WINAPI SQLSetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLULEN Value) - { -- struct SQLSetStmtOption_params params = { 0, Option, Value }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, Option %d, Value %s)\n", StatementHandle, Option, debugstr_sqlulen(Value)); -+ FIXME("(StatementHandle %p, Option %d, Value %s)\n", StatementHandle, Option, debugstr_sqlulen(Value)); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLSetStmtOption, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1517,22 +824,14 @@ SQLRETURN WINAPI SQLSpecialColumns(SQLHSTMT StatementHandle, SQLUSMALLINT Identi - SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Scope, - SQLUSMALLINT Nullable) - { -- struct SQLSpecialColumns_params params = { 0, IdentifierType, CatalogName, NameLength1, SchemaName, NameLength2, -- TableName, NameLength3, Scope, Nullable }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, IdentifierType %d, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d," -+ FIXME("(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); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLSpecialColumns, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1543,22 +842,14 @@ SQLRETURN WINAPI SQLStatistics(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, S - SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, - SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved) - { -- struct SQLStatistics_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, -- NameLength3, Unique, Reserved }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d SchemaName %s, NameLength2 %d, TableName %s" -+ FIXME("(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); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLStatistics, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1569,23 +860,15 @@ SQLRETURN WINAPI SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSM - SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, - SQLSMALLINT NameLength3, SQLCHAR *TableType, SQLSMALLINT NameLength4) - { -- struct SQLTables_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, -- NameLength3, TableType, NameLength4 }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," -+ FIXME("(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); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLTables, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1594,42 +877,27 @@ SQLRETURN WINAPI SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSM - */ - SQLRETURN WINAPI SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType) - { -- struct SQLTransact_params params = { 0, 0, CompletionType }; -- struct handle *env = EnvironmentHandle, *con = ConnectionHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(EnvironmentHandle %p, ConnectionHandle %p, CompletionType %d)\n", EnvironmentHandle, ConnectionHandle, -+ FIXME("(EnvironmentHandle %p, ConnectionHandle %p, CompletionType %d)\n", EnvironmentHandle, ConnectionHandle, - CompletionType); - -- if (!env || !con) return SQL_INVALID_HANDLE; -- -- params.EnvironmentHandle = env->unix_handle; -- params.ConnectionHandle = con->unix_handle; -- ret = ODBC_CALL( SQLTransact, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLBrowseConnect [ODBC32.055] - */ --SQLRETURN WINAPI SQLBrowseConnect(SQLHDBC ConnectionHandle, SQLCHAR *InConnectionString, SQLSMALLINT StringLength1, -- SQLCHAR *OutConnectionString, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength2) -+SQLRETURN WINAPI SQLBrowseConnect(SQLHDBC hdbc, SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, -+ SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, -+ SQLSMALLINT *pcbConnStrOut) - { -- struct SQLBrowseConnect_params params = { 0, InConnectionString, StringLength1, OutConnectionString, BufferLength, -- StringLength2 }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -- -- TRACE("(ConnectionHandle %p, InConnectionString %s, StringLength1 %d, OutConnectionString %p, BufferLength, %d, " -- "StringLength2 %p)\n", ConnectionHandle, debugstr_an((const char *)InConnectionString, StringLength1), -- StringLength1, OutConnectionString, BufferLength, StringLength2); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(hdbc %p, szConnStrIn %s, cbConnStrIn %d, szConnStrOut %p, cbConnStrOutMax %d, pcbConnStrOut %p)\n", -+ hdbc, debugstr_an((const char *)szConnStrIn, cbConnStrIn), cbConnStrIn, szConnStrOut, cbConnStrOutMax, -+ pcbConnStrOut); - -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLBrowseConnect, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1638,149 +906,96 @@ SQLRETURN WINAPI SQLBrowseConnect(SQLHDBC ConnectionHandle, SQLCHAR *InConnectio - */ - SQLRETURN WINAPI SQLBulkOperations(SQLHSTMT StatementHandle, SQLSMALLINT Operation) - { -- struct SQLBulkOperations_params params = { 0, Operation }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, Operation %d)\n", StatementHandle, Operation); -+ FIXME("(StatementHandle %p, Operation %d)\n", StatementHandle, Operation); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- if (SUCCESS(( ret = ODBC_CALL( SQLBulkOperations, ¶ms )))) update_result_lengths( handle, SQL_PARAM_OUTPUT ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLColAttributes [ODBC32.006] - */ --SQLRETURN WINAPI SQLColAttributes(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, -- SQLPOINTER CharacterAttributes, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, -- SQLLEN *NumericAttributes) -+SQLRETURN WINAPI SQLColAttributes(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, -+ SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, -+ SQLLEN *pfDesc) - { -- struct SQLColAttributes_params params = { 0, ColumnNumber, FieldIdentifier, CharacterAttributes, BufferLength, -- StringLength }; -- struct handle *handle = StatementHandle; -- INT64 attrs; -- SQLRETURN ret; -- -- TRACE("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttributes %p, BufferLength %d, " -- "StringLength %p, NumericAttributes %p)\n", StatementHandle, ColumnNumber, FieldIdentifier, -- CharacterAttributes, BufferLength, StringLength, NumericAttributes); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol, -+ fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); - -- params.StatementHandle = handle->unix_handle; -- params.NumericAttributes = &attrs; -- if (SUCCESS((ret = ODBC_CALL( SQLColAttributes, ¶ms )))) *NumericAttributes = attrs; -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLColumnPrivileges [ODBC32.056] - */ --SQLRETURN WINAPI SQLColumnPrivileges(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, -- SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, -- SQLSMALLINT NameLength3, SQLCHAR *ColumnName, SQLSMALLINT NameLength4) -+SQLRETURN WINAPI SQLColumnPrivileges(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, -+ SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, -+ SQLSMALLINT cbTableName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName) - { -- struct SQLColumnPrivileges_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, -- TableName, NameLength3, ColumnName, NameLength4 }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- 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); -- -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," -+ " cbTableName %d, szColumnName %s, cbColumnName %d)\n", hstmt, -+ debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName, -+ debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName, -+ debugstr_an((const char *)szTableName, cbTableName), cbTableName, -+ debugstr_an((const char *)szColumnName, cbColumnName), cbColumnName); - -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLColumnPrivileges, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLDescribeParam [ODBC32.058] - */ --SQLRETURN WINAPI SQLDescribeParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT *DataType, -- SQLULEN *ParameterSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) -+SQLRETURN WINAPI SQLDescribeParam(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT *pfSqlType, -+ SQLULEN *pcbParamDef, SQLSMALLINT *pibScale, SQLSMALLINT *pfNullable) - { -- struct SQLDescribeParam_params params = { 0, ParameterNumber, DataType, NULL, DecimalDigits, Nullable }; -- struct handle *handle = StatementHandle; -- UINT64 size; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, ParameterNumber %d, DataType %p, ParameterSize %p, DecimalDigits %p, Nullable %p)\n", -- StatementHandle, ParameterNumber, DataType, ParameterSize, DecimalDigits, Nullable); -+ FIXME("(hstmt %p, ipar %d, pfSqlType %p, pcbParamDef %p, pibScale %p, pfNullable %p)\n", hstmt, ipar, -+ pfSqlType, pcbParamDef, pibScale, pfNullable); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- params.ParameterSize = &size; -- if (SUCCESS((ret = ODBC_CALL( SQLDescribeParam, ¶ms )))) *ParameterSize = size; -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLExtendedFetch [ODBC32.059] - */ --SQLRETURN WINAPI SQLExtendedFetch(SQLHSTMT StatementHandle, SQLUSMALLINT FetchOrientation, SQLLEN FetchOffset, -- SQLULEN *RowCount, SQLUSMALLINT *RowStatusArray) -+SQLRETURN WINAPI SQLExtendedFetch(SQLHSTMT hstmt, SQLUSMALLINT fFetchType, SQLLEN irow, SQLULEN *pcrow, -+ SQLUSMALLINT *rgfRowStatus) - { -- struct SQLExtendedFetch_params params = { 0, FetchOrientation, FetchOffset, NULL, RowStatusArray }; -- struct handle *handle = StatementHandle; -- UINT64 count; -- SQLRETURN ret; -- -- TRACE("(StatementHandle %p, FetchOrientation %d, FetchOffset %s, RowCount %p, RowStatusArray %p)\n", -- StatementHandle, FetchOrientation, debugstr_sqllen(FetchOffset), RowCount, RowStatusArray); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(hstmt %p, fFetchType %d, irow %s, pcrow %p, rgfRowStatus %p)\n", hstmt, fFetchType, debugstr_sqllen(irow), -+ pcrow, rgfRowStatus); - -- params.StatementHandle = handle->unix_handle; -- params.RowCount = &count; -- if (SUCCESS((ret = ODBC_CALL( SQLExtendedFetch, ¶ms )))) *RowCount = count; -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLForeignKeys [ODBC32.060] - */ --SQLRETURN WINAPI SQLForeignKeys(SQLHSTMT StatementHandle, SQLCHAR *PkCatalogName, SQLSMALLINT NameLength1, -- SQLCHAR *PkSchemaName, SQLSMALLINT NameLength2, SQLCHAR *PkTableName, -- SQLSMALLINT NameLength3, SQLCHAR *FkCatalogName, SQLSMALLINT NameLength4, -- SQLCHAR *FkSchemaName, SQLSMALLINT NameLength5, SQLCHAR *FkTableName, -- SQLSMALLINT NameLength6) -+SQLRETURN WINAPI SQLForeignKeys(SQLHSTMT hstmt, SQLCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName, -+ SQLCHAR *szPkSchemaName, SQLSMALLINT cbPkSchemaName, SQLCHAR *szPkTableName, -+ SQLSMALLINT cbPkTableName, SQLCHAR *szFkCatalogName, -+ SQLSMALLINT cbFkCatalogName, SQLCHAR *szFkSchemaName, -+ SQLSMALLINT cbFkSchemaName, SQLCHAR *szFkTableName, SQLSMALLINT cbFkTableName) - { -- struct SQLForeignKeys_params params = { 0, PkCatalogName, NameLength1, PkSchemaName, NameLength2, -- PkTableName, NameLength3, FkCatalogName, NameLength4, -- FkSchemaName, NameLength5, FkTableName, NameLength6 }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- 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); -+ FIXME("(hstmt %p, szPkCatalogName %s, cbPkCatalogName %d, szPkSchemaName %s, cbPkSchemaName %d," -+ " szPkTableName %s, cbPkTableName %d, szFkCatalogName %s, cbFkCatalogName %d, szFkSchemaName %s," -+ " cbFkSchemaName %d, szFkTableName %s, cbFkTableName %d)\n", hstmt, -+ debugstr_an((const char *)szPkCatalogName, cbPkCatalogName), cbPkCatalogName, -+ debugstr_an((const char *)szPkSchemaName, cbPkSchemaName), cbPkSchemaName, -+ debugstr_an((const char *)szPkTableName, cbPkTableName), cbPkTableName, -+ debugstr_an((const char *)szFkCatalogName, cbFkCatalogName), cbFkCatalogName, -+ debugstr_an((const char *)szFkSchemaName, cbFkSchemaName), cbFkSchemaName, -+ debugstr_an((const char *)szFkTableName, cbFkTableName), cbFkTableName); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLForeignKeys, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -1789,389 +1004,213 @@ SQLRETURN WINAPI SQLForeignKeys(SQLHSTMT StatementHandle, SQLCHAR *PkCatalogName - */ - SQLRETURN WINAPI SQLMoreResults(SQLHSTMT StatementHandle) - { -- struct SQLMoreResults_params params; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -- -- TRACE("(%p)\n", StatementHandle); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(%p)\n", StatementHandle); - -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLMoreResults, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLNativeSql [ODBC32.062] - */ --SQLRETURN WINAPI SQLNativeSql(SQLHDBC ConnectionHandle, SQLCHAR *InStatementText, SQLINTEGER TextLength1, -- SQLCHAR *OutStatementText, SQLINTEGER BufferLength, SQLINTEGER *TextLength2) -+SQLRETURN WINAPI SQLNativeSql(SQLHDBC hdbc, SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLCHAR *szSqlStr, -+ SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr) - { -- struct SQLNativeSql_params params = { 0, InStatementText, TextLength1, OutStatementText, BufferLength, -- TextLength2 }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -+ 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); -+ FIXME("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc, -+ debugstr_an((const char *)szSqlStrIn, cbSqlStrIn), cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLNativeSql, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLNumParams [ODBC32.063] - */ --SQLRETURN WINAPI SQLNumParams(SQLHSTMT StatementHandle, SQLSMALLINT *ParameterCount) -+SQLRETURN WINAPI SQLNumParams(SQLHSTMT hstmt, SQLSMALLINT *pcpar) - { -- struct SQLNumParams_params params = { 0, ParameterCount }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -- -- TRACE("(StatementHandle %p, pcpar %p)\n", StatementHandle, ParameterCount); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(hstmt %p, pcpar %p)\n", hstmt, pcpar); - -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLNumParams, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLParamOptions [ODBC32.064] - */ --SQLRETURN WINAPI SQLParamOptions(SQLHSTMT StatementHandle, SQLULEN RowCount, SQLULEN *RowNumber) -+SQLRETURN WINAPI SQLParamOptions(SQLHSTMT hstmt, SQLULEN crow, SQLULEN *pirow) - { -- struct SQLParamOptions_params params = { 0, RowCount }; -- struct handle *handle = StatementHandle; -- UINT64 row; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, RowCount %s, RowNumber %p)\n", StatementHandle, debugstr_sqlulen(RowCount), -- RowNumber); -+ FIXME("(hstmt %p, crow %s, pirow %p)\n", hstmt, debugstr_sqlulen(crow), pirow); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- params.RowNumber = &row; -- if (SUCCESS((ret = ODBC_CALL( SQLParamOptions, ¶ms )))) *RowNumber = row; -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLPrimaryKeys [ODBC32.065] - */ --SQLRETURN WINAPI SQLPrimaryKeys(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, -- SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, -- SQLSMALLINT NameLength3) -+SQLRETURN WINAPI SQLPrimaryKeys(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, -+ SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, -+ SQLSMALLINT cbTableName) - { -- struct SQLPrimaryKeys_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, -- NameLength3 }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -- -- 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); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," -+ " cbTableName %d)\n", hstmt, -+ debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName, -+ debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName, -+ debugstr_an((const char *)szTableName, cbTableName), cbTableName); - -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLPrimaryKeys, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLProcedureColumns [ODBC32.066] - */ --SQLRETURN WINAPI SQLProcedureColumns(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, -- SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *ProcName, -- SQLSMALLINT NameLength3, SQLCHAR *ColumnName, SQLSMALLINT NameLength4) -+SQLRETURN WINAPI SQLProcedureColumns(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, -+ SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName, -+ SQLSMALLINT cbProcName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName) - { -- struct SQLProcedureColumns_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, -- ProcName, NameLength3, ColumnName, NameLength4 }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- 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); -+ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," -+ " cbProcName %d, szColumnName %s, cbColumnName %d)\n", hstmt, -+ debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName, -+ debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName, -+ debugstr_an((const char *)szProcName, cbProcName), cbProcName, -+ debugstr_an((const char *)szColumnName, cbColumnName), cbColumnName); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLProcedureColumns, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLProcedures [ODBC32.067] - */ --SQLRETURN WINAPI SQLProcedures(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, -- SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *ProcName, -- SQLSMALLINT NameLength3) -+SQLRETURN WINAPI SQLProcedures(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, -+ SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName, -+ SQLSMALLINT cbProcName) - { -- struct SQLProcedures_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, ProcName, -- NameLength3 }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -- -- 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); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," -+ " cbProcName %d)\n", hstmt, -+ debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName, -+ debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName, -+ debugstr_an((const char *)szProcName, cbProcName), cbProcName); - -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLProcedures, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLSetPos [ODBC32.068] - */ --SQLRETURN WINAPI SQLSetPos(SQLHSTMT StatementHandle, SQLSETPOSIROW RowNumber, SQLUSMALLINT Operation, -- SQLUSMALLINT LockType) -+SQLRETURN WINAPI SQLSetPos(SQLHSTMT hstmt, SQLSETPOSIROW irow, SQLUSMALLINT fOption, SQLUSMALLINT fLock) - { -- struct SQLSetPos_params params = { 0, RowNumber, Operation, LockType }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, RowNumber %s, Operation %d, LockType %d)\n", StatementHandle, -- debugstr_sqlulen(RowNumber), Operation, LockType); -+ FIXME("(hstmt %p, irow %s, fOption %d, fLock %d)\n", hstmt, debugstr_sqlulen(irow), fOption, fLock); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- if (SUCCESS(( ret = ODBC_CALL( SQLSetPos, ¶ms ))) && Operation == SQL_REFRESH) -- update_result_lengths( handle, SQL_PARAM_OUTPUT ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLTablePrivileges [ODBC32.070] - */ --SQLRETURN WINAPI SQLTablePrivileges(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, -- SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, -- SQLSMALLINT NameLength3) -+SQLRETURN WINAPI SQLTablePrivileges(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, -+ SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, -+ SQLSMALLINT cbTableName) - { -- struct SQLTablePrivileges_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, -- TableName, NameLength3 }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -- -- 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); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," -+ " cbTableName %d)\n", hstmt, -+ debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName, -+ debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName, -+ debugstr_an((const char *)szTableName, cbTableName), cbTableName); - -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLTablePrivileges, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLDrivers [ODBC32.071] - */ --SQLRETURN WINAPI SQLDrivers(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR *DriverDescription, -- SQLSMALLINT BufferLength1, SQLSMALLINT *DescriptionLength, -- SQLCHAR *DriverAttributes, SQLSMALLINT BufferLength2, -- SQLSMALLINT *AttributesLength) -+SQLRETURN WINAPI SQLDrivers(SQLHENV EnvironmentHandle, SQLUSMALLINT fDirection, SQLCHAR *szDriverDesc, -+ SQLSMALLINT cbDriverDescMax, SQLSMALLINT *pcbDriverDesc, -+ SQLCHAR *szDriverAttributes, SQLSMALLINT cbDriverAttrMax, -+ SQLSMALLINT *pcbDriverAttr) - { -- struct SQLDrivers_params params = { 0, Direction, DriverDescription, BufferLength1, DescriptionLength, -- DriverAttributes, BufferLength2, AttributesLength }; -- struct handle *handle = EnvironmentHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_NO_DATA; - -- TRACE("(EnvironmentHandle %p, Direction %d, DriverDescription %p, BufferLength1 %d, DescriptionLength %p," -- " DriverAttributes %p, BufferLength2 %d, AttributesLength %p)\n", EnvironmentHandle, Direction, -- DriverDescription, BufferLength1, DescriptionLength, DriverAttributes, BufferLength2, AttributesLength); -+ FIXME("(EnvironmentHandle %p, Direction %d, szDriverDesc %p, cbDriverDescMax %d, pcbDriverDesc %p," -+ " DriverAttributes %p, cbDriverAttrMax %d, pcbDriverAttr %p)\n", EnvironmentHandle, fDirection, -+ szDriverDesc, cbDriverDescMax, pcbDriverDesc, szDriverAttributes, cbDriverAttrMax, pcbDriverAttr); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.EnvironmentHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLDrivers, ¶ms ); -- -- if (ret == SQL_NO_DATA && Direction == SQL_FETCH_FIRST) -- ERR_(winediag)("No ODBC drivers could be found. Check the settings for your libodbc provider.\n"); -- -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLBindParameter [ODBC32.072] - */ --SQLRETURN WINAPI SQLBindParameter(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT InputOutputType, -- SQLSMALLINT ValueType, SQLSMALLINT ParameterType, SQLULEN ColumnSize, -- SQLSMALLINT DecimalDigits, SQLPOINTER ParameterValue, SQLLEN BufferLength, -- SQLLEN *StrLen_or_Ind) -+SQLRETURN WINAPI SQLBindParameter(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT fParamType, -+ SQLSMALLINT fCType, SQLSMALLINT fSqlType, SQLULEN cbColDef, -+ SQLSMALLINT ibScale, SQLPOINTER rgbValue, SQLLEN cbValueMax, -+ SQLLEN *pcbValue) - { -- struct SQLBindParameter_params params = { 0, ParameterNumber, InputOutputType, ValueType, ParameterType, -- ColumnSize, DecimalDigits, ParameterValue, BufferLength }; -- struct handle *handle = StatementHandle; -- UINT i = ParameterNumber - 1; -- SQLRETURN ret; -- -- TRACE("(StatementHandle %p, ParameterNumber %d, InputOutputType %d, ValueType %d, ParameterType %d, " -- "ColumnSize %s, DecimalDigits %d, ParameterValue, %p, BufferLength %s, StrLen_or_Ind %p)\n", -- StatementHandle, ParameterNumber, InputOutputType, ValueType, ParameterType, debugstr_sqlulen(ColumnSize), -- DecimalDigits, ParameterValue, debugstr_sqllen(BufferLength), StrLen_or_Ind); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -- if (!ParameterNumber) -- { -- FIXME( "parameter 0 not handled\n" ); -- return SQL_ERROR; -- } -- if (!alloc_binding( &handle->bind_parameter, InputOutputType, ParameterNumber, handle->row_count )) return SQL_ERROR; -- handle->bind_parameter.param[i].parameter.input_output_type = InputOutputType; -- handle->bind_parameter.param[i].parameter.value_type = ValueType; -- handle->bind_parameter.param[i].parameter.parameter_type = ParameterType; -- handle->bind_parameter.param[i].parameter.column_size = ColumnSize; -- handle->bind_parameter.param[i].parameter.decimal_digits = DecimalDigits; -- handle->bind_parameter.param[i].parameter.parameter_value = ParameterValue; -- handle->bind_parameter.param[i].parameter.buffer_length = BufferLength; -+ FIXME("(hstmt %p, ipar %d, fParamType %d, fCType %d, fSqlType %d, cbColDef %s, ibScale %d, rgbValue %p," -+ " cbValueMax %s, pcbValue %p)\n", hstmt, ipar, fParamType, fCType, fSqlType, debugstr_sqlulen(cbColDef), -+ ibScale, rgbValue, debugstr_sqllen(cbValueMax), pcbValue); - -- params.StatementHandle = handle->unix_handle; -- params.StrLen_or_Ind = handle->bind_parameter.param[i].len; -- *(UINT64 *)params.StrLen_or_Ind = *StrLen_or_Ind; -- if (SUCCESS((ret = ODBC_CALL( SQLBindParameter, ¶ms )))) handle->bind_parameter.param[i].ptr = StrLen_or_Ind; -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLDriverConnect [ODBC32.041] - */ --SQLRETURN WINAPI SQLDriverConnect(SQLHDBC ConnectionHandle, SQLHWND WindowHandle, SQLCHAR *ConnectionString, -- SQLSMALLINT Length, SQLCHAR *OutConnectionString, SQLSMALLINT BufferLength, -- SQLSMALLINT *Length2, SQLUSMALLINT DriverCompletion) -+SQLRETURN WINAPI SQLDriverConnect(SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR *ConnectionString, SQLSMALLINT Length, -+ SQLCHAR *conn_str_out, SQLSMALLINT conn_str_out_max, -+ SQLSMALLINT *ptr_conn_str_out, SQLUSMALLINT driver_completion) - { -- struct SQLDriverConnect_params params = { 0, WindowHandle, ConnectionString, Length, OutConnectionString, -- BufferLength, Length2, DriverCompletion }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -- -- TRACE("(ConnectionHandle %p, hwnd %p, ConnectionString %s, Length %d, conn_str_out %p, conn_str_out_max %d," -- " ptr_conn_str_out %p, driver_completion %d)\n", ConnectionHandle, WindowHandle, -- debugstr_an((const char *)ConnectionString, Length), Length, OutConnectionString, BufferLength, -- Length2, DriverCompletion); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(hdbc %p, hwnd %p, ConnectionString %s, Length %d, conn_str_out %p, conn_str_out_max %d," -+ " ptr_conn_str_out %p, driver_completion %d)\n", hdbc, hwnd, -+ debugstr_an((const char *)ConnectionString, Length), Length, conn_str_out, conn_str_out_max, -+ ptr_conn_str_out, driver_completion); - -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLDriverConnect, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLSetScrollOptions [ODBC32.069] - */ --SQLRETURN WINAPI SQLSetScrollOptions(SQLHSTMT StatementHandle, SQLUSMALLINT Concurrency, SQLLEN KeySetSize, -- SQLUSMALLINT RowSetSize) -+SQLRETURN WINAPI SQLSetScrollOptions(SQLHSTMT statement_handle, SQLUSMALLINT f_concurrency, SQLLEN crow_keyset, -+ SQLUSMALLINT crow_rowset) - { -- struct SQLSetScrollOptions_params params = { 0, Concurrency, KeySetSize, RowSetSize }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, Concurrency %d, KeySetSize %s, RowSetSize %d)\n", StatementHandle, -- Concurrency, debugstr_sqllen(KeySetSize), RowSetSize); -+ FIXME("(statement_handle %p, f_concurrency %d, crow_keyset %s, crow_rowset %d)\n", statement_handle, -+ f_concurrency, debugstr_sqllen(crow_keyset), crow_rowset); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLSetScrollOptions, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - --static BOOL SQLColAttributes_KnownStringAttribute(SQLUSMALLINT fDescType) --{ -- static const SQLUSMALLINT attrList[] = -- { -- SQL_COLUMN_OWNER_NAME, -- SQL_COLUMN_QUALIFIER_NAME, -- SQL_COLUMN_LABEL, -- SQL_COLUMN_NAME, -- SQL_COLUMN_TABLE_NAME, -- SQL_COLUMN_TYPE_NAME, -- SQL_DESC_BASE_COLUMN_NAME, -- SQL_DESC_BASE_TABLE_NAME, -- SQL_DESC_CATALOG_NAME, -- SQL_DESC_LABEL, -- SQL_DESC_LITERAL_PREFIX, -- SQL_DESC_LITERAL_SUFFIX, -- SQL_DESC_LOCAL_TYPE_NAME, -- SQL_DESC_NAME, -- SQL_DESC_SCHEMA_NAME, -- SQL_DESC_TABLE_NAME, -- SQL_DESC_TYPE_NAME, -- }; -- unsigned int i; -- -- for (i = 0; i < ARRAY_SIZE(attrList); i++) { -- if (attrList[i] == fDescType) return TRUE; -- } -- return FALSE; --} -- - /************************************************************************* - * SQLColAttributesW [ODBC32.106] - */ --SQLRETURN WINAPI SQLColAttributesW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, -- SQLPOINTER CharacterAttributes, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, -- SQLLEN *NumericAttributes) -+SQLRETURN WINAPI SQLColAttributesW(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, -+ SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, -+ SQLLEN *pfDesc) - { -- struct SQLColAttributesW_params params = { 0, ColumnNumber, FieldIdentifier, CharacterAttributes, BufferLength, -- StringLength }; -- struct handle *handle = StatementHandle; -- INT64 attrs; -- SQLRETURN ret; -- -- TRACE("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttributes %p, BufferLength %d, " -- "StringLength %p, NumericAttributes %p)\n", StatementHandle, ColumnNumber, FieldIdentifier, -- CharacterAttributes, BufferLength, StringLength, NumericAttributes); -- -- if (!handle) return SQL_INVALID_HANDLE; -+ SQLRETURN ret = SQL_ERROR; - -- params.StatementHandle = handle->unix_handle; -- params.NumericAttributes = &attrs; -- if (SUCCESS((ret = ODBC_CALL( SQLColAttributesW, ¶ms )))) *NumericAttributes = attrs; -+ FIXME("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol, -+ fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); - -- 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; -- } -- -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2182,20 +1221,12 @@ SQLRETURN WINAPI SQLConnectW(SQLHDBC ConnectionHandle, WCHAR *ServerName, SQLSMA - WCHAR *UserName, SQLSMALLINT NameLength2, WCHAR *Authentication, - SQLSMALLINT NameLength3) - { -- struct SQLConnectW_params params = { 0, ServerName, NameLength1, UserName, NameLength2, Authentication, -- NameLength3 }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(ConnectionHandle %p, ServerName %s, NameLength1 %d, UserName %s, NameLength2 %d, Authentication %s," -+ FIXME("(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); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLConnectW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2206,36 +1237,15 @@ SQLRETURN WINAPI SQLDescribeColW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNu - SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType, - SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) - { -- struct SQLDescribeColW_params params = { 0, ColumnNumber, ColumnName, BufferLength, NameLength, DataType, -- NULL, DecimalDigits, Nullable }; -- struct handle *handle = StatementHandle; - SQLSMALLINT dummy; -- UINT64 size; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," -+ FIXME("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," - " ColumnSize %p, DecimalDigits %p, Nullable %p)\n", StatementHandle, ColumnNumber, ColumnName, - BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); - -- if (!handle) return SQL_INVALID_HANDLE; -+ if (!NameLength) NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ - -- params.StatementHandle = handle->unix_handle; -- if (!NameLength) params.NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ -- params.ColumnSize = &size; -- if (SUCCESS((ret = ODBC_CALL( SQLDescribeColW, ¶ms )))) -- { -- if (ColumnName && NameLength) TRACE("ColumnName %s\n", debugstr_wn(ColumnName, *NameLength)); -- if (DataType) TRACE("DataType %d\n", *DataType); -- if (ColumnSize) -- { -- *ColumnSize = size; -- TRACE("ColumnSize %s\n", debugstr_sqlulen(*ColumnSize)); -- } -- if (DecimalDigits) TRACE("DecimalDigits %d\n", *DecimalDigits); -- if (Nullable) TRACE("Nullable %d\n", *Nullable); -- } -- -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2243,28 +1253,15 @@ SQLRETURN WINAPI SQLDescribeColW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNu - * SQLErrorW [ODBC32.110] - */ - SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, -- WCHAR *SqlState, SQLINTEGER *NativeError, WCHAR *MessageText, -+ WCHAR *Sqlstate, SQLINTEGER *NativeError, WCHAR *MessageText, - SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) - { -- struct SQLErrorW_params params = { 0, 0, 0, SqlState, NativeError, MessageText, BufferLength, TextLength }; -- struct handle *env = EnvironmentHandle, *con = ConnectionHandle, *stmt = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, SqlState %p, NativeError %p," -+ FIXME("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, Sqlstate %p, NativeError %p," - " MessageText %p, BufferLength %d, TextLength %p)\n", EnvironmentHandle, ConnectionHandle, -- StatementHandle, SqlState, NativeError, MessageText, BufferLength, TextLength); -- -- if (env) params.EnvironmentHandle = env->unix_handle; -- if (con) params.ConnectionHandle = con->unix_handle; -- if (stmt) params.StatementHandle = stmt->unix_handle; -- if (SUCCESS((ret = ODBC_CALL( SQLErrorW, ¶ms )))) -- { -- TRACE(" SqlState %s\n", debugstr_wn(SqlState, 5)); -- TRACE(" Error %d\n", *NativeError); -- TRACE(" MessageText %s\n", debugstr_wn(MessageText, *TextLength)); -- } -+ StatementHandle, Sqlstate, NativeError, MessageText, BufferLength, TextLength); - -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2273,18 +1270,11 @@ SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, - */ - SQLRETURN WINAPI SQLExecDirectW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength) - { -- struct SQLExecDirectW_params params = { 0, StatementText, TextLength }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, -+ FIXME("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, - debugstr_wn(StatementText, TextLength), TextLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLExecDirectW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2294,18 +1284,11 @@ SQLRETURN WINAPI SQLExecDirectW(SQLHSTMT StatementHandle, WCHAR *StatementText, - SQLRETURN WINAPI SQLGetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, SQLSMALLINT BufferLength, - SQLSMALLINT *NameLength) - { -- struct SQLGetCursorNameW_params params = { 0, CursorName, BufferLength, NameLength }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle, CursorName, -+ FIXME("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle, CursorName, - BufferLength, NameLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetCursorNameW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2314,18 +1297,11 @@ SQLRETURN WINAPI SQLGetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, - */ - SQLRETURN WINAPI SQLPrepareW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength) - { -- struct SQLPrepareW_params params = { 0, StatementText, TextLength }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, -+ FIXME("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, - debugstr_wn(StatementText, TextLength), TextLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLPrepareW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2334,18 +1310,11 @@ SQLRETURN WINAPI SQLPrepareW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQL - */ - SQLRETURN WINAPI SQLSetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, SQLSMALLINT NameLength) - { -- struct SQLSetCursorNameW_params params = { 0, CursorName, NameLength }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle, -+ FIXME("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle, - debugstr_wn(CursorName, NameLength), NameLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLSetCursorNameW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2357,30 +1326,12 @@ SQLRETURN WINAPI SQLColAttributeW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnN - SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, - SQLLEN *NumericAttribute) - { -- struct SQLColAttributeW_params params = { 0, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength, -- StringLength }; -- struct handle *handle = StatementHandle; -- INT64 attr; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("StatementHandle %p ColumnNumber %d FieldIdentifier %d CharacterAttribute %p BufferLength %d" -+ FIXME("StatementHandle %p ColumnNumber %d FieldIdentifier %d CharacterAttribute %p BufferLength %d" - " StringLength %p NumericAttribute %p\n", StatementHandle, ColumnNumber, FieldIdentifier, - CharacterAttribute, BufferLength, StringLength, NumericAttribute); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- params.NumericAttribute = &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; -- } -- -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2390,18 +1341,11 @@ SQLRETURN WINAPI SQLColAttributeW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnN - SQLRETURN WINAPI SQLGetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER BufferLength, SQLINTEGER *StringLength) - { -- struct SQLGetConnectAttrW_params params = { 0, Attribute, Value, BufferLength, StringLength }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, -+ FIXME("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, - Attribute, Value, BufferLength, StringLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetConnectAttrW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2411,18 +1355,11 @@ SQLRETURN WINAPI SQLGetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribu - SQLRETURN WINAPI SQLGetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, - SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) - { -- struct SQLGetDescFieldW_params params = { 0, RecNumber, FieldIdentifier, Value, BufferLength, StringLength }; -- struct handle *handle = DescriptorHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n", -+ FIXME("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n", - DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength, StringLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.DescriptorHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetDescFieldW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2434,22 +1371,12 @@ SQLRETURN WINAPI SQLGetDescRecW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber - SQLSMALLINT *SubType, SQLLEN *Length, SQLSMALLINT *Precision, - SQLSMALLINT *Scale, SQLSMALLINT *Nullable) - { -- struct SQLGetDescRecW_params params = { 0, RecNumber, Name, BufferLength, StringLength, Type, SubType, -- NULL, Precision, Scale, Nullable }; -- struct handle *handle = DescriptorHandle; -- INT64 len; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p," -+ FIXME("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p," - " Length %p, Precision %p, Scale %p, Nullable %p)\n", DescriptorHandle, RecNumber, Name, BufferLength, - StringLength, Type, SubType, Length, Precision, Scale, Nullable); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.DescriptorHandle = handle->unix_handle; -- params.Length = &len; -- if (SUCCESS((ret = ODBC_CALL( SQLGetDescRecW, ¶ms )))) *Length = len; -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2460,43 +1387,27 @@ SQLRETURN WINAPI SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLS - SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, - SQLSMALLINT *StringLength) - { -- struct SQLGetDiagFieldW_params params = { HandleType, 0, RecNumber, DiagIdentifier, DiagInfo, BufferLength, -- StringLength }; -- struct handle *handle = Handle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_NO_DATA; - -- TRACE("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," -+ FIXME("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," - " StringLength %p)\n", HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.Handle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetDiagFieldW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLGetDiagRecW [ODBC32.136] - */ --SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, WCHAR *SqlState, -- SQLINTEGER *NativeError, WCHAR *MessageText, SQLSMALLINT BufferLength, -- SQLSMALLINT *TextLength) -+SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, -+ WCHAR *Sqlstate, SQLINTEGER *NativeError, WCHAR *MessageText, -+ SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) - { -- struct SQLGetDiagRecW_params params = { HandleType, 0, RecNumber, SqlState, NativeError, MessageText, -- BufferLength, TextLength }; -- struct handle *handle = Handle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(HandleType %d, Handle %p, RecNumber %d, SqlState %p, NativeError %p, MessageText %p, BufferLength %d," -- " TextLength %p)\n", HandleType, Handle, RecNumber, SqlState, NativeError, MessageText, BufferLength, -+ FIXME("(HandleType %d, Handle %p, RecNumber %d, Sqlstate %p, NativeError %p, MessageText %p, BufferLength %d," -+ " TextLength %p)\n", HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength, - TextLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.Handle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetDiagRecW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2506,11 +1417,9 @@ SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMA - SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER BufferLength, SQLINTEGER *StringLength) - { -- struct SQLGetStmtAttrW_params params = { 0, Attribute, Value, BufferLength, StringLength }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, -+ FIXME("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, - Attribute, Value, BufferLength, StringLength); - - if (!Value) -@@ -2519,11 +1428,6 @@ SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, - return SQL_ERROR; - } - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetStmtAttrW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2533,18 +1437,11 @@ SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, - SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER StringLength) - { -- struct SQLSetConnectAttrW_params params = { 0, Attribute, Value, StringLength }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, -- Value, StringLength); -- -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value, -+ StringLength); - -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLSetConnectAttrW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2555,21 +1452,14 @@ SQLRETURN WINAPI SQLColumnsW(SQLHSTMT StatementHandle, WCHAR *CatalogName, SQLSM - WCHAR *SchemaName, SQLSMALLINT NameLength2, WCHAR *TableName, - SQLSMALLINT NameLength3, WCHAR *ColumnName, SQLSMALLINT NameLength4) - { -- struct SQLColumnsW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, -- NameLength3, ColumnName, NameLength4 }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," -+ FIXME("(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); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLColumnsW, ¶ms ); -- TRACE("Returning %d\n", ret); -+ FIXME("Returning %d\n", ret); - return ret; - } - -@@ -2580,21 +1470,13 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl - SQLSMALLINT Length, WCHAR *OutConnectionString, SQLSMALLINT BufferLength, - SQLSMALLINT *Length2, SQLUSMALLINT DriverCompletion) - { -- struct SQLDriverConnectW_params params = { 0, WindowHandle, InConnectionString, Length, OutConnectionString, -- BufferLength, Length2, DriverCompletion }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(ConnectionHandle %p, WindowHandle %p, InConnectionString %s, Length %d, OutConnectionString %p," -+ FIXME("(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, - DriverCompletion); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLDriverConnectW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2603,17 +1485,10 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl - */ - SQLRETURN WINAPI SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value) - { -- struct SQLGetConnectOptionW_params params = { 0, Option, Value }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(ConnectionHandle %p, Option %d, Value %p)\n", ConnectionHandle, Option, Value); -+ FIXME("(ConnectionHandle %p, Option %d, Value %p)\n", ConnectionHandle, Option, Value); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetConnectOptionW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2623,18 +1498,11 @@ SQLRETURN WINAPI SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Opt - SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, - SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) - { -- struct SQLGetInfoW_params params = { 0, InfoType, InfoValue, BufferLength, StringLength }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, -+ FIXME("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, - InfoType, InfoValue, BufferLength, StringLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetInfoW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2643,17 +1511,10 @@ SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQ - */ - SQLRETURN WINAPI SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType) - { -- struct SQLGetTypeInfoW_params params = { 0, DataType }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); -+ FIXME("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLGetTypeInfoW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2662,17 +1523,10 @@ SQLRETURN WINAPI SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType) - */ - SQLRETURN WINAPI SQLSetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value) - { -- struct SQLSetConnectOptionW_params params = { 0, Option, Value }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -- -- TRACE("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle, Option, debugstr_sqllen(Value)); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle, Option, debugstr_sqllen(Value)); - -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLSetConnectOptionW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2684,21 +1538,13 @@ SQLRETURN WINAPI SQLSpecialColumnsW(SQLHSTMT StatementHandle, SQLUSMALLINT Ident - SQLSMALLINT NameLength2, SQLWCHAR *TableName, SQLSMALLINT NameLength3, - SQLUSMALLINT Scope, SQLUSMALLINT Nullable) - { -- struct SQLSpecialColumnsW_params params = { 0, IdentifierType, CatalogName, NameLength1, SchemaName, NameLength2, -- TableName, NameLength3, Scope, Nullable }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, IdentifierType %d, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d," -+ FIXME("(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); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLSpecialColumnsW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2709,21 +1555,13 @@ SQLRETURN WINAPI SQLStatisticsW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, - SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, - SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved) - { -- struct SQLStatisticsW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, -- NameLength3, Unique, Reserved }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d SchemaName %s, NameLength2 %d, TableName %s" -+ FIXME("(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); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLStatisticsW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2734,71 +1572,47 @@ SQLRETURN WINAPI SQLTablesW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQL - SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, - SQLSMALLINT NameLength3, SQLWCHAR *TableType, SQLSMALLINT NameLength4) - { -- struct SQLTablesW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, -- NameLength3, TableType, NameLength4 }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," -+ FIXME("(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); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLTablesW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLBrowseConnectW [ODBC32.155] - */ --SQLRETURN WINAPI SQLBrowseConnectW(SQLHDBC ConnectionHandle, SQLWCHAR *InConnectionString, SQLSMALLINT StringLength1, -- SQLWCHAR *OutConnectionString, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength2) -+SQLRETURN WINAPI SQLBrowseConnectW(SQLHDBC hdbc, SQLWCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, -+ SQLWCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, -+ SQLSMALLINT *pcbConnStrOut) - { -- struct SQLBrowseConnectW_params params = { 0, InConnectionString, StringLength1, OutConnectionString, -- BufferLength, StringLength2 }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -- -- TRACE("(ConnectionHandle %p, InConnectionString %s, StringLength1 %d, OutConnectionString %p, BufferLength %d, " -- "StringLength2 %p)\n", ConnectionHandle, debugstr_wn(InConnectionString, StringLength1), StringLength1, -- OutConnectionString, BufferLength, StringLength2); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(hdbc %p, szConnStrIn %s, cbConnStrIn %d, szConnStrOut %p, cbConnStrOutMax %d, pcbConnStrOut %p)\n", -+ hdbc, debugstr_wn(szConnStrIn, cbConnStrIn), cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut); - -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLBrowseConnectW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLColumnPrivilegesW [ODBC32.156] - */ --SQLRETURN WINAPI SQLColumnPrivilegesW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, -- SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, -- SQLSMALLINT NameLength3, SQLWCHAR *ColumnName, SQLSMALLINT NameLength4) -+SQLRETURN WINAPI SQLColumnPrivilegesW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, -+ SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, -+ SQLSMALLINT cbTableName, SQLWCHAR *szColumnName, SQLSMALLINT cbColumnName) - { -- struct SQLColumnPrivilegesW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, -- TableName, NameLength3, ColumnName, NameLength4 }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- 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); -+ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," -+ " cbTableName %d, szColumnName %s, cbColumnName %d)\n", hstmt, -+ debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName, -+ debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, -+ debugstr_wn(szTableName, cbTableName), cbTableName, -+ debugstr_wn(szColumnName, cbColumnName), cbColumnName); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLColumnPrivilegesW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -2809,215 +1623,136 @@ SQLRETURN WINAPI SQLDataSourcesW(SQLHENV EnvironmentHandle, SQLUSMALLINT Directi - SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, WCHAR *Description, - SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2) - { -- struct SQLDataSourcesW_params params = { 0, Direction, ServerName, BufferLength1, NameLength1, Description, -- BufferLength2, NameLength2 }; -- struct handle *handle = EnvironmentHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_NO_DATA; - -- TRACE("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p," -+ FIXME("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p," - " BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle, Direction, ServerName, BufferLength1, - NameLength1, Description, BufferLength2, NameLength2); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.EnvironmentHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLDataSourcesW, ¶ms ); -- -- if (ret >= 0 && TRACE_ON(odbc)) -- { -- if (ServerName && NameLength1 && *NameLength1 > 0) -- TRACE(" DataSource %s", debugstr_wn(ServerName, *NameLength1)); -- if (Description && NameLength2 && *NameLength2 > 0) -- TRACE(" Description %s", debugstr_wn(Description, *NameLength2)); -- TRACE("\n"); -- } -- -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLForeignKeysW [ODBC32.160] - */ --SQLRETURN WINAPI SQLForeignKeysW(SQLHSTMT StatementHandle, SQLWCHAR *PkCatalogName, SQLSMALLINT NameLength1, -- SQLWCHAR *PkSchemaName, SQLSMALLINT NameLength2, SQLWCHAR *PkTableName, -- SQLSMALLINT NameLength3, SQLWCHAR *FkCatalogName, SQLSMALLINT NameLength4, -- SQLWCHAR *FkSchemaName, SQLSMALLINT NameLength5, SQLWCHAR *FkTableName, -- SQLSMALLINT NameLength6) -+SQLRETURN WINAPI SQLForeignKeysW(SQLHSTMT hstmt, SQLWCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName, -+ SQLWCHAR *szPkSchemaName, SQLSMALLINT cbPkSchemaName, SQLWCHAR *szPkTableName, -+ SQLSMALLINT cbPkTableName, SQLWCHAR *szFkCatalogName, -+ SQLSMALLINT cbFkCatalogName, SQLWCHAR *szFkSchemaName, -+ SQLSMALLINT cbFkSchemaName, SQLWCHAR *szFkTableName, SQLSMALLINT cbFkTableName) - { -- struct SQLForeignKeysW_params params = { 0, PkCatalogName, NameLength1, PkSchemaName, NameLength2, -- PkTableName, NameLength2, FkCatalogName, NameLength3, -- FkSchemaName, NameLength5, FkTableName, NameLength6 }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- 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); -+ FIXME("(hstmt %p, szPkCatalogName %s, cbPkCatalogName %d, szPkSchemaName %s, cbPkSchemaName %d," -+ " szPkTableName %s, cbPkTableName %d, szFkCatalogName %s, cbFkCatalogName %d, szFkSchemaName %s," -+ " cbFkSchemaName %d, szFkTableName %s, cbFkTableName %d)\n", hstmt, -+ debugstr_wn(szPkCatalogName, cbPkCatalogName), cbPkCatalogName, -+ debugstr_wn(szPkSchemaName, cbPkSchemaName), cbPkSchemaName, -+ debugstr_wn(szPkTableName, cbPkTableName), cbPkTableName, -+ debugstr_wn(szFkCatalogName, cbFkCatalogName), cbFkCatalogName, -+ debugstr_wn(szFkSchemaName, cbFkSchemaName), cbFkSchemaName, -+ debugstr_wn(szFkTableName, cbFkTableName), cbFkTableName); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLForeignKeysW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLNativeSqlW [ODBC32.162] - */ --SQLRETURN WINAPI SQLNativeSqlW(SQLHDBC ConnectionHandle, SQLWCHAR *InStatementText, SQLINTEGER TextLength1, -- SQLWCHAR *OutStatementText, SQLINTEGER BufferLength, SQLINTEGER *TextLength2) -+SQLRETURN WINAPI SQLNativeSqlW(SQLHDBC hdbc, SQLWCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLWCHAR *szSqlStr, -+ SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr) - { -- struct SQLNativeSqlW_params params = { 0, InStatementText, TextLength1, OutStatementText, BufferLength, -- TextLength2 }; -- struct handle *handle = ConnectionHandle; -- SQLRETURN ret; -- -- TRACE("(ConnectionHandle %p, InStatementText %s, TextLength1 %d, OutStatementText %p, BufferLength %d, " -- "TextLength2 %p)\n", ConnectionHandle, debugstr_wn(InStatementText, TextLength1), TextLength1, -- OutStatementText, BufferLength, TextLength2); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc, -+ debugstr_wn(szSqlStrIn, cbSqlStrIn), cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr); - -- params.ConnectionHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLNativeSqlW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLPrimaryKeysW [ODBC32.165] - */ --SQLRETURN WINAPI SQLPrimaryKeysW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, -- SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, -- SQLSMALLINT NameLength3) -+SQLRETURN WINAPI SQLPrimaryKeysW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, -+ SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, -+ SQLSMALLINT cbTableName) - { -- struct SQLPrimaryKeysW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, -- NameLength2 }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ 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); -+ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," -+ " cbTableName %d)\n", hstmt, -+ debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName, -+ debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, -+ debugstr_wn(szTableName, cbTableName), cbTableName); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLPrimaryKeysW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLProcedureColumnsW [ODBC32.166] - */ --SQLRETURN WINAPI SQLProcedureColumnsW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, -- SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *ProcName, -- SQLSMALLINT NameLength3, SQLWCHAR *ColumnName, SQLSMALLINT NameLength4 ) -+SQLRETURN WINAPI SQLProcedureColumnsW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, -+ SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szProcName, -+ SQLSMALLINT cbProcName, SQLWCHAR *szColumnName, SQLSMALLINT cbColumnName) - { -- struct SQLProcedureColumnsW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, -- ProcName, NameLength3, ColumnName, NameLength4 }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -- -- 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); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," -+ " cbProcName %d, szColumnName %s, cbColumnName %d)\n", hstmt, -+ debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName, -+ debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, -+ debugstr_wn(szProcName, cbProcName), cbProcName, -+ debugstr_wn(szColumnName, cbColumnName), cbColumnName); - -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLProcedureColumnsW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLProceduresW [ODBC32.167] - */ --SQLRETURN WINAPI SQLProceduresW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, -- SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *ProcName, -- SQLSMALLINT NameLength3) -+SQLRETURN WINAPI SQLProceduresW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, -+ SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szProcName, -+ SQLSMALLINT cbProcName) - { -- struct SQLProceduresW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, ProcName, -- NameLength3 }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -- -- 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); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," -+ " cbProcName %d)\n", hstmt, debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName, -+ debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, debugstr_wn(szProcName, cbProcName), cbProcName); - -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLProceduresW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLTablePrivilegesW [ODBC32.170] - */ --SQLRETURN WINAPI SQLTablePrivilegesW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, -- SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, -- SQLSMALLINT NameLength3) -+SQLRETURN WINAPI SQLTablePrivilegesW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, -+ SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, -+ SQLSMALLINT cbTableName) - { -- struct SQLTablePrivilegesW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, -- NameLength3 }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -+ 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); -+ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," -+ " cbTableName %d)\n", hstmt, debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName, -+ debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, debugstr_wn(szTableName, cbTableName), cbTableName); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLTablePrivilegesW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - - /************************************************************************* - * SQLDriversW [ODBC32.171] - */ --SQLRETURN WINAPI SQLDriversW(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLWCHAR *DriverDescription, -- SQLSMALLINT BufferLength1, SQLSMALLINT *DescriptionLength, SQLWCHAR *DriverAttributes, -- SQLSMALLINT BufferLength2, SQLSMALLINT *AttributesLength) -+SQLRETURN WINAPI SQLDriversW(SQLHENV EnvironmentHandle, SQLUSMALLINT fDirection, SQLWCHAR *szDriverDesc, -+ SQLSMALLINT cbDriverDescMax, SQLSMALLINT *pcbDriverDesc, -+ SQLWCHAR *szDriverAttributes, SQLSMALLINT cbDriverAttrMax, -+ SQLSMALLINT *pcbDriverAttr) - { -- struct SQLDriversW_params params = { 0, Direction, DriverDescription, BufferLength1, DescriptionLength, -- DriverAttributes, BufferLength2, AttributesLength }; -- struct handle *handle = EnvironmentHandle; -- SQLRETURN ret; -- -- TRACE("(EnvironmentHandle %p, Direction %d, DriverDescription %p, BufferLength1 %d, DescriptionLength %p," -- " DriverAttributes %p, BufferLength2 %d, AttributesLength %p)\n", EnvironmentHandle, Direction, -- DriverDescription, BufferLength1, DescriptionLength, DriverAttributes, BufferLength2, AttributesLength); -+ SQLRETURN ret = SQL_NO_DATA; - -- if (!handle) return SQL_INVALID_HANDLE; -+ FIXME("(EnvironmentHandle %p, Direction %d, szDriverDesc %p, cbDriverDescMax %d, pcbDriverDesc %p," -+ " DriverAttributes %p, cbDriverAttrMax %d, pcbDriverAttr %p)\n", EnvironmentHandle, fDirection, -+ szDriverDesc, cbDriverDescMax, pcbDriverDesc, szDriverAttributes, cbDriverAttrMax, pcbDriverAttr); - -- params.EnvironmentHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLDriversW, ¶ms ); -- -- if (ret == SQL_NO_DATA && Direction == SQL_FETCH_FIRST) -- ERR_(winediag)("No ODBC drivers could be found. Check the settings for your libodbc provider.\n"); -- -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -3027,18 +1762,11 @@ SQLRETURN WINAPI SQLDriversW(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, - SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, - SQLPOINTER Value, SQLINTEGER BufferLength) - { -- struct SQLSetDescFieldW_params params = { 0, RecNumber, FieldIdentifier, Value, BufferLength }; -- struct handle *handle = DescriptorHandle; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle, -+ FIXME("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle, - RecNumber, FieldIdentifier, Value, BufferLength); - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.DescriptorHandle = handle->unix_handle; -- ret = ODBC_CALL( SQLSetDescFieldW, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -3048,28 +1776,11 @@ SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumb - SQLRETURN WINAPI SQLSetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER StringLength) - { -- struct SQLSetStmtAttrW_params params = { 0, Attribute, Value, StringLength }; -- struct handle *handle = StatementHandle; -- SQLRETURN ret; -- -- TRACE("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, -- Value, StringLength); -+ SQLRETURN ret = SQL_ERROR; - -- if (!handle) return SQL_INVALID_HANDLE; -- -- params.StatementHandle = handle->unix_handle; -- if (SUCCESS((ret = ODBC_CALL( SQLSetStmtAttrW, ¶ms )))) -- { -- SQLULEN row_count = (SQLULEN)Value; -- if (Attribute == SQL_ATTR_ROW_ARRAY_SIZE && row_count != handle->row_count) -- { -- TRACE( "resizing result length array\n" ); -- if (!resize_result_lengths( handle, row_count )) ret = SQL_ERROR; -- else handle->row_count = row_count; -- } -- } -+ FIXME("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value, -+ StringLength); - -- TRACE("Returning %d\n", ret); - return ret; - } - -@@ -3077,34 +1788,14 @@ SQLRETURN WINAPI SQLSetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, - * SQLGetDiagRecA [ODBC32.236] - */ - SQLRETURN WINAPI SQLGetDiagRecA(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, -- SQLCHAR *SqlState, SQLINTEGER *NativeError, SQLCHAR *MessageText, -+ SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText, - SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) - { -- return SQLGetDiagRec( HandleType, Handle, RecNumber, SqlState, NativeError, MessageText, BufferLength, -- TextLength ); --} -- --/*********************************************************************** -- * DllMain [Internal] Initializes the internal 'ODBC32.DLL'. -- */ --BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved) --{ -- TRACE("proxy ODBC: %p,%lx,%p\n", hinstDLL, reason, reserved); -+ SQLRETURN ret = SQL_ERROR; - -- switch (reason) -- { -- case DLL_PROCESS_ATTACH: -- DisableThreadLibraryCalls(hinstDLL); -- if (!__wine_init_unix_call()) -- { -- if (WINE_UNIX_CALL( process_attach, NULL )) __wine_unixlib_handle = 0; -- } -- IsWow64Process( GetCurrentProcess(), &is_wow64 ); -- break; -- -- case DLL_PROCESS_DETACH: -- if (reserved) break; -- } -+ FIXME("(HandleType %d, Handle %p, RecNumber %d, Sqlstate %p, NativeError %p, MessageText %p, BufferLength %d," -+ " TextLength %p)\n", HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength, -+ TextLength); - -- return TRUE; -+ return ret; - } -diff --git a/dlls/odbc32/unixlib.c b/dlls/odbc32/unixlib.c -deleted file mode 100644 -index cc963c5a893..00000000000 ---- a/dlls/odbc32/unixlib.c -+++ /dev/null -@@ -1,3673 +0,0 @@ --/* -- * Win32 ODBC functions -- * -- * Copyright 1999 Xiang Li, Corel Corporation -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Lesser General Public License for more details. -- * -- * You should have received a copy of the GNU Lesser General Public -- * License along with this library; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -- */ -- --#if 0 --#pragma makedep unix --#endif -- --#include "config.h" -- --#include --#include --#include --#include -- --#include "ntstatus.h" --#define WIN32_NO_STATUS --#include "windef.h" --#include "winbase.h" --#include "winternl.h" --#include "sql.h" --#include "sqlucode.h" --#include "sqlext.h" -- --#include "wine/debug.h" --#include "unixlib.h" -- --WINE_DEFAULT_DEBUG_CHANNEL(odbc); -- --static inline void init_unicode_string( UNICODE_STRING *str, const WCHAR *data, ULONG data_size ) --{ -- str->Length = str->MaximumLength = data_size; -- str->Buffer = (WCHAR *)data; --} -- --static inline void ascii_to_unicode( WCHAR *dst, const char *src, size_t len ) --{ -- while (len--) *dst++ = (unsigned char)*src++; --} -- --static HANDLE create_hkcu_key( const WCHAR *path, ULONG path_size ) --{ -- NTSTATUS status; -- char buffer[512 + ARRAY_SIZE("\\Registry\\User\\")]; -- WCHAR bufferW[512 + ARRAY_SIZE("\\Registry\\User\\")]; -- DWORD_PTR sid_data[(sizeof(TOKEN_USER) + SECURITY_MAX_SID_SIZE) / sizeof(DWORD_PTR)]; -- DWORD i, len = sizeof(sid_data); -- SID *sid; -- UNICODE_STRING str; -- OBJECT_ATTRIBUTES attr; -- HANDLE ret; -- -- status = NtQueryInformationToken( GetCurrentThreadEffectiveToken(), TokenUser, sid_data, len, &len ); -- if (status) return NULL; -- -- sid = ((TOKEN_USER *)sid_data)->User.Sid; -- len = snprintf( buffer, sizeof(buffer), "\\Registry\\User\\S-%u-%u", sid->Revision, -- (int)MAKELONG( MAKEWORD( sid->IdentifierAuthority.Value[5], sid->IdentifierAuthority.Value[4] ), -- MAKEWORD( sid->IdentifierAuthority.Value[3], sid->IdentifierAuthority.Value[2] ))); -- for (i = 0; i < sid->SubAuthorityCount; i++) -- len += snprintf( buffer + len, sizeof(buffer) - len, "-%u", (int)sid->SubAuthority[i] ); -- buffer[len++] = '\\'; -- -- ascii_to_unicode( bufferW, buffer, len ); -- memcpy( bufferW + len, path, path_size ); -- init_unicode_string( &str, bufferW, len * sizeof(WCHAR) + path_size ); -- InitializeObjectAttributes( &attr, &str, OBJ_CASE_INSENSITIVE, 0, NULL ); -- if (!NtCreateKey( &ret, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL )) return ret; -- return NULL; --} -- --static HANDLE create_hklm_key( const WCHAR *path, ULONG path_size ) --{ -- static const WCHAR machineW[] = {'\\','R','e','g','i','s','t','r','y','\\','M','a','c','h','i','n','e','\\'}; -- OBJECT_ATTRIBUTES attr; -- UNICODE_STRING str; -- WCHAR bufferW[256 + ARRAY_SIZE(machineW)]; -- HANDLE ret; -- -- memcpy( bufferW, machineW, sizeof(machineW) ); -- memcpy( bufferW + ARRAY_SIZE(machineW), path, path_size ); -- init_unicode_string( &str, bufferW, sizeof(machineW) + path_size ); -- InitializeObjectAttributes( &attr, &str, OBJ_CASE_INSENSITIVE, 0, NULL ); -- if (!NtCreateKey( &ret, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL )) return ret; -- return NULL; --} -- --static HANDLE create_key( HANDLE root, const WCHAR *path, ULONG path_size, ULONG options, ULONG *disposition ) --{ -- UNICODE_STRING name = { path_size, path_size, (WCHAR *)path }; -- OBJECT_ATTRIBUTES attr; -- HANDLE ret; -- -- attr.Length = sizeof(attr); -- attr.RootDirectory = root; -- attr.ObjectName = &name; -- attr.Attributes = 0; -- attr.SecurityDescriptor = NULL; -- attr.SecurityQualityOfService = NULL; -- if (NtCreateKey( &ret, MAXIMUM_ALLOWED, &attr, 0, NULL, options, disposition )) return NULL; -- return ret; --} -- --static ULONG query_value( HANDLE key, const WCHAR *name, ULONG name_size, KEY_VALUE_PARTIAL_INFORMATION *info, -- ULONG size ) --{ -- UNICODE_STRING str = { name_size, name_size, (WCHAR *)name }; -- if (NtQueryValueKey( key, &str, KeyValuePartialInformation, info, size, &size )) return 0; -- return size - FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data); --} -- --static BOOL set_value( HANDLE key, const WCHAR *name, ULONG name_size, ULONG type, const void *value, ULONG count ) --{ -- UNICODE_STRING str = { name_size, name_size, (WCHAR *)name }; -- return !NtSetValueKey( key, &str, 0, type, value, count ); --} -- --/*********************************************************************** -- * odbc_replicate_odbcinst_to_registry -- * -- * Utility to odbc_replicate_odbcinst_to_registry() to replicate the drivers of the -- * ODBCINST.INI settings -- * -- * The driver settings are not replicated to the registry. If we were to -- * replicate them we would need to decide whether to replicate all settings -- * or to do some translation; whether to remove any entries present only in -- * the windows registry, etc. -- */ --static void replicate_odbcinst_to_registry( SQLHENV env ) --{ -- static const WCHAR odbcW[] = {'S','o','f','t','w','a','r','e','\\','O','D','B','C'}; -- static const WCHAR odbcinstW[] = {'O','D','B','C','I','N','S','T','.','I','N','I'}; -- static const WCHAR driversW[] = {'O','D','B','C',' ','D','r','i','v','e','r','s'}; -- HANDLE key_odbc, key_odbcinst, key_drivers; -- BOOL success = FALSE; -- -- if (!(key_odbc = create_hklm_key( odbcW, sizeof(odbcW) ))) return; -- -- if ((key_odbcinst = create_key( key_odbc, odbcinstW, sizeof(odbcinstW), 0, NULL ))) -- { -- if ((key_drivers = create_key( key_odbcinst, driversW, sizeof(driversW), 0, NULL ))) -- { -- SQLRETURN ret; -- SQLUSMALLINT dir = SQL_FETCH_FIRST; -- WCHAR desc [256]; -- SQLSMALLINT len; -- -- success = TRUE; -- while (SUCCESS((ret = SQLDriversW( env, dir, (SQLWCHAR *)desc, sizeof(desc), &len, NULL, 0, NULL )))) -- { -- dir = SQL_FETCH_NEXT; -- if (len == lstrlenW( desc )) -- { -- static const WCHAR installedW[] = {'I','n','s','t','a','l','l','e','d',0}; -- HANDLE key_driver; -- WCHAR buffer[256]; -- KEY_VALUE_PARTIAL_INFORMATION *info = (void *)buffer; -- -- if (!query_value( key_drivers, desc, len * sizeof(WCHAR), info, sizeof(buffer) )) -- { -- if (!set_value( key_drivers, desc, len * sizeof(WCHAR), REG_SZ, (const BYTE *)installedW, -- sizeof(installedW) )) -- { -- TRACE( "error replicating driver %s\n", debugstr_w(desc) ); -- success = FALSE; -- } -- } -- if ((key_driver = create_key( key_odbcinst, desc, lstrlenW( desc ) * sizeof(WCHAR), 0, NULL ))) -- NtClose( key_driver ); -- else -- { -- TRACE( "error ensuring driver key %s\n", debugstr_w(desc) ); -- success = FALSE; -- } -- } -- else -- { -- WARN( "unusually long driver name %s not replicated\n", debugstr_w(desc) ); -- success = FALSE; -- } -- } -- NtClose( key_drivers ); -- } -- else TRACE( "error opening Drivers key\n" ); -- -- NtClose( key_odbcinst ); -- } -- else TRACE( "error creating/opening ODBCINST.INI key\n" ); -- -- if (!success) WARN( "may not have replicated all ODBC drivers to the registry\n" ); -- NtClose( key_odbc ); --} -- --/*********************************************************************** -- * replicate_odbc_to_registry -- * -- * Utility to replicate_to_registry() to replicate either the USER or -- * SYSTEM data sources. -- * -- * For now simply place the "Driver description" (as returned by SQLDataSources) -- * into the registry as the driver. This is enough to satisfy Crystal's -- * requirement that there be a driver entry. (It doesn't seem to care what -- * the setting is). -- * A slightly more accurate setting would be to access the registry to find -- * the actual driver library for the given description (which appears to map -- * to one of the HKLM/Software/ODBC/ODBCINST.INI keys). (If you do this note -- * that this will add a requirement that this function be called after -- * replicate_odbcinst_to_registry()) -- */ --static void replicate_odbc_to_registry( BOOL is_user, SQLHENV env ) --{ -- static const WCHAR odbcW[] = {'S','o','f','t','w','a','r','e','\\','O','D','B','C'}; -- static const WCHAR odbciniW[] = {'O','D','B','C','.','I','N','I'}; -- HANDLE key_odbc, key_odbcini, key_source; -- SQLRETURN ret; -- SQLUSMALLINT dir; -- WCHAR dsn[SQL_MAX_DSN_LENGTH + 1], desc[256]; -- SQLSMALLINT len_dsn, len_desc; -- BOOL success = FALSE; -- const char *which; -- -- if (is_user) -- { -- key_odbc = create_hkcu_key( odbcW, sizeof(odbcW) ); -- which = "user"; -- } -- else -- { -- key_odbc = create_hklm_key( odbcW, sizeof(odbcW) ); -- which = "system"; -- } -- if (!key_odbc) return; -- -- if ((key_odbcini = create_key( key_odbc, odbciniW, sizeof(odbciniW), 0, NULL ))) -- { -- success = TRUE; -- dir = is_user ? SQL_FETCH_FIRST_USER : SQL_FETCH_FIRST_SYSTEM; -- while (SUCCESS((ret = SQLDataSourcesW( env, dir, (SQLWCHAR *)dsn, sizeof(dsn), &len_dsn, (SQLWCHAR *)desc, -- sizeof(desc), &len_desc )))) -- { -- dir = SQL_FETCH_NEXT; -- if (len_dsn == lstrlenW( dsn ) && len_desc == lstrlenW( desc )) -- { -- if ((key_source = create_key( key_odbcini, dsn, len_dsn * sizeof(WCHAR), 0, NULL ))) -- { -- static const WCHAR driverW[] = {'D','r','i','v','e','r'}; -- WCHAR buffer[256]; -- KEY_VALUE_PARTIAL_INFORMATION *info = (void *)buffer; -- ULONG size; -- -- if (!(size = query_value( key_source, driverW, sizeof(driverW), info, sizeof(buffer) ))) -- { -- if (!set_value( key_source, driverW, sizeof(driverW), REG_SZ, (const BYTE *)desc, -- len_desc * sizeof(WCHAR) )) -- { -- TRACE( "error replicating description of %s (%s)\n", debugstr_w(dsn), debugstr_w(desc) ); -- success = FALSE; -- } -- } -- NtClose( key_source ); -- } -- else -- { -- TRACE( "error opening %s DSN key %s\n", which, debugstr_w(dsn) ); -- success = FALSE; -- } -- } -- else -- { -- WARN( "unusually long %s data source name %s (%s) not replicated\n", which, debugstr_w(dsn), debugstr_w(desc) ); -- success = FALSE; -- } -- } -- NtClose( key_odbcini ); -- } -- else TRACE( "error creating/opening %s ODBC.INI registry key\n", which ); -- -- if (!success) WARN( "may not have replicated all %s ODBC DSNs to the registry\n", which ); -- NtClose( key_odbc ); --} -- --/*********************************************************************** -- * replicate_to_registry -- * -- * Unfortunately some of the functions that Windows documents as being part -- * of the ODBC API it implements directly during compilation or something -- * in terms of registry access functions. -- * e.g. SQLGetInstalledDrivers queries the list at -- * HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\ODBC Drivers -- * -- * This function is called when the driver manager is loaded and is used -- * to replicate the appropriate details into the Wine registry -- */ --static void replicate_to_registry(void) --{ -- SQLHENV env; -- SQLRETURN ret; -- -- if (!(ret = SQLAllocEnv( &env ))) -- { -- replicate_odbcinst_to_registry( env ); -- replicate_odbc_to_registry( FALSE /* system dsn */, env ); -- replicate_odbc_to_registry( TRUE /* user dsn */, env ); -- SQLFreeEnv( env ); -- } -- else -- { -- TRACE( "error %d opening an SQL environment\n", (int)ret ); -- WARN( "external ODBC settings have not been replicated to the Wine registry\n" ); -- } --} -- --static NTSTATUS odbc_process_attach( void *args ) --{ -- replicate_to_registry(); -- return STATUS_SUCCESS; --} -- --static NTSTATUS wrap_SQLAllocConnect( void *args ) --{ -- struct SQLAllocConnect_params *params = args; -- return SQLAllocConnect( (SQLHENV)(ULONG_PTR)params->EnvironmentHandle, (SQLHDBC *)¶ms->ConnectionHandle ); --} -- --static NTSTATUS wrap_SQLAllocEnv( void *args ) --{ -- struct SQLAllocEnv_params *params = args; -- return SQLAllocEnv( (SQLHENV *)¶ms->EnvironmentHandle ); --} -- --static NTSTATUS wrap_SQLAllocHandle( void *args ) --{ -- struct SQLAllocHandle_params *params = args; -- return SQLAllocHandle( params->HandleType, (SQLHANDLE)(ULONG_PTR)params->InputHandle, -- (SQLHANDLE *)¶ms->OutputHandle ); --} -- --static NTSTATUS wrap_SQLAllocHandleStd( void *args ) --{ -- struct SQLAllocHandleStd_params *params = args; -- return SQLAllocHandleStd( params->HandleType, (SQLHANDLE)(ULONG_PTR)params->InputHandle, -- (SQLHANDLE *)¶ms->OutputHandle ); --} -- --static NTSTATUS wrap_SQLAllocStmt( void *args ) --{ -- struct SQLAllocStmt_params *params = args; -- return SQLAllocStmt( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, (SQLHSTMT *)¶ms->StatementHandle ); --} -- --static NTSTATUS wrap_SQLBindCol( void *args ) --{ -- struct SQLBindCol_params *params = args; -- return SQLBindCol( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ColumnNumber, params->TargetType, -- params->TargetValue, params->BufferLength, params->StrLen_or_Ind ); --} -- --static NTSTATUS wrap_SQLBindParam( void *args ) --{ -- struct SQLBindParam_params *params = args; -- return SQLBindParam( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ParameterNumber, params->ValueType, -- params->ParameterType, params->LengthPrecision, params->ParameterScale, -- params->ParameterValue, params->StrLen_or_Ind ); --} -- --static NTSTATUS wrap_SQLBindParameter( void *args ) --{ -- struct SQLBindParameter_params *params = args; -- return SQLBindParameter( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ParameterNumber, -- params->InputOutputType, params->ValueType, params->ParameterType, params->ColumnSize, -- params->DecimalDigits, params->ParameterValue, params->BufferLength, -- params->StrLen_or_Ind ); --} -- --static NTSTATUS wrap_SQLBrowseConnect( void *args ) --{ -- struct SQLBrowseConnect_params *params = args; -- return SQLBrowseConnect( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->InConnectionString, -- params->StringLength1, params->OutConnectionString, params->BufferLength, -- params->StringLength2 ); --} -- --static NTSTATUS wrap_SQLBrowseConnectW( void *args ) --{ -- struct SQLBrowseConnectW_params *params = args; -- return SQLBrowseConnectW( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->InConnectionString, -- params->StringLength1, params->OutConnectionString, params->BufferLength, -- params->StringLength2 ); --} -- --static NTSTATUS wrap_SQLBulkOperations( void *args ) --{ -- struct SQLBulkOperations_params *params = args; -- return SQLBulkOperations( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Operation ); --} -- --static NTSTATUS wrap_SQLCancel( void *args ) --{ -- struct SQLCancel_params *params = args; -- return SQLCancel( (SQLHSTMT)(ULONG_PTR)params->StatementHandle ); --} -- --static NTSTATUS wrap_SQLCloseCursor( void *args ) --{ -- struct SQLCloseCursor_params *params = args; -- return SQLCloseCursor( (SQLHSTMT)(ULONG_PTR)params->StatementHandle ); --} -- --static NTSTATUS wrap_SQLColAttribute( void *args ) --{ -- struct SQLColAttribute_params *params = args; -- return SQLColAttribute( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ColumnNumber, -- params->FieldIdentifier, params->CharacterAttribute, params->BufferLength, -- params->StringLength, (SQLLEN *)(ULONG_PTR)params->NumericAttribute ); --} -- --static NTSTATUS wrap_SQLColAttributeW( void *args ) --{ -- struct SQLColAttributeW_params *params = args; -- return SQLColAttributeW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ColumnNumber, -- params->FieldIdentifier, params->CharacterAttribute, -- params->BufferLength, params->StringLength, -- (SQLLEN *)(ULONG_PTR)params->NumericAttribute ); --} -- --static NTSTATUS wrap_SQLColAttributes( void *args ) --{ -- struct SQLColAttributes_params *params = args; -- return SQLColAttributes( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ColumnNumber, -- params->FieldIdentifier, params->CharacterAttributes, params->BufferLength, -- params->StringLength, (SQLLEN *)(ULONG_PTR)params->NumericAttributes ); --} -- --static NTSTATUS wrap_SQLColAttributesW( void *args ) --{ -- struct SQLColAttributesW_params *params = args; -- return SQLColAttributesW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ColumnNumber, -- params->FieldIdentifier, params->CharacterAttributes, params->BufferLength, -- params->StringLength, (SQLLEN *)(ULONG_PTR)params->NumericAttributes ); --} -- --static NTSTATUS wrap_SQLColumnPrivileges( void *args ) --{ -- struct SQLColumnPrivileges_params *params = args; -- return SQLColumnPrivileges( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, -- params->NameLength1, params->SchemaName, params->NameLength2, -- params->TableName, params->NameLength3, params->ColumnName, params->NameLength4 ); --} -- --static NTSTATUS wrap_SQLColumnPrivilegesW( void *args ) --{ -- struct SQLColumnPrivilegesW_params *params = args; -- return SQLColumnPrivilegesW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, -- params->NameLength1, params->SchemaName, params->NameLength2, -- params->TableName, params->NameLength3, params->ColumnName, params->NameLength4 ); --} -- --static NTSTATUS wrap_SQLColumns( void *args ) --{ -- struct SQLColumns_params *params = args; -- return SQLColumns( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, params->NameLength1, -- params->SchemaName, params->NameLength2, params->TableName, params->NameLength3, -- params->ColumnName, params->NameLength4 ); --} -- --static NTSTATUS wrap_SQLColumnsW( void *args ) --{ -- struct SQLColumnsW_params *params = args; -- return SQLColumnsW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, params->NameLength1, -- params->SchemaName, params->NameLength2, params->TableName, params->NameLength3, -- params->ColumnName, params->NameLength4 ); --} -- --static NTSTATUS wrap_SQLConnect( void *args ) --{ -- struct SQLConnect_params *params = args; -- return SQLConnect( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->ServerName, params->NameLength1, -- params->UserName, params->NameLength2, params->Authentication, params->NameLength3 ); --} -- --static NTSTATUS wrap_SQLConnectW( void *args ) --{ -- struct SQLConnectW_params *params = args; -- return SQLConnectW( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->ServerName, params->NameLength1, -- params->UserName, params->NameLength2, params->Authentication, params->NameLength3 ); --} -- --static NTSTATUS wrap_SQLCopyDesc( void *args ) --{ -- struct SQLCopyDesc_params *params = args; -- return SQLCopyDesc( (SQLHDESC)(ULONG_PTR)params->SourceDescHandle, (SQLHDESC)(ULONG_PTR)params->TargetDescHandle ); --} -- --static NTSTATUS wrap_SQLDataSources( void *args ) --{ -- struct SQLDataSources_params *params = args; -- return SQLDataSources( (SQLHENV)(ULONG_PTR)params->EnvironmentHandle, params->Direction, params->ServerName, -- params->BufferLength1, params->NameLength1, params->Description, -- params->BufferLength2, params->NameLength2 ); --} -- --static NTSTATUS wrap_SQLDataSourcesW( void *args ) --{ -- struct SQLDataSourcesW_params *params = args; -- return SQLDataSourcesW( (SQLHENV)(ULONG_PTR)params->EnvironmentHandle, params->Direction, params->ServerName, -- params->BufferLength1, params->NameLength1, params->Description, -- params->BufferLength2, params->NameLength2 ); --} -- --static NTSTATUS wrap_SQLDescribeCol( void *args ) --{ -- struct SQLDescribeCol_params *params = args; -- return SQLDescribeCol( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ColumnNumber, params->ColumnName, -- params->BufferLength, params->NameLength, params->DataType, -- (SQLULEN *)(ULONG_PTR)params->ColumnSize, params->DecimalDigits, params->Nullable ); --} -- --static NTSTATUS wrap_SQLDescribeColW( void *args ) --{ -- struct SQLDescribeColW_params *params = args; -- return SQLDescribeColW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ColumnNumber, params->ColumnName, -- params->BufferLength, params->NameLength, params->DataType, -- (SQLULEN *)(ULONG_PTR)params->ColumnSize, params->DecimalDigits, params->Nullable ); --} -- --static NTSTATUS wrap_SQLDescribeParam( void *args ) --{ -- struct SQLDescribeParam_params *params = args; -- return SQLDescribeParam( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ParameterNumber, params->DataType, -- (SQLULEN *)(ULONG_PTR)params->ParameterSize, params->DecimalDigits, params->Nullable ); --} -- --static NTSTATUS wrap_SQLDisconnect( void *args ) --{ -- struct SQLDisconnect_params *params = args; -- return SQLDisconnect( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle ); --} -- --static NTSTATUS wrap_SQLDriverConnect( void *args ) --{ -- struct SQLDriverConnect_params *params = args; -- return SQLDriverConnect( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, (SQLHWND)(ULONG_PTR)params->WindowHandle, -- params->ConnectionString, params->Length, params->OutConnectionString, -- params->BufferLength, params->Length2, params->DriverCompletion ); --} -- --static NTSTATUS wrap_SQLDriverConnectW( void *args ) --{ -- struct SQLDriverConnectW_params *params = args; -- return SQLDriverConnectW( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, (SQLHWND)(ULONG_PTR)params->WindowHandle, -- params->InConnectionString, params->Length, params->OutConnectionString, -- params->BufferLength, params->Length2, params->DriverCompletion ); --} -- --static NTSTATUS wrap_SQLDrivers( void *args ) --{ -- struct SQLDrivers_params *params = args; -- return SQLDrivers( (SQLHENV)(ULONG_PTR)params->EnvironmentHandle, params->Direction, params->DriverDescription, -- params->BufferLength1, params->DescriptionLength, params->DriverAttributes, -- params->BufferLength2, params->AttributesLength ); --} -- --static NTSTATUS wrap_SQLDriversW( void *args ) --{ -- struct SQLDriversW_params *params = args; -- return SQLDriversW( (SQLHENV)(ULONG_PTR)params->EnvironmentHandle, params->Direction, params->DriverDescription, -- params->BufferLength1, params->DescriptionLength, params->DriverAttributes, -- params->BufferLength2, params->AttributesLength ); --} -- --static NTSTATUS wrap_SQLEndTran( void *args ) --{ -- struct SQLEndTran_params *params = args; -- return SQLEndTran( params->HandleType, (SQLHANDLE)(ULONG_PTR)params->Handle, params->CompletionType ); --} -- --static NTSTATUS wrap_SQLError( void *args ) --{ -- struct SQLError_params *params = args; -- return SQLError( (SQLHENV)(ULONG_PTR)params->EnvironmentHandle, (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, -- (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->SqlState, params->NativeError, -- params->MessageText, params->BufferLength, params->TextLength ); --} -- --static NTSTATUS wrap_SQLErrorW( void *args ) --{ -- struct SQLErrorW_params *params = args; -- return SQLErrorW( (SQLHENV)(ULONG_PTR)params->EnvironmentHandle, (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, -- (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->SqlState, params->NativeError, -- params->MessageText, params->BufferLength, params->TextLength ); --} -- --static NTSTATUS wrap_SQLExecDirect( void *args ) --{ -- struct SQLExecDirect_params *params = args; -- return SQLExecDirect( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->StatementText, params->TextLength ); --} -- --static NTSTATUS wrap_SQLExecDirectW( void *args ) --{ -- struct SQLExecDirectW_params *params = args; -- return SQLExecDirectW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->StatementText, params->TextLength ); --} -- --static NTSTATUS wrap_SQLExecute( void *args ) --{ -- struct SQLExecute_params *params = args; -- return SQLExecute( (SQLHSTMT)(ULONG_PTR)params->StatementHandle ); --} -- --static NTSTATUS wrap_SQLExtendedFetch( void *args ) --{ -- struct SQLExtendedFetch_params *params = args; -- return SQLExtendedFetch( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->FetchOrientation, -- params->FetchOffset, (SQLULEN *)(ULONG_PTR)params->RowCount, params->RowStatusArray ); --} -- --static NTSTATUS wrap_SQLFetch( void *args ) --{ -- struct SQLFetch_params *params = args; -- return SQLFetch( (SQLHSTMT)(ULONG_PTR)params->StatementHandle ); --} -- --static NTSTATUS wrap_SQLFetchScroll( void *args ) --{ -- struct SQLFetchScroll_params *params = args; -- return SQLFetchScroll( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->FetchOrientation, -- params->FetchOffset ); --} -- --static NTSTATUS wrap_SQLForeignKeys( void *args ) --{ -- struct SQLForeignKeys_params *params = args; -- return SQLForeignKeys( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->PkCatalogName, -- params->NameLength1, params->PkSchemaName, params->NameLength2, -- params->PkTableName, params->NameLength3, params->FkCatalogName, -- params->NameLength4, params->FkSchemaName, params->NameLength5, -- params->FkTableName, params->NameLength6 ); --} -- --static NTSTATUS wrap_SQLForeignKeysW( void *args ) --{ -- struct SQLForeignKeysW_params *params = args; -- return SQLForeignKeysW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->PkCatalogName, -- params->NameLength1, params->PkSchemaName, params->NameLength2, -- params->PkTableName, params->NameLength3, params->FkCatalogName, -- params->NameLength4, params->FkSchemaName, params->NameLength5, -- params->FkTableName, params->NameLength6 ); --} -- --static NTSTATUS wrap_SQLFreeConnect( void *args ) --{ -- struct SQLFreeConnect_params *params = args; -- return SQLFreeConnect( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle ); --} -- --static NTSTATUS wrap_SQLFreeEnv( void *args ) --{ -- struct SQLFreeEnv_params *params = args; -- return SQLFreeEnv( (SQLHENV)(ULONG_PTR)params->EnvironmentHandle ); --} -- --static NTSTATUS wrap_SQLFreeHandle( void *args ) --{ -- struct SQLFreeHandle_params *params = args; -- return SQLFreeHandle( params->HandleType, (SQLHANDLE)(ULONG_PTR)params->Handle ); --} -- --static NTSTATUS wrap_SQLFreeStmt( void *args ) --{ -- struct SQLFreeStmt_params *params = args; -- return SQLFreeStmt( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Option ); --} -- --static NTSTATUS wrap_SQLGetConnectAttr( void *args ) --{ -- struct SQLGetConnectAttr_params *params = args; -- return SQLGetConnectAttr( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->Attribute, params->Value, -- params->BufferLength, params->StringLength ); --} -- --static NTSTATUS wrap_SQLGetConnectAttrW( void *args ) --{ -- struct SQLGetConnectAttrW_params *params = args; -- return SQLGetConnectAttrW( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->Attribute, params->Value, -- params->BufferLength, params->StringLength ); --} -- --static NTSTATUS wrap_SQLGetConnectOption( void *args ) --{ -- struct SQLGetConnectOption_params *params = args; -- return SQLGetConnectOption( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->Option, params->Value ); --} -- --static NTSTATUS wrap_SQLGetConnectOptionW( void *args ) --{ -- struct SQLGetConnectOptionW_params *params = args; -- return SQLGetConnectOptionW( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->Option, params->Value ); --} -- --static NTSTATUS wrap_SQLGetCursorName( void *args ) --{ -- struct SQLGetCursorName_params *params = args; -- return SQLGetCursorName( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CursorName, params->BufferLength, -- params->NameLength ); --} -- --static NTSTATUS wrap_SQLGetCursorNameW( void *args ) --{ -- struct SQLGetCursorNameW_params *params = args; -- return SQLGetCursorNameW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CursorName, params->BufferLength, -- params->NameLength ); --} -- --static NTSTATUS wrap_SQLGetData( void *args ) --{ -- struct SQLGetData_params *params = args; -- return SQLGetData( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ColumnNumber, params->TargetType, -- params->TargetValue, params->BufferLength, (SQLLEN *)(ULONG_PTR)params->StrLen_or_Ind ); --} -- --static NTSTATUS wrap_SQLGetDescField( void *args ) --{ -- struct SQLGetDescField_params *params = args; -- return SQLGetDescField( (SQLHDESC)(ULONG_PTR)params->DescriptorHandle, params->RecNumber, params->FieldIdentifier, -- params->Value, params->BufferLength, params->StringLength ); --} -- --static NTSTATUS wrap_SQLGetDescFieldW( void *args ) --{ -- struct SQLGetDescFieldW_params *params = args; -- return SQLGetDescFieldW( (SQLHDESC)(ULONG_PTR)params->DescriptorHandle, params->RecNumber, params->FieldIdentifier, -- params->Value, params->BufferLength, params->StringLength ); --} -- --static NTSTATUS wrap_SQLGetDescRec( void *args ) --{ -- struct SQLGetDescRec_params *params = args; -- return SQLGetDescRec( (SQLHDESC)(ULONG_PTR)params->DescriptorHandle, params->RecNumber, params->Name, -- params->BufferLength, params->StringLength, params->Type, params->SubType, -- (SQLLEN *)(ULONG_PTR)params->Length, params->Precision, params->Scale, params->Nullable ); --} -- --static NTSTATUS wrap_SQLGetDescRecW( void *args ) --{ -- struct SQLGetDescRecW_params *params = args; -- return SQLGetDescRecW( (SQLHDESC)(ULONG_PTR)params->DescriptorHandle, params->RecNumber, params->Name, -- params->BufferLength, params->StringLength, params->Type, params->SubType, -- (SQLLEN *)(ULONG_PTR)params->Length, params->Precision, params->Scale, params->Nullable ); --} -- --static NTSTATUS wrap_SQLGetDiagField( void *args ) --{ -- struct SQLGetDiagField_params *params = args; -- return SQLGetDiagField( params->HandleType, (SQLHANDLE)(ULONG_PTR)params->Handle, params->RecNumber, -- params->DiagIdentifier, params->DiagInfo, params->BufferLength, params->StringLength ); --} -- --static NTSTATUS wrap_SQLGetDiagFieldW( void *args ) --{ -- struct SQLGetDiagFieldW_params *params = args; -- return SQLGetDiagFieldW( params->HandleType, (SQLHANDLE)(ULONG_PTR)params->Handle, params->RecNumber, -- params->DiagIdentifier, params->DiagInfo, params->BufferLength, params->StringLength ); --} -- --static NTSTATUS wrap_SQLGetDiagRec( void *args ) --{ -- struct SQLGetDiagRec_params *params = args; -- return SQLGetDiagRec( params->HandleType, (SQLHANDLE)(ULONG_PTR)params->Handle, params->RecNumber, params->SqlState, -- params->NativeError, params->MessageText, params->BufferLength, params->TextLength ); --} -- --static NTSTATUS wrap_SQLGetDiagRecW( void *args ) --{ -- struct SQLGetDiagRecW_params *params = args; -- return SQLGetDiagRecW( params->HandleType, (SQLHANDLE)(ULONG_PTR)params->Handle, params->RecNumber, params->SqlState, -- params->NativeError, params->MessageText, params->BufferLength, params->TextLength ); --} -- --static NTSTATUS wrap_SQLGetEnvAttr( void *args ) --{ -- struct SQLGetEnvAttr_params *params = args; -- return SQLGetEnvAttr( (SQLHENV)(ULONG_PTR)params->EnvironmentHandle, params->Attribute, -- params->Value, params->BufferLength, params->StringLength ); --} -- --static NTSTATUS wrap_SQLGetFunctions( void *args ) --{ -- struct SQLGetFunctions_params *params = args; -- return SQLGetFunctions( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->FunctionId, params->Supported ); --} -- --static NTSTATUS wrap_SQLGetInfo( void *args ) --{ -- struct SQLGetInfo_params *params = args; -- return SQLGetInfo( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->InfoType, params->InfoValue, -- params->BufferLength, params->StringLength ); --} -- --static NTSTATUS wrap_SQLGetInfoW( void *args ) --{ -- struct SQLGetInfoW_params *params = args; -- return SQLGetInfoW( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->InfoType, params->InfoValue, -- params->BufferLength, params->StringLength ); --} -- --static NTSTATUS wrap_SQLGetStmtAttr( void *args ) --{ -- struct SQLGetStmtAttr_params *params = args; -- return SQLGetStmtAttr( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Attribute, params->Value, -- params->BufferLength, params->StringLength ); --} -- --static NTSTATUS wrap_SQLGetStmtAttrW( void *args ) --{ -- struct SQLGetStmtAttrW_params *params = args; -- return SQLGetStmtAttrW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Attribute, params->Value, -- params->BufferLength, params->StringLength ); --} -- --static NTSTATUS wrap_SQLGetStmtOption( void *args ) --{ -- struct SQLGetStmtOption_params *params = args; -- return SQLGetStmtOption( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Option, params->Value ); --} -- --static NTSTATUS wrap_SQLGetTypeInfo( void *args ) --{ -- struct SQLGetTypeInfo_params *params = args; -- return SQLGetTypeInfo( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->DataType ); --} -- --static NTSTATUS wrap_SQLGetTypeInfoW( void *args ) --{ -- struct SQLGetTypeInfoW_params *params = args; -- return SQLGetTypeInfoW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->DataType ); --} -- --static NTSTATUS wrap_SQLMoreResults( void *args ) --{ -- struct SQLMoreResults_params *params = args; -- return SQLMoreResults( (SQLHSTMT)(ULONG_PTR)params->StatementHandle ); --} -- --static NTSTATUS wrap_SQLNativeSql( void *args ) --{ -- struct SQLNativeSql_params *params = args; -- return SQLNativeSql( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->InStatementText, params->TextLength1, -- params->OutStatementText, params->BufferLength, params->TextLength2 ); --} -- --static NTSTATUS wrap_SQLNativeSqlW( void *args ) --{ -- struct SQLNativeSqlW_params *params = args; -- return SQLNativeSqlW( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->InStatementText, params->TextLength1, -- params->OutStatementText, params->BufferLength, params->TextLength2 ); --} -- --static NTSTATUS wrap_SQLNumParams( void *args ) --{ -- struct SQLNumParams_params *params = args; -- return SQLNumParams( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ParameterCount ); --} -- --static NTSTATUS wrap_SQLNumResultCols( void *args ) --{ -- struct SQLNumResultCols_params *params = args; -- return SQLNumResultCols( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ColumnCount ); --} -- --static NTSTATUS wrap_SQLParamData( void *args ) --{ -- struct SQLParamData_params *params = args; -- return SQLParamData( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Value ); --} -- --static NTSTATUS wrap_SQLParamOptions( void *args ) --{ -- struct SQLParamOptions_params *params = args; -- return SQLParamOptions( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->RowCount, -- (SQLULEN *)(ULONG_PTR)params->RowNumber ); --} -- --static NTSTATUS wrap_SQLPrepare( void *args ) --{ -- struct SQLPrepare_params *params = args; -- return SQLPrepare( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->StatementText, params->TextLength ); --} -- --static NTSTATUS wrap_SQLPrepareW( void *args ) --{ -- struct SQLPrepareW_params *params = args; -- return SQLPrepareW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->StatementText, params->TextLength ); --} -- --static NTSTATUS wrap_SQLPrimaryKeys( void *args ) --{ -- struct SQLPrimaryKeys_params *params = args; -- return SQLPrimaryKeys( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, params->NameLength1, -- params->SchemaName, params->NameLength2, params->TableName, params->NameLength3 ); --} -- --static NTSTATUS wrap_SQLPrimaryKeysW( void *args ) --{ -- struct SQLPrimaryKeysW_params *params = args; -- return SQLPrimaryKeysW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, params->NameLength1, -- params->SchemaName, params->NameLength2, params->TableName, params->NameLength3 ); --} -- --static NTSTATUS wrap_SQLProcedureColumns( void *args ) --{ -- struct SQLProcedureColumns_params *params = args; -- return SQLProcedureColumns( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, -- params->NameLength1, params->SchemaName, params->NameLength2, params->ProcName, -- params->NameLength3, params->ColumnName, params->NameLength4 ); --} -- --static NTSTATUS wrap_SQLProcedureColumnsW( void *args ) --{ -- struct SQLProcedureColumnsW_params *params = args; -- return SQLProcedureColumnsW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, -- params->NameLength1, params->SchemaName, params->NameLength2, params->ProcName, -- params->NameLength3, params->ColumnName, params->NameLength4 ); --} -- --static NTSTATUS wrap_SQLProcedures( void *args ) --{ -- struct SQLProcedures_params *params = args; -- return SQLProcedures( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, params->NameLength1, -- params->SchemaName, params->NameLength2, params->ProcName, params->NameLength3 ); --} -- --static NTSTATUS wrap_SQLProceduresW( void *args ) --{ -- struct SQLProceduresW_params *params = args; -- return SQLProceduresW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, params->NameLength1, -- params->SchemaName, params->NameLength2, params->ProcName, params->NameLength3 ); --} -- --static NTSTATUS wrap_SQLPutData( void *args ) --{ -- struct SQLPutData_params *params = args; -- return SQLPutData( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Data, params->StrLen_or_Ind ); --} -- --static NTSTATUS wrap_SQLRowCount( void *args ) --{ -- struct SQLRowCount_params *params = args; -- return SQLRowCount( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, (SQLLEN *)(ULONG_PTR)params->RowCount ); --} -- --static NTSTATUS wrap_SQLSetConnectAttr( void *args ) --{ -- struct SQLSetConnectAttr_params *params = args; -- return SQLSetConnectAttr( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->Attribute, params->Value, -- params->StringLength ); --} -- --static NTSTATUS wrap_SQLSetConnectAttrW( void *args ) --{ -- struct SQLSetConnectAttrW_params *params = args; -- return SQLSetConnectAttrW( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->Attribute, params->Value, -- params->StringLength ); --} -- --static NTSTATUS wrap_SQLSetConnectOption( void *args ) --{ -- struct SQLSetConnectOption_params *params = args; -- return SQLSetConnectOption( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->Option, params->Value ); --} -- --static NTSTATUS wrap_SQLSetConnectOptionW( void *args ) --{ -- struct SQLSetConnectOptionW_params *params = args; -- return SQLSetConnectOptionW( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->Option, params->Value ); --} -- --static NTSTATUS wrap_SQLSetCursorName( void *args ) --{ -- struct SQLSetCursorName_params *params = args; -- return SQLSetCursorName( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CursorName, params->NameLength ); --} -- --static NTSTATUS wrap_SQLSetCursorNameW( void *args ) --{ -- struct SQLSetCursorNameW_params *params = args; -- return SQLSetCursorNameW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CursorName, params->NameLength ); --} -- --static NTSTATUS wrap_SQLSetDescField( void *args ) --{ -- struct SQLSetDescField_params *params = args; -- return SQLSetDescField( (SQLHDESC)(ULONG_PTR)params->DescriptorHandle, params->RecNumber, params->FieldIdentifier, -- params->Value, params->BufferLength ); --} -- --static NTSTATUS wrap_SQLSetDescFieldW( void *args ) --{ -- struct SQLSetDescFieldW_params *params = args; -- return SQLSetDescFieldW( (SQLHDESC)(ULONG_PTR)params->DescriptorHandle, params->RecNumber, params->FieldIdentifier, -- params->Value, params->BufferLength ); --} -- --static NTSTATUS wrap_SQLSetDescRec( void *args ) --{ -- struct SQLSetDescRec_params *params = args; -- return SQLSetDescRec( (SQLHDESC)(ULONG_PTR)params->DescriptorHandle, params->RecNumber, params->Type, -- params->SubType, params->Length, params->Precision, params->Scale, -- params->Data, (SQLLEN *)(ULONG_PTR)params->StringLength, -- (SQLLEN *)(ULONG_PTR)params->Indicator ); --} -- --static NTSTATUS wrap_SQLSetEnvAttr( void *args ) --{ -- struct SQLSetEnvAttr_params *params = args; -- return SQLSetEnvAttr( (SQLHENV)(ULONG_PTR)params->EnvironmentHandle, params->Attribute, params->Value, -- params->StringLength ); --} -- --static NTSTATUS wrap_SQLSetParam( void *args ) --{ -- struct SQLSetParam_params *params = args; -- return SQLSetParam( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ParameterNumber, params->ValueType, -- params->ParameterType, params->LengthPrecision, params->ParameterScale, -- params->ParameterValue, (SQLLEN *)(ULONG_PTR)params->StrLen_or_Ind ); --} -- --static NTSTATUS wrap_SQLSetPos( void *args ) --{ -- struct SQLSetPos_params *params = args; -- return SQLSetPos( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->RowNumber, params->Operation, -- params->LockType ); --} -- --static NTSTATUS wrap_SQLSetScrollOptions( void *args ) --{ -- struct SQLSetScrollOptions_params *params = args; -- return SQLSetScrollOptions( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Concurrency, -- params->KeySetSize, params->RowSetSize ); --} -- --static NTSTATUS wrap_SQLSetStmtAttr( void *args ) --{ -- struct SQLSetStmtAttr_params *params = args; -- return SQLSetStmtAttr( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Attribute, params->Value, -- params->StringLength ); --} -- --static NTSTATUS wrap_SQLSetStmtAttrW( void *args ) --{ -- struct SQLSetStmtAttrW_params *params = args; -- return SQLSetStmtAttrW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Attribute, params->Value, -- params->StringLength ); --} -- --static NTSTATUS wrap_SQLSetStmtOption( void *args ) --{ -- struct SQLSetStmtOption_params *params = args; -- return SQLSetStmtOption( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Option, params->Value ); --} -- --static NTSTATUS wrap_SQLSpecialColumns( void *args ) --{ -- struct SQLSpecialColumns_params *params = args; -- return SQLSpecialColumns( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->IdentifierType, -- params->CatalogName, params->NameLength1, params->SchemaName, params->NameLength2, -- params->TableName, params->NameLength3, params->Scope, params->Nullable ); --} -- --static NTSTATUS wrap_SQLSpecialColumnsW( void *args ) --{ -- struct SQLSpecialColumnsW_params *params = args; -- return SQLSpecialColumnsW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->IdentifierType, -- params->CatalogName, params->NameLength1, params->SchemaName, params->NameLength2, -- params->TableName, params->NameLength3, params->Scope, params->Nullable ); --} -- --static NTSTATUS wrap_SQLStatistics( void *args ) --{ -- struct SQLStatistics_params *params = args; -- return SQLStatistics( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, params->NameLength1, -- params->SchemaName, params->NameLength2, params->TableName, -- params->NameLength3, params->Unique, params->Reserved ); --} -- --static NTSTATUS wrap_SQLStatisticsW( void *args ) --{ -- struct SQLStatisticsW_params *params = args; -- return SQLStatisticsW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, params->NameLength1, -- params->SchemaName, params->NameLength2, params->TableName, -- params->NameLength3, params->Unique, params->Reserved ); --} -- --static NTSTATUS wrap_SQLTablePrivileges( void *args ) --{ -- struct SQLTablePrivileges_params *params = args; -- return SQLTablePrivileges( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, -- params->NameLength1, params->SchemaName, params->NameLength2, params->TableName, -- params->NameLength3 ); --} -- --static NTSTATUS wrap_SQLTablePrivilegesW( void *args ) --{ -- struct SQLTablePrivilegesW_params *params = args; -- return SQLTablePrivilegesW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, -- params->NameLength1, params->SchemaName, params->NameLength2, params->TableName, -- params->NameLength3 ); --} -- --static NTSTATUS wrap_SQLTables( void *args ) --{ -- struct SQLTables_params *params = args; -- return SQLTables( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, params->NameLength1, -- params->SchemaName, params->NameLength2, params->TableName, -- params->NameLength3, params->TableType, params->NameLength4 ); --} -- --static NTSTATUS wrap_SQLTablesW( void *args ) --{ -- struct SQLTablesW_params *params = args; -- return SQLTablesW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, params->NameLength1, -- params->SchemaName, params->NameLength2, params->TableName, -- params->NameLength3, params->TableType, params->NameLength4 ); --} -- --static NTSTATUS wrap_SQLTransact( void *args ) --{ -- struct SQLTransact_params *params = args; -- return SQLTransact( (SQLHENV)(ULONG_PTR)params->EnvironmentHandle, (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, -- params->CompletionType ); --} -- --const unixlib_entry_t __wine_unix_call_funcs[] = --{ -- odbc_process_attach, -- wrap_SQLAllocConnect, -- wrap_SQLAllocEnv, -- wrap_SQLAllocHandle, -- wrap_SQLAllocHandleStd, -- wrap_SQLAllocStmt, -- wrap_SQLBindCol, -- wrap_SQLBindParam, -- wrap_SQLBindParameter, -- wrap_SQLBrowseConnect, -- wrap_SQLBrowseConnectW, -- wrap_SQLBulkOperations, -- wrap_SQLCancel, -- wrap_SQLCloseCursor, -- wrap_SQLColAttribute, -- wrap_SQLColAttributeW, -- wrap_SQLColAttributes, -- wrap_SQLColAttributesW, -- wrap_SQLColumnPrivileges, -- wrap_SQLColumnPrivilegesW, -- wrap_SQLColumns, -- wrap_SQLColumnsW, -- wrap_SQLConnect, -- wrap_SQLConnectW, -- wrap_SQLCopyDesc, -- wrap_SQLDataSources, -- wrap_SQLDataSourcesW, -- wrap_SQLDescribeCol, -- wrap_SQLDescribeColW, -- wrap_SQLDescribeParam, -- wrap_SQLDisconnect, -- wrap_SQLDriverConnect, -- wrap_SQLDriverConnectW, -- wrap_SQLDrivers, -- wrap_SQLDriversW, -- wrap_SQLEndTran, -- wrap_SQLError, -- wrap_SQLErrorW, -- wrap_SQLExecDirect, -- wrap_SQLExecDirectW, -- wrap_SQLExecute, -- wrap_SQLExtendedFetch, -- wrap_SQLFetch, -- wrap_SQLFetchScroll, -- wrap_SQLForeignKeys, -- wrap_SQLForeignKeysW, -- wrap_SQLFreeConnect, -- wrap_SQLFreeEnv, -- wrap_SQLFreeHandle, -- wrap_SQLFreeStmt, -- wrap_SQLGetConnectAttr, -- wrap_SQLGetConnectAttrW, -- wrap_SQLGetConnectOption, -- wrap_SQLGetConnectOptionW, -- wrap_SQLGetCursorName, -- wrap_SQLGetCursorNameW, -- wrap_SQLGetData, -- wrap_SQLGetDescField, -- wrap_SQLGetDescFieldW, -- wrap_SQLGetDescRec, -- wrap_SQLGetDescRecW, -- wrap_SQLGetDiagField, -- wrap_SQLGetDiagFieldW, -- wrap_SQLGetDiagRec, -- wrap_SQLGetDiagRecW, -- wrap_SQLGetEnvAttr, -- wrap_SQLGetFunctions, -- wrap_SQLGetInfo, -- wrap_SQLGetInfoW, -- wrap_SQLGetStmtAttr, -- wrap_SQLGetStmtAttrW, -- wrap_SQLGetStmtOption, -- wrap_SQLGetTypeInfo, -- wrap_SQLGetTypeInfoW, -- wrap_SQLMoreResults, -- wrap_SQLNativeSql, -- wrap_SQLNativeSqlW, -- wrap_SQLNumParams, -- wrap_SQLNumResultCols, -- wrap_SQLParamData, -- wrap_SQLParamOptions, -- wrap_SQLPrepare, -- wrap_SQLPrepareW, -- wrap_SQLPrimaryKeys, -- wrap_SQLPrimaryKeysW, -- wrap_SQLProcedureColumns, -- wrap_SQLProcedureColumnsW, -- wrap_SQLProcedures, -- wrap_SQLProceduresW, -- wrap_SQLPutData, -- wrap_SQLRowCount, -- wrap_SQLSetConnectAttr, -- wrap_SQLSetConnectAttrW, -- wrap_SQLSetConnectOption, -- wrap_SQLSetConnectOptionW, -- wrap_SQLSetCursorName, -- wrap_SQLSetCursorNameW, -- wrap_SQLSetDescField, -- wrap_SQLSetDescFieldW, -- wrap_SQLSetDescRec, -- wrap_SQLSetEnvAttr, -- wrap_SQLSetParam, -- wrap_SQLSetPos, -- wrap_SQLSetScrollOptions, -- wrap_SQLSetStmtAttr, -- wrap_SQLSetStmtAttrW, -- wrap_SQLSetStmtOption, -- wrap_SQLSpecialColumns, -- wrap_SQLSpecialColumnsW, -- wrap_SQLStatistics, -- wrap_SQLStatisticsW, -- wrap_SQLTablePrivileges, -- wrap_SQLTablePrivilegesW, -- wrap_SQLTables, -- wrap_SQLTablesW, -- wrap_SQLTransact, --}; -- --C_ASSERT( ARRAYSIZE( __wine_unix_call_funcs) == unix_funcs_count ); -- --#ifdef _WIN64 -- --typedef ULONG PTR32; -- --static NTSTATUS wow64_SQLBindCol( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- INT16 ColumnNumber; -- INT16 TargetType; -- PTR32 TargetValue; -- INT64 BufferLength; -- PTR32 StrLen_or_Ind; -- } const *params32 = args; -- -- struct SQLBindCol_params params = -- { -- params32->StatementHandle, -- params32->ColumnNumber, -- params32->TargetType, -- ULongToPtr(params32->TargetValue), -- params32->BufferLength, -- ULongToPtr(params32->StrLen_or_Ind) -- }; -- -- return wrap_SQLBindCol( ¶ms ); --} -- --static NTSTATUS wow64_SQLBindParam( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- UINT16 ParameterNumber; -- INT16 ValueType; -- INT16 ParameterType; -- UINT64 LengthPrecision; -- INT16 ParameterScale; -- PTR32 ParameterValue; -- PTR32 StrLen_or_Ind; -- } const *params32 = args; -- -- struct SQLBindParam_params params = -- { -- params32->StatementHandle, -- params32->ParameterNumber, -- params32->ValueType, -- params32->ParameterType, -- params32->LengthPrecision, -- params32->ParameterScale, -- ULongToPtr(params32->ParameterValue), -- ULongToPtr(params32->StrLen_or_Ind) -- }; -- -- return wrap_SQLBindParam( ¶ms ); --} -- --static NTSTATUS wow64_SQLBindParameter( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- UINT16 ParameterNumber; -- INT16 InputOutputType; -- INT16 ValueType; -- INT16 ParameterType; -- UINT64 ColumnSize; -- INT16 DecimalDigits; -- PTR32 ParameterValue; -- INT64 BufferLength; -- PTR32 StrLen_or_Ind; -- } const *params32 = args; -- -- struct SQLBindParameter_params params = -- { -- params32->StatementHandle, -- params32->ParameterNumber, -- params32->InputOutputType, -- params32->ValueType, -- params32->ParameterType, -- params32->ColumnSize, -- params32->DecimalDigits, -- ULongToPtr(params32->ParameterValue), -- params32->BufferLength, -- ULongToPtr(params32->StrLen_or_Ind) -- }; -- -- return wrap_SQLBindParameter( ¶ms ); --} -- --static NTSTATUS wow64_SQLBrowseConnect( void *args ) --{ -- struct -- { -- UINT64 ConnectionHandle; -- PTR32 InConnectionString; -- INT16 StringLength1; -- PTR32 OutConnectionString; -- INT16 BufferLength; -- PTR32 StringLength2; -- } const *params32 = args; -- -- struct SQLBrowseConnect_params params = -- { -- params32->ConnectionHandle, -- ULongToPtr(params32->InConnectionString), -- params32->StringLength1, -- ULongToPtr(params32->OutConnectionString), -- params32->BufferLength, -- ULongToPtr(params32->StringLength2) -- }; -- -- return wrap_SQLBrowseConnect( ¶ms ); --} -- --static NTSTATUS wow64_SQLBrowseConnectW( void *args ) --{ -- struct -- { -- UINT64 ConnectionHandle; -- PTR32 InConnectionString; -- INT16 StringLength1; -- PTR32 OutConnectionString; -- INT16 BufferLength; -- PTR32 StringLength2; -- } const *params32 = args; -- -- struct SQLBrowseConnectW_params params = -- { -- params32->ConnectionHandle, -- ULongToPtr(params32->InConnectionString), -- params32->StringLength1, -- ULongToPtr(params32->OutConnectionString), -- params32->BufferLength, -- ULongToPtr(params32->StringLength2) -- }; -- -- return wrap_SQLBrowseConnectW( ¶ms ); --} -- --static NTSTATUS wow64_SQLColAttribute( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- UINT16 ColumnNumber; -- UINT16 FieldIdentifier; -- PTR32 CharacterAttribute; -- INT16 BufferLength; -- PTR32 StringLength; -- PTR32 NumericAttribute; -- } const *params32 = args; -- -- struct SQLColAttribute_params params = -- { -- params32->StatementHandle, -- params32->ColumnNumber, -- params32->FieldIdentifier, -- ULongToPtr(params32->CharacterAttribute), -- params32->BufferLength, -- ULongToPtr(params32->StringLength), -- ULongToPtr(params32->NumericAttribute) -- }; -- -- return wrap_SQLColAttribute( ¶ms ); --} -- --static NTSTATUS wow64_SQLColAttributeW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- UINT16 ColumnNumber; -- UINT16 FieldIdentifier; -- PTR32 CharacterAttribute; -- INT16 BufferLength; -- PTR32 StringLength; -- PTR32 NumericAttribute; -- } const *params32 = args; -- -- struct SQLColAttributeW_params params = -- { -- params32->StatementHandle, -- params32->ColumnNumber, -- params32->FieldIdentifier, -- ULongToPtr(params32->CharacterAttribute), -- params32->BufferLength, -- ULongToPtr(params32->StringLength), -- ULongToPtr(params32->NumericAttribute) -- }; -- -- return wrap_SQLColAttributeW( ¶ms ); --} -- --static NTSTATUS wow64_SQLColAttributes( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- UINT16 ColumnNumber; -- UINT16 FieldIdentifier; -- PTR32 CharacterAttributes; -- INT16 BufferLength; -- PTR32 StringLength; -- PTR32 NumericAttributes; -- } const *params32 = args; -- -- struct SQLColAttributes_params params = -- { -- params32->StatementHandle, -- params32->ColumnNumber, -- params32->FieldIdentifier, -- ULongToPtr(params32->CharacterAttributes), -- params32->BufferLength, -- ULongToPtr(params32->StringLength), -- ULongToPtr(params32->NumericAttributes) -- }; -- -- return wrap_SQLColAttributes( ¶ms ); --} -- --static NTSTATUS wow64_SQLColAttributesW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- UINT16 ColumnNumber; -- UINT16 FieldIdentifier; -- PTR32 CharacterAttributes; -- INT16 BufferLength; -- PTR32 StringLength; -- PTR32 NumericAttributes; -- } const *params32 = args; -- -- struct SQLColAttributesW_params params = -- { -- params32->StatementHandle, -- params32->ColumnNumber, -- params32->FieldIdentifier, -- ULongToPtr(params32->CharacterAttributes), -- params32->BufferLength, -- ULongToPtr(params32->StringLength), -- ULongToPtr(params32->NumericAttributes) -- }; -- -- return wrap_SQLColAttributesW( ¶ms ); --} -- --static NTSTATUS wow64_SQLColumnPrivileges( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CatalogName; -- INT16 NameLength1; -- PTR32 SchemaName; -- INT16 NameLength2; -- PTR32 TableName; -- INT16 NameLength3; -- PTR32 ColumnName; -- INT16 NameLength4; -- } const *params32 = args; -- -- struct SQLColumnPrivileges_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CatalogName), -- params32->NameLength1, -- ULongToPtr(params32->SchemaName), -- params32->NameLength2, -- ULongToPtr(params32->TableName), -- params32->NameLength3, -- ULongToPtr(params32->ColumnName), -- params32->NameLength4 -- }; -- -- return wrap_SQLColumnPrivileges( ¶ms ); --} -- --static NTSTATUS wow64_SQLColumnPrivilegesW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CatalogName; -- INT16 NameLength1; -- PTR32 SchemaName; -- INT16 NameLength2; -- PTR32 TableName; -- INT16 NameLength3; -- PTR32 ColumnName; -- INT16 NameLength4; -- } const *params32 = args; -- -- struct SQLColumnPrivilegesW_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CatalogName), -- params32->NameLength1, -- ULongToPtr(params32->SchemaName), -- params32->NameLength2, -- ULongToPtr(params32->TableName), -- params32->NameLength3, -- ULongToPtr(params32->ColumnName), -- params32->NameLength4 -- }; -- -- return wrap_SQLColumnPrivilegesW( ¶ms ); --} -- --static NTSTATUS wow64_SQLColumns( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CatalogName; -- INT16 NameLength1; -- PTR32 SchemaName; -- INT16 NameLength2; -- PTR32 TableName; -- INT16 NameLength3; -- PTR32 ColumnName; -- INT16 NameLength4; -- } const *params32 = args; -- -- struct SQLColumns_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CatalogName), -- params32->NameLength1, -- ULongToPtr(params32->SchemaName), -- params32->NameLength2, -- ULongToPtr(params32->TableName), -- params32->NameLength3, -- ULongToPtr(params32->ColumnName), -- params32->NameLength4 -- }; -- -- return wrap_SQLColumns( ¶ms ); --} -- --static NTSTATUS wow64_SQLColumnsW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CatalogName; -- INT16 NameLength1; -- PTR32 SchemaName; -- INT16 NameLength2; -- PTR32 TableName; -- INT16 NameLength3; -- PTR32 ColumnName; -- INT16 NameLength4; -- } const *params32 = args; -- -- struct SQLColumnsW_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CatalogName), -- params32->NameLength1, -- ULongToPtr(params32->SchemaName), -- params32->NameLength2, -- ULongToPtr(params32->TableName), -- params32->NameLength3, -- ULongToPtr(params32->ColumnName), -- params32->NameLength4 -- }; -- -- return wrap_SQLColumnsW( ¶ms ); --} -- --static NTSTATUS wow64_SQLConnect( void *args ) --{ -- struct -- { -- UINT64 ConnectionHandle; -- PTR32 ServerName; -- INT16 NameLength1; -- PTR32 UserName; -- INT16 NameLength2; -- PTR32 Authentication; -- INT16 NameLength3; -- } const *params32 = args; -- -- struct SQLConnect_params params = -- { -- params32->ConnectionHandle, -- ULongToPtr(params32->ServerName), -- params32->NameLength1, -- ULongToPtr(params32->UserName), -- params32->NameLength2, -- ULongToPtr(params32->Authentication), -- params32->NameLength3 -- }; -- -- return wrap_SQLConnect( ¶ms ); --} -- --static NTSTATUS wow64_SQLConnectW( void *args ) --{ -- struct -- { -- UINT64 ConnectionHandle; -- PTR32 ServerName; -- INT16 NameLength1; -- PTR32 UserName; -- INT16 NameLength2; -- PTR32 Authentication; -- INT16 NameLength3; -- } const *params32 = args; -- -- struct SQLConnectW_params params = -- { -- params32->ConnectionHandle, -- ULongToPtr(params32->ServerName), -- params32->NameLength1, -- ULongToPtr(params32->UserName), -- params32->NameLength2, -- ULongToPtr(params32->Authentication), -- params32->NameLength3 -- }; -- -- return wrap_SQLConnectW( ¶ms ); --} -- --static NTSTATUS wow64_SQLDataSources( void *args ) --{ -- struct -- { -- UINT64 EnvironmentHandle; -- UINT16 Direction; -- PTR32 ServerName; -- INT16 BufferLength1; -- PTR32 NameLength1; -- PTR32 Description; -- INT16 BufferLength2; -- PTR32 NameLength2; -- } const *params32 = args; -- -- struct SQLDataSources_params params = -- { -- params32->EnvironmentHandle, -- params32->Direction, -- ULongToPtr(params32->ServerName), -- params32->BufferLength1, -- ULongToPtr(params32->NameLength1), -- ULongToPtr(params32->Description), -- params32->BufferLength2, -- ULongToPtr(params32->NameLength2) -- }; -- -- return wrap_SQLDataSources( ¶ms ); --} -- --static NTSTATUS wow64_SQLDataSourcesW( void *args ) --{ -- struct -- { -- UINT64 EnvironmentHandle; -- UINT16 Direction; -- PTR32 ServerName; -- INT16 BufferLength1; -- PTR32 NameLength1; -- PTR32 Description; -- INT16 BufferLength2; -- PTR32 NameLength2; -- } const *params32 = args; -- -- struct SQLDataSourcesW_params params = -- { -- params32->EnvironmentHandle, -- params32->Direction, -- ULongToPtr(params32->ServerName), -- params32->BufferLength1, -- ULongToPtr(params32->NameLength1), -- ULongToPtr(params32->Description), -- params32->BufferLength2, -- ULongToPtr(params32->NameLength2) -- }; -- -- return wrap_SQLDataSourcesW( ¶ms ); --} -- --static NTSTATUS wow64_SQLDescribeCol( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- INT16 ColumnNumber; -- PTR32 ColumnName; -- INT16 BufferLength; -- PTR32 NameLength; -- PTR32 DataType; -- PTR32 ColumnSize; -- PTR32 DecimalDigits; -- PTR32 Nullable; -- } const *params32 = args; -- -- struct SQLDescribeCol_params params = -- { -- params32->StatementHandle, -- params32->ColumnNumber, -- ULongToPtr(params32->ColumnName), -- params32->BufferLength, -- ULongToPtr(params32->NameLength), -- ULongToPtr(params32->DataType), -- ULongToPtr(params32->ColumnSize), -- ULongToPtr(params32->DecimalDigits), -- ULongToPtr(params32->Nullable) -- }; -- -- return wrap_SQLDescribeCol( ¶ms ); --} -- --static NTSTATUS wow64_SQLDescribeColW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- INT16 ColumnNumber; -- PTR32 ColumnName; -- INT16 BufferLength; -- PTR32 NameLength; -- PTR32 DataType; -- PTR32 ColumnSize; -- PTR32 DecimalDigits; -- PTR32 Nullable; -- } const *params32 = args; -- -- struct SQLDescribeColW_params params = -- { -- params32->StatementHandle, -- params32->ColumnNumber, -- ULongToPtr(params32->ColumnName), -- params32->BufferLength, -- ULongToPtr(params32->NameLength), -- ULongToPtr(params32->DataType), -- ULongToPtr(params32->ColumnSize), -- ULongToPtr(params32->DecimalDigits), -- ULongToPtr(params32->Nullable) -- }; -- -- return wrap_SQLDescribeColW( ¶ms ); --} -- --static NTSTATUS wow64_SQLDescribeParam( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- INT16 ParameterNumber; -- PTR32 DataType; -- PTR32 ParameterSize; -- PTR32 DecimalDigits; -- PTR32 Nullable; -- } const *params32 = args; -- -- struct SQLDescribeParam_params params = -- { -- params32->StatementHandle, -- params32->ParameterNumber, -- ULongToPtr(params32->DataType), -- ULongToPtr(params32->ParameterSize), -- ULongToPtr(params32->DecimalDigits), -- ULongToPtr(params32->Nullable) -- }; -- -- return wrap_SQLDescribeParam( ¶ms ); --} -- --static NTSTATUS wow64_SQLDrivers( void *args ) --{ -- struct -- { -- UINT64 EnvironmentHandle; -- UINT16 Direction; -- PTR32 DriverDescription; -- INT16 BufferLength1; -- PTR32 DescriptionLength; -- PTR32 DriverAttributes; -- INT16 BufferLength2; -- PTR32 AttributesLength; -- } const *params32 = args; -- -- struct SQLDrivers_params params = -- { -- params32->EnvironmentHandle, -- params32->Direction, -- ULongToPtr(params32->DriverDescription), -- params32->BufferLength1, -- ULongToPtr(params32->DescriptionLength), -- ULongToPtr(params32->DriverAttributes), -- params32->BufferLength2, -- ULongToPtr(params32->AttributesLength) -- }; -- -- return wrap_SQLDrivers( ¶ms ); --} -- --static NTSTATUS wow64_SQLDriversW( void *args ) --{ -- struct -- { -- UINT64 EnvironmentHandle; -- UINT16 Direction; -- PTR32 DriverDescription; -- INT16 BufferLength1; -- PTR32 DescriptionLength; -- PTR32 DriverAttributes; -- INT16 BufferLength2; -- PTR32 AttributesLength; -- } const *params32 = args; -- -- struct SQLDriversW_params params = -- { -- params32->EnvironmentHandle, -- params32->Direction, -- ULongToPtr(params32->DriverDescription), -- params32->BufferLength1, -- ULongToPtr(params32->DescriptionLength), -- ULongToPtr(params32->DriverAttributes), -- params32->BufferLength2, -- ULongToPtr(params32->AttributesLength) -- }; -- -- return wrap_SQLDriversW( ¶ms ); --} -- --static NTSTATUS wow64_SQLDriverConnect( void *args ) --{ -- struct -- { -- UINT64 ConnectionHandle; -- PTR32 WindowHandle; -- PTR32 InConnectionString; -- INT16 Length; -- PTR32 OutConnectionString; -- INT16 BufferLength; -- PTR32 Length2; -- UINT16 DriverCompletion; -- } const *params32 = args; -- -- struct SQLDriverConnect_params params = -- { -- params32->ConnectionHandle, -- ULongToPtr(params32->WindowHandle), -- ULongToPtr(params32->InConnectionString), -- params32->Length, -- ULongToPtr(params32->OutConnectionString), -- params32->BufferLength, -- ULongToPtr(params32->Length2), -- params32->DriverCompletion, -- }; -- -- return wrap_SQLDriverConnect( ¶ms ); --} -- --static NTSTATUS wow64_SQLDriverConnectW( void *args ) --{ -- struct -- { -- UINT64 ConnectionHandle; -- PTR32 WindowHandle; -- PTR32 InConnectionString; -- INT16 Length; -- PTR32 OutConnectionString; -- INT16 BufferLength; -- PTR32 Length2; -- UINT16 DriverCompletion; -- } const *params32 = args; -- -- struct SQLDriverConnectW_params params = -- { -- params32->ConnectionHandle, -- ULongToPtr(params32->WindowHandle), -- ULongToPtr(params32->InConnectionString), -- params32->Length, -- ULongToPtr(params32->OutConnectionString), -- params32->BufferLength, -- ULongToPtr(params32->Length2), -- params32->DriverCompletion, -- }; -- -- return wrap_SQLDriverConnectW( ¶ms ); --} -- --static NTSTATUS wow64_SQLError( void *args ) --{ -- struct -- { -- UINT64 EnvironmentHandle; -- UINT64 ConnectionHandle; -- UINT64 StatementHandle; -- PTR32 SqlState; -- PTR32 NativeError; -- PTR32 MessageText; -- INT16 BufferLength; -- PTR32 TextLength; -- } const *params32 = args; -- -- struct SQLError_params params = -- { -- params32->EnvironmentHandle, -- params32->ConnectionHandle, -- params32->StatementHandle, -- ULongToPtr(params32->SqlState), -- ULongToPtr(params32->NativeError), -- ULongToPtr(params32->MessageText), -- params32->BufferLength, -- ULongToPtr(params32->TextLength) -- }; -- -- return wrap_SQLError( ¶ms ); --} -- --static NTSTATUS wow64_SQLErrorW( void *args ) --{ -- struct -- { -- UINT64 EnvironmentHandle; -- UINT64 ConnectionHandle; -- UINT64 StatementHandle; -- PTR32 SqlState; -- PTR32 NativeError; -- PTR32 MessageText; -- INT16 BufferLength; -- PTR32 TextLength; -- } const *params32 = args; -- -- struct SQLErrorW_params params = -- { -- params32->EnvironmentHandle, -- params32->ConnectionHandle, -- params32->StatementHandle, -- ULongToPtr(params32->SqlState), -- ULongToPtr(params32->NativeError), -- ULongToPtr(params32->MessageText), -- params32->BufferLength, -- ULongToPtr(params32->TextLength) -- }; -- -- return wrap_SQLErrorW( ¶ms ); --} -- --static NTSTATUS wow64_SQLExecDirect( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 StatementText; -- INT32 TextLength; -- } const *params32 = args; -- -- struct SQLExecDirect_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->StatementText), -- params32->TextLength, -- }; -- -- return wrap_SQLExecDirect( ¶ms ); --} -- --static NTSTATUS wow64_SQLExecDirectW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 StatementText; -- INT32 TextLength; -- } const *params32 = args; -- -- struct SQLExecDirectW_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->StatementText), -- params32->TextLength, -- }; -- -- return wrap_SQLExecDirectW( ¶ms ); --} -- --static NTSTATUS wow64_SQLExtendedFetch( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- INT16 FetchOrientation; -- INT64 FetchOffset; -- UINT64 RowCount; -- PTR32 RowStatusArray; -- } const *params32 = args; -- -- struct SQLExtendedFetch_params params = -- { -- params32->StatementHandle, -- params32->FetchOrientation, -- params32->FetchOffset, -- ULongToPtr(params32->RowCount), -- ULongToPtr(params32->RowStatusArray) -- }; -- -- return wrap_SQLExtendedFetch( ¶ms ); --} -- --static NTSTATUS wow64_SQLForeignKeys( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 PkCatalogName; -- INT16 NameLength1; -- PTR32 PkSchemaName; -- INT16 NameLength2; -- PTR32 PkTableName; -- INT16 NameLength3; -- PTR32 FkCatalogName; -- INT16 NameLength4; -- PTR32 FkSchemaName; -- INT16 NameLength5; -- PTR32 FkTableName; -- INT16 NameLength6; -- } const *params32 = args; -- -- struct SQLForeignKeys_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->PkCatalogName), -- params32->NameLength1, -- ULongToPtr(params32->PkSchemaName), -- params32->NameLength2, -- ULongToPtr(params32->PkTableName), -- params32->NameLength3, -- ULongToPtr(params32->FkCatalogName), -- params32->NameLength4, -- ULongToPtr(params32->FkSchemaName), -- params32->NameLength5, -- ULongToPtr(params32->FkTableName), -- params32->NameLength6 -- }; -- -- return wrap_SQLForeignKeys( ¶ms ); --} -- --static NTSTATUS wow64_SQLForeignKeysW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 PkCatalogName; -- INT16 NameLength1; -- PTR32 PkSchemaName; -- INT16 NameLength2; -- PTR32 PkTableName; -- INT16 NameLength3; -- PTR32 FkCatalogName; -- INT16 NameLength4; -- PTR32 FkSchemaName; -- INT16 NameLength5; -- PTR32 FkTableName; -- INT16 NameLength6; -- } const *params32 = args; -- -- struct SQLForeignKeysW_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->PkCatalogName), -- params32->NameLength1, -- ULongToPtr(params32->PkSchemaName), -- params32->NameLength2, -- ULongToPtr(params32->PkTableName), -- params32->NameLength3, -- ULongToPtr(params32->FkCatalogName), -- params32->NameLength4, -- ULongToPtr(params32->FkSchemaName), -- params32->NameLength5, -- ULongToPtr(params32->FkTableName), -- params32->NameLength6 -- }; -- -- return wrap_SQLForeignKeysW( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetConnectAttr( void *args ) --{ -- struct -- { -- UINT64 ConnectionHandle; -- INT32 Attribute; -- PTR32 Value; -- INT32 BufferLength; -- PTR32 StringLength; -- } const *params32 = args; -- -- struct SQLGetConnectAttr_params params = -- { -- params32->ConnectionHandle, -- params32->Attribute, -- ULongToPtr(params32->Value), -- params32->BufferLength, -- ULongToPtr(params32->StringLength) -- }; -- -- return wrap_SQLGetConnectAttr( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetConnectAttrW( void *args ) --{ -- struct -- { -- UINT64 ConnectionHandle; -- INT32 Attribute; -- PTR32 Value; -- INT32 BufferLength; -- PTR32 StringLength; -- } const *params32 = args; -- -- struct SQLGetConnectAttrW_params params = -- { -- params32->ConnectionHandle, -- params32->Attribute, -- ULongToPtr(params32->Value), -- params32->BufferLength, -- ULongToPtr(params32->StringLength) -- }; -- -- return wrap_SQLGetConnectAttrW( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetConnectOption( void *args ) --{ -- struct -- { -- UINT64 ConnectionHandle; -- INT16 Option; -- PTR32 Value; -- } const *params32 = args; -- -- struct SQLGetConnectOption_params params = -- { -- params32->ConnectionHandle, -- params32->Option, -- ULongToPtr(params32->Value) -- }; -- -- return wrap_SQLGetConnectOption( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetConnectOptionW( void *args ) --{ -- struct -- { -- UINT64 ConnectionHandle; -- INT16 Option; -- PTR32 Value; -- } const *params32 = args; -- -- struct SQLGetConnectOptionW_params params = -- { -- params32->ConnectionHandle, -- params32->Option, -- ULongToPtr(params32->Value) -- }; -- -- return wrap_SQLGetConnectOptionW( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetCursorName( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CursorName; -- INT16 BufferLength; -- PTR32 NameLength; -- } const *params32 = args; -- -- struct SQLGetCursorName_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CursorName), -- params32->BufferLength, -- ULongToPtr(params32->NameLength) -- }; -- -- return wrap_SQLGetCursorName( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetCursorNameW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CursorName; -- INT16 BufferLength; -- PTR32 NameLength; -- } const *params32 = args; -- -- struct SQLGetCursorNameW_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CursorName), -- params32->BufferLength, -- ULongToPtr(params32->NameLength) -- }; -- -- return wrap_SQLGetCursorNameW( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetData( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- INT16 ColumnNumber; -- INT16 TargetType; -- PTR32 TargetValue; -- INT64 BufferLength; -- PTR32 StrLen_or_Ind; -- } const *params32 = args; -- -- struct SQLGetData_params params = -- { -- params32->StatementHandle, -- params32->ColumnNumber, -- params32->TargetType, -- ULongToPtr(params32->TargetValue), -- params32->BufferLength, -- ULongToPtr(params32->StrLen_or_Ind) -- }; -- -- return wrap_SQLGetData( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetDescField( void *args ) --{ -- struct -- { -- UINT64 DescriptorHandle; -- INT16 RecNumber; -- INT16 FieldIdentifier; -- PTR32 Value; -- INT32 BufferLength; -- PTR32 StringLength; -- } const *params32 = args; -- -- struct SQLGetDescField_params params = -- { -- params32->DescriptorHandle, -- params32->RecNumber, -- params32->FieldIdentifier, -- ULongToPtr(params32->Value), -- params32->BufferLength, -- ULongToPtr(params32->StringLength) -- }; -- -- return wrap_SQLGetDescField( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetDescFieldW( void *args ) --{ -- struct -- { -- UINT64 DescriptorHandle; -- INT16 RecNumber; -- INT16 FieldIdentifier; -- PTR32 Value; -- INT32 BufferLength; -- PTR32 StringLength; -- } const *params32 = args; -- -- struct SQLGetDescFieldW_params params = -- { -- params32->DescriptorHandle, -- params32->RecNumber, -- params32->FieldIdentifier, -- ULongToPtr(params32->Value), -- params32->BufferLength, -- ULongToPtr(params32->StringLength) -- }; -- -- return wrap_SQLGetDescFieldW( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetDescRec( void *args ) --{ -- struct -- { -- UINT64 DescriptorHandle; -- INT16 RecNumber; -- PTR32 Name; -- INT16 BufferLength; -- PTR32 StringLength; -- PTR32 Type; -- PTR32 SubType; -- PTR32 Length; -- PTR32 Precision; -- PTR32 Scale; -- PTR32 Nullable; -- } const *params32 = args; -- -- struct SQLGetDescRec_params params = -- { -- params32->DescriptorHandle, -- params32->RecNumber, -- ULongToPtr(params32->Name), -- params32->BufferLength, -- ULongToPtr(params32->StringLength), -- ULongToPtr(params32->Type), -- ULongToPtr(params32->SubType), -- ULongToPtr(params32->Length), -- ULongToPtr(params32->Precision), -- ULongToPtr(params32->Scale), -- ULongToPtr(params32->Nullable) -- }; -- -- return wrap_SQLGetDescRec( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetDescRecW( void *args ) --{ -- struct -- { -- UINT64 DescriptorHandle; -- INT16 RecNumber; -- PTR32 Name; -- INT16 BufferLength; -- PTR32 StringLength; -- PTR32 Type; -- PTR32 SubType; -- PTR32 Length; -- PTR32 Precision; -- PTR32 Scale; -- PTR32 Nullable; -- } const *params32 = args; -- -- struct SQLGetDescRecW_params params = -- { -- params32->DescriptorHandle, -- params32->RecNumber, -- ULongToPtr(params32->Name), -- params32->BufferLength, -- ULongToPtr(params32->StringLength), -- ULongToPtr(params32->Type), -- ULongToPtr(params32->SubType), -- ULongToPtr(params32->Length), -- ULongToPtr(params32->Precision), -- ULongToPtr(params32->Scale), -- ULongToPtr(params32->Nullable) -- }; -- -- return wrap_SQLGetDescRecW( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetDiagRec( void *args ) --{ -- struct -- { -- INT16 HandleType; -- UINT64 Handle; -- INT16 RecNumber; -- PTR32 SqlState; -- PTR32 NativeError; -- PTR32 MessageText; -- INT16 BufferLength; -- PTR32 TextLength; -- } const *params32 = args; -- -- struct SQLGetDiagRec_params params = -- { -- params32->HandleType, -- params32->Handle, -- params32->RecNumber, -- ULongToPtr(params32->SqlState), -- ULongToPtr(params32->NativeError), -- ULongToPtr(params32->MessageText), -- params32->BufferLength, -- ULongToPtr(params32->TextLength) -- }; -- -- return wrap_SQLGetDiagRec( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetDiagRecW( void *args ) --{ -- struct -- { -- INT16 HandleType; -- UINT64 Handle; -- INT16 RecNumber; -- PTR32 SqlState; -- PTR32 NativeError; -- PTR32 MessageText; -- INT16 BufferLength; -- PTR32 TextLength; -- } const *params32 = args; -- -- struct SQLGetDiagRecW_params params = -- { -- params32->HandleType, -- params32->Handle, -- params32->RecNumber, -- ULongToPtr(params32->SqlState), -- ULongToPtr(params32->NativeError), -- ULongToPtr(params32->MessageText), -- params32->BufferLength, -- ULongToPtr(params32->TextLength) -- }; -- -- return wrap_SQLGetDiagRecW( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetDiagField( void *args ) --{ -- struct -- { -- INT16 HandleType; -- UINT64 Handle; -- INT16 RecNumber; -- INT16 DiagIdentifier; -- PTR32 DiagInfo; -- INT16 BufferLength; -- PTR32 StringLength; -- } const *params32 = args; -- -- struct SQLGetDiagField_params params = -- { -- params32->HandleType, -- params32->Handle, -- params32->RecNumber, -- params32->DiagIdentifier, -- ULongToPtr(params32->DiagInfo), -- params32->BufferLength, -- ULongToPtr(params32->StringLength) -- }; -- -- return wrap_SQLGetDiagField( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetDiagFieldW( void *args ) --{ -- struct -- { -- INT16 HandleType; -- UINT64 Handle; -- INT16 RecNumber; -- INT16 DiagIdentifier; -- PTR32 DiagInfo; -- INT16 BufferLength; -- PTR32 StringLength; -- } const *params32 = args; -- -- struct SQLGetDiagFieldW_params params = -- { -- params32->HandleType, -- params32->Handle, -- params32->RecNumber, -- params32->DiagIdentifier, -- ULongToPtr(params32->DiagInfo), -- params32->BufferLength, -- ULongToPtr(params32->StringLength) -- }; -- -- return wrap_SQLGetDiagFieldW( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetEnvAttr( void *args ) --{ -- struct -- { -- UINT64 EnvironmentHandle; -- INT32 Attribute; -- PTR32 Value; -- INT32 BufferLength; -- PTR32 StringLength; -- } const *params32 = args; -- -- struct SQLGetEnvAttr_params params = -- { -- params32->EnvironmentHandle, -- params32->Attribute, -- ULongToPtr(params32->Value), -- params32->BufferLength, -- ULongToPtr(params32->StringLength) -- }; -- -- return wrap_SQLGetEnvAttr( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetFunctions( void *args ) --{ -- struct -- { -- UINT64 ConnectionHandle; -- UINT16 FunctionId; -- PTR32 Supported; -- } const *params32 = args; -- -- struct SQLGetFunctions_params params = -- { -- params32->ConnectionHandle, -- params32->FunctionId, -- ULongToPtr(params32->Supported) -- }; -- -- return wrap_SQLGetFunctions( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetInfo( void *args ) --{ -- struct -- { -- UINT64 ConnectionHandle; -- UINT16 InfoType; -- PTR32 InfoValue; -- INT16 BufferLength; -- PTR32 StringLength; -- } const *params32 = args; -- -- struct SQLGetInfo_params params = -- { -- params32->ConnectionHandle, -- params32->InfoType, -- ULongToPtr(params32->InfoValue), -- params32->BufferLength, -- ULongToPtr(params32->StringLength) -- }; -- -- return wrap_SQLGetInfo( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetInfoW( void *args ) --{ -- struct -- { -- UINT64 ConnectionHandle; -- UINT16 InfoType; -- PTR32 InfoValue; -- INT16 BufferLength; -- PTR32 StringLength; -- } const *params32 = args; -- -- struct SQLGetInfoW_params params = -- { -- params32->ConnectionHandle, -- params32->InfoType, -- ULongToPtr(params32->InfoValue), -- params32->BufferLength, -- ULongToPtr(params32->StringLength) -- }; -- -- return wrap_SQLGetInfoW( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetStmtOption( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- UINT16 Option; -- PTR32 Value; -- } const *params32 = args; -- -- struct SQLGetStmtOption_params params = -- { -- params32->StatementHandle, -- params32->Option, -- ULongToPtr(params32->Value) -- }; -- -- return wrap_SQLGetStmtOption( ¶ms ); --} -- --static NTSTATUS wow64_SQLNativeSql( void *args ) --{ -- struct -- { -- UINT64 ConnectionHandle; -- PTR32 InStatementText; -- INT32 TextLength1; -- PTR32 OutStatementText; -- INT32 BufferLength; -- PTR32 TextLength2; -- } const *params32 = args; -- -- struct SQLNativeSql_params params = -- { -- params32->ConnectionHandle, -- ULongToPtr(params32->InStatementText), -- params32->TextLength1, -- ULongToPtr(params32->OutStatementText), -- params32->BufferLength, -- ULongToPtr(params32->TextLength2) -- }; -- -- return wrap_SQLNativeSql( ¶ms ); --} -- --static NTSTATUS wow64_SQLNativeSqlW( void *args ) --{ -- struct -- { -- UINT64 ConnectionHandle; -- PTR32 InStatementText; -- INT32 TextLength1; -- PTR32 OutStatementText; -- INT32 BufferLength; -- PTR32 TextLength2; -- } const *params32 = args; -- -- struct SQLNativeSqlW_params params = -- { -- params32->ConnectionHandle, -- ULongToPtr(params32->InStatementText), -- params32->TextLength1, -- ULongToPtr(params32->OutStatementText), -- params32->BufferLength, -- ULongToPtr(params32->TextLength2) -- }; -- -- return wrap_SQLNativeSqlW( ¶ms ); --} -- --static NTSTATUS wow64_SQLNumParams( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 ParameterCount; -- } const *params32 = args; -- -- struct SQLNumParams_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->ParameterCount) -- }; -- -- return wrap_SQLNumParams( ¶ms ); --} -- --static NTSTATUS wow64_SQLNumResultCols( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 ColumnCount; -- } const *params32 = args; -- -- struct SQLNumResultCols_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->ColumnCount) -- }; -- -- return wrap_SQLNumResultCols( ¶ms ); --} -- --static NTSTATUS wow64_SQLParamData( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 Value; -- } const *params32 = args; -- -- struct SQLParamData_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->Value) -- }; -- -- return wrap_SQLParamData( ¶ms ); --} -- --static NTSTATUS wow64_SQLParamOptions( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- UINT64 RowCount; -- PTR32 RowNumber; -- } const *params32 = args; -- -- struct SQLParamOptions_params params = -- { -- params32->StatementHandle, -- params32->RowCount, -- ULongToPtr(params32->RowNumber) -- }; -- -- return wrap_SQLParamOptions( ¶ms ); --} -- --static NTSTATUS wow64_SQLPrepare( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 StatementText; -- INT32 TextLength; -- } const *params32 = args; -- -- struct SQLPrepare_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->StatementText), -- params32->TextLength, -- }; -- -- return wrap_SQLPrepare( ¶ms ); --} -- --static NTSTATUS wow64_SQLPrepareW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 StatementText; -- INT32 TextLength; -- } const *params32 = args; -- -- struct SQLPrepareW_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->StatementText), -- params32->TextLength, -- }; -- -- return wrap_SQLPrepareW( ¶ms ); --} -- --static NTSTATUS wow64_SQLPrimaryKeys( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CatalogName; -- INT16 NameLength1; -- PTR32 SchemaName; -- INT16 NameLength2; -- PTR32 TableName; -- INT16 NameLength3; -- } const *params32 = args; -- -- struct SQLPrimaryKeys_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CatalogName), -- params32->NameLength1, -- ULongToPtr(params32->SchemaName), -- params32->NameLength2, -- ULongToPtr(params32->TableName), -- params32->NameLength3 -- }; -- -- return wrap_SQLPrimaryKeys( ¶ms ); --} -- --static NTSTATUS wow64_SQLPrimaryKeysW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CatalogName; -- INT16 NameLength1; -- PTR32 SchemaName; -- INT16 NameLength2; -- PTR32 TableName; -- INT16 NameLength3; -- } const *params32 = args; -- -- struct SQLPrimaryKeysW_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CatalogName), -- params32->NameLength1, -- ULongToPtr(params32->SchemaName), -- params32->NameLength2, -- ULongToPtr(params32->TableName), -- params32->NameLength3 -- }; -- -- return wrap_SQLPrimaryKeysW( ¶ms ); --} -- --static NTSTATUS wow64_SQLProcedureColumns( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CatalogName; -- INT16 NameLength1; -- PTR32 SchemaName; -- INT16 NameLength2; -- PTR32 ProcName; -- INT16 NameLength3; -- PTR32 ColumnName; -- INT16 NameLength4; -- } const *params32 = args; -- -- struct SQLProcedureColumns_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CatalogName), -- params32->NameLength1, -- ULongToPtr(params32->SchemaName), -- params32->NameLength2, -- ULongToPtr(params32->ProcName), -- params32->NameLength3, -- ULongToPtr(params32->ColumnName), -- params32->NameLength4 -- }; -- -- return wrap_SQLProcedureColumns( ¶ms ); --} -- --static NTSTATUS wow64_SQLProcedureColumnsW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CatalogName; -- INT16 NameLength1; -- PTR32 SchemaName; -- INT16 NameLength2; -- PTR32 ProcName; -- INT16 NameLength3; -- PTR32 ColumnName; -- INT16 NameLength4; -- } const *params32 = args; -- -- struct SQLProcedureColumnsW_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CatalogName), -- params32->NameLength1, -- ULongToPtr(params32->SchemaName), -- params32->NameLength2, -- ULongToPtr(params32->ProcName), -- params32->NameLength3, -- ULongToPtr(params32->ColumnName), -- params32->NameLength4 -- }; -- -- return wrap_SQLProcedureColumnsW( ¶ms ); --} -- --static NTSTATUS wow64_SQLProcedures( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CatalogName; -- INT16 NameLength1; -- PTR32 SchemaName; -- INT16 NameLength2; -- PTR32 ProcName; -- INT16 NameLength3; -- } const *params32 = args; -- -- struct SQLProcedures_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CatalogName), -- params32->NameLength1, -- ULongToPtr(params32->SchemaName), -- params32->NameLength2, -- ULongToPtr(params32->ProcName), -- params32->NameLength3 -- }; -- -- return wrap_SQLProcedures( ¶ms ); --} -- --static NTSTATUS wow64_SQLProceduresW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CatalogName; -- INT16 NameLength1; -- PTR32 SchemaName; -- INT16 NameLength2; -- PTR32 ProcName; -- INT16 NameLength3; -- } const *params32 = args; -- -- struct SQLProceduresW_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CatalogName), -- params32->NameLength1, -- ULongToPtr(params32->SchemaName), -- params32->NameLength2, -- ULongToPtr(params32->ProcName), -- params32->NameLength3 -- }; -- -- return wrap_SQLProceduresW( ¶ms ); --} -- --static NTSTATUS wow64_SQLPutData( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 Data; -- INT64 StrLen_or_Ind; -- } const *params32 = args; -- -- struct SQLPutData_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->Data), -- params32->StrLen_or_Ind -- }; -- -- return wrap_SQLPutData( ¶ms ); --} -- --static NTSTATUS wow64_SQLRowCount( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 RowCount; -- } const *params32 = args; -- -- struct SQLRowCount_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->RowCount) -- }; -- -- return wrap_SQLRowCount( ¶ms ); --} -- --static NTSTATUS wow64_SQLSetConnectAttr( void *args ) --{ -- struct -- { -- UINT64 ConnectionHandle; -- INT32 Attribute; -- PTR32 Value; -- INT32 StringLength; -- } const *params32 = args; -- -- struct SQLSetConnectAttr_params params = -- { -- params32->ConnectionHandle, -- params32->Attribute, -- ULongToPtr(params32->Value), -- params32->StringLength -- }; -- -- return wrap_SQLSetConnectAttr( ¶ms ); --} -- --static NTSTATUS wow64_SQLSetConnectAttrW( void *args ) --{ -- struct -- { -- UINT64 ConnectionHandle; -- INT32 Attribute; -- PTR32 Value; -- INT32 StringLength; -- } const *params32 = args; -- -- struct SQLSetConnectAttrW_params params = -- { -- params32->ConnectionHandle, -- params32->Attribute, -- ULongToPtr(params32->Value), -- params32->StringLength -- }; -- -- return wrap_SQLSetConnectAttrW( ¶ms ); --} -- --static NTSTATUS wow64_SQLSetCursorName( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CursorName; -- INT16 NameLength; -- } const *params32 = args; -- -- struct SQLSetCursorName_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CursorName), -- params32->NameLength -- }; -- -- return wrap_SQLSetCursorName( ¶ms ); --} -- --static NTSTATUS wow64_SQLSetCursorNameW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CursorName; -- INT16 NameLength; -- } const *params32 = args; -- -- struct SQLSetCursorNameW_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CursorName), -- params32->NameLength -- }; -- -- return wrap_SQLSetCursorNameW( ¶ms ); --} -- --static NTSTATUS wow64_SQLSetDescField( void *args ) --{ -- struct -- { -- UINT64 DescriptorHandle; -- INT16 RecNumber; -- INT16 FieldIdentifier; -- PTR32 Value; -- INT32 BufferLength; -- } const *params32 = args; -- -- struct SQLSetDescField_params params = -- { -- params32->DescriptorHandle, -- params32->RecNumber, -- params32->FieldIdentifier, -- ULongToPtr(params32->Value), -- params32->BufferLength -- }; -- -- return wrap_SQLSetDescField( ¶ms ); --} -- --static NTSTATUS wow64_SQLSetDescFieldW( void *args ) --{ -- struct -- { -- UINT64 DescriptorHandle; -- INT16 RecNumber; -- INT16 FieldIdentifier; -- PTR32 Value; -- INT32 BufferLength; -- } const *params32 = args; -- -- struct SQLSetDescFieldW_params params = -- { -- params32->DescriptorHandle, -- params32->RecNumber, -- params32->FieldIdentifier, -- ULongToPtr(params32->Value), -- params32->BufferLength -- }; -- -- return wrap_SQLSetDescFieldW( ¶ms ); --} -- --static NTSTATUS wow64_SQLSetDescRec( void *args ) --{ -- struct -- { -- UINT64 DescriptorHandle; -- INT16 RecNumber; -- INT16 Type; -- INT16 SubType; -- INT64 Length; -- INT16 Precision; -- INT16 Scale; -- PTR32 Data; -- PTR32 StringLength; -- PTR32 Indicator; -- } const *params32 = args; -- -- struct SQLSetDescRec_params params = -- { -- params32->DescriptorHandle, -- params32->RecNumber, -- params32->Type, -- params32->SubType, -- params32->Length, -- params32->Precision, -- params32->Scale, -- ULongToPtr(params32->Data), -- ULongToPtr(params32->StringLength), -- ULongToPtr(params32->Indicator) -- }; -- -- return wrap_SQLSetDescRec( ¶ms ); --} -- --static NTSTATUS wow64_SQLSetEnvAttr( void *args ) --{ -- struct -- { -- UINT64 EnvironmentHandle; -- INT32 Attribute; -- PTR32 Value; -- INT32 StringLength; -- } const *params32 = args; -- -- struct SQLSetEnvAttr_params params = -- { -- params32->EnvironmentHandle, -- params32->Attribute, -- ULongToPtr(params32->Value), -- params32->StringLength -- }; -- -- return wrap_SQLSetEnvAttr( ¶ms ); --} -- --static NTSTATUS wow64_SQLSetParam( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- INT16 ParameterNumber; -- INT16 ValueType; -- INT16 ParameterType; -- UINT64 LengthPrecision; -- INT16 ParameterScale; -- PTR32 ParameterValue; -- PTR32 StrLen_or_Ind; -- } const *params32 = args; -- -- struct SQLSetParam_params params = -- { -- params32->StatementHandle, -- params32->ParameterNumber, -- params32->ValueType, -- params32->ParameterType, -- params32->LengthPrecision, -- params32->ParameterScale, -- ULongToPtr(params32->ParameterValue), -- ULongToPtr(params32->StrLen_or_Ind) -- }; -- -- return wrap_SQLSetParam( ¶ms ); --} -- --static NTSTATUS wow64_SQLSetStmtAttr( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- INT32 Attribute; -- PTR32 Value; -- INT32 StringLength; -- } const *params32 = args; -- -- struct SQLSetStmtAttr_params params = -- { -- params32->StatementHandle, -- params32->Attribute, -- ULongToPtr(params32->Value), -- params32->StringLength -- }; -- -- return wrap_SQLSetStmtAttr( ¶ms ); --} -- --static NTSTATUS wow64_SQLSetStmtAttrW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- INT32 Attribute; -- PTR32 Value; -- INT32 StringLength; -- } const *params32 = args; -- -- struct SQLSetStmtAttrW_params params = -- { -- params32->StatementHandle, -- params32->Attribute, -- ULongToPtr(params32->Value), -- params32->StringLength -- }; -- -- return wrap_SQLSetStmtAttrW( ¶ms ); --} -- --static NTSTATUS wow64_SQLSpecialColumns( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- UINT16 IdentifierType; -- PTR32 CatalogName; -- INT16 NameLength1; -- PTR32 SchemaName; -- INT16 NameLength2; -- PTR32 TableName; -- INT16 NameLength3; -- UINT16 Scope; -- UINT16 Nullable; -- } const *params32 = args; -- -- struct SQLSpecialColumns_params params = -- { -- params32->StatementHandle, -- params32->IdentifierType, -- ULongToPtr(params32->CatalogName), -- params32->NameLength1, -- ULongToPtr(params32->SchemaName), -- params32->NameLength2, -- ULongToPtr(params32->TableName), -- params32->NameLength3, -- params32->Scope, -- params32->Nullable -- }; -- -- return wrap_SQLSpecialColumns( ¶ms ); --} -- --static NTSTATUS wow64_SQLSpecialColumnsW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- UINT16 IdentifierType; -- PTR32 CatalogName; -- INT16 NameLength1; -- PTR32 SchemaName; -- INT16 NameLength2; -- PTR32 TableName; -- INT16 NameLength3; -- UINT16 Scope; -- UINT16 Nullable; -- } const *params32 = args; -- -- struct SQLSpecialColumnsW_params params = -- { -- params32->StatementHandle, -- params32->IdentifierType, -- ULongToPtr(params32->CatalogName), -- params32->NameLength1, -- ULongToPtr(params32->SchemaName), -- params32->NameLength2, -- ULongToPtr(params32->TableName), -- params32->NameLength3, -- params32->Scope, -- params32->Nullable -- }; -- -- return wrap_SQLSpecialColumnsW( ¶ms ); --} -- --static NTSTATUS wow64_SQLStatistics( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CatalogName; -- INT16 NameLength1; -- PTR32 SchemaName; -- INT16 NameLength2; -- PTR32 TableName; -- INT16 NameLength3; -- UINT16 Unique; -- UINT16 Reserved; -- } const *params32 = args; -- -- struct SQLStatistics_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CatalogName), -- params32->NameLength1, -- ULongToPtr(params32->SchemaName), -- params32->NameLength2, -- ULongToPtr(params32->TableName), -- params32->NameLength3, -- params32->Unique, -- params32->Reserved -- }; -- -- return wrap_SQLStatistics( ¶ms ); --} -- --static NTSTATUS wow64_SQLStatisticsW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CatalogName; -- INT16 NameLength1; -- PTR32 SchemaName; -- INT16 NameLength2; -- PTR32 TableName; -- INT16 NameLength3; -- UINT16 Unique; -- UINT16 Reserved; -- } const *params32 = args; -- -- struct SQLStatisticsW_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CatalogName), -- params32->NameLength1, -- ULongToPtr(params32->SchemaName), -- params32->NameLength2, -- ULongToPtr(params32->TableName), -- params32->NameLength3, -- params32->Unique, -- params32->Reserved -- }; -- -- return wrap_SQLStatisticsW( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetStmtAttr( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- INT32 Attribute; -- PTR32 Value; -- INT32 BufferLength; -- PTR32 StringLength; -- } const *params32 = args; -- -- struct SQLGetStmtAttr_params params = -- { -- params32->StatementHandle, -- params32->Attribute, -- ULongToPtr(params32->Value), -- params32->BufferLength, -- ULongToPtr(params32->StringLength) -- }; -- -- return wrap_SQLGetStmtAttr( ¶ms ); --} -- --static NTSTATUS wow64_SQLGetStmtAttrW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- INT32 Attribute; -- PTR32 Value; -- INT32 BufferLength; -- PTR32 StringLength; -- } const *params32 = args; -- -- struct SQLGetStmtAttrW_params params = -- { -- params32->StatementHandle, -- params32->Attribute, -- ULongToPtr(params32->Value), -- params32->BufferLength, -- ULongToPtr(params32->StringLength) -- }; -- -- return wrap_SQLGetStmtAttrW( ¶ms ); --} -- --static NTSTATUS wow64_SQLTablePrivileges( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CatalogName; -- INT16 NameLength1; -- PTR32 SchemaName; -- INT16 NameLength2; -- PTR32 TableName; -- INT16 NameLength3; -- } const *params32 = args; -- -- struct SQLTablePrivileges_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CatalogName), -- params32->NameLength1, -- ULongToPtr(params32->SchemaName), -- params32->NameLength2, -- ULongToPtr(params32->TableName), -- params32->NameLength3 -- }; -- -- return wrap_SQLTablePrivileges( ¶ms ); --} -- --static NTSTATUS wow64_SQLTablePrivilegesW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CatalogName; -- INT16 NameLength1; -- PTR32 SchemaName; -- INT16 NameLength2; -- PTR32 TableName; -- INT16 NameLength3; -- } const *params32 = args; -- -- struct SQLTablePrivilegesW_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CatalogName), -- params32->NameLength1, -- ULongToPtr(params32->SchemaName), -- params32->NameLength2, -- ULongToPtr(params32->TableName), -- params32->NameLength3 -- }; -- -- return wrap_SQLTablePrivilegesW( ¶ms ); --} -- --static NTSTATUS wow64_SQLTables( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CatalogName; -- INT16 NameLength1; -- PTR32 SchemaName; -- INT16 NameLength2; -- PTR32 TableName; -- INT16 NameLength3; -- PTR32 TableType; -- INT16 NameLength4; -- } const *params32 = args; -- -- struct SQLTables_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CatalogName), -- params32->NameLength1, -- ULongToPtr(params32->SchemaName), -- params32->NameLength2, -- ULongToPtr(params32->TableName), -- params32->NameLength3, -- ULongToPtr(params32->TableType), -- params32->NameLength4 -- }; -- -- return wrap_SQLTables( ¶ms ); --} -- --static NTSTATUS wow64_SQLTablesW( void *args ) --{ -- struct -- { -- UINT64 StatementHandle; -- PTR32 CatalogName; -- INT16 NameLength1; -- PTR32 SchemaName; -- INT16 NameLength2; -- PTR32 TableName; -- INT16 NameLength3; -- PTR32 TableType; -- INT16 NameLength4; -- } const *params32 = args; -- -- struct SQLTablesW_params params = -- { -- params32->StatementHandle, -- ULongToPtr(params32->CatalogName), -- params32->NameLength1, -- ULongToPtr(params32->SchemaName), -- params32->NameLength2, -- ULongToPtr(params32->TableName), -- params32->NameLength3, -- ULongToPtr(params32->TableType), -- params32->NameLength4 -- }; -- -- return wrap_SQLTablesW( ¶ms ); --} -- --const unixlib_entry_t __wine_unix_call_wow64_funcs[] = --{ -- odbc_process_attach, -- wrap_SQLAllocConnect, -- wrap_SQLAllocEnv, -- wrap_SQLAllocHandle, -- wrap_SQLAllocHandleStd, -- wrap_SQLAllocStmt, -- wow64_SQLBindCol, -- wow64_SQLBindParam, -- wow64_SQLBindParameter, -- wow64_SQLBrowseConnect, -- wow64_SQLBrowseConnectW, -- wrap_SQLBulkOperations, -- wrap_SQLCancel, -- wrap_SQLCloseCursor, -- wow64_SQLColAttribute, -- wow64_SQLColAttributeW, -- wow64_SQLColAttributes, -- wow64_SQLColAttributesW, -- wow64_SQLColumnPrivileges, -- wow64_SQLColumnPrivilegesW, -- wow64_SQLColumns, -- wow64_SQLColumnsW, -- wow64_SQLConnect, -- wow64_SQLConnectW, -- wrap_SQLCopyDesc, -- wow64_SQLDataSources, -- wow64_SQLDataSourcesW, -- wow64_SQLDescribeCol, -- wow64_SQLDescribeColW, -- wow64_SQLDescribeParam, -- wrap_SQLDisconnect, -- wow64_SQLDriverConnect, -- wow64_SQLDriverConnectW, -- wow64_SQLDrivers, -- wow64_SQLDriversW, -- wrap_SQLEndTran, -- wow64_SQLError, -- wow64_SQLErrorW, -- wow64_SQLExecDirect, -- wow64_SQLExecDirectW, -- wrap_SQLExecute, -- wow64_SQLExtendedFetch, -- wrap_SQLFetch, -- wrap_SQLFetchScroll, -- wow64_SQLForeignKeys, -- wow64_SQLForeignKeysW, -- wrap_SQLFreeConnect, -- wrap_SQLFreeEnv, -- wrap_SQLFreeHandle, -- wrap_SQLFreeStmt, -- wow64_SQLGetConnectAttr, -- wow64_SQLGetConnectAttrW, -- wow64_SQLGetConnectOption, -- wow64_SQLGetConnectOptionW, -- wow64_SQLGetCursorName, -- wow64_SQLGetCursorNameW, -- wow64_SQLGetData, -- wow64_SQLGetDescField, -- wow64_SQLGetDescFieldW, -- wow64_SQLGetDescRec, -- wow64_SQLGetDescRecW, -- wow64_SQLGetDiagField, -- wow64_SQLGetDiagFieldW, -- wow64_SQLGetDiagRec, -- wow64_SQLGetDiagRecW, -- wow64_SQLGetEnvAttr, -- wow64_SQLGetFunctions, -- wow64_SQLGetInfo, -- wow64_SQLGetInfoW, -- wow64_SQLGetStmtAttr, -- wow64_SQLGetStmtAttrW, -- wow64_SQLGetStmtOption, -- wrap_SQLGetTypeInfo, -- wrap_SQLGetTypeInfoW, -- wrap_SQLMoreResults, -- wow64_SQLNativeSql, -- wow64_SQLNativeSqlW, -- wow64_SQLNumParams, -- wow64_SQLNumResultCols, -- wow64_SQLParamData, -- wow64_SQLParamOptions, -- wow64_SQLPrepare, -- wow64_SQLPrepareW, -- wow64_SQLPrimaryKeys, -- wow64_SQLPrimaryKeysW, -- wow64_SQLProcedureColumns, -- wow64_SQLProcedureColumnsW, -- wow64_SQLProcedures, -- wow64_SQLProceduresW, -- wow64_SQLPutData, -- wow64_SQLRowCount, -- wow64_SQLSetConnectAttr, -- wow64_SQLSetConnectAttrW, -- wrap_SQLSetConnectOption, -- wrap_SQLSetConnectOptionW, -- wow64_SQLSetCursorName, -- wow64_SQLSetCursorNameW, -- wow64_SQLSetDescField, -- wow64_SQLSetDescFieldW, -- wow64_SQLSetDescRec, -- wow64_SQLSetEnvAttr, -- wow64_SQLSetParam, -- wrap_SQLSetPos, -- wrap_SQLSetScrollOptions, -- wow64_SQLSetStmtAttr, -- wow64_SQLSetStmtAttrW, -- wrap_SQLSetStmtOption, -- wow64_SQLSpecialColumns, -- wow64_SQLSpecialColumnsW, -- wow64_SQLStatistics, -- wow64_SQLStatisticsW, -- wow64_SQLTablePrivileges, -- wow64_SQLTablePrivilegesW, -- wow64_SQLTables, -- wow64_SQLTablesW, -- wrap_SQLTransact, --}; -- --C_ASSERT( ARRAYSIZE( __wine_unix_call_wow64_funcs) == unix_funcs_count ); -- --#endif /* _WIN64 */ --- -2.43.0 - diff --git a/patches/odbc-remove-unixodbc/0001-wineodbc-Make-an-ODBC-driver-for-unixODBC-usage.patch b/patches/odbc-remove-unixodbc/0001-wineodbc-Make-an-ODBC-driver-for-unixODBC-usage.patch new file mode 100644 index 00000000..565407f6 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0001-wineodbc-Make-an-ODBC-driver-for-unixODBC-usage.patch @@ -0,0 +1,8033 @@ +From 0446c41060ebbdbabc0ffd820882a97db30f3680 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Sun, 23 Jun 2024 16:05:20 +1000 +Subject: [PATCH] wineodbc: Make an ODBC driver for unixODBC usage + +--- + configure.ac | 1 + + dlls/odbc32/Makefile.in | 5 +- + dlls/odbc32/proxyodbc.c | 2145 ++++-------------- + dlls/wineodbc/Makefile.in | 9 + + dlls/wineodbc/proxyodbc.c | 3110 +++++++++++++++++++++++++++ + dlls/wineodbc/rsrc.rc | 26 + + dlls/{odbc32 => wineodbc}/unixlib.c | 0 + dlls/wineodbc/unixlib.h | 1291 +++++++++++ + dlls/wineodbc/wineodbc.spec | 176 ++ + 9 files changed, 5032 insertions(+), 1731 deletions(-) + create mode 100644 dlls/wineodbc/Makefile.in + create mode 100644 dlls/wineodbc/proxyodbc.c + create mode 100644 dlls/wineodbc/rsrc.rc + rename dlls/{odbc32 => wineodbc}/unixlib.c (100%) + create mode 100644 dlls/wineodbc/unixlib.h + create mode 100644 dlls/wineodbc/wineodbc.spec + +diff --git a/configure.ac b/configure.ac +index e828083fc91..fe32b35d431 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3284,6 +3284,7 @@ WINE_CONFIG_MAKEFILE(dlls/winegstreamer) + WINE_CONFIG_MAKEFILE(dlls/winehid.sys) + WINE_CONFIG_MAKEFILE(dlls/winemac.drv) + WINE_CONFIG_MAKEFILE(dlls/winemapi) ++WINE_CONFIG_MAKEFILE(dlls/wineodbc) + WINE_CONFIG_MAKEFILE(dlls/wineoss.drv) + WINE_CONFIG_MAKEFILE(dlls/wineps.drv) + WINE_CONFIG_MAKEFILE(dlls/wineps16.drv16,enable_win16) +diff --git a/dlls/odbc32/Makefile.in b/dlls/odbc32/Makefile.in +index 0ec0ae8eaf4..a42f1473d67 100644 +--- a/dlls/odbc32/Makefile.in ++++ b/dlls/odbc32/Makefile.in +@@ -1,10 +1,7 @@ + MODULE = odbc32.dll +-UNIXLIB = odbc32.so + IMPORTLIB = odbc32 + IMPORTS = advapi32 +-UNIX_LIBS = $(ODBC_LIBS) + + SOURCES = \ + proxyodbc.c \ +- rsrc.rc \ +- unixlib.c ++ rsrc.rc +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 47e0aff0b18..89e4545f068 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -40,46 +40,19 @@ + #include "sql.h" + #include "sqltypes.h" + #include "sqlext.h" +-#include "unixlib.h" + + WINE_DEFAULT_DEBUG_CHANNEL(odbc); +-WINE_DECLARE_DEBUG_CHANNEL(winediag); + +-#define ODBC_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params ) +- +-static BOOL is_wow64; +- +-static struct handle *alloc_handle( void ) +-{ +- struct handle *ret; +- if (!(ret = calloc( 1, sizeof(*ret) ))) return NULL; +- ret->row_count = 1; +- return ret; +-} + + /************************************************************************* + * SQLAllocConnect [ODBC32.001] + */ + SQLRETURN WINAPI SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionHandle) + { +- struct SQLAllocConnect_params params; +- struct handle *con, *env = EnvironmentHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(EnvironmentHandle %p, ConnectionHandle %p)\n", EnvironmentHandle, ConnectionHandle); +- +- *ConnectionHandle = 0; +- if (!(con = alloc_handle())) return SQL_ERROR; +- +- params.EnvironmentHandle = env->unix_handle; +- if (SUCCESS((ret = ODBC_CALL( SQLAllocConnect, ¶ms )))) +- { +- con->unix_handle = params.ConnectionHandle; +- *ConnectionHandle = con; +- } +- else free( con ); +- +- TRACE("Returning %d, ConnectionHandle %p\n", ret, *ConnectionHandle); ++ FIXME("(EnvironmentHandle %p, ConnectionHandle %p)\n", EnvironmentHandle, ConnectionHandle); ++ *ConnectionHandle = SQL_NULL_HDBC; + return ret; + } + +@@ -88,23 +61,12 @@ SQLRETURN WINAPI SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionH + */ + SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle) + { +- struct SQLAllocEnv_params params; +- struct handle *env; +- SQLRETURN ret; +- +- TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle); ++ SQLRETURN ret = SQL_ERROR; + +- *EnvironmentHandle = 0; +- if (!(env = alloc_handle())) return SQL_ERROR; ++ FIXME("(EnvironmentHandle %p)\n", EnvironmentHandle); + +- if (SUCCESS((ret = ODBC_CALL( SQLAllocEnv, ¶ms )))) +- { +- env->unix_handle = params.EnvironmentHandle; +- *EnvironmentHandle = env; +- } +- else free( env ); ++ *EnvironmentHandle = SQL_NULL_HENV; + +- TRACE("Returning %d, EnvironmentHandle %p\n", ret, *EnvironmentHandle); + return ret; + } + +@@ -113,25 +75,11 @@ SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle) + */ + SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle) + { +- struct SQLAllocHandle_params params; +- struct handle *output, *input = InputHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); ++ FIXME("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); + + *OutputHandle = 0; +- if (!(output = alloc_handle())) return SQL_ERROR; +- +- params.HandleType = HandleType; +- params.InputHandle = input ? input->unix_handle : 0; +- if (SUCCESS((ret = ODBC_CALL( SQLAllocHandle, ¶ms )))) +- { +- output->unix_handle = params.OutputHandle; +- *OutputHandle = output; +- } +- else free( output ); +- +- TRACE("Returning %d, OutputHandle %p\n", ret, *OutputHandle); + return ret; + } + +@@ -140,24 +88,11 @@ SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, S + */ + SQLRETURN WINAPI SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandle) + { +- struct SQLAllocStmt_params params; +- struct handle *stmt, *con = ConnectionHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, StatementHandle %p)\n", ConnectionHandle, StatementHandle); ++ FIXME("(ConnectionHandle %p, StatementHandle %p)\n", ConnectionHandle, StatementHandle); + +- *StatementHandle = 0; +- if (!(stmt = alloc_handle())) return SQL_ERROR; +- +- params.ConnectionHandle = con->unix_handle; +- if (SUCCESS((ret = ODBC_CALL( SQLAllocStmt, ¶ms )))) +- { +- stmt->unix_handle = params.StatementHandle; +- *StatementHandle = stmt; +- } +- else free( stmt ); +- +- TRACE ("Returning %d, StatementHandle %p\n", ret, *StatementHandle); ++ *StatementHandle = SQL_NULL_HSTMT; + return ret; + } + +@@ -166,25 +101,11 @@ SQLRETURN WINAPI SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandl + */ + SQLRETURN WINAPI SQLAllocHandleStd(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle) + { +- struct SQLAllocHandleStd_params params; +- struct handle *output, *input = InputHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); ++ FIXME("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); + + *OutputHandle = 0; +- if (!(output = alloc_handle())) return SQL_ERROR; +- +- params.HandleType = HandleType; +- params.InputHandle = input ? input->unix_handle : 0; +- if (SUCCESS((ret = ODBC_CALL( SQLAllocHandleStd, ¶ms )))) +- { +- output->unix_handle = params.OutputHandle; +- *OutputHandle = output; +- } +- else free( output ); +- +- TRACE ("Returning %d, OutputHandle %p\n", ret, *OutputHandle); + return ret; + } + +@@ -197,51 +118,17 @@ static const char *debugstr_sqllen( SQLLEN len ) + #endif + } + +-#define MAX_BINDING_PARAMS 1024 +-static BOOL alloc_binding( struct param_binding *binding, USHORT type, UINT column, UINT row_count ) +-{ +- if (column > MAX_BINDING_PARAMS) +- { +- FIXME( "increase maximum number of parameters\n" ); +- return FALSE; +- } +- if (!binding->param && !(binding->param = calloc( MAX_BINDING_PARAMS, sizeof(*binding->param)))) return FALSE; +- +- if (!(binding->param[column - 1].len = calloc( row_count, sizeof(UINT64) ))) return FALSE; +- binding->param[column - 1].type = type; +- binding->count = column; +- return TRUE; +-} +- + /************************************************************************* + * SQLBindCol [ODBC32.004] + */ + SQLRETURN WINAPI SQLBindCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, + SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind) + { +- struct SQLBindCol_params params = { 0, ColumnNumber, TargetType, TargetValue, BufferLength }; +- struct handle *handle = StatementHandle; +- UINT i = ColumnNumber - 1; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", ++ FIXME("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", + StatementHandle, ColumnNumber, TargetType, TargetValue, debugstr_sqllen(BufferLength), StrLen_or_Ind); + +- if (!handle) return SQL_INVALID_HANDLE; +- if (!ColumnNumber) +- { +- FIXME( "column 0 not handled\n" ); +- return SQL_ERROR; +- } +- if (!alloc_binding( &handle->bind_col, SQL_PARAM_INPUT_OUTPUT, ColumnNumber, handle->row_count )) return SQL_ERROR; +- handle->bind_col.param[i].col.target_type = TargetType; +- handle->bind_col.param[i].col.target_value = TargetValue; +- handle->bind_col.param[i].col.buffer_length = BufferLength; +- +- params.StatementHandle = handle->unix_handle; +- if (StrLen_or_Ind) params.StrLen_or_Ind = handle->bind_col.param[i].len; +- if (SUCCESS(( ret = ODBC_CALL( SQLBindCol, ¶ms )))) handle->bind_col.param[i].ptr = StrLen_or_Ind; +- TRACE ("Returning %d\n", ret); + return ret; + } + +@@ -261,34 +148,12 @@ SQLRETURN WINAPI SQLBindParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNu + SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale, + SQLPOINTER ParameterValue, SQLLEN *StrLen_or_Ind) + { +- struct SQLBindParam_params params = { 0, ParameterNumber, ValueType, ParameterType, LengthPrecision, +- ParameterScale, ParameterValue }; +- struct handle *handle = StatementHandle; +- UINT i = ParameterNumber - 1; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s," ++ FIXME("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s," + " ParameterScale %d, ParameterValue %p, StrLen_or_Ind %p)\n", StatementHandle, ParameterNumber, ValueType, + ParameterType, debugstr_sqlulen(LengthPrecision), ParameterScale, ParameterValue, StrLen_or_Ind); + +- if (!handle) return SQL_INVALID_HANDLE; +- if (!ParameterNumber) +- { +- FIXME( "parameter 0 not handled\n" ); +- return SQL_ERROR; +- } +- if (!alloc_binding( &handle->bind_param, SQL_PARAM_INPUT, ParameterNumber, handle->row_count )) return SQL_ERROR; +- handle->bind_param.param[i].param.value_type = ValueType; +- handle->bind_param.param[i].param.parameter_type = ParameterType; +- handle->bind_param.param[i].param.length_precision = LengthPrecision; +- handle->bind_param.param[i].param.parameter_scale = ParameterScale; +- handle->bind_param.param[i].param.parameter_value = ParameterValue; +- +- params.StatementHandle = handle->unix_handle; +- params.StrLen_or_Ind = handle->bind_param.param[i].len; +- *(UINT64 *)params.StrLen_or_Ind = *StrLen_or_Ind; +- if (SUCCESS(( ret = ODBC_CALL( SQLBindParam, ¶ms )))) handle->bind_param.param[i].ptr = StrLen_or_Ind; +- TRACE ("Returning %d\n", ret); + return ret; + } + +@@ -297,17 +162,10 @@ SQLRETURN WINAPI SQLBindParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNu + */ + SQLRETURN WINAPI SQLCancel(SQLHSTMT StatementHandle) + { +- struct SQLCancel_params params; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p)\n", StatementHandle); ++ FIXME("(StatementHandle %p)\n", StatementHandle); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLCancel, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -316,43 +174,27 @@ SQLRETURN WINAPI SQLCancel(SQLHSTMT StatementHandle) + */ + SQLRETURN WINAPI SQLCloseCursor(SQLHSTMT StatementHandle) + { +- struct SQLCloseCursor_params params; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; +- +- TRACE("(StatementHandle %p)\n", StatementHandle); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(StatementHandle %p)\n", StatementHandle); + +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLCloseCursor, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLColAttribute [ODBC32.027] + */ +-SQLRETURN WINAPI SQLColAttribute(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, +- SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, ++SQLRETURN WINAPI SQLColAttribute(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, ++ SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttribute, ++ SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, + SQLLEN *NumericAttribute) + { +- struct SQLColAttribute_params params = { 0, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength, +- StringLength }; +- struct handle *handle = StatementHandle; +- INT64 num_attr = 0; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttribute %p, BufferLength %d," ++ FIXME("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttribute %p, BufferLength %d," + " StringLength %p, NumericAttribute %p)\n", StatementHandle, ColumnNumber, FieldIdentifier, + CharacterAttribute, BufferLength, StringLength, NumericAttribute); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- params.NumericAttribute = &num_attr; +- if (SUCCESS(( ret = ODBC_CALL( SQLColAttribute, ¶ms ))) && NumericAttribute) *NumericAttribute = num_attr; +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -363,23 +205,15 @@ SQLRETURN WINAPI SQLColumns(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLS + SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, + SQLSMALLINT NameLength3, SQLCHAR *ColumnName, SQLSMALLINT NameLength4) + { +- struct SQLColumns_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, +- NameLength3, ColumnName, NameLength4 }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," ++ FIXME("(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); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLColumns, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -390,21 +224,14 @@ SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSM + SQLCHAR *UserName, SQLSMALLINT NameLength2, SQLCHAR *Authentication, + SQLSMALLINT NameLength3) + { +- struct SQLConnect_params params = { 0, ServerName, NameLength1, UserName, NameLength2, Authentication, NameLength3 }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, ServerName %s, NameLength1 %d, UserName %s, NameLength2 %d, Authentication %s," ++ FIXME("(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); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLConnect, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -413,18 +240,10 @@ SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSM + */ + SQLRETURN WINAPI SQLCopyDesc(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle) + { +- struct SQLCopyDesc_params params; +- struct handle *source = SourceDescHandle, *target = TargetDescHandle; +- SQLRETURN ret; +- +- TRACE("(SourceDescHandle %p, TargetDescHandle %p)\n", SourceDescHandle, TargetDescHandle); ++ SQLRETURN ret = SQL_ERROR; + +- if (!source || !target) return SQL_INVALID_HANDLE; ++ FIXME("(SourceDescHandle %p, TargetDescHandle %p)\n", SourceDescHandle, TargetDescHandle); + +- params.SourceDescHandle = source->unix_handle; +- params.TargetDescHandle = target->unix_handle; +- ret = ODBC_CALL( SQLCopyDesc, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -435,28 +254,12 @@ SQLRETURN WINAPI SQLDataSources(SQLHENV EnvironmentHandle, SQLUSMALLINT Directio + SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, SQLCHAR *Description, + SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2) + { +- struct SQLDataSources_params params = { 0, Direction, ServerName, BufferLength1, NameLength1, Description, +- BufferLength2, NameLength2 }; +- struct handle *handle = EnvironmentHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_NO_DATA; + +- TRACE("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p," ++ FIXME("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p," + " BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle, Direction, ServerName, BufferLength1, + NameLength1, Description, BufferLength2, NameLength2); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.EnvironmentHandle = handle->unix_handle; +- if (SUCCESS((ret = ODBC_CALL( SQLDataSources, ¶ms ))) && TRACE_ON(odbc)) +- { +- if (ServerName && NameLength1 && *NameLength1 > 0) +- TRACE(" DataSource %s", debugstr_an((const char *)ServerName, *NameLength1)); +- if (Description && NameLength2 && *NameLength2 > 0) +- TRACE(" Description %s", debugstr_an((const char *)Description, *NameLength2)); +- TRACE("\n"); +- } +- +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -464,8 +267,13 @@ SQLRETURN WINAPI SQLDataSourcesA(SQLHENV EnvironmentHandle, SQLUSMALLINT Directi + SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, SQLCHAR *Description, + SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2) + { +- return SQLDataSources( EnvironmentHandle, Direction, ServerName, BufferLength1, NameLength1, Description, +- BufferLength2, NameLength2 ); ++ SQLRETURN ret = SQL_NO_DATA; ++ ++ FIXME("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p," ++ " BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle, Direction, ServerName, BufferLength1, ++ NameLength1, Description, BufferLength2, NameLength2); ++ ++ return ret; + } + + /************************************************************************* +@@ -475,36 +283,12 @@ SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNum + SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType, + SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) + { +- struct SQLDescribeCol_params params = { 0, ColumnNumber, ColumnName, BufferLength, NameLength, DataType, +- NULL, DecimalDigits, Nullable }; +- struct handle *handle = StatementHandle; +- UINT64 size; +- SQLSMALLINT dummy; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," ++ FIXME("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," + " ColumnSize %p, DecimalDigits %p, Nullable %p)\n", StatementHandle, ColumnNumber, ColumnName, + BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- if (!params.NameLength) params.NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ +- params.ColumnSize = &size; +- if (SUCCESS((ret = ODBC_CALL( SQLDescribeCol, ¶ms )))) +- { +- if (ColumnName && NameLength) TRACE(" ColumnName %s\n", debugstr_an((const char *)ColumnName, *NameLength)); +- if (DataType) TRACE(" DataType %d\n", *DataType); +- if (ColumnSize) +- { +- *ColumnSize = size; +- TRACE(" ColumnSize %s\n", debugstr_sqlulen(*ColumnSize)); +- } +- if (DecimalDigits) TRACE(" DecimalDigits %d\n", *DecimalDigits); +- if (Nullable) TRACE(" Nullable %d\n", *Nullable); +- } +- +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -513,17 +297,10 @@ SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNum + */ + SQLRETURN WINAPI SQLDisconnect(SQLHDBC ConnectionHandle) + { +- struct SQLDisconnect_params params; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p)\n", ConnectionHandle); ++ FIXME("(ConnectionHandle %p)\n", ConnectionHandle); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLDisconnect, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -532,17 +309,10 @@ SQLRETURN WINAPI SQLDisconnect(SQLHDBC ConnectionHandle) + */ + SQLRETURN WINAPI SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType) + { +- struct SQLEndTran_params params = { HandleType, 0, CompletionType }; +- struct handle *handle = Handle; +- SQLRETURN ret; +- +- TRACE("(HandleType %d, Handle %p, CompletionType %d)\n", HandleType, Handle, CompletionType); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(HandleType %d, Handle %p, CompletionType %d)\n", HandleType, Handle, CompletionType); + +- params.Handle = handle->unix_handle; +- ret = ODBC_CALL( SQLEndTran, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -550,28 +320,15 @@ SQLRETURN WINAPI SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLIN + * SQLError [ODBC32.010] + */ + SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, +- SQLCHAR *SqlState, SQLINTEGER *NativeError, SQLCHAR *MessageText, ++ SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText, + SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) + { +- struct SQLError_params params = { 0, 0, 0, SqlState, NativeError, MessageText, BufferLength, TextLength }; +- struct handle *env = EnvironmentHandle, *con = ConnectionHandle, *stmt = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, SqlState %p, NativeError %p," ++ FIXME("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, Sqlstate %p, NativeError %p," + " MessageText %p, BufferLength %d, TextLength %p)\n", EnvironmentHandle, ConnectionHandle, +- StatementHandle, SqlState, NativeError, MessageText, BufferLength, TextLength); ++ StatementHandle, Sqlstate, NativeError, MessageText, BufferLength, TextLength); + +- if (env) params.EnvironmentHandle = env->unix_handle; +- if (con) params.ConnectionHandle = con->unix_handle; +- if (stmt) params.StatementHandle = stmt->unix_handle; +- if (SUCCESS((ret = ODBC_CALL( SQLError, ¶ms )))) +- { +- TRACE(" SqlState %s\n", debugstr_an((const char *)SqlState, 5)); +- TRACE(" Error %d\n", *NativeError); +- TRACE(" MessageText %s\n", debugstr_an((const char *)MessageText, *TextLength)); +- } +- +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -580,98 +337,23 @@ SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, S + */ + SQLRETURN WINAPI SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength) + { +- struct SQLExecDirect_params params = { 0, StatementText, TextLength }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, ++ FIXME("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, + debugstr_an((const char *)StatementText, TextLength), TextLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLExecDirect, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +-static void len_to_user( SQLLEN *ptr, UINT8 *len, UINT row_count, UINT width ) +-{ +- UINT i; +- for (i = 0; i < row_count; i++) +- { +- *ptr++ = *(SQLLEN *)(len + i * width); +- } +-} +- +-static void len_from_user( UINT8 *len, SQLLEN *ptr, UINT row_count, UINT width ) +-{ +- UINT i; +- for (i = 0; i < row_count; i++) +- { +- *(SQLLEN *)(len + i * width) = *ptr++; +- } +-} +- +-static void update_result_lengths( struct handle *handle, USHORT type ) +-{ +- UINT i, width = sizeof(void *) == 8 ? 8 : is_wow64 ? 8 : 4; +- +- switch (type) +- { +- case SQL_PARAM_OUTPUT: +- for (i = 0; i < handle->bind_col.count; i++) +- { +- len_to_user( handle->bind_col.param[i].ptr, handle->bind_col.param[i].len, handle->row_count, width ); +- } +- for (i = 0; i < handle->bind_param.count; i++) +- { +- len_to_user( handle->bind_param.param[i].ptr, handle->bind_param.param[i].len, handle->row_count, width ); +- } +- for (i = 0; i < handle->bind_parameter.count; i++) +- { +- if (handle->bind_parameter.param[i].type != SQL_PARAM_OUTPUT && +- handle->bind_parameter.param[i].type != SQL_PARAM_INPUT_OUTPUT) continue; +- +- len_to_user( handle->bind_parameter.param[i].ptr, handle->bind_parameter.param[i].len, handle->row_count, width ); +- } +- break; +- +- case SQL_PARAM_INPUT: +- for (i = 0; i < handle->bind_col.count; i++) +- { +- len_from_user( handle->bind_col.param[i].len, handle->bind_col.param[i].ptr, handle->row_count, width ); +- } +- /* FIXME: handle bind_param */ +- for (i = 0; i < handle->bind_parameter.count; i++) +- { +- if (handle->bind_parameter.param[i].type != SQL_PARAM_INPUT && +- handle->bind_parameter.param[i].type != SQL_PARAM_INPUT_OUTPUT) continue; +- +- len_from_user( handle->bind_parameter.param[i].len, handle->bind_parameter.param[i].ptr, handle->row_count, width ); +- } +- +- default: break; +- } +-} +- + /************************************************************************* + * SQLExecute [ODBC32.012] + */ + SQLRETURN WINAPI SQLExecute(SQLHSTMT StatementHandle) + { +- struct SQLExecute_params params; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p)\n", StatementHandle); ++ FIXME("(StatementHandle %p)\n", StatementHandle); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- update_result_lengths( handle, SQL_PARAM_INPUT ); +- if (SUCCESS(( ret = ODBC_CALL( SQLExecute, ¶ms )))) update_result_lengths( handle, SQL_PARAM_OUTPUT ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -680,17 +362,10 @@ SQLRETURN WINAPI SQLExecute(SQLHSTMT StatementHandle) + */ + SQLRETURN WINAPI SQLFetch(SQLHSTMT StatementHandle) + { +- struct SQLFetch_params params; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; +- +- TRACE("(StatementHandle %p)\n", StatementHandle); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(StatementHandle %p)\n", StatementHandle); + +- params.StatementHandle = handle->unix_handle; +- if (SUCCESS(( ret = ODBC_CALL( SQLFetch, ¶ms )))) update_result_lengths( handle, SQL_PARAM_OUTPUT ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -699,18 +374,11 @@ SQLRETURN WINAPI SQLFetch(SQLHSTMT StatementHandle) + */ + SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset) + { +- struct SQLFetchScroll_params params = { 0, FetchOrientation, FetchOffset }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, FetchOrientation %d, FetchOffset %s)\n", StatementHandle, FetchOrientation, ++ FIXME("(StatementHandle %p, FetchOrientation %d, FetchOffset %s)\n", StatementHandle, FetchOrientation, + debugstr_sqllen(FetchOffset)); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- if (SUCCESS(( ret = ODBC_CALL( SQLFetchScroll, ¶ms )))) update_result_lengths( handle, SQL_PARAM_OUTPUT ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -719,18 +387,10 @@ SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrien + */ + SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle) + { +- struct SQLFreeConnect_params params; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; +- +- TRACE("(ConnectionHandle %p)\n", ConnectionHandle); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(ConnectionHandle %p)\n", ConnectionHandle); + +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLFreeConnect, ¶ms ); +- free( handle ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -739,59 +399,22 @@ SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle) + */ + SQLRETURN WINAPI SQLFreeEnv(SQLHENV EnvironmentHandle) + { +- struct SQLFreeEnv_params params; +- struct handle *handle = EnvironmentHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle); ++ FIXME("(EnvironmentHandle %p)\n", EnvironmentHandle); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.EnvironmentHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLFreeEnv, ¶ms ); +- free( handle ); +- TRACE("Returning %d\n", ret); + return ret; + } + +-static void free_bindings( struct handle *handle ) +-{ +- if (handle->bind_col.param) +- { +- free( handle->bind_col.param->len ); +- free( handle->bind_col.param ); +- } +- if (handle->bind_param.param) +- { +- free( handle->bind_param.param->len ); +- free( handle->bind_param.param ); +- } +- if (handle->bind_parameter.param) +- { +- free( handle->bind_parameter.param->len ); +- free( handle->bind_parameter.param ); +- } +-} +- + /************************************************************************* + * SQLFreeHandle [ODBC32.031] + */ + SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) + { +- struct SQLFreeHandle_params params; +- struct handle *handle = Handle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(HandleType %d, Handle %p)\n", HandleType, Handle); ++ FIXME("(HandleType %d, Handle %p)\n", HandleType, Handle); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.HandleType = HandleType; +- params.Handle = handle->unix_handle; +- ret = ODBC_CALL( SQLFreeHandle, ¶ms ); +- free_bindings( handle ); +- free( handle ); +- TRACE ("Returning %d\n", ret); + return ret; + } + +@@ -800,20 +423,10 @@ SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) + */ + SQLRETURN WINAPI SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option) + { +- struct SQLFreeStmt_params params; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; +- +- TRACE("(StatementHandle %p, Option %d)\n", StatementHandle, Option); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(StatementHandle %p, Option %d)\n", StatementHandle, Option); + +- params.StatementHandle = handle->unix_handle; +- params.Option = Option; +- ret = ODBC_CALL( SQLFreeStmt, ¶ms ); +- free_bindings( handle ); +- free( handle ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -823,18 +436,11 @@ SQLRETURN WINAPI SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option) + SQLRETURN WINAPI SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength) + { +- struct SQLGetConnectAttr_params params = { 0, Attribute, Value, BufferLength, StringLength }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, ++ FIXME("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, + Attribute, Value, BufferLength, StringLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetConnectAttr, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -843,17 +449,10 @@ SQLRETURN WINAPI SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribut + */ + SQLRETURN WINAPI SQLGetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value) + { +- struct SQLGetConnectOption_params params = { 0, Option, Value }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; +- +- TRACE("(ConnectionHandle %p, Option %d, Value %p)\n", ConnectionHandle, Option, Value); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(ConnectionHandle %p, Option %d, Value %p)\n", ConnectionHandle, Option, Value); + +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetConnectOption, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -863,18 +462,11 @@ SQLRETURN WINAPI SQLGetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Opti + SQLRETURN WINAPI SQLGetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT BufferLength, + SQLSMALLINT *NameLength) + { +- struct SQLGetCursorName_params params = { 0, CursorName, BufferLength, NameLength }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle, CursorName, ++ FIXME("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle, CursorName, + BufferLength, NameLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetCursorName, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -884,20 +476,11 @@ SQLRETURN WINAPI SQLGetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, + SQLRETURN WINAPI SQLGetData(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, + SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind) + { +- struct SQLGetData_params params = { 0, ColumnNumber, TargetType, TargetValue, BufferLength }; +- struct handle *handle = StatementHandle; +- INT64 len; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", ++ FIXME("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", + StatementHandle, ColumnNumber, TargetType, TargetValue, debugstr_sqllen(BufferLength), StrLen_or_Ind); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- params.StrLen_or_Ind = &len; +- if (SUCCESS((ret = ODBC_CALL( SQLGetData, ¶ms )))) *StrLen_or_Ind = len; +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -907,18 +490,11 @@ SQLRETURN WINAPI SQLGetData(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, + SQLRETURN WINAPI SQLGetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, + SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) + { +- struct SQLGetDescField_params params = { 0, RecNumber, FieldIdentifier, Value, BufferLength, StringLength }; +- struct handle *handle = DescriptorHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n", ++ FIXME("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n", + DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength, StringLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.DescriptorHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetDescField, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -930,22 +506,12 @@ SQLRETURN WINAPI SQLGetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, + SQLSMALLINT *SubType, SQLLEN *Length, SQLSMALLINT *Precision, + SQLSMALLINT *Scale, SQLSMALLINT *Nullable) + { +- struct SQLGetDescRec_params params = { 0, RecNumber, Name, BufferLength, StringLength, Type, SubType, NULL, +- Precision, Scale, Nullable }; +- struct handle *handle = DescriptorHandle; +- INT64 len; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p," ++ FIXME("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p," + " Length %p, Precision %p, Scale %p, Nullable %p)\n", DescriptorHandle, RecNumber, Name, BufferLength, + StringLength, Type, SubType, Length, Precision, Scale, Nullable); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.DescriptorHandle = handle->unix_handle; +- params.Length = &len; +- if (SUCCESS((ret = ODBC_CALL( SQLGetDescRec, ¶ms )))) *Length = len; +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -956,19 +522,11 @@ SQLRETURN WINAPI SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSM + SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, + SQLSMALLINT *StringLength) + { +- struct SQLGetDiagField_params params = { HandleType, 0, RecNumber, DiagIdentifier, DiagInfo, BufferLength, +- StringLength }; +- struct handle *handle = Handle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_NO_DATA; + +- TRACE("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," ++ FIXME("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," + " StringLength %p)\n", HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.Handle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetDiagField, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -976,23 +534,15 @@ SQLRETURN WINAPI SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSM + * SQLGetDiagRec [ODBC32.036] + */ + SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, +- SQLCHAR *SqlState, SQLINTEGER *NativeError, SQLCHAR *MessageText, ++ SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText, + SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) + { +- struct SQLGetDiagRec_params params = { HandleType, 0, RecNumber, SqlState, NativeError, MessageText, +- BufferLength, TextLength }; +- struct handle *handle = Handle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_NO_DATA; + +- TRACE("(HandleType %d, Handle %p, RecNumber %d, SqlState %p, NativeError %p, MessageText %p, BufferLength %d," +- " TextLength %p)\n", HandleType, Handle, RecNumber, SqlState, NativeError, MessageText, BufferLength, ++ FIXME("(HandleType %d, Handle %p, RecNumber %d, Sqlstate %p, NativeError %p, MessageText %p, BufferLength %d," ++ " TextLength %p)\n", HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength, + TextLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.Handle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetDiagRec, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1002,18 +552,11 @@ SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMAL + SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength) + { +- struct SQLGetEnvAttr_params params = { 0, Attribute, Value, BufferLength, StringLength }; +- struct handle *handle = EnvironmentHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(EnvironmentHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ++ FIXME("(EnvironmentHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", + EnvironmentHandle, Attribute, Value, BufferLength, StringLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.EnvironmentHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetEnvAttr, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1022,17 +565,10 @@ SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, + */ + SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported) + { +- struct SQLGetFunctions_params params = { 0, FunctionId, Supported }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; +- +- TRACE("(ConnectionHandle %p, FunctionId %d, Supported %p)\n", ConnectionHandle, FunctionId, Supported); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(ConnectionHandle %p, FunctionId %d, Supported %p)\n", ConnectionHandle, FunctionId, Supported); + +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetFunctions, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1042,18 +578,11 @@ SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT Function + SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) + { +- struct SQLGetInfo_params params = { 0, InfoType, InfoValue, BufferLength, StringLength }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, ++ FIXME("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, + InfoType, InfoValue, BufferLength, StringLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetInfo, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1063,11 +592,9 @@ SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQL + SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength) + { +- struct SQLGetStmtAttr_params params = { 0, Attribute, Value, BufferLength, StringLength }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, ++ FIXME("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, + Attribute, Value, BufferLength, StringLength); + + if (!Value) +@@ -1076,11 +603,6 @@ SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, + return SQL_ERROR; + } + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetStmtAttr, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1089,17 +611,10 @@ SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, + */ + SQLRETURN WINAPI SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLPOINTER Value) + { +- struct SQLGetStmtOption_params params = { 0, Option, Value }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, Option %d, Value %p)\n", StatementHandle, Option, Value); ++ FIXME("(StatementHandle %p, Option %d, Value %p)\n", StatementHandle, Option, Value); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetStmtOption, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1108,17 +623,10 @@ SQLRETURN WINAPI SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, + */ + SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) + { +- struct SQLGetTypeInfo_params params = { 0, DataType }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; +- +- TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); + +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetTypeInfo, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1127,17 +635,10 @@ SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) + */ + SQLRETURN WINAPI SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnCount) + { +- struct SQLNumResultCols_params params = { 0, ColumnCount }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, ColumnCount %p)\n", StatementHandle, ColumnCount); ++ FIXME("(StatementHandle %p, ColumnCount %p)\n", StatementHandle, ColumnCount); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLNumResultCols, ¶ms ); +- TRACE("Returning %d ColumnCount %d\n", ret, *ColumnCount); + return ret; + } + +@@ -1146,17 +647,10 @@ SQLRETURN WINAPI SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnC + */ + SQLRETURN WINAPI SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value) + { +- struct SQLParamData_params params = { 0, Value }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; +- +- TRACE("(StatementHandle %p, Value %p)\n", StatementHandle, Value); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(StatementHandle %p, Value %p)\n", StatementHandle, Value); + +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLParamData, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1165,18 +659,11 @@ SQLRETURN WINAPI SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value) + */ + SQLRETURN WINAPI SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength) + { +- struct SQLPrepare_params params = { 0, StatementText, TextLength }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, ++ FIXME("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, + debugstr_an((const char *)StatementText, TextLength), TextLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLPrepare, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1185,17 +672,10 @@ SQLRETURN WINAPI SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQ + */ + SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN StrLen_or_Ind) + { +- struct SQLPutData_params params = { 0, Data, StrLen_or_Ind }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; +- +- TRACE("(StatementHandle %p, Data %p, StrLen_or_Ind %s)\n", StatementHandle, Data, debugstr_sqllen(StrLen_or_Ind)); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(StatementHandle %p, Data %p, StrLen_or_Ind %s)\n", StatementHandle, Data, debugstr_sqllen(StrLen_or_Ind)); + +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLPutData, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1204,23 +684,10 @@ SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN St + */ + SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount) + { +- struct SQLRowCount_params params; +- struct handle *handle = StatementHandle; +- INT64 count; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, RowCount %p)\n", StatementHandle, RowCount); ++ FIXME("(StatementHandle %p, RowCount %p)\n", StatementHandle, RowCount); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- params.RowCount = &count; +- if (SUCCESS((ret = ODBC_CALL( SQLRowCount, ¶ms ))) && RowCount) +- { +- *RowCount = count; +- TRACE(" RowCount %s\n", debugstr_sqllen(*RowCount)); +- } +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1230,18 +697,11 @@ SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount) + SQLRETURN WINAPI SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength) + { +- struct SQLSetConnectAttr_params params = { 0, Attribute, Value, StringLength }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value, ++ FIXME("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value, + StringLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLSetConnectAttr, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1250,17 +710,10 @@ SQLRETURN WINAPI SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribut + */ + SQLRETURN WINAPI SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value) + { +- struct SQLSetConnectOption_params params = { 0, Option, Value }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle, Option, debugstr_sqlulen(Value)); ++ FIXME("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle, Option, debugstr_sqlulen(Value)); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLSetConnectOption, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1269,18 +722,11 @@ SQLRETURN WINAPI SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Opti + */ + SQLRETURN WINAPI SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT NameLength) + { +- struct SQLSetCursorName_params params = { 0, CursorName, NameLength }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle, ++ FIXME("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle, + debugstr_an((const char *)CursorName, NameLength), NameLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLSetCursorName, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1290,18 +736,11 @@ SQLRETURN WINAPI SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, + SQLRETURN WINAPI SQLSetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, + SQLPOINTER Value, SQLINTEGER BufferLength) + { +- struct SQLSetDescField_params params = { 0, RecNumber, FieldIdentifier, Value, BufferLength }; +- struct handle *handle = DescriptorHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle, ++ FIXME("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle, + RecNumber, FieldIdentifier, Value, BufferLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.DescriptorHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLSetDescField, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1312,26 +751,12 @@ SQLRETURN WINAPI SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, + SQLSMALLINT SubType, SQLLEN Length, SQLSMALLINT Precision, SQLSMALLINT Scale, + SQLPOINTER Data, SQLLEN *StringLength, SQLLEN *Indicator) + { +- struct SQLSetDescRec_params params = { 0, RecNumber, Type, SubType, Length, Precision, Scale, Data }; +- struct handle *handle = DescriptorHandle; +- INT64 stringlen, indicator; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(DescriptorHandle %p, RecNumber %d, Type %d, SubType %d, Length %s, Precision %d, Scale %d, Data %p," ++ FIXME("(DescriptorHandle %p, RecNumber %d, Type %d, SubType %d, Length %s, Precision %d, Scale %d, Data %p," + " StringLength %p, Indicator %p)\n", DescriptorHandle, RecNumber, Type, SubType, debugstr_sqllen(Length), + Precision, Scale, Data, StringLength, Indicator); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.DescriptorHandle = handle->unix_handle; +- params.StringLength = &stringlen; +- params.Indicator = &indicator; +- if (SUCCESS((ret = ODBC_CALL( SQLSetDescRec, ¶ms )))) +- { +- *StringLength = stringlen; +- *Indicator = indicator; +- } +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1341,16 +766,11 @@ SQLRETURN WINAPI SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, + SQLRETURN WINAPI SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength) + { +- struct SQLSetEnvAttr_params params = { 0, Attribute, Value, StringLength }; +- struct handle *handle = EnvironmentHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(EnvironmentHandle %p, Attribute %d, Value %p, StringLength %d)\n", EnvironmentHandle, Attribute, Value, ++ FIXME("(EnvironmentHandle %p, Attribute %d, Value %p, StringLength %d)\n", EnvironmentHandle, Attribute, Value, + StringLength); + +- params.EnvironmentHandle = handle ? handle->unix_handle : 0; +- ret = ODBC_CALL( SQLSetEnvAttr, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1361,132 +781,26 @@ SQLRETURN WINAPI SQLSetParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNum + SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale, + SQLPOINTER ParameterValue, SQLLEN *StrLen_or_Ind) + { +- struct SQLSetParam_params params = { 0, ParameterNumber, ValueType, ParameterType, LengthPrecision, ParameterScale, +- ParameterValue }; +- struct handle *handle = StatementHandle; +- INT64 len; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s," ++ FIXME("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s," + " ParameterScale %d, ParameterValue %p, StrLen_or_Ind %p)\n", StatementHandle, ParameterNumber, ValueType, + ParameterType, debugstr_sqlulen(LengthPrecision), ParameterScale, ParameterValue, StrLen_or_Ind); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- params.StrLen_or_Ind = &len; +- if (SUCCESS((ret = ODBC_CALL( SQLSetParam, ¶ms )))) *StrLen_or_Ind = len; +- TRACE("Returning %d\n", ret); + return ret; + } + +-static BOOL resize_result_lengths( struct handle *handle, UINT size ) +-{ +- UINT i; +- for (i = 0; i < handle->bind_col.count; i++) +- { +- UINT8 *tmp; +- if (!handle->bind_col.param[i].ptr) continue; +- if (!(tmp = realloc( handle->bind_col.param[i].len, size * sizeof(UINT64) ))) return FALSE; +- if (tmp != handle->bind_col.param[i].len) +- { +- struct SQLBindCol_params params; +- +- params.StatementHandle = handle->unix_handle; +- params.ColumnNumber = i + 1; +- params.TargetType = handle->bind_col.param[i].col.target_type; +- params.TargetValue = handle->bind_col.param[i].col.target_value; +- params.BufferLength = handle->bind_col.param[i].col.buffer_length; +- params.StrLen_or_Ind = tmp; +- if (!SUCCESS(ODBC_CALL( SQLBindCol, ¶ms ))) +- { +- free( tmp ); +- return FALSE; +- } +- } +- handle->bind_col.param[i].len = tmp; +- } +- for (i = 0; i < handle->bind_param.count; i++) +- { +- UINT8 *tmp; +- if (!handle->bind_param.param[i].ptr) continue; +- if (!(tmp = realloc( handle->bind_param.param[i].len, size * sizeof(UINT64) ))) return FALSE; +- if (tmp != handle->bind_param.param[i].len) +- { +- struct SQLBindParam_params params; +- +- params.StatementHandle = handle->unix_handle; +- params.ParameterNumber = i + 1; +- params.ValueType = handle->bind_param.param[i].param.value_type; +- params.ParameterType = handle->bind_param.param[i].param.parameter_type; +- params.LengthPrecision = handle->bind_param.param[i].param.length_precision; +- params.ParameterScale = handle->bind_param.param[i].param.parameter_scale; +- params.ParameterValue = handle->bind_param.param[i].param.parameter_value; +- params.StrLen_or_Ind = tmp; +- if (!SUCCESS(ODBC_CALL( SQLBindParam, ¶ms ))) +- { +- free( tmp ); +- return FALSE; +- } +- } +- handle->bind_param.param[i].len = tmp; +- } +- for (i = 0; i < handle->bind_parameter.count; i++) +- { +- UINT8 *tmp; +- if (!(tmp = realloc( handle->bind_parameter.param[i].len, size * sizeof(UINT64) ))) return FALSE; +- if (tmp != handle->bind_parameter.param[i].len) +- { +- struct SQLBindParameter_params params; +- +- params.StatementHandle = handle->unix_handle; +- params.ParameterNumber = i + 1; +- params.InputOutputType = handle->bind_parameter.param[i].parameter.input_output_type; +- params.ValueType = handle->bind_parameter.param[i].parameter.value_type; +- params.ParameterType = handle->bind_parameter.param[i].parameter.parameter_type; +- params.ColumnSize = handle->bind_parameter.param[i].parameter.column_size; +- params.DecimalDigits = handle->bind_parameter.param[i].parameter.decimal_digits; +- params.ParameterValue = handle->bind_parameter.param[i].parameter.parameter_value; +- params.BufferLength = handle->bind_parameter.param[i].parameter.buffer_length; +- params.StrLen_or_Ind = tmp; +- if (!SUCCESS(ODBC_CALL( SQLBindParameter, ¶ms ))) +- { +- free( tmp ); +- return FALSE; +- } +- } +- handle->bind_parameter.param[i].len = tmp; +- } +- return TRUE; +-} +- + /************************************************************************* + * SQLSetStmtAttr [ODBC32.076] + */ + SQLRETURN WINAPI SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength) + { +- struct SQLSetStmtAttr_params params = { 0, Attribute, Value, StringLength }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value, ++ FIXME("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value, + StringLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- if (SUCCESS((ret = ODBC_CALL( SQLSetStmtAttr, ¶ms )))) +- { +- SQLULEN row_count = (SQLULEN)Value; +- if (Attribute == SQL_ATTR_ROW_ARRAY_SIZE && row_count != handle->row_count) +- { +- TRACE( "resizing result length array\n" ); +- if (!resize_result_lengths( handle, row_count )) ret = SQL_ERROR; +- else handle->row_count = row_count; +- } +- } +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1495,17 +809,10 @@ SQLRETURN WINAPI SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, + */ + SQLRETURN WINAPI SQLSetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLULEN Value) + { +- struct SQLSetStmtOption_params params = { 0, Option, Value }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, Option %d, Value %s)\n", StatementHandle, Option, debugstr_sqlulen(Value)); ++ FIXME("(StatementHandle %p, Option %d, Value %s)\n", StatementHandle, Option, debugstr_sqlulen(Value)); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLSetStmtOption, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1517,22 +824,14 @@ SQLRETURN WINAPI SQLSpecialColumns(SQLHSTMT StatementHandle, SQLUSMALLINT Identi + SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Scope, + SQLUSMALLINT Nullable) + { +- struct SQLSpecialColumns_params params = { 0, IdentifierType, CatalogName, NameLength1, SchemaName, NameLength2, +- TableName, NameLength3, Scope, Nullable }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, IdentifierType %d, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d," ++ FIXME("(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); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLSpecialColumns, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1543,22 +842,14 @@ SQLRETURN WINAPI SQLStatistics(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, S + SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, + SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved) + { +- struct SQLStatistics_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, +- NameLength3, Unique, Reserved }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d SchemaName %s, NameLength2 %d, TableName %s" ++ FIXME("(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); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLStatistics, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1569,23 +860,15 @@ SQLRETURN WINAPI SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSM + SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, + SQLSMALLINT NameLength3, SQLCHAR *TableType, SQLSMALLINT NameLength4) + { +- struct SQLTables_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, +- NameLength3, TableType, NameLength4 }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," ++ FIXME("(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); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLTables, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1594,42 +877,27 @@ SQLRETURN WINAPI SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSM + */ + SQLRETURN WINAPI SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType) + { +- struct SQLTransact_params params = { 0, 0, CompletionType }; +- struct handle *env = EnvironmentHandle, *con = ConnectionHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(EnvironmentHandle %p, ConnectionHandle %p, CompletionType %d)\n", EnvironmentHandle, ConnectionHandle, ++ FIXME("(EnvironmentHandle %p, ConnectionHandle %p, CompletionType %d)\n", EnvironmentHandle, ConnectionHandle, + CompletionType); + +- if (!env || !con) return SQL_INVALID_HANDLE; +- +- params.EnvironmentHandle = env->unix_handle; +- params.ConnectionHandle = con->unix_handle; +- ret = ODBC_CALL( SQLTransact, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLBrowseConnect [ODBC32.055] + */ +-SQLRETURN WINAPI SQLBrowseConnect(SQLHDBC ConnectionHandle, SQLCHAR *InConnectionString, SQLSMALLINT StringLength1, +- SQLCHAR *OutConnectionString, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength2) ++SQLRETURN WINAPI SQLBrowseConnect(SQLHDBC hdbc, SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, ++ SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, ++ SQLSMALLINT *pcbConnStrOut) + { +- struct SQLBrowseConnect_params params = { 0, InConnectionString, StringLength1, OutConnectionString, BufferLength, +- StringLength2 }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; +- +- TRACE("(ConnectionHandle %p, InConnectionString %s, StringLength1 %d, OutConnectionString %p, BufferLength, %d, " +- "StringLength2 %p)\n", ConnectionHandle, debugstr_an((const char *)InConnectionString, StringLength1), +- StringLength1, OutConnectionString, BufferLength, StringLength2); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(hdbc %p, szConnStrIn %s, cbConnStrIn %d, szConnStrOut %p, cbConnStrOutMax %d, pcbConnStrOut %p)\n", ++ hdbc, debugstr_an((const char *)szConnStrIn, cbConnStrIn), cbConnStrIn, szConnStrOut, cbConnStrOutMax, ++ pcbConnStrOut); + +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLBrowseConnect, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1638,149 +906,96 @@ SQLRETURN WINAPI SQLBrowseConnect(SQLHDBC ConnectionHandle, SQLCHAR *InConnectio + */ + SQLRETURN WINAPI SQLBulkOperations(SQLHSTMT StatementHandle, SQLSMALLINT Operation) + { +- struct SQLBulkOperations_params params = { 0, Operation }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, Operation %d)\n", StatementHandle, Operation); ++ FIXME("(StatementHandle %p, Operation %d)\n", StatementHandle, Operation); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- if (SUCCESS(( ret = ODBC_CALL( SQLBulkOperations, ¶ms )))) update_result_lengths( handle, SQL_PARAM_OUTPUT ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLColAttributes [ODBC32.006] + */ +-SQLRETURN WINAPI SQLColAttributes(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, +- SQLPOINTER CharacterAttributes, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, +- SQLLEN *NumericAttributes) ++SQLRETURN WINAPI SQLColAttributes(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, ++ SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, ++ SQLLEN *pfDesc) + { +- struct SQLColAttributes_params params = { 0, ColumnNumber, FieldIdentifier, CharacterAttributes, BufferLength, +- StringLength }; +- struct handle *handle = StatementHandle; +- INT64 attrs; +- SQLRETURN ret; +- +- TRACE("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttributes %p, BufferLength %d, " +- "StringLength %p, NumericAttributes %p)\n", StatementHandle, ColumnNumber, FieldIdentifier, +- CharacterAttributes, BufferLength, StringLength, NumericAttributes); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol, ++ fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); + +- params.StatementHandle = handle->unix_handle; +- params.NumericAttributes = &attrs; +- if (SUCCESS((ret = ODBC_CALL( SQLColAttributes, ¶ms )))) *NumericAttributes = attrs; +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLColumnPrivileges [ODBC32.056] + */ +-SQLRETURN WINAPI SQLColumnPrivileges(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, +- SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, +- SQLSMALLINT NameLength3, SQLCHAR *ColumnName, SQLSMALLINT NameLength4) ++SQLRETURN WINAPI SQLColumnPrivileges(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, ++ SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, ++ SQLSMALLINT cbTableName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName) + { +- struct SQLColumnPrivileges_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, +- TableName, NameLength3, ColumnName, NameLength4 }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- 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); +- +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," ++ " cbTableName %d, szColumnName %s, cbColumnName %d)\n", hstmt, ++ debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName, ++ debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName, ++ debugstr_an((const char *)szTableName, cbTableName), cbTableName, ++ debugstr_an((const char *)szColumnName, cbColumnName), cbColumnName); + +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLColumnPrivileges, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLDescribeParam [ODBC32.058] + */ +-SQLRETURN WINAPI SQLDescribeParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT *DataType, +- SQLULEN *ParameterSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) ++SQLRETURN WINAPI SQLDescribeParam(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT *pfSqlType, ++ SQLULEN *pcbParamDef, SQLSMALLINT *pibScale, SQLSMALLINT *pfNullable) + { +- struct SQLDescribeParam_params params = { 0, ParameterNumber, DataType, NULL, DecimalDigits, Nullable }; +- struct handle *handle = StatementHandle; +- UINT64 size; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, ParameterNumber %d, DataType %p, ParameterSize %p, DecimalDigits %p, Nullable %p)\n", +- StatementHandle, ParameterNumber, DataType, ParameterSize, DecimalDigits, Nullable); ++ FIXME("(hstmt %p, ipar %d, pfSqlType %p, pcbParamDef %p, pibScale %p, pfNullable %p)\n", hstmt, ipar, ++ pfSqlType, pcbParamDef, pibScale, pfNullable); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- params.ParameterSize = &size; +- if (SUCCESS((ret = ODBC_CALL( SQLDescribeParam, ¶ms )))) *ParameterSize = size; +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLExtendedFetch [ODBC32.059] + */ +-SQLRETURN WINAPI SQLExtendedFetch(SQLHSTMT StatementHandle, SQLUSMALLINT FetchOrientation, SQLLEN FetchOffset, +- SQLULEN *RowCount, SQLUSMALLINT *RowStatusArray) ++SQLRETURN WINAPI SQLExtendedFetch(SQLHSTMT hstmt, SQLUSMALLINT fFetchType, SQLLEN irow, SQLULEN *pcrow, ++ SQLUSMALLINT *rgfRowStatus) + { +- struct SQLExtendedFetch_params params = { 0, FetchOrientation, FetchOffset, NULL, RowStatusArray }; +- struct handle *handle = StatementHandle; +- UINT64 count; +- SQLRETURN ret; +- +- TRACE("(StatementHandle %p, FetchOrientation %d, FetchOffset %s, RowCount %p, RowStatusArray %p)\n", +- StatementHandle, FetchOrientation, debugstr_sqllen(FetchOffset), RowCount, RowStatusArray); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(hstmt %p, fFetchType %d, irow %s, pcrow %p, rgfRowStatus %p)\n", hstmt, fFetchType, debugstr_sqllen(irow), ++ pcrow, rgfRowStatus); + +- params.StatementHandle = handle->unix_handle; +- params.RowCount = &count; +- if (SUCCESS((ret = ODBC_CALL( SQLExtendedFetch, ¶ms )))) *RowCount = count; +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLForeignKeys [ODBC32.060] + */ +-SQLRETURN WINAPI SQLForeignKeys(SQLHSTMT StatementHandle, SQLCHAR *PkCatalogName, SQLSMALLINT NameLength1, +- SQLCHAR *PkSchemaName, SQLSMALLINT NameLength2, SQLCHAR *PkTableName, +- SQLSMALLINT NameLength3, SQLCHAR *FkCatalogName, SQLSMALLINT NameLength4, +- SQLCHAR *FkSchemaName, SQLSMALLINT NameLength5, SQLCHAR *FkTableName, +- SQLSMALLINT NameLength6) ++SQLRETURN WINAPI SQLForeignKeys(SQLHSTMT hstmt, SQLCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName, ++ SQLCHAR *szPkSchemaName, SQLSMALLINT cbPkSchemaName, SQLCHAR *szPkTableName, ++ SQLSMALLINT cbPkTableName, SQLCHAR *szFkCatalogName, ++ SQLSMALLINT cbFkCatalogName, SQLCHAR *szFkSchemaName, ++ SQLSMALLINT cbFkSchemaName, SQLCHAR *szFkTableName, SQLSMALLINT cbFkTableName) + { +- struct SQLForeignKeys_params params = { 0, PkCatalogName, NameLength1, PkSchemaName, NameLength2, +- PkTableName, NameLength3, FkCatalogName, NameLength4, +- FkSchemaName, NameLength5, FkTableName, NameLength6 }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- 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); ++ FIXME("(hstmt %p, szPkCatalogName %s, cbPkCatalogName %d, szPkSchemaName %s, cbPkSchemaName %d," ++ " szPkTableName %s, cbPkTableName %d, szFkCatalogName %s, cbFkCatalogName %d, szFkSchemaName %s," ++ " cbFkSchemaName %d, szFkTableName %s, cbFkTableName %d)\n", hstmt, ++ debugstr_an((const char *)szPkCatalogName, cbPkCatalogName), cbPkCatalogName, ++ debugstr_an((const char *)szPkSchemaName, cbPkSchemaName), cbPkSchemaName, ++ debugstr_an((const char *)szPkTableName, cbPkTableName), cbPkTableName, ++ debugstr_an((const char *)szFkCatalogName, cbFkCatalogName), cbFkCatalogName, ++ debugstr_an((const char *)szFkSchemaName, cbFkSchemaName), cbFkSchemaName, ++ debugstr_an((const char *)szFkTableName, cbFkTableName), cbFkTableName); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLForeignKeys, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1789,389 +1004,213 @@ SQLRETURN WINAPI SQLForeignKeys(SQLHSTMT StatementHandle, SQLCHAR *PkCatalogName + */ + SQLRETURN WINAPI SQLMoreResults(SQLHSTMT StatementHandle) + { +- struct SQLMoreResults_params params; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; +- +- TRACE("(%p)\n", StatementHandle); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(%p)\n", StatementHandle); + +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLMoreResults, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLNativeSql [ODBC32.062] + */ +-SQLRETURN WINAPI SQLNativeSql(SQLHDBC ConnectionHandle, SQLCHAR *InStatementText, SQLINTEGER TextLength1, +- SQLCHAR *OutStatementText, SQLINTEGER BufferLength, SQLINTEGER *TextLength2) ++SQLRETURN WINAPI SQLNativeSql(SQLHDBC hdbc, SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLCHAR *szSqlStr, ++ SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr) + { +- struct SQLNativeSql_params params = { 0, InStatementText, TextLength1, OutStatementText, BufferLength, +- TextLength2 }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; ++ 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); ++ FIXME("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc, ++ debugstr_an((const char *)szSqlStrIn, cbSqlStrIn), cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLNativeSql, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLNumParams [ODBC32.063] + */ +-SQLRETURN WINAPI SQLNumParams(SQLHSTMT StatementHandle, SQLSMALLINT *ParameterCount) ++SQLRETURN WINAPI SQLNumParams(SQLHSTMT hstmt, SQLSMALLINT *pcpar) + { +- struct SQLNumParams_params params = { 0, ParameterCount }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; +- +- TRACE("(StatementHandle %p, pcpar %p)\n", StatementHandle, ParameterCount); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(hstmt %p, pcpar %p)\n", hstmt, pcpar); + +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLNumParams, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLParamOptions [ODBC32.064] + */ +-SQLRETURN WINAPI SQLParamOptions(SQLHSTMT StatementHandle, SQLULEN RowCount, SQLULEN *RowNumber) ++SQLRETURN WINAPI SQLParamOptions(SQLHSTMT hstmt, SQLULEN crow, SQLULEN *pirow) + { +- struct SQLParamOptions_params params = { 0, RowCount }; +- struct handle *handle = StatementHandle; +- UINT64 row; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, RowCount %s, RowNumber %p)\n", StatementHandle, debugstr_sqlulen(RowCount), +- RowNumber); ++ FIXME("(hstmt %p, crow %s, pirow %p)\n", hstmt, debugstr_sqlulen(crow), pirow); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- params.RowNumber = &row; +- if (SUCCESS((ret = ODBC_CALL( SQLParamOptions, ¶ms )))) *RowNumber = row; +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLPrimaryKeys [ODBC32.065] + */ +-SQLRETURN WINAPI SQLPrimaryKeys(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, +- SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, +- SQLSMALLINT NameLength3) ++SQLRETURN WINAPI SQLPrimaryKeys(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, ++ SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, ++ SQLSMALLINT cbTableName) + { +- struct SQLPrimaryKeys_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, +- NameLength3 }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; +- +- 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); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," ++ " cbTableName %d)\n", hstmt, ++ debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName, ++ debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName, ++ debugstr_an((const char *)szTableName, cbTableName), cbTableName); + +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLPrimaryKeys, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLProcedureColumns [ODBC32.066] + */ +-SQLRETURN WINAPI SQLProcedureColumns(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, +- SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *ProcName, +- SQLSMALLINT NameLength3, SQLCHAR *ColumnName, SQLSMALLINT NameLength4) ++SQLRETURN WINAPI SQLProcedureColumns(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, ++ SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName, ++ SQLSMALLINT cbProcName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName) + { +- struct SQLProcedureColumns_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, +- ProcName, NameLength3, ColumnName, NameLength4 }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- 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); ++ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," ++ " cbProcName %d, szColumnName %s, cbColumnName %d)\n", hstmt, ++ debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName, ++ debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName, ++ debugstr_an((const char *)szProcName, cbProcName), cbProcName, ++ debugstr_an((const char *)szColumnName, cbColumnName), cbColumnName); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLProcedureColumns, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLProcedures [ODBC32.067] + */ +-SQLRETURN WINAPI SQLProcedures(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, +- SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *ProcName, +- SQLSMALLINT NameLength3) ++SQLRETURN WINAPI SQLProcedures(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, ++ SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName, ++ SQLSMALLINT cbProcName) + { +- struct SQLProcedures_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, ProcName, +- NameLength3 }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; +- +- 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); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," ++ " cbProcName %d)\n", hstmt, ++ debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName, ++ debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName, ++ debugstr_an((const char *)szProcName, cbProcName), cbProcName); + +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLProcedures, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLSetPos [ODBC32.068] + */ +-SQLRETURN WINAPI SQLSetPos(SQLHSTMT StatementHandle, SQLSETPOSIROW RowNumber, SQLUSMALLINT Operation, +- SQLUSMALLINT LockType) ++SQLRETURN WINAPI SQLSetPos(SQLHSTMT hstmt, SQLSETPOSIROW irow, SQLUSMALLINT fOption, SQLUSMALLINT fLock) + { +- struct SQLSetPos_params params = { 0, RowNumber, Operation, LockType }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, RowNumber %s, Operation %d, LockType %d)\n", StatementHandle, +- debugstr_sqlulen(RowNumber), Operation, LockType); ++ FIXME("(hstmt %p, irow %s, fOption %d, fLock %d)\n", hstmt, debugstr_sqlulen(irow), fOption, fLock); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- if (SUCCESS(( ret = ODBC_CALL( SQLSetPos, ¶ms ))) && Operation == SQL_REFRESH) +- update_result_lengths( handle, SQL_PARAM_OUTPUT ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLTablePrivileges [ODBC32.070] + */ +-SQLRETURN WINAPI SQLTablePrivileges(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, +- SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, +- SQLSMALLINT NameLength3) ++SQLRETURN WINAPI SQLTablePrivileges(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, ++ SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, ++ SQLSMALLINT cbTableName) + { +- struct SQLTablePrivileges_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, +- TableName, NameLength3 }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; +- +- 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); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," ++ " cbTableName %d)\n", hstmt, ++ debugstr_an((const char *)szCatalogName, cbCatalogName), cbCatalogName, ++ debugstr_an((const char *)szSchemaName, cbSchemaName), cbSchemaName, ++ debugstr_an((const char *)szTableName, cbTableName), cbTableName); + +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLTablePrivileges, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLDrivers [ODBC32.071] + */ +-SQLRETURN WINAPI SQLDrivers(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR *DriverDescription, +- SQLSMALLINT BufferLength1, SQLSMALLINT *DescriptionLength, +- SQLCHAR *DriverAttributes, SQLSMALLINT BufferLength2, +- SQLSMALLINT *AttributesLength) ++SQLRETURN WINAPI SQLDrivers(SQLHENV EnvironmentHandle, SQLUSMALLINT fDirection, SQLCHAR *szDriverDesc, ++ SQLSMALLINT cbDriverDescMax, SQLSMALLINT *pcbDriverDesc, ++ SQLCHAR *szDriverAttributes, SQLSMALLINT cbDriverAttrMax, ++ SQLSMALLINT *pcbDriverAttr) + { +- struct SQLDrivers_params params = { 0, Direction, DriverDescription, BufferLength1, DescriptionLength, +- DriverAttributes, BufferLength2, AttributesLength }; +- struct handle *handle = EnvironmentHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_NO_DATA; + +- TRACE("(EnvironmentHandle %p, Direction %d, DriverDescription %p, BufferLength1 %d, DescriptionLength %p," +- " DriverAttributes %p, BufferLength2 %d, AttributesLength %p)\n", EnvironmentHandle, Direction, +- DriverDescription, BufferLength1, DescriptionLength, DriverAttributes, BufferLength2, AttributesLength); ++ FIXME("(EnvironmentHandle %p, Direction %d, szDriverDesc %p, cbDriverDescMax %d, pcbDriverDesc %p," ++ " DriverAttributes %p, cbDriverAttrMax %d, pcbDriverAttr %p)\n", EnvironmentHandle, fDirection, ++ szDriverDesc, cbDriverDescMax, pcbDriverDesc, szDriverAttributes, cbDriverAttrMax, pcbDriverAttr); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.EnvironmentHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLDrivers, ¶ms ); +- +- if (ret == SQL_NO_DATA && Direction == SQL_FETCH_FIRST) +- ERR_(winediag)("No ODBC drivers could be found. Check the settings for your libodbc provider.\n"); +- +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLBindParameter [ODBC32.072] + */ +-SQLRETURN WINAPI SQLBindParameter(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT InputOutputType, +- SQLSMALLINT ValueType, SQLSMALLINT ParameterType, SQLULEN ColumnSize, +- SQLSMALLINT DecimalDigits, SQLPOINTER ParameterValue, SQLLEN BufferLength, +- SQLLEN *StrLen_or_Ind) ++SQLRETURN WINAPI SQLBindParameter(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT fParamType, ++ SQLSMALLINT fCType, SQLSMALLINT fSqlType, SQLULEN cbColDef, ++ SQLSMALLINT ibScale, SQLPOINTER rgbValue, SQLLEN cbValueMax, ++ SQLLEN *pcbValue) + { +- struct SQLBindParameter_params params = { 0, ParameterNumber, InputOutputType, ValueType, ParameterType, +- ColumnSize, DecimalDigits, ParameterValue, BufferLength }; +- struct handle *handle = StatementHandle; +- UINT i = ParameterNumber - 1; +- SQLRETURN ret; +- +- TRACE("(StatementHandle %p, ParameterNumber %d, InputOutputType %d, ValueType %d, ParameterType %d, " +- "ColumnSize %s, DecimalDigits %d, ParameterValue, %p, BufferLength %s, StrLen_or_Ind %p)\n", +- StatementHandle, ParameterNumber, InputOutputType, ValueType, ParameterType, debugstr_sqlulen(ColumnSize), +- DecimalDigits, ParameterValue, debugstr_sqllen(BufferLength), StrLen_or_Ind); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; +- if (!ParameterNumber) +- { +- FIXME( "parameter 0 not handled\n" ); +- return SQL_ERROR; +- } +- if (!alloc_binding( &handle->bind_parameter, InputOutputType, ParameterNumber, handle->row_count )) return SQL_ERROR; +- handle->bind_parameter.param[i].parameter.input_output_type = InputOutputType; +- handle->bind_parameter.param[i].parameter.value_type = ValueType; +- handle->bind_parameter.param[i].parameter.parameter_type = ParameterType; +- handle->bind_parameter.param[i].parameter.column_size = ColumnSize; +- handle->bind_parameter.param[i].parameter.decimal_digits = DecimalDigits; +- handle->bind_parameter.param[i].parameter.parameter_value = ParameterValue; +- handle->bind_parameter.param[i].parameter.buffer_length = BufferLength; ++ FIXME("(hstmt %p, ipar %d, fParamType %d, fCType %d, fSqlType %d, cbColDef %s, ibScale %d, rgbValue %p," ++ " cbValueMax %s, pcbValue %p)\n", hstmt, ipar, fParamType, fCType, fSqlType, debugstr_sqlulen(cbColDef), ++ ibScale, rgbValue, debugstr_sqllen(cbValueMax), pcbValue); + +- params.StatementHandle = handle->unix_handle; +- params.StrLen_or_Ind = handle->bind_parameter.param[i].len; +- *(UINT64 *)params.StrLen_or_Ind = *StrLen_or_Ind; +- if (SUCCESS((ret = ODBC_CALL( SQLBindParameter, ¶ms )))) handle->bind_parameter.param[i].ptr = StrLen_or_Ind; +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLDriverConnect [ODBC32.041] + */ +-SQLRETURN WINAPI SQLDriverConnect(SQLHDBC ConnectionHandle, SQLHWND WindowHandle, SQLCHAR *ConnectionString, +- SQLSMALLINT Length, SQLCHAR *OutConnectionString, SQLSMALLINT BufferLength, +- SQLSMALLINT *Length2, SQLUSMALLINT DriverCompletion) ++SQLRETURN WINAPI SQLDriverConnect(SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR *ConnectionString, SQLSMALLINT Length, ++ SQLCHAR *conn_str_out, SQLSMALLINT conn_str_out_max, ++ SQLSMALLINT *ptr_conn_str_out, SQLUSMALLINT driver_completion) + { +- struct SQLDriverConnect_params params = { 0, WindowHandle, ConnectionString, Length, OutConnectionString, +- BufferLength, Length2, DriverCompletion }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; +- +- TRACE("(ConnectionHandle %p, hwnd %p, ConnectionString %s, Length %d, conn_str_out %p, conn_str_out_max %d," +- " ptr_conn_str_out %p, driver_completion %d)\n", ConnectionHandle, WindowHandle, +- debugstr_an((const char *)ConnectionString, Length), Length, OutConnectionString, BufferLength, +- Length2, DriverCompletion); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(hdbc %p, hwnd %p, ConnectionString %s, Length %d, conn_str_out %p, conn_str_out_max %d," ++ " ptr_conn_str_out %p, driver_completion %d)\n", hdbc, hwnd, ++ debugstr_an((const char *)ConnectionString, Length), Length, conn_str_out, conn_str_out_max, ++ ptr_conn_str_out, driver_completion); + +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLDriverConnect, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLSetScrollOptions [ODBC32.069] + */ +-SQLRETURN WINAPI SQLSetScrollOptions(SQLHSTMT StatementHandle, SQLUSMALLINT Concurrency, SQLLEN KeySetSize, +- SQLUSMALLINT RowSetSize) ++SQLRETURN WINAPI SQLSetScrollOptions(SQLHSTMT statement_handle, SQLUSMALLINT f_concurrency, SQLLEN crow_keyset, ++ SQLUSMALLINT crow_rowset) + { +- struct SQLSetScrollOptions_params params = { 0, Concurrency, KeySetSize, RowSetSize }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, Concurrency %d, KeySetSize %s, RowSetSize %d)\n", StatementHandle, +- Concurrency, debugstr_sqllen(KeySetSize), RowSetSize); ++ FIXME("(statement_handle %p, f_concurrency %d, crow_keyset %s, crow_rowset %d)\n", statement_handle, ++ f_concurrency, debugstr_sqllen(crow_keyset), crow_rowset); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLSetScrollOptions, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +-static BOOL SQLColAttributes_KnownStringAttribute(SQLUSMALLINT fDescType) +-{ +- static const SQLUSMALLINT attrList[] = +- { +- SQL_COLUMN_OWNER_NAME, +- SQL_COLUMN_QUALIFIER_NAME, +- SQL_COLUMN_LABEL, +- SQL_COLUMN_NAME, +- SQL_COLUMN_TABLE_NAME, +- SQL_COLUMN_TYPE_NAME, +- SQL_DESC_BASE_COLUMN_NAME, +- SQL_DESC_BASE_TABLE_NAME, +- SQL_DESC_CATALOG_NAME, +- SQL_DESC_LABEL, +- SQL_DESC_LITERAL_PREFIX, +- SQL_DESC_LITERAL_SUFFIX, +- SQL_DESC_LOCAL_TYPE_NAME, +- SQL_DESC_NAME, +- SQL_DESC_SCHEMA_NAME, +- SQL_DESC_TABLE_NAME, +- SQL_DESC_TYPE_NAME, +- }; +- unsigned int i; +- +- for (i = 0; i < ARRAY_SIZE(attrList); i++) { +- if (attrList[i] == fDescType) return TRUE; +- } +- return FALSE; +-} +- + /************************************************************************* + * SQLColAttributesW [ODBC32.106] + */ +-SQLRETURN WINAPI SQLColAttributesW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, +- SQLPOINTER CharacterAttributes, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, +- SQLLEN *NumericAttributes) ++SQLRETURN WINAPI SQLColAttributesW(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, ++ SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, ++ SQLLEN *pfDesc) + { +- struct SQLColAttributesW_params params = { 0, ColumnNumber, FieldIdentifier, CharacterAttributes, BufferLength, +- StringLength }; +- struct handle *handle = StatementHandle; +- INT64 attrs; +- SQLRETURN ret; +- +- TRACE("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttributes %p, BufferLength %d, " +- "StringLength %p, NumericAttributes %p)\n", StatementHandle, ColumnNumber, FieldIdentifier, +- CharacterAttributes, BufferLength, StringLength, NumericAttributes); +- +- if (!handle) return SQL_INVALID_HANDLE; ++ SQLRETURN ret = SQL_ERROR; + +- params.StatementHandle = handle->unix_handle; +- params.NumericAttributes = &attrs; +- if (SUCCESS((ret = ODBC_CALL( SQLColAttributesW, ¶ms )))) *NumericAttributes = attrs; ++ FIXME("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol, ++ fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); + +- 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; +- } +- +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2182,20 +1221,12 @@ SQLRETURN WINAPI SQLConnectW(SQLHDBC ConnectionHandle, WCHAR *ServerName, SQLSMA + WCHAR *UserName, SQLSMALLINT NameLength2, WCHAR *Authentication, + SQLSMALLINT NameLength3) + { +- struct SQLConnectW_params params = { 0, ServerName, NameLength1, UserName, NameLength2, Authentication, +- NameLength3 }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, ServerName %s, NameLength1 %d, UserName %s, NameLength2 %d, Authentication %s," ++ FIXME("(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); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLConnectW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2206,36 +1237,15 @@ SQLRETURN WINAPI SQLDescribeColW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNu + SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType, + SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) + { +- struct SQLDescribeColW_params params = { 0, ColumnNumber, ColumnName, BufferLength, NameLength, DataType, +- NULL, DecimalDigits, Nullable }; +- struct handle *handle = StatementHandle; + SQLSMALLINT dummy; +- UINT64 size; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," ++ FIXME("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," + " ColumnSize %p, DecimalDigits %p, Nullable %p)\n", StatementHandle, ColumnNumber, ColumnName, + BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); + +- if (!handle) return SQL_INVALID_HANDLE; ++ if (!NameLength) NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ + +- params.StatementHandle = handle->unix_handle; +- if (!NameLength) params.NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ +- params.ColumnSize = &size; +- if (SUCCESS((ret = ODBC_CALL( SQLDescribeColW, ¶ms )))) +- { +- if (ColumnName && NameLength) TRACE("ColumnName %s\n", debugstr_wn(ColumnName, *NameLength)); +- if (DataType) TRACE("DataType %d\n", *DataType); +- if (ColumnSize) +- { +- *ColumnSize = size; +- TRACE("ColumnSize %s\n", debugstr_sqlulen(*ColumnSize)); +- } +- if (DecimalDigits) TRACE("DecimalDigits %d\n", *DecimalDigits); +- if (Nullable) TRACE("Nullable %d\n", *Nullable); +- } +- +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2243,28 +1253,15 @@ SQLRETURN WINAPI SQLDescribeColW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNu + * SQLErrorW [ODBC32.110] + */ + SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, +- WCHAR *SqlState, SQLINTEGER *NativeError, WCHAR *MessageText, ++ WCHAR *Sqlstate, SQLINTEGER *NativeError, WCHAR *MessageText, + SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) + { +- struct SQLErrorW_params params = { 0, 0, 0, SqlState, NativeError, MessageText, BufferLength, TextLength }; +- struct handle *env = EnvironmentHandle, *con = ConnectionHandle, *stmt = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, SqlState %p, NativeError %p," ++ FIXME("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, Sqlstate %p, NativeError %p," + " MessageText %p, BufferLength %d, TextLength %p)\n", EnvironmentHandle, ConnectionHandle, +- StatementHandle, SqlState, NativeError, MessageText, BufferLength, TextLength); +- +- if (env) params.EnvironmentHandle = env->unix_handle; +- if (con) params.ConnectionHandle = con->unix_handle; +- if (stmt) params.StatementHandle = stmt->unix_handle; +- if (SUCCESS((ret = ODBC_CALL( SQLErrorW, ¶ms )))) +- { +- TRACE(" SqlState %s\n", debugstr_wn(SqlState, 5)); +- TRACE(" Error %d\n", *NativeError); +- TRACE(" MessageText %s\n", debugstr_wn(MessageText, *TextLength)); +- } ++ StatementHandle, Sqlstate, NativeError, MessageText, BufferLength, TextLength); + +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2273,18 +1270,11 @@ SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, + */ + SQLRETURN WINAPI SQLExecDirectW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength) + { +- struct SQLExecDirectW_params params = { 0, StatementText, TextLength }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, ++ FIXME("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, + debugstr_wn(StatementText, TextLength), TextLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLExecDirectW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2294,18 +1284,11 @@ SQLRETURN WINAPI SQLExecDirectW(SQLHSTMT StatementHandle, WCHAR *StatementText, + SQLRETURN WINAPI SQLGetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, SQLSMALLINT BufferLength, + SQLSMALLINT *NameLength) + { +- struct SQLGetCursorNameW_params params = { 0, CursorName, BufferLength, NameLength }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle, CursorName, ++ FIXME("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle, CursorName, + BufferLength, NameLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetCursorNameW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2314,18 +1297,11 @@ SQLRETURN WINAPI SQLGetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, + */ + SQLRETURN WINAPI SQLPrepareW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength) + { +- struct SQLPrepareW_params params = { 0, StatementText, TextLength }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, ++ FIXME("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, + debugstr_wn(StatementText, TextLength), TextLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLPrepareW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2334,18 +1310,11 @@ SQLRETURN WINAPI SQLPrepareW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQL + */ + SQLRETURN WINAPI SQLSetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, SQLSMALLINT NameLength) + { +- struct SQLSetCursorNameW_params params = { 0, CursorName, NameLength }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle, ++ FIXME("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle, + debugstr_wn(CursorName, NameLength), NameLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLSetCursorNameW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2357,30 +1326,12 @@ SQLRETURN WINAPI SQLColAttributeW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnN + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, + SQLLEN *NumericAttribute) + { +- struct SQLColAttributeW_params params = { 0, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength, +- StringLength }; +- struct handle *handle = StatementHandle; +- INT64 attr; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("StatementHandle %p ColumnNumber %d FieldIdentifier %d CharacterAttribute %p BufferLength %d" ++ FIXME("StatementHandle %p ColumnNumber %d FieldIdentifier %d CharacterAttribute %p BufferLength %d" + " StringLength %p NumericAttribute %p\n", StatementHandle, ColumnNumber, FieldIdentifier, + CharacterAttribute, BufferLength, StringLength, NumericAttribute); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- params.NumericAttribute = &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; +- } +- +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2390,18 +1341,11 @@ SQLRETURN WINAPI SQLColAttributeW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnN + SQLRETURN WINAPI SQLGetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength) + { +- struct SQLGetConnectAttrW_params params = { 0, Attribute, Value, BufferLength, StringLength }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, ++ FIXME("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, + Attribute, Value, BufferLength, StringLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetConnectAttrW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2411,18 +1355,11 @@ SQLRETURN WINAPI SQLGetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribu + SQLRETURN WINAPI SQLGetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, + SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) + { +- struct SQLGetDescFieldW_params params = { 0, RecNumber, FieldIdentifier, Value, BufferLength, StringLength }; +- struct handle *handle = DescriptorHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n", ++ FIXME("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n", + DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength, StringLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.DescriptorHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetDescFieldW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2434,22 +1371,12 @@ SQLRETURN WINAPI SQLGetDescRecW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber + SQLSMALLINT *SubType, SQLLEN *Length, SQLSMALLINT *Precision, + SQLSMALLINT *Scale, SQLSMALLINT *Nullable) + { +- struct SQLGetDescRecW_params params = { 0, RecNumber, Name, BufferLength, StringLength, Type, SubType, +- NULL, Precision, Scale, Nullable }; +- struct handle *handle = DescriptorHandle; +- INT64 len; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p," ++ FIXME("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p," + " Length %p, Precision %p, Scale %p, Nullable %p)\n", DescriptorHandle, RecNumber, Name, BufferLength, + StringLength, Type, SubType, Length, Precision, Scale, Nullable); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.DescriptorHandle = handle->unix_handle; +- params.Length = &len; +- if (SUCCESS((ret = ODBC_CALL( SQLGetDescRecW, ¶ms )))) *Length = len; +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2460,43 +1387,27 @@ SQLRETURN WINAPI SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLS + SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, + SQLSMALLINT *StringLength) + { +- struct SQLGetDiagFieldW_params params = { HandleType, 0, RecNumber, DiagIdentifier, DiagInfo, BufferLength, +- StringLength }; +- struct handle *handle = Handle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_NO_DATA; + +- TRACE("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," ++ FIXME("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," + " StringLength %p)\n", HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.Handle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetDiagFieldW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLGetDiagRecW [ODBC32.136] + */ +-SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, WCHAR *SqlState, +- SQLINTEGER *NativeError, WCHAR *MessageText, SQLSMALLINT BufferLength, +- SQLSMALLINT *TextLength) ++SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, ++ WCHAR *Sqlstate, SQLINTEGER *NativeError, WCHAR *MessageText, ++ SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) + { +- struct SQLGetDiagRecW_params params = { HandleType, 0, RecNumber, SqlState, NativeError, MessageText, +- BufferLength, TextLength }; +- struct handle *handle = Handle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(HandleType %d, Handle %p, RecNumber %d, SqlState %p, NativeError %p, MessageText %p, BufferLength %d," +- " TextLength %p)\n", HandleType, Handle, RecNumber, SqlState, NativeError, MessageText, BufferLength, ++ FIXME("(HandleType %d, Handle %p, RecNumber %d, Sqlstate %p, NativeError %p, MessageText %p, BufferLength %d," ++ " TextLength %p)\n", HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength, + TextLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.Handle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetDiagRecW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2506,11 +1417,9 @@ SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMA + SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength) + { +- struct SQLGetStmtAttrW_params params = { 0, Attribute, Value, BufferLength, StringLength }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, ++ FIXME("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, + Attribute, Value, BufferLength, StringLength); + + if (!Value) +@@ -2519,11 +1428,6 @@ SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, + return SQL_ERROR; + } + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetStmtAttrW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2533,18 +1437,11 @@ SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, + SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength) + { +- struct SQLSetConnectAttrW_params params = { 0, Attribute, Value, StringLength }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, +- Value, StringLength); +- +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value, ++ StringLength); + +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLSetConnectAttrW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2555,21 +1452,14 @@ SQLRETURN WINAPI SQLColumnsW(SQLHSTMT StatementHandle, WCHAR *CatalogName, SQLSM + WCHAR *SchemaName, SQLSMALLINT NameLength2, WCHAR *TableName, + SQLSMALLINT NameLength3, WCHAR *ColumnName, SQLSMALLINT NameLength4) + { +- struct SQLColumnsW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, +- NameLength3, ColumnName, NameLength4 }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," ++ FIXME("(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); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLColumnsW, ¶ms ); +- TRACE("Returning %d\n", ret); ++ FIXME("Returning %d\n", ret); + return ret; + } + +@@ -2580,21 +1470,13 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl + SQLSMALLINT Length, WCHAR *OutConnectionString, SQLSMALLINT BufferLength, + SQLSMALLINT *Length2, SQLUSMALLINT DriverCompletion) + { +- struct SQLDriverConnectW_params params = { 0, WindowHandle, InConnectionString, Length, OutConnectionString, +- BufferLength, Length2, DriverCompletion }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, WindowHandle %p, InConnectionString %s, Length %d, OutConnectionString %p," ++ FIXME("(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, + DriverCompletion); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLDriverConnectW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2603,17 +1485,10 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl + */ + SQLRETURN WINAPI SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value) + { +- struct SQLGetConnectOptionW_params params = { 0, Option, Value }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, Option %d, Value %p)\n", ConnectionHandle, Option, Value); ++ FIXME("(ConnectionHandle %p, Option %d, Value %p)\n", ConnectionHandle, Option, Value); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetConnectOptionW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2623,18 +1498,11 @@ SQLRETURN WINAPI SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Opt + SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) + { +- struct SQLGetInfoW_params params = { 0, InfoType, InfoValue, BufferLength, StringLength }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, ++ FIXME("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, + InfoType, InfoValue, BufferLength, StringLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetInfoW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2643,17 +1511,10 @@ SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQ + */ + SQLRETURN WINAPI SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType) + { +- struct SQLGetTypeInfoW_params params = { 0, DataType }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); ++ FIXME("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLGetTypeInfoW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2662,17 +1523,10 @@ SQLRETURN WINAPI SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType) + */ + SQLRETURN WINAPI SQLSetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value) + { +- struct SQLSetConnectOptionW_params params = { 0, Option, Value }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; +- +- TRACE("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle, Option, debugstr_sqllen(Value)); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle, Option, debugstr_sqllen(Value)); + +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLSetConnectOptionW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2684,21 +1538,13 @@ SQLRETURN WINAPI SQLSpecialColumnsW(SQLHSTMT StatementHandle, SQLUSMALLINT Ident + SQLSMALLINT NameLength2, SQLWCHAR *TableName, SQLSMALLINT NameLength3, + SQLUSMALLINT Scope, SQLUSMALLINT Nullable) + { +- struct SQLSpecialColumnsW_params params = { 0, IdentifierType, CatalogName, NameLength1, SchemaName, NameLength2, +- TableName, NameLength3, Scope, Nullable }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, IdentifierType %d, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d," ++ FIXME("(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); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLSpecialColumnsW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2709,21 +1555,13 @@ SQLRETURN WINAPI SQLStatisticsW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, + SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, + SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved) + { +- struct SQLStatisticsW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, +- NameLength3, Unique, Reserved }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d SchemaName %s, NameLength2 %d, TableName %s" ++ FIXME("(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); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLStatisticsW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2734,71 +1572,47 @@ SQLRETURN WINAPI SQLTablesW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQL + SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, + SQLSMALLINT NameLength3, SQLWCHAR *TableType, SQLSMALLINT NameLength4) + { +- struct SQLTablesW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, +- NameLength3, TableType, NameLength4 }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," ++ FIXME("(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); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLTablesW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLBrowseConnectW [ODBC32.155] + */ +-SQLRETURN WINAPI SQLBrowseConnectW(SQLHDBC ConnectionHandle, SQLWCHAR *InConnectionString, SQLSMALLINT StringLength1, +- SQLWCHAR *OutConnectionString, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength2) ++SQLRETURN WINAPI SQLBrowseConnectW(SQLHDBC hdbc, SQLWCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, ++ SQLWCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, ++ SQLSMALLINT *pcbConnStrOut) + { +- struct SQLBrowseConnectW_params params = { 0, InConnectionString, StringLength1, OutConnectionString, +- BufferLength, StringLength2 }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; +- +- TRACE("(ConnectionHandle %p, InConnectionString %s, StringLength1 %d, OutConnectionString %p, BufferLength %d, " +- "StringLength2 %p)\n", ConnectionHandle, debugstr_wn(InConnectionString, StringLength1), StringLength1, +- OutConnectionString, BufferLength, StringLength2); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(hdbc %p, szConnStrIn %s, cbConnStrIn %d, szConnStrOut %p, cbConnStrOutMax %d, pcbConnStrOut %p)\n", ++ hdbc, debugstr_wn(szConnStrIn, cbConnStrIn), cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut); + +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLBrowseConnectW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLColumnPrivilegesW [ODBC32.156] + */ +-SQLRETURN WINAPI SQLColumnPrivilegesW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, +- SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, +- SQLSMALLINT NameLength3, SQLWCHAR *ColumnName, SQLSMALLINT NameLength4) ++SQLRETURN WINAPI SQLColumnPrivilegesW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, ++ SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, ++ SQLSMALLINT cbTableName, SQLWCHAR *szColumnName, SQLSMALLINT cbColumnName) + { +- struct SQLColumnPrivilegesW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, +- TableName, NameLength3, ColumnName, NameLength4 }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- 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); ++ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," ++ " cbTableName %d, szColumnName %s, cbColumnName %d)\n", hstmt, ++ debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName, ++ debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, ++ debugstr_wn(szTableName, cbTableName), cbTableName, ++ debugstr_wn(szColumnName, cbColumnName), cbColumnName); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLColumnPrivilegesW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2809,215 +1623,136 @@ SQLRETURN WINAPI SQLDataSourcesW(SQLHENV EnvironmentHandle, SQLUSMALLINT Directi + SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, WCHAR *Description, + SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2) + { +- struct SQLDataSourcesW_params params = { 0, Direction, ServerName, BufferLength1, NameLength1, Description, +- BufferLength2, NameLength2 }; +- struct handle *handle = EnvironmentHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_NO_DATA; + +- TRACE("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p," ++ FIXME("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p," + " BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle, Direction, ServerName, BufferLength1, + NameLength1, Description, BufferLength2, NameLength2); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.EnvironmentHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLDataSourcesW, ¶ms ); +- +- if (ret >= 0 && TRACE_ON(odbc)) +- { +- if (ServerName && NameLength1 && *NameLength1 > 0) +- TRACE(" DataSource %s", debugstr_wn(ServerName, *NameLength1)); +- if (Description && NameLength2 && *NameLength2 > 0) +- TRACE(" Description %s", debugstr_wn(Description, *NameLength2)); +- TRACE("\n"); +- } +- +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLForeignKeysW [ODBC32.160] + */ +-SQLRETURN WINAPI SQLForeignKeysW(SQLHSTMT StatementHandle, SQLWCHAR *PkCatalogName, SQLSMALLINT NameLength1, +- SQLWCHAR *PkSchemaName, SQLSMALLINT NameLength2, SQLWCHAR *PkTableName, +- SQLSMALLINT NameLength3, SQLWCHAR *FkCatalogName, SQLSMALLINT NameLength4, +- SQLWCHAR *FkSchemaName, SQLSMALLINT NameLength5, SQLWCHAR *FkTableName, +- SQLSMALLINT NameLength6) ++SQLRETURN WINAPI SQLForeignKeysW(SQLHSTMT hstmt, SQLWCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName, ++ SQLWCHAR *szPkSchemaName, SQLSMALLINT cbPkSchemaName, SQLWCHAR *szPkTableName, ++ SQLSMALLINT cbPkTableName, SQLWCHAR *szFkCatalogName, ++ SQLSMALLINT cbFkCatalogName, SQLWCHAR *szFkSchemaName, ++ SQLSMALLINT cbFkSchemaName, SQLWCHAR *szFkTableName, SQLSMALLINT cbFkTableName) + { +- struct SQLForeignKeysW_params params = { 0, PkCatalogName, NameLength1, PkSchemaName, NameLength2, +- PkTableName, NameLength2, FkCatalogName, NameLength3, +- FkSchemaName, NameLength5, FkTableName, NameLength6 }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- 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); ++ FIXME("(hstmt %p, szPkCatalogName %s, cbPkCatalogName %d, szPkSchemaName %s, cbPkSchemaName %d," ++ " szPkTableName %s, cbPkTableName %d, szFkCatalogName %s, cbFkCatalogName %d, szFkSchemaName %s," ++ " cbFkSchemaName %d, szFkTableName %s, cbFkTableName %d)\n", hstmt, ++ debugstr_wn(szPkCatalogName, cbPkCatalogName), cbPkCatalogName, ++ debugstr_wn(szPkSchemaName, cbPkSchemaName), cbPkSchemaName, ++ debugstr_wn(szPkTableName, cbPkTableName), cbPkTableName, ++ debugstr_wn(szFkCatalogName, cbFkCatalogName), cbFkCatalogName, ++ debugstr_wn(szFkSchemaName, cbFkSchemaName), cbFkSchemaName, ++ debugstr_wn(szFkTableName, cbFkTableName), cbFkTableName); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLForeignKeysW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLNativeSqlW [ODBC32.162] + */ +-SQLRETURN WINAPI SQLNativeSqlW(SQLHDBC ConnectionHandle, SQLWCHAR *InStatementText, SQLINTEGER TextLength1, +- SQLWCHAR *OutStatementText, SQLINTEGER BufferLength, SQLINTEGER *TextLength2) ++SQLRETURN WINAPI SQLNativeSqlW(SQLHDBC hdbc, SQLWCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLWCHAR *szSqlStr, ++ SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr) + { +- struct SQLNativeSqlW_params params = { 0, InStatementText, TextLength1, OutStatementText, BufferLength, +- TextLength2 }; +- struct handle *handle = ConnectionHandle; +- SQLRETURN ret; +- +- TRACE("(ConnectionHandle %p, InStatementText %s, TextLength1 %d, OutStatementText %p, BufferLength %d, " +- "TextLength2 %p)\n", ConnectionHandle, debugstr_wn(InStatementText, TextLength1), TextLength1, +- OutStatementText, BufferLength, TextLength2); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc, ++ debugstr_wn(szSqlStrIn, cbSqlStrIn), cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr); + +- params.ConnectionHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLNativeSqlW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLPrimaryKeysW [ODBC32.165] + */ +-SQLRETURN WINAPI SQLPrimaryKeysW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, +- SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, +- SQLSMALLINT NameLength3) ++SQLRETURN WINAPI SQLPrimaryKeysW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, ++ SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, ++ SQLSMALLINT cbTableName) + { +- struct SQLPrimaryKeysW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, +- NameLength2 }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ 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); ++ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," ++ " cbTableName %d)\n", hstmt, ++ debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName, ++ debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, ++ debugstr_wn(szTableName, cbTableName), cbTableName); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLPrimaryKeysW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLProcedureColumnsW [ODBC32.166] + */ +-SQLRETURN WINAPI SQLProcedureColumnsW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, +- SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *ProcName, +- SQLSMALLINT NameLength3, SQLWCHAR *ColumnName, SQLSMALLINT NameLength4 ) ++SQLRETURN WINAPI SQLProcedureColumnsW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, ++ SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szProcName, ++ SQLSMALLINT cbProcName, SQLWCHAR *szColumnName, SQLSMALLINT cbColumnName) + { +- struct SQLProcedureColumnsW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, +- ProcName, NameLength3, ColumnName, NameLength4 }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; +- +- 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); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," ++ " cbProcName %d, szColumnName %s, cbColumnName %d)\n", hstmt, ++ debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName, ++ debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, ++ debugstr_wn(szProcName, cbProcName), cbProcName, ++ debugstr_wn(szColumnName, cbColumnName), cbColumnName); + +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLProcedureColumnsW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLProceduresW [ODBC32.167] + */ +-SQLRETURN WINAPI SQLProceduresW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, +- SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *ProcName, +- SQLSMALLINT NameLength3) ++SQLRETURN WINAPI SQLProceduresW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, ++ SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szProcName, ++ SQLSMALLINT cbProcName) + { +- struct SQLProceduresW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, ProcName, +- NameLength3 }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; +- +- 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); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," ++ " cbProcName %d)\n", hstmt, debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName, ++ debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, debugstr_wn(szProcName, cbProcName), cbProcName); + +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLProceduresW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLTablePrivilegesW [ODBC32.170] + */ +-SQLRETURN WINAPI SQLTablePrivilegesW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, +- SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, +- SQLSMALLINT NameLength3) ++SQLRETURN WINAPI SQLTablePrivilegesW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, ++ SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, ++ SQLSMALLINT cbTableName) + { +- struct SQLTablePrivilegesW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, +- NameLength3 }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; ++ 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); ++ FIXME("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," ++ " cbTableName %d)\n", hstmt, debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName, ++ debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, debugstr_wn(szTableName, cbTableName), cbTableName); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLTablePrivilegesW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + + /************************************************************************* + * SQLDriversW [ODBC32.171] + */ +-SQLRETURN WINAPI SQLDriversW(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLWCHAR *DriverDescription, +- SQLSMALLINT BufferLength1, SQLSMALLINT *DescriptionLength, SQLWCHAR *DriverAttributes, +- SQLSMALLINT BufferLength2, SQLSMALLINT *AttributesLength) ++SQLRETURN WINAPI SQLDriversW(SQLHENV EnvironmentHandle, SQLUSMALLINT fDirection, SQLWCHAR *szDriverDesc, ++ SQLSMALLINT cbDriverDescMax, SQLSMALLINT *pcbDriverDesc, ++ SQLWCHAR *szDriverAttributes, SQLSMALLINT cbDriverAttrMax, ++ SQLSMALLINT *pcbDriverAttr) + { +- struct SQLDriversW_params params = { 0, Direction, DriverDescription, BufferLength1, DescriptionLength, +- DriverAttributes, BufferLength2, AttributesLength }; +- struct handle *handle = EnvironmentHandle; +- SQLRETURN ret; +- +- TRACE("(EnvironmentHandle %p, Direction %d, DriverDescription %p, BufferLength1 %d, DescriptionLength %p," +- " DriverAttributes %p, BufferLength2 %d, AttributesLength %p)\n", EnvironmentHandle, Direction, +- DriverDescription, BufferLength1, DescriptionLength, DriverAttributes, BufferLength2, AttributesLength); ++ SQLRETURN ret = SQL_NO_DATA; + +- if (!handle) return SQL_INVALID_HANDLE; ++ FIXME("(EnvironmentHandle %p, Direction %d, szDriverDesc %p, cbDriverDescMax %d, pcbDriverDesc %p," ++ " DriverAttributes %p, cbDriverAttrMax %d, pcbDriverAttr %p)\n", EnvironmentHandle, fDirection, ++ szDriverDesc, cbDriverDescMax, pcbDriverDesc, szDriverAttributes, cbDriverAttrMax, pcbDriverAttr); + +- params.EnvironmentHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLDriversW, ¶ms ); +- +- if (ret == SQL_NO_DATA && Direction == SQL_FETCH_FIRST) +- ERR_(winediag)("No ODBC drivers could be found. Check the settings for your libodbc provider.\n"); +- +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -3027,18 +1762,11 @@ SQLRETURN WINAPI SQLDriversW(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, + SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, + SQLPOINTER Value, SQLINTEGER BufferLength) + { +- struct SQLSetDescFieldW_params params = { 0, RecNumber, FieldIdentifier, Value, BufferLength }; +- struct handle *handle = DescriptorHandle; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle, ++ FIXME("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle, + RecNumber, FieldIdentifier, Value, BufferLength); + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.DescriptorHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLSetDescFieldW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -3048,28 +1776,11 @@ SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumb + SQLRETURN WINAPI SQLSetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength) + { +- struct SQLSetStmtAttrW_params params = { 0, Attribute, Value, StringLength }; +- struct handle *handle = StatementHandle; +- SQLRETURN ret; +- +- TRACE("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, +- Value, StringLength); ++ SQLRETURN ret = SQL_ERROR; + +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- if (SUCCESS((ret = ODBC_CALL( SQLSetStmtAttrW, ¶ms )))) +- { +- SQLULEN row_count = (SQLULEN)Value; +- if (Attribute == SQL_ATTR_ROW_ARRAY_SIZE && row_count != handle->row_count) +- { +- TRACE( "resizing result length array\n" ); +- if (!resize_result_lengths( handle, row_count )) ret = SQL_ERROR; +- else handle->row_count = row_count; +- } +- } ++ FIXME("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value, ++ StringLength); + +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -3077,34 +1788,14 @@ SQLRETURN WINAPI SQLSetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, + * SQLGetDiagRecA [ODBC32.236] + */ + SQLRETURN WINAPI SQLGetDiagRecA(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, +- SQLCHAR *SqlState, SQLINTEGER *NativeError, SQLCHAR *MessageText, ++ SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText, + SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) + { +- return SQLGetDiagRec( HandleType, Handle, RecNumber, SqlState, NativeError, MessageText, BufferLength, +- TextLength ); +-} +- +-/*********************************************************************** +- * DllMain [Internal] Initializes the internal 'ODBC32.DLL'. +- */ +-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved) +-{ +- TRACE("proxy ODBC: %p,%lx,%p\n", hinstDLL, reason, reserved); ++ SQLRETURN ret = SQL_ERROR; + +- switch (reason) +- { +- case DLL_PROCESS_ATTACH: +- DisableThreadLibraryCalls(hinstDLL); +- if (!__wine_init_unix_call()) +- { +- if (WINE_UNIX_CALL( process_attach, NULL )) __wine_unixlib_handle = 0; +- } +- IsWow64Process( GetCurrentProcess(), &is_wow64 ); +- break; +- +- case DLL_PROCESS_DETACH: +- if (reserved) break; +- } ++ FIXME("(HandleType %d, Handle %p, RecNumber %d, Sqlstate %p, NativeError %p, MessageText %p, BufferLength %d," ++ " TextLength %p)\n", HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength, ++ TextLength); + +- return TRUE; ++ return ret; + } +diff --git a/dlls/wineodbc/Makefile.in b/dlls/wineodbc/Makefile.in +new file mode 100644 +index 00000000000..017daca7d3f +--- /dev/null ++++ b/dlls/wineodbc/Makefile.in +@@ -0,0 +1,9 @@ ++MODULE = wineodbc.dll ++UNIXLIB = wineodbc.so ++IMPORTS = advapi32 ++UNIX_LIBS = $(ODBC_LIBS) ++ ++SOURCES = \ ++ proxyodbc.c \ ++ rsrc.rc \ ++ unixlib.c +diff --git a/dlls/wineodbc/proxyodbc.c b/dlls/wineodbc/proxyodbc.c +new file mode 100644 +index 00000000000..47e0aff0b18 +--- /dev/null ++++ b/dlls/wineodbc/proxyodbc.c +@@ -0,0 +1,3110 @@ ++/* ++ * Win32 ODBC functions ++ * ++ * Copyright 1999 Xiang Li, Corel Corporation ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA ++ * ++ * NOTES: ++ * Proxy ODBC driver manager. This manager delegates all ODBC ++ * calls to a real ODBC driver manager named by the environment ++ * variable LIB_ODBC_DRIVER_MANAGER, or to libodbc.so if the ++ * variable is not set. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "windef.h" ++#include "winbase.h" ++#include "winternl.h" ++#include "winreg.h" ++#include "wine/debug.h" ++ ++#include "sql.h" ++#include "sqltypes.h" ++#include "sqlext.h" ++#include "unixlib.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(odbc); ++WINE_DECLARE_DEBUG_CHANNEL(winediag); ++ ++#define ODBC_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params ) ++ ++static BOOL is_wow64; ++ ++static struct handle *alloc_handle( void ) ++{ ++ struct handle *ret; ++ if (!(ret = calloc( 1, sizeof(*ret) ))) return NULL; ++ ret->row_count = 1; ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLAllocConnect [ODBC32.001] ++ */ ++SQLRETURN WINAPI SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionHandle) ++{ ++ struct SQLAllocConnect_params params; ++ struct handle *con, *env = EnvironmentHandle; ++ SQLRETURN ret; ++ ++ TRACE("(EnvironmentHandle %p, ConnectionHandle %p)\n", EnvironmentHandle, ConnectionHandle); ++ ++ *ConnectionHandle = 0; ++ if (!(con = alloc_handle())) return SQL_ERROR; ++ ++ params.EnvironmentHandle = env->unix_handle; ++ if (SUCCESS((ret = ODBC_CALL( SQLAllocConnect, ¶ms )))) ++ { ++ con->unix_handle = params.ConnectionHandle; ++ *ConnectionHandle = con; ++ } ++ else free( con ); ++ ++ TRACE("Returning %d, ConnectionHandle %p\n", ret, *ConnectionHandle); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLAllocEnv [ODBC32.002] ++ */ ++SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle) ++{ ++ struct SQLAllocEnv_params params; ++ struct handle *env; ++ SQLRETURN ret; ++ ++ TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle); ++ ++ *EnvironmentHandle = 0; ++ if (!(env = alloc_handle())) return SQL_ERROR; ++ ++ if (SUCCESS((ret = ODBC_CALL( SQLAllocEnv, ¶ms )))) ++ { ++ env->unix_handle = params.EnvironmentHandle; ++ *EnvironmentHandle = env; ++ } ++ else free( env ); ++ ++ TRACE("Returning %d, EnvironmentHandle %p\n", ret, *EnvironmentHandle); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLAllocHandle [ODBC32.024] ++ */ ++SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle) ++{ ++ struct SQLAllocHandle_params params; ++ struct handle *output, *input = InputHandle; ++ SQLRETURN ret; ++ ++ TRACE("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); ++ ++ *OutputHandle = 0; ++ if (!(output = alloc_handle())) return SQL_ERROR; ++ ++ params.HandleType = HandleType; ++ params.InputHandle = input ? input->unix_handle : 0; ++ if (SUCCESS((ret = ODBC_CALL( SQLAllocHandle, ¶ms )))) ++ { ++ output->unix_handle = params.OutputHandle; ++ *OutputHandle = output; ++ } ++ else free( output ); ++ ++ TRACE("Returning %d, OutputHandle %p\n", ret, *OutputHandle); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLAllocStmt [ODBC32.003] ++ */ ++SQLRETURN WINAPI SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandle) ++{ ++ struct SQLAllocStmt_params params; ++ struct handle *stmt, *con = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(ConnectionHandle %p, StatementHandle %p)\n", ConnectionHandle, StatementHandle); ++ ++ *StatementHandle = 0; ++ if (!(stmt = alloc_handle())) return SQL_ERROR; ++ ++ params.ConnectionHandle = con->unix_handle; ++ if (SUCCESS((ret = ODBC_CALL( SQLAllocStmt, ¶ms )))) ++ { ++ stmt->unix_handle = params.StatementHandle; ++ *StatementHandle = stmt; ++ } ++ else free( stmt ); ++ ++ TRACE ("Returning %d, StatementHandle %p\n", ret, *StatementHandle); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLAllocHandleStd [ODBC32.077] ++ */ ++SQLRETURN WINAPI SQLAllocHandleStd(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle) ++{ ++ struct SQLAllocHandleStd_params params; ++ struct handle *output, *input = InputHandle; ++ SQLRETURN ret; ++ ++ TRACE("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); ++ ++ *OutputHandle = 0; ++ if (!(output = alloc_handle())) return SQL_ERROR; ++ ++ params.HandleType = HandleType; ++ params.InputHandle = input ? input->unix_handle : 0; ++ if (SUCCESS((ret = ODBC_CALL( SQLAllocHandleStd, ¶ms )))) ++ { ++ output->unix_handle = params.OutputHandle; ++ *OutputHandle = output; ++ } ++ else free( output ); ++ ++ TRACE ("Returning %d, OutputHandle %p\n", ret, *OutputHandle); ++ return ret; ++} ++ ++static const char *debugstr_sqllen( SQLLEN len ) ++{ ++#ifdef _WIN64 ++ return wine_dbg_sprintf( "%Id", len ); ++#else ++ return wine_dbg_sprintf( "%d", len ); ++#endif ++} ++ ++#define MAX_BINDING_PARAMS 1024 ++static BOOL alloc_binding( struct param_binding *binding, USHORT type, UINT column, UINT row_count ) ++{ ++ if (column > MAX_BINDING_PARAMS) ++ { ++ FIXME( "increase maximum number of parameters\n" ); ++ return FALSE; ++ } ++ if (!binding->param && !(binding->param = calloc( MAX_BINDING_PARAMS, sizeof(*binding->param)))) return FALSE; ++ ++ if (!(binding->param[column - 1].len = calloc( row_count, sizeof(UINT64) ))) return FALSE; ++ binding->param[column - 1].type = type; ++ binding->count = column; ++ return TRUE; ++} ++ ++/************************************************************************* ++ * SQLBindCol [ODBC32.004] ++ */ ++SQLRETURN WINAPI SQLBindCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, ++ SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind) ++{ ++ struct SQLBindCol_params params = { 0, ColumnNumber, TargetType, TargetValue, BufferLength }; ++ struct handle *handle = StatementHandle; ++ UINT i = ColumnNumber - 1; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", ++ StatementHandle, ColumnNumber, TargetType, TargetValue, debugstr_sqllen(BufferLength), StrLen_or_Ind); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ if (!ColumnNumber) ++ { ++ FIXME( "column 0 not handled\n" ); ++ return SQL_ERROR; ++ } ++ if (!alloc_binding( &handle->bind_col, SQL_PARAM_INPUT_OUTPUT, ColumnNumber, handle->row_count )) return SQL_ERROR; ++ handle->bind_col.param[i].col.target_type = TargetType; ++ handle->bind_col.param[i].col.target_value = TargetValue; ++ handle->bind_col.param[i].col.buffer_length = BufferLength; ++ ++ params.StatementHandle = handle->unix_handle; ++ if (StrLen_or_Ind) params.StrLen_or_Ind = handle->bind_col.param[i].len; ++ if (SUCCESS(( ret = ODBC_CALL( SQLBindCol, ¶ms )))) handle->bind_col.param[i].ptr = StrLen_or_Ind; ++ TRACE ("Returning %d\n", ret); ++ return ret; ++} ++ ++static const char *debugstr_sqlulen( SQLULEN len ) ++{ ++#ifdef _WIN64 ++ return wine_dbg_sprintf( "%Iu", len ); ++#else ++ return wine_dbg_sprintf( "%u", len ); ++#endif ++} ++ ++/************************************************************************* ++ * SQLBindParam [ODBC32.025] ++ */ ++SQLRETURN WINAPI SQLBindParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, ++ SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale, ++ SQLPOINTER ParameterValue, SQLLEN *StrLen_or_Ind) ++{ ++ struct SQLBindParam_params params = { 0, ParameterNumber, ValueType, ParameterType, LengthPrecision, ++ ParameterScale, ParameterValue }; ++ struct handle *handle = StatementHandle; ++ UINT i = ParameterNumber - 1; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s," ++ " ParameterScale %d, ParameterValue %p, StrLen_or_Ind %p)\n", StatementHandle, ParameterNumber, ValueType, ++ ParameterType, debugstr_sqlulen(LengthPrecision), ParameterScale, ParameterValue, StrLen_or_Ind); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ if (!ParameterNumber) ++ { ++ FIXME( "parameter 0 not handled\n" ); ++ return SQL_ERROR; ++ } ++ if (!alloc_binding( &handle->bind_param, SQL_PARAM_INPUT, ParameterNumber, handle->row_count )) return SQL_ERROR; ++ handle->bind_param.param[i].param.value_type = ValueType; ++ handle->bind_param.param[i].param.parameter_type = ParameterType; ++ handle->bind_param.param[i].param.length_precision = LengthPrecision; ++ handle->bind_param.param[i].param.parameter_scale = ParameterScale; ++ handle->bind_param.param[i].param.parameter_value = ParameterValue; ++ ++ params.StatementHandle = handle->unix_handle; ++ params.StrLen_or_Ind = handle->bind_param.param[i].len; ++ *(UINT64 *)params.StrLen_or_Ind = *StrLen_or_Ind; ++ if (SUCCESS(( ret = ODBC_CALL( SQLBindParam, ¶ms )))) handle->bind_param.param[i].ptr = StrLen_or_Ind; ++ TRACE ("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLCancel [ODBC32.005] ++ */ ++SQLRETURN WINAPI SQLCancel(SQLHSTMT StatementHandle) ++{ ++ struct SQLCancel_params params; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p)\n", StatementHandle); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLCancel, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLCloseCursor [ODBC32.026] ++ */ ++SQLRETURN WINAPI SQLCloseCursor(SQLHSTMT StatementHandle) ++{ ++ struct SQLCloseCursor_params params; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p)\n", StatementHandle); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLCloseCursor, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLColAttribute [ODBC32.027] ++ */ ++SQLRETURN WINAPI SQLColAttribute(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, ++ SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, ++ SQLLEN *NumericAttribute) ++{ ++ struct SQLColAttribute_params params = { 0, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength, ++ StringLength }; ++ struct handle *handle = StatementHandle; ++ INT64 num_attr = 0; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttribute %p, BufferLength %d," ++ " StringLength %p, NumericAttribute %p)\n", StatementHandle, ColumnNumber, FieldIdentifier, ++ CharacterAttribute, BufferLength, StringLength, NumericAttribute); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ params.NumericAttribute = &num_attr; ++ if (SUCCESS(( ret = ODBC_CALL( SQLColAttribute, ¶ms ))) && NumericAttribute) *NumericAttribute = num_attr; ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLColumns [ODBC32.040] ++ */ ++SQLRETURN WINAPI SQLColumns(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, ++ SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, ++ SQLSMALLINT NameLength3, SQLCHAR *ColumnName, SQLSMALLINT NameLength4) ++{ ++ struct SQLColumns_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, ++ NameLength3, ColumnName, NameLength4 }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLColumns, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLConnect [ODBC32.007] ++ */ ++SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSMALLINT NameLength1, ++ SQLCHAR *UserName, SQLSMALLINT NameLength2, SQLCHAR *Authentication, ++ SQLSMALLINT NameLength3) ++{ ++ struct SQLConnect_params params = { 0, ServerName, NameLength1, UserName, NameLength2, Authentication, NameLength3 }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLConnect, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLCopyDesc [ODBC32.028] ++ */ ++SQLRETURN WINAPI SQLCopyDesc(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle) ++{ ++ struct SQLCopyDesc_params params; ++ struct handle *source = SourceDescHandle, *target = TargetDescHandle; ++ SQLRETURN ret; ++ ++ TRACE("(SourceDescHandle %p, TargetDescHandle %p)\n", SourceDescHandle, TargetDescHandle); ++ ++ if (!source || !target) return SQL_INVALID_HANDLE; ++ ++ params.SourceDescHandle = source->unix_handle; ++ params.TargetDescHandle = target->unix_handle; ++ ret = ODBC_CALL( SQLCopyDesc, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLDataSources [ODBC32.057] ++ */ ++SQLRETURN WINAPI SQLDataSources(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR *ServerName, ++ SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, SQLCHAR *Description, ++ SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2) ++{ ++ struct SQLDataSources_params params = { 0, Direction, ServerName, BufferLength1, NameLength1, Description, ++ BufferLength2, NameLength2 }; ++ struct handle *handle = EnvironmentHandle; ++ SQLRETURN ret; ++ ++ TRACE("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p," ++ " BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle, Direction, ServerName, BufferLength1, ++ NameLength1, Description, BufferLength2, NameLength2); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.EnvironmentHandle = handle->unix_handle; ++ if (SUCCESS((ret = ODBC_CALL( SQLDataSources, ¶ms ))) && TRACE_ON(odbc)) ++ { ++ if (ServerName && NameLength1 && *NameLength1 > 0) ++ TRACE(" DataSource %s", debugstr_an((const char *)ServerName, *NameLength1)); ++ if (Description && NameLength2 && *NameLength2 > 0) ++ TRACE(" Description %s", debugstr_an((const char *)Description, *NameLength2)); ++ TRACE("\n"); ++ } ++ ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++SQLRETURN WINAPI SQLDataSourcesA(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR *ServerName, ++ SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, SQLCHAR *Description, ++ SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2) ++{ ++ return SQLDataSources( EnvironmentHandle, Direction, ServerName, BufferLength1, NameLength1, Description, ++ BufferLength2, NameLength2 ); ++} ++ ++/************************************************************************* ++ * SQLDescribeCol [ODBC32.008] ++ */ ++SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, ++ SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType, ++ SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) ++{ ++ struct SQLDescribeCol_params params = { 0, ColumnNumber, ColumnName, BufferLength, NameLength, DataType, ++ NULL, DecimalDigits, Nullable }; ++ struct handle *handle = StatementHandle; ++ UINT64 size; ++ SQLSMALLINT dummy; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," ++ " ColumnSize %p, DecimalDigits %p, Nullable %p)\n", StatementHandle, ColumnNumber, ColumnName, ++ BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ if (!params.NameLength) params.NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ ++ params.ColumnSize = &size; ++ if (SUCCESS((ret = ODBC_CALL( SQLDescribeCol, ¶ms )))) ++ { ++ if (ColumnName && NameLength) TRACE(" ColumnName %s\n", debugstr_an((const char *)ColumnName, *NameLength)); ++ if (DataType) TRACE(" DataType %d\n", *DataType); ++ if (ColumnSize) ++ { ++ *ColumnSize = size; ++ TRACE(" ColumnSize %s\n", debugstr_sqlulen(*ColumnSize)); ++ } ++ if (DecimalDigits) TRACE(" DecimalDigits %d\n", *DecimalDigits); ++ if (Nullable) TRACE(" Nullable %d\n", *Nullable); ++ } ++ ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLDisconnect [ODBC32.009] ++ */ ++SQLRETURN WINAPI SQLDisconnect(SQLHDBC ConnectionHandle) ++{ ++ struct SQLDisconnect_params params; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(ConnectionHandle %p)\n", ConnectionHandle); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLDisconnect, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLEndTran [ODBC32.029] ++ */ ++SQLRETURN WINAPI SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType) ++{ ++ struct SQLEndTran_params params = { HandleType, 0, CompletionType }; ++ struct handle *handle = Handle; ++ SQLRETURN ret; ++ ++ TRACE("(HandleType %d, Handle %p, CompletionType %d)\n", HandleType, Handle, CompletionType); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.Handle = handle->unix_handle; ++ ret = ODBC_CALL( SQLEndTran, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLError [ODBC32.010] ++ */ ++SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, ++ SQLCHAR *SqlState, SQLINTEGER *NativeError, SQLCHAR *MessageText, ++ SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) ++{ ++ struct SQLError_params params = { 0, 0, 0, SqlState, NativeError, MessageText, BufferLength, TextLength }; ++ struct handle *env = EnvironmentHandle, *con = ConnectionHandle, *stmt = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, SqlState %p, NativeError %p," ++ " MessageText %p, BufferLength %d, TextLength %p)\n", EnvironmentHandle, ConnectionHandle, ++ StatementHandle, SqlState, NativeError, MessageText, BufferLength, TextLength); ++ ++ if (env) params.EnvironmentHandle = env->unix_handle; ++ if (con) params.ConnectionHandle = con->unix_handle; ++ if (stmt) params.StatementHandle = stmt->unix_handle; ++ if (SUCCESS((ret = ODBC_CALL( SQLError, ¶ms )))) ++ { ++ TRACE(" SqlState %s\n", debugstr_an((const char *)SqlState, 5)); ++ TRACE(" Error %d\n", *NativeError); ++ TRACE(" MessageText %s\n", debugstr_an((const char *)MessageText, *TextLength)); ++ } ++ ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLExecDirect [ODBC32.011] ++ */ ++SQLRETURN WINAPI SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength) ++{ ++ struct SQLExecDirect_params params = { 0, StatementText, TextLength }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, ++ debugstr_an((const char *)StatementText, TextLength), TextLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLExecDirect, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++static void len_to_user( SQLLEN *ptr, UINT8 *len, UINT row_count, UINT width ) ++{ ++ UINT i; ++ for (i = 0; i < row_count; i++) ++ { ++ *ptr++ = *(SQLLEN *)(len + i * width); ++ } ++} ++ ++static void len_from_user( UINT8 *len, SQLLEN *ptr, UINT row_count, UINT width ) ++{ ++ UINT i; ++ for (i = 0; i < row_count; i++) ++ { ++ *(SQLLEN *)(len + i * width) = *ptr++; ++ } ++} ++ ++static void update_result_lengths( struct handle *handle, USHORT type ) ++{ ++ UINT i, width = sizeof(void *) == 8 ? 8 : is_wow64 ? 8 : 4; ++ ++ switch (type) ++ { ++ case SQL_PARAM_OUTPUT: ++ for (i = 0; i < handle->bind_col.count; i++) ++ { ++ len_to_user( handle->bind_col.param[i].ptr, handle->bind_col.param[i].len, handle->row_count, width ); ++ } ++ for (i = 0; i < handle->bind_param.count; i++) ++ { ++ len_to_user( handle->bind_param.param[i].ptr, handle->bind_param.param[i].len, handle->row_count, width ); ++ } ++ for (i = 0; i < handle->bind_parameter.count; i++) ++ { ++ if (handle->bind_parameter.param[i].type != SQL_PARAM_OUTPUT && ++ handle->bind_parameter.param[i].type != SQL_PARAM_INPUT_OUTPUT) continue; ++ ++ len_to_user( handle->bind_parameter.param[i].ptr, handle->bind_parameter.param[i].len, handle->row_count, width ); ++ } ++ break; ++ ++ case SQL_PARAM_INPUT: ++ for (i = 0; i < handle->bind_col.count; i++) ++ { ++ len_from_user( handle->bind_col.param[i].len, handle->bind_col.param[i].ptr, handle->row_count, width ); ++ } ++ /* FIXME: handle bind_param */ ++ for (i = 0; i < handle->bind_parameter.count; i++) ++ { ++ if (handle->bind_parameter.param[i].type != SQL_PARAM_INPUT && ++ handle->bind_parameter.param[i].type != SQL_PARAM_INPUT_OUTPUT) continue; ++ ++ len_from_user( handle->bind_parameter.param[i].len, handle->bind_parameter.param[i].ptr, handle->row_count, width ); ++ } ++ ++ default: break; ++ } ++} ++ ++/************************************************************************* ++ * SQLExecute [ODBC32.012] ++ */ ++SQLRETURN WINAPI SQLExecute(SQLHSTMT StatementHandle) ++{ ++ struct SQLExecute_params params; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p)\n", StatementHandle); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ update_result_lengths( handle, SQL_PARAM_INPUT ); ++ if (SUCCESS(( ret = ODBC_CALL( SQLExecute, ¶ms )))) update_result_lengths( handle, SQL_PARAM_OUTPUT ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLFetch [ODBC32.013] ++ */ ++SQLRETURN WINAPI SQLFetch(SQLHSTMT StatementHandle) ++{ ++ struct SQLFetch_params params; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p)\n", StatementHandle); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ if (SUCCESS(( ret = ODBC_CALL( SQLFetch, ¶ms )))) update_result_lengths( handle, SQL_PARAM_OUTPUT ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLFetchScroll [ODBC32.030] ++ */ ++SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset) ++{ ++ struct SQLFetchScroll_params params = { 0, FetchOrientation, FetchOffset }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, FetchOrientation %d, FetchOffset %s)\n", StatementHandle, FetchOrientation, ++ debugstr_sqllen(FetchOffset)); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ if (SUCCESS(( ret = ODBC_CALL( SQLFetchScroll, ¶ms )))) update_result_lengths( handle, SQL_PARAM_OUTPUT ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLFreeConnect [ODBC32.014] ++ */ ++SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle) ++{ ++ struct SQLFreeConnect_params params; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(ConnectionHandle %p)\n", ConnectionHandle); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLFreeConnect, ¶ms ); ++ free( handle ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLFreeEnv [ODBC32.015] ++ */ ++SQLRETURN WINAPI SQLFreeEnv(SQLHENV EnvironmentHandle) ++{ ++ struct SQLFreeEnv_params params; ++ struct handle *handle = EnvironmentHandle; ++ SQLRETURN ret; ++ ++ TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.EnvironmentHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLFreeEnv, ¶ms ); ++ free( handle ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++static void free_bindings( struct handle *handle ) ++{ ++ if (handle->bind_col.param) ++ { ++ free( handle->bind_col.param->len ); ++ free( handle->bind_col.param ); ++ } ++ if (handle->bind_param.param) ++ { ++ free( handle->bind_param.param->len ); ++ free( handle->bind_param.param ); ++ } ++ if (handle->bind_parameter.param) ++ { ++ free( handle->bind_parameter.param->len ); ++ free( handle->bind_parameter.param ); ++ } ++} ++ ++/************************************************************************* ++ * SQLFreeHandle [ODBC32.031] ++ */ ++SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) ++{ ++ struct SQLFreeHandle_params params; ++ struct handle *handle = Handle; ++ SQLRETURN ret; ++ ++ TRACE("(HandleType %d, Handle %p)\n", HandleType, Handle); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.HandleType = HandleType; ++ params.Handle = handle->unix_handle; ++ ret = ODBC_CALL( SQLFreeHandle, ¶ms ); ++ free_bindings( handle ); ++ free( handle ); ++ TRACE ("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLFreeStmt [ODBC32.016] ++ */ ++SQLRETURN WINAPI SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option) ++{ ++ struct SQLFreeStmt_params params; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, Option %d)\n", StatementHandle, Option); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ params.Option = Option; ++ ret = ODBC_CALL( SQLFreeStmt, ¶ms ); ++ free_bindings( handle ); ++ free( handle ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetConnectAttr [ODBC32.032] ++ */ ++SQLRETURN WINAPI SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, ++ SQLINTEGER BufferLength, SQLINTEGER *StringLength) ++{ ++ struct SQLGetConnectAttr_params params = { 0, Attribute, Value, BufferLength, StringLength }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, ++ Attribute, Value, BufferLength, StringLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetConnectAttr, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetConnectOption [ODBC32.042] ++ */ ++SQLRETURN WINAPI SQLGetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value) ++{ ++ struct SQLGetConnectOption_params params = { 0, Option, Value }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(ConnectionHandle %p, Option %d, Value %p)\n", ConnectionHandle, Option, Value); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetConnectOption, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetCursorName [ODBC32.017] ++ */ ++SQLRETURN WINAPI SQLGetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT BufferLength, ++ SQLSMALLINT *NameLength) ++{ ++ struct SQLGetCursorName_params params = { 0, CursorName, BufferLength, NameLength }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle, CursorName, ++ BufferLength, NameLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetCursorName, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetData [ODBC32.043] ++ */ ++SQLRETURN WINAPI SQLGetData(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, ++ SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind) ++{ ++ struct SQLGetData_params params = { 0, ColumnNumber, TargetType, TargetValue, BufferLength }; ++ struct handle *handle = StatementHandle; ++ INT64 len; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", ++ StatementHandle, ColumnNumber, TargetType, TargetValue, debugstr_sqllen(BufferLength), StrLen_or_Ind); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ params.StrLen_or_Ind = &len; ++ if (SUCCESS((ret = ODBC_CALL( SQLGetData, ¶ms )))) *StrLen_or_Ind = len; ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetDescField [ODBC32.033] ++ */ ++SQLRETURN WINAPI SQLGetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, ++ SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) ++{ ++ struct SQLGetDescField_params params = { 0, RecNumber, FieldIdentifier, Value, BufferLength, StringLength }; ++ struct handle *handle = DescriptorHandle; ++ SQLRETURN ret; ++ ++ TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n", ++ DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength, StringLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.DescriptorHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetDescField, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetDescRec [ODBC32.034] ++ */ ++SQLRETURN WINAPI SQLGetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLCHAR *Name, ++ SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLSMALLINT *Type, ++ SQLSMALLINT *SubType, SQLLEN *Length, SQLSMALLINT *Precision, ++ SQLSMALLINT *Scale, SQLSMALLINT *Nullable) ++{ ++ struct SQLGetDescRec_params params = { 0, RecNumber, Name, BufferLength, StringLength, Type, SubType, NULL, ++ Precision, Scale, Nullable }; ++ struct handle *handle = DescriptorHandle; ++ INT64 len; ++ SQLRETURN ret; ++ ++ TRACE("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p," ++ " Length %p, Precision %p, Scale %p, Nullable %p)\n", DescriptorHandle, RecNumber, Name, BufferLength, ++ StringLength, Type, SubType, Length, Precision, Scale, Nullable); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.DescriptorHandle = handle->unix_handle; ++ params.Length = &len; ++ if (SUCCESS((ret = ODBC_CALL( SQLGetDescRec, ¶ms )))) *Length = len; ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetDiagField [ODBC32.035] ++ */ ++SQLRETURN WINAPI SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, ++ SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, ++ SQLSMALLINT *StringLength) ++{ ++ struct SQLGetDiagField_params params = { HandleType, 0, RecNumber, DiagIdentifier, DiagInfo, BufferLength, ++ StringLength }; ++ struct handle *handle = Handle; ++ SQLRETURN ret; ++ ++ TRACE("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," ++ " StringLength %p)\n", HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.Handle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetDiagField, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetDiagRec [ODBC32.036] ++ */ ++SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, ++ SQLCHAR *SqlState, SQLINTEGER *NativeError, SQLCHAR *MessageText, ++ SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) ++{ ++ struct SQLGetDiagRec_params params = { HandleType, 0, RecNumber, SqlState, NativeError, MessageText, ++ BufferLength, TextLength }; ++ struct handle *handle = Handle; ++ SQLRETURN ret; ++ ++ TRACE("(HandleType %d, Handle %p, RecNumber %d, SqlState %p, NativeError %p, MessageText %p, BufferLength %d," ++ " TextLength %p)\n", HandleType, Handle, RecNumber, SqlState, NativeError, MessageText, BufferLength, ++ TextLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.Handle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetDiagRec, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetEnvAttr [ODBC32.037] ++ */ ++SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, ++ SQLINTEGER BufferLength, SQLINTEGER *StringLength) ++{ ++ struct SQLGetEnvAttr_params params = { 0, Attribute, Value, BufferLength, StringLength }; ++ struct handle *handle = EnvironmentHandle; ++ SQLRETURN ret; ++ ++ TRACE("(EnvironmentHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ++ EnvironmentHandle, Attribute, Value, BufferLength, StringLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.EnvironmentHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetEnvAttr, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetFunctions [ODBC32.044] ++ */ ++SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported) ++{ ++ struct SQLGetFunctions_params params = { 0, FunctionId, Supported }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(ConnectionHandle %p, FunctionId %d, Supported %p)\n", ConnectionHandle, FunctionId, Supported); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetFunctions, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetInfo [ODBC32.045] ++ */ ++SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, ++ SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) ++{ ++ struct SQLGetInfo_params params = { 0, InfoType, InfoValue, BufferLength, StringLength }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, ++ InfoType, InfoValue, BufferLength, StringLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetInfo, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetStmtAttr [ODBC32.038] ++ */ ++SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, ++ SQLINTEGER BufferLength, SQLINTEGER *StringLength) ++{ ++ struct SQLGetStmtAttr_params params = { 0, Attribute, Value, BufferLength, StringLength }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, ++ Attribute, Value, BufferLength, StringLength); ++ ++ if (!Value) ++ { ++ WARN("Unexpected NULL Value return address\n"); ++ return SQL_ERROR; ++ } ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetStmtAttr, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetStmtOption [ODBC32.046] ++ */ ++SQLRETURN WINAPI SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLPOINTER Value) ++{ ++ struct SQLGetStmtOption_params params = { 0, Option, Value }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, Option %d, Value %p)\n", StatementHandle, Option, Value); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetStmtOption, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetTypeInfo [ODBC32.047] ++ */ ++SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) ++{ ++ struct SQLGetTypeInfo_params params = { 0, DataType }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetTypeInfo, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLNumResultCols [ODBC32.018] ++ */ ++SQLRETURN WINAPI SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnCount) ++{ ++ struct SQLNumResultCols_params params = { 0, ColumnCount }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, ColumnCount %p)\n", StatementHandle, ColumnCount); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLNumResultCols, ¶ms ); ++ TRACE("Returning %d ColumnCount %d\n", ret, *ColumnCount); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLParamData [ODBC32.048] ++ */ ++SQLRETURN WINAPI SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value) ++{ ++ struct SQLParamData_params params = { 0, Value }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, Value %p)\n", StatementHandle, Value); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLParamData, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLPrepare [ODBC32.019] ++ */ ++SQLRETURN WINAPI SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength) ++{ ++ struct SQLPrepare_params params = { 0, StatementText, TextLength }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, ++ debugstr_an((const char *)StatementText, TextLength), TextLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLPrepare, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLPutData [ODBC32.049] ++ */ ++SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN StrLen_or_Ind) ++{ ++ struct SQLPutData_params params = { 0, Data, StrLen_or_Ind }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, Data %p, StrLen_or_Ind %s)\n", StatementHandle, Data, debugstr_sqllen(StrLen_or_Ind)); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLPutData, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLRowCount [ODBC32.020] ++ */ ++SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount) ++{ ++ struct SQLRowCount_params params; ++ struct handle *handle = StatementHandle; ++ INT64 count; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, RowCount %p)\n", StatementHandle, RowCount); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ params.RowCount = &count; ++ if (SUCCESS((ret = ODBC_CALL( SQLRowCount, ¶ms ))) && RowCount) ++ { ++ *RowCount = count; ++ TRACE(" RowCount %s\n", debugstr_sqllen(*RowCount)); ++ } ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLSetConnectAttr [ODBC32.039] ++ */ ++SQLRETURN WINAPI SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, ++ SQLINTEGER StringLength) ++{ ++ struct SQLSetConnectAttr_params params = { 0, Attribute, Value, StringLength }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value, ++ StringLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLSetConnectAttr, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLSetConnectOption [ODBC32.050] ++ */ ++SQLRETURN WINAPI SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value) ++{ ++ struct SQLSetConnectOption_params params = { 0, Option, Value }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle, Option, debugstr_sqlulen(Value)); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLSetConnectOption, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLSetCursorName [ODBC32.021] ++ */ ++SQLRETURN WINAPI SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT NameLength) ++{ ++ struct SQLSetCursorName_params params = { 0, CursorName, NameLength }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle, ++ debugstr_an((const char *)CursorName, NameLength), NameLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLSetCursorName, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLSetDescField [ODBC32.073] ++ */ ++SQLRETURN WINAPI SQLSetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, ++ SQLPOINTER Value, SQLINTEGER BufferLength) ++{ ++ struct SQLSetDescField_params params = { 0, RecNumber, FieldIdentifier, Value, BufferLength }; ++ struct handle *handle = DescriptorHandle; ++ SQLRETURN ret; ++ ++ TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle, ++ RecNumber, FieldIdentifier, Value, BufferLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.DescriptorHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLSetDescField, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLSetDescRec [ODBC32.074] ++ */ ++SQLRETURN WINAPI SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT Type, ++ SQLSMALLINT SubType, SQLLEN Length, SQLSMALLINT Precision, SQLSMALLINT Scale, ++ SQLPOINTER Data, SQLLEN *StringLength, SQLLEN *Indicator) ++{ ++ struct SQLSetDescRec_params params = { 0, RecNumber, Type, SubType, Length, Precision, Scale, Data }; ++ struct handle *handle = DescriptorHandle; ++ INT64 stringlen, indicator; ++ SQLRETURN ret; ++ ++ TRACE("(DescriptorHandle %p, RecNumber %d, Type %d, SubType %d, Length %s, Precision %d, Scale %d, Data %p," ++ " StringLength %p, Indicator %p)\n", DescriptorHandle, RecNumber, Type, SubType, debugstr_sqllen(Length), ++ Precision, Scale, Data, StringLength, Indicator); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.DescriptorHandle = handle->unix_handle; ++ params.StringLength = &stringlen; ++ params.Indicator = &indicator; ++ if (SUCCESS((ret = ODBC_CALL( SQLSetDescRec, ¶ms )))) ++ { ++ *StringLength = stringlen; ++ *Indicator = indicator; ++ } ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLSetEnvAttr [ODBC32.075] ++ */ ++SQLRETURN WINAPI SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, ++ SQLINTEGER StringLength) ++{ ++ struct SQLSetEnvAttr_params params = { 0, Attribute, Value, StringLength }; ++ struct handle *handle = EnvironmentHandle; ++ SQLRETURN ret; ++ ++ TRACE("(EnvironmentHandle %p, Attribute %d, Value %p, StringLength %d)\n", EnvironmentHandle, Attribute, Value, ++ StringLength); ++ ++ params.EnvironmentHandle = handle ? handle->unix_handle : 0; ++ ret = ODBC_CALL( SQLSetEnvAttr, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLSetParam [ODBC32.022] ++ */ ++SQLRETURN WINAPI SQLSetParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, ++ SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale, ++ SQLPOINTER ParameterValue, SQLLEN *StrLen_or_Ind) ++{ ++ struct SQLSetParam_params params = { 0, ParameterNumber, ValueType, ParameterType, LengthPrecision, ParameterScale, ++ ParameterValue }; ++ struct handle *handle = StatementHandle; ++ INT64 len; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s," ++ " ParameterScale %d, ParameterValue %p, StrLen_or_Ind %p)\n", StatementHandle, ParameterNumber, ValueType, ++ ParameterType, debugstr_sqlulen(LengthPrecision), ParameterScale, ParameterValue, StrLen_or_Ind); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ params.StrLen_or_Ind = &len; ++ if (SUCCESS((ret = ODBC_CALL( SQLSetParam, ¶ms )))) *StrLen_or_Ind = len; ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++static BOOL resize_result_lengths( struct handle *handle, UINT size ) ++{ ++ UINT i; ++ for (i = 0; i < handle->bind_col.count; i++) ++ { ++ UINT8 *tmp; ++ if (!handle->bind_col.param[i].ptr) continue; ++ if (!(tmp = realloc( handle->bind_col.param[i].len, size * sizeof(UINT64) ))) return FALSE; ++ if (tmp != handle->bind_col.param[i].len) ++ { ++ struct SQLBindCol_params params; ++ ++ params.StatementHandle = handle->unix_handle; ++ params.ColumnNumber = i + 1; ++ params.TargetType = handle->bind_col.param[i].col.target_type; ++ params.TargetValue = handle->bind_col.param[i].col.target_value; ++ params.BufferLength = handle->bind_col.param[i].col.buffer_length; ++ params.StrLen_or_Ind = tmp; ++ if (!SUCCESS(ODBC_CALL( SQLBindCol, ¶ms ))) ++ { ++ free( tmp ); ++ return FALSE; ++ } ++ } ++ handle->bind_col.param[i].len = tmp; ++ } ++ for (i = 0; i < handle->bind_param.count; i++) ++ { ++ UINT8 *tmp; ++ if (!handle->bind_param.param[i].ptr) continue; ++ if (!(tmp = realloc( handle->bind_param.param[i].len, size * sizeof(UINT64) ))) return FALSE; ++ if (tmp != handle->bind_param.param[i].len) ++ { ++ struct SQLBindParam_params params; ++ ++ params.StatementHandle = handle->unix_handle; ++ params.ParameterNumber = i + 1; ++ params.ValueType = handle->bind_param.param[i].param.value_type; ++ params.ParameterType = handle->bind_param.param[i].param.parameter_type; ++ params.LengthPrecision = handle->bind_param.param[i].param.length_precision; ++ params.ParameterScale = handle->bind_param.param[i].param.parameter_scale; ++ params.ParameterValue = handle->bind_param.param[i].param.parameter_value; ++ params.StrLen_or_Ind = tmp; ++ if (!SUCCESS(ODBC_CALL( SQLBindParam, ¶ms ))) ++ { ++ free( tmp ); ++ return FALSE; ++ } ++ } ++ handle->bind_param.param[i].len = tmp; ++ } ++ for (i = 0; i < handle->bind_parameter.count; i++) ++ { ++ UINT8 *tmp; ++ if (!(tmp = realloc( handle->bind_parameter.param[i].len, size * sizeof(UINT64) ))) return FALSE; ++ if (tmp != handle->bind_parameter.param[i].len) ++ { ++ struct SQLBindParameter_params params; ++ ++ params.StatementHandle = handle->unix_handle; ++ params.ParameterNumber = i + 1; ++ params.InputOutputType = handle->bind_parameter.param[i].parameter.input_output_type; ++ params.ValueType = handle->bind_parameter.param[i].parameter.value_type; ++ params.ParameterType = handle->bind_parameter.param[i].parameter.parameter_type; ++ params.ColumnSize = handle->bind_parameter.param[i].parameter.column_size; ++ params.DecimalDigits = handle->bind_parameter.param[i].parameter.decimal_digits; ++ params.ParameterValue = handle->bind_parameter.param[i].parameter.parameter_value; ++ params.BufferLength = handle->bind_parameter.param[i].parameter.buffer_length; ++ params.StrLen_or_Ind = tmp; ++ if (!SUCCESS(ODBC_CALL( SQLBindParameter, ¶ms ))) ++ { ++ free( tmp ); ++ return FALSE; ++ } ++ } ++ handle->bind_parameter.param[i].len = tmp; ++ } ++ return TRUE; ++} ++ ++/************************************************************************* ++ * SQLSetStmtAttr [ODBC32.076] ++ */ ++SQLRETURN WINAPI SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, ++ SQLINTEGER StringLength) ++{ ++ struct SQLSetStmtAttr_params params = { 0, Attribute, Value, StringLength }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value, ++ StringLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ if (SUCCESS((ret = ODBC_CALL( SQLSetStmtAttr, ¶ms )))) ++ { ++ SQLULEN row_count = (SQLULEN)Value; ++ if (Attribute == SQL_ATTR_ROW_ARRAY_SIZE && row_count != handle->row_count) ++ { ++ TRACE( "resizing result length array\n" ); ++ if (!resize_result_lengths( handle, row_count )) ret = SQL_ERROR; ++ else handle->row_count = row_count; ++ } ++ } ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLSetStmtOption [ODBC32.051] ++ */ ++SQLRETURN WINAPI SQLSetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLULEN Value) ++{ ++ struct SQLSetStmtOption_params params = { 0, Option, Value }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, Option %d, Value %s)\n", StatementHandle, Option, debugstr_sqlulen(Value)); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLSetStmtOption, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLSpecialColumns [ODBC32.052] ++ */ ++SQLRETURN WINAPI SQLSpecialColumns(SQLHSTMT StatementHandle, SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName, ++ SQLSMALLINT NameLength1, SQLCHAR *SchemaName, SQLSMALLINT NameLength2, ++ SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Scope, ++ SQLUSMALLINT Nullable) ++{ ++ struct SQLSpecialColumns_params params = { 0, IdentifierType, CatalogName, NameLength1, SchemaName, NameLength2, ++ TableName, NameLength3, Scope, Nullable }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLSpecialColumns, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLStatistics [ODBC32.053] ++ */ ++SQLRETURN WINAPI SQLStatistics(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, ++ SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, ++ SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved) ++{ ++ struct SQLStatistics_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, ++ NameLength3, Unique, Reserved }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLStatistics, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLTables [ODBC32.054] ++ */ ++SQLRETURN WINAPI SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, ++ SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, ++ SQLSMALLINT NameLength3, SQLCHAR *TableType, SQLSMALLINT NameLength4) ++{ ++ struct SQLTables_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, ++ NameLength3, TableType, NameLength4 }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLTables, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLTransact [ODBC32.023] ++ */ ++SQLRETURN WINAPI SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType) ++{ ++ struct SQLTransact_params params = { 0, 0, CompletionType }; ++ struct handle *env = EnvironmentHandle, *con = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(EnvironmentHandle %p, ConnectionHandle %p, CompletionType %d)\n", EnvironmentHandle, ConnectionHandle, ++ CompletionType); ++ ++ if (!env || !con) return SQL_INVALID_HANDLE; ++ ++ params.EnvironmentHandle = env->unix_handle; ++ params.ConnectionHandle = con->unix_handle; ++ ret = ODBC_CALL( SQLTransact, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLBrowseConnect [ODBC32.055] ++ */ ++SQLRETURN WINAPI SQLBrowseConnect(SQLHDBC ConnectionHandle, SQLCHAR *InConnectionString, SQLSMALLINT StringLength1, ++ SQLCHAR *OutConnectionString, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength2) ++{ ++ struct SQLBrowseConnect_params params = { 0, InConnectionString, StringLength1, OutConnectionString, BufferLength, ++ StringLength2 }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(ConnectionHandle %p, InConnectionString %s, StringLength1 %d, OutConnectionString %p, BufferLength, %d, " ++ "StringLength2 %p)\n", ConnectionHandle, debugstr_an((const char *)InConnectionString, StringLength1), ++ StringLength1, OutConnectionString, BufferLength, StringLength2); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLBrowseConnect, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLBulkOperations [ODBC32.078] ++ */ ++SQLRETURN WINAPI SQLBulkOperations(SQLHSTMT StatementHandle, SQLSMALLINT Operation) ++{ ++ struct SQLBulkOperations_params params = { 0, Operation }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, Operation %d)\n", StatementHandle, Operation); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ if (SUCCESS(( ret = ODBC_CALL( SQLBulkOperations, ¶ms )))) update_result_lengths( handle, SQL_PARAM_OUTPUT ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLColAttributes [ODBC32.006] ++ */ ++SQLRETURN WINAPI SQLColAttributes(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, ++ SQLPOINTER CharacterAttributes, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, ++ SQLLEN *NumericAttributes) ++{ ++ struct SQLColAttributes_params params = { 0, ColumnNumber, FieldIdentifier, CharacterAttributes, BufferLength, ++ StringLength }; ++ struct handle *handle = StatementHandle; ++ INT64 attrs; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttributes %p, BufferLength %d, " ++ "StringLength %p, NumericAttributes %p)\n", StatementHandle, ColumnNumber, FieldIdentifier, ++ CharacterAttributes, BufferLength, StringLength, NumericAttributes); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ params.NumericAttributes = &attrs; ++ if (SUCCESS((ret = ODBC_CALL( SQLColAttributes, ¶ms )))) *NumericAttributes = attrs; ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLColumnPrivileges [ODBC32.056] ++ */ ++SQLRETURN WINAPI SQLColumnPrivileges(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, ++ SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, ++ SQLSMALLINT NameLength3, SQLCHAR *ColumnName, SQLSMALLINT NameLength4) ++{ ++ struct SQLColumnPrivileges_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, ++ TableName, NameLength3, ColumnName, NameLength4 }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLColumnPrivileges, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLDescribeParam [ODBC32.058] ++ */ ++SQLRETURN WINAPI SQLDescribeParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT *DataType, ++ SQLULEN *ParameterSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) ++{ ++ struct SQLDescribeParam_params params = { 0, ParameterNumber, DataType, NULL, DecimalDigits, Nullable }; ++ struct handle *handle = StatementHandle; ++ UINT64 size; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, ParameterNumber %d, DataType %p, ParameterSize %p, DecimalDigits %p, Nullable %p)\n", ++ StatementHandle, ParameterNumber, DataType, ParameterSize, DecimalDigits, Nullable); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ params.ParameterSize = &size; ++ if (SUCCESS((ret = ODBC_CALL( SQLDescribeParam, ¶ms )))) *ParameterSize = size; ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLExtendedFetch [ODBC32.059] ++ */ ++SQLRETURN WINAPI SQLExtendedFetch(SQLHSTMT StatementHandle, SQLUSMALLINT FetchOrientation, SQLLEN FetchOffset, ++ SQLULEN *RowCount, SQLUSMALLINT *RowStatusArray) ++{ ++ struct SQLExtendedFetch_params params = { 0, FetchOrientation, FetchOffset, NULL, RowStatusArray }; ++ struct handle *handle = StatementHandle; ++ UINT64 count; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, FetchOrientation %d, FetchOffset %s, RowCount %p, RowStatusArray %p)\n", ++ StatementHandle, FetchOrientation, debugstr_sqllen(FetchOffset), RowCount, RowStatusArray); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ params.RowCount = &count; ++ if (SUCCESS((ret = ODBC_CALL( SQLExtendedFetch, ¶ms )))) *RowCount = count; ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLForeignKeys [ODBC32.060] ++ */ ++SQLRETURN WINAPI SQLForeignKeys(SQLHSTMT StatementHandle, SQLCHAR *PkCatalogName, SQLSMALLINT NameLength1, ++ SQLCHAR *PkSchemaName, SQLSMALLINT NameLength2, SQLCHAR *PkTableName, ++ SQLSMALLINT NameLength3, SQLCHAR *FkCatalogName, SQLSMALLINT NameLength4, ++ SQLCHAR *FkSchemaName, SQLSMALLINT NameLength5, SQLCHAR *FkTableName, ++ SQLSMALLINT NameLength6) ++{ ++ struct SQLForeignKeys_params params = { 0, PkCatalogName, NameLength1, PkSchemaName, NameLength2, ++ PkTableName, NameLength3, FkCatalogName, NameLength4, ++ FkSchemaName, NameLength5, FkTableName, NameLength6 }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLForeignKeys, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLMoreResults [ODBC32.061] ++ */ ++SQLRETURN WINAPI SQLMoreResults(SQLHSTMT StatementHandle) ++{ ++ struct SQLMoreResults_params params; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(%p)\n", StatementHandle); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLMoreResults, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLNativeSql [ODBC32.062] ++ */ ++SQLRETURN WINAPI SQLNativeSql(SQLHDBC ConnectionHandle, SQLCHAR *InStatementText, SQLINTEGER TextLength1, ++ SQLCHAR *OutStatementText, SQLINTEGER BufferLength, SQLINTEGER *TextLength2) ++{ ++ struct SQLNativeSql_params params = { 0, InStatementText, TextLength1, OutStatementText, BufferLength, ++ TextLength2 }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLNativeSql, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLNumParams [ODBC32.063] ++ */ ++SQLRETURN WINAPI SQLNumParams(SQLHSTMT StatementHandle, SQLSMALLINT *ParameterCount) ++{ ++ struct SQLNumParams_params params = { 0, ParameterCount }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, pcpar %p)\n", StatementHandle, ParameterCount); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLNumParams, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLParamOptions [ODBC32.064] ++ */ ++SQLRETURN WINAPI SQLParamOptions(SQLHSTMT StatementHandle, SQLULEN RowCount, SQLULEN *RowNumber) ++{ ++ struct SQLParamOptions_params params = { 0, RowCount }; ++ struct handle *handle = StatementHandle; ++ UINT64 row; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, RowCount %s, RowNumber %p)\n", StatementHandle, debugstr_sqlulen(RowCount), ++ RowNumber); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ params.RowNumber = &row; ++ if (SUCCESS((ret = ODBC_CALL( SQLParamOptions, ¶ms )))) *RowNumber = row; ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLPrimaryKeys [ODBC32.065] ++ */ ++SQLRETURN WINAPI SQLPrimaryKeys(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, ++ SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, ++ SQLSMALLINT NameLength3) ++{ ++ struct SQLPrimaryKeys_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, ++ NameLength3 }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLPrimaryKeys, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLProcedureColumns [ODBC32.066] ++ */ ++SQLRETURN WINAPI SQLProcedureColumns(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, ++ SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *ProcName, ++ SQLSMALLINT NameLength3, SQLCHAR *ColumnName, SQLSMALLINT NameLength4) ++{ ++ struct SQLProcedureColumns_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, ++ ProcName, NameLength3, ColumnName, NameLength4 }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLProcedureColumns, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLProcedures [ODBC32.067] ++ */ ++SQLRETURN WINAPI SQLProcedures(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, ++ SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *ProcName, ++ SQLSMALLINT NameLength3) ++{ ++ struct SQLProcedures_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, ProcName, ++ NameLength3 }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLProcedures, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLSetPos [ODBC32.068] ++ */ ++SQLRETURN WINAPI SQLSetPos(SQLHSTMT StatementHandle, SQLSETPOSIROW RowNumber, SQLUSMALLINT Operation, ++ SQLUSMALLINT LockType) ++{ ++ struct SQLSetPos_params params = { 0, RowNumber, Operation, LockType }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, RowNumber %s, Operation %d, LockType %d)\n", StatementHandle, ++ debugstr_sqlulen(RowNumber), Operation, LockType); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ if (SUCCESS(( ret = ODBC_CALL( SQLSetPos, ¶ms ))) && Operation == SQL_REFRESH) ++ update_result_lengths( handle, SQL_PARAM_OUTPUT ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLTablePrivileges [ODBC32.070] ++ */ ++SQLRETURN WINAPI SQLTablePrivileges(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, ++ SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, ++ SQLSMALLINT NameLength3) ++{ ++ struct SQLTablePrivileges_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, ++ TableName, NameLength3 }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLTablePrivileges, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLDrivers [ODBC32.071] ++ */ ++SQLRETURN WINAPI SQLDrivers(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR *DriverDescription, ++ SQLSMALLINT BufferLength1, SQLSMALLINT *DescriptionLength, ++ SQLCHAR *DriverAttributes, SQLSMALLINT BufferLength2, ++ SQLSMALLINT *AttributesLength) ++{ ++ struct SQLDrivers_params params = { 0, Direction, DriverDescription, BufferLength1, DescriptionLength, ++ DriverAttributes, BufferLength2, AttributesLength }; ++ struct handle *handle = EnvironmentHandle; ++ SQLRETURN ret; ++ ++ TRACE("(EnvironmentHandle %p, Direction %d, DriverDescription %p, BufferLength1 %d, DescriptionLength %p," ++ " DriverAttributes %p, BufferLength2 %d, AttributesLength %p)\n", EnvironmentHandle, Direction, ++ DriverDescription, BufferLength1, DescriptionLength, DriverAttributes, BufferLength2, AttributesLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.EnvironmentHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLDrivers, ¶ms ); ++ ++ if (ret == SQL_NO_DATA && Direction == SQL_FETCH_FIRST) ++ ERR_(winediag)("No ODBC drivers could be found. Check the settings for your libodbc provider.\n"); ++ ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLBindParameter [ODBC32.072] ++ */ ++SQLRETURN WINAPI SQLBindParameter(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT InputOutputType, ++ SQLSMALLINT ValueType, SQLSMALLINT ParameterType, SQLULEN ColumnSize, ++ SQLSMALLINT DecimalDigits, SQLPOINTER ParameterValue, SQLLEN BufferLength, ++ SQLLEN *StrLen_or_Ind) ++{ ++ struct SQLBindParameter_params params = { 0, ParameterNumber, InputOutputType, ValueType, ParameterType, ++ ColumnSize, DecimalDigits, ParameterValue, BufferLength }; ++ struct handle *handle = StatementHandle; ++ UINT i = ParameterNumber - 1; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, ParameterNumber %d, InputOutputType %d, ValueType %d, ParameterType %d, " ++ "ColumnSize %s, DecimalDigits %d, ParameterValue, %p, BufferLength %s, StrLen_or_Ind %p)\n", ++ StatementHandle, ParameterNumber, InputOutputType, ValueType, ParameterType, debugstr_sqlulen(ColumnSize), ++ DecimalDigits, ParameterValue, debugstr_sqllen(BufferLength), StrLen_or_Ind); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ if (!ParameterNumber) ++ { ++ FIXME( "parameter 0 not handled\n" ); ++ return SQL_ERROR; ++ } ++ if (!alloc_binding( &handle->bind_parameter, InputOutputType, ParameterNumber, handle->row_count )) return SQL_ERROR; ++ handle->bind_parameter.param[i].parameter.input_output_type = InputOutputType; ++ handle->bind_parameter.param[i].parameter.value_type = ValueType; ++ handle->bind_parameter.param[i].parameter.parameter_type = ParameterType; ++ handle->bind_parameter.param[i].parameter.column_size = ColumnSize; ++ handle->bind_parameter.param[i].parameter.decimal_digits = DecimalDigits; ++ handle->bind_parameter.param[i].parameter.parameter_value = ParameterValue; ++ handle->bind_parameter.param[i].parameter.buffer_length = BufferLength; ++ ++ params.StatementHandle = handle->unix_handle; ++ params.StrLen_or_Ind = handle->bind_parameter.param[i].len; ++ *(UINT64 *)params.StrLen_or_Ind = *StrLen_or_Ind; ++ if (SUCCESS((ret = ODBC_CALL( SQLBindParameter, ¶ms )))) handle->bind_parameter.param[i].ptr = StrLen_or_Ind; ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLDriverConnect [ODBC32.041] ++ */ ++SQLRETURN WINAPI SQLDriverConnect(SQLHDBC ConnectionHandle, SQLHWND WindowHandle, SQLCHAR *ConnectionString, ++ SQLSMALLINT Length, SQLCHAR *OutConnectionString, SQLSMALLINT BufferLength, ++ SQLSMALLINT *Length2, SQLUSMALLINT DriverCompletion) ++{ ++ struct SQLDriverConnect_params params = { 0, WindowHandle, ConnectionString, Length, OutConnectionString, ++ BufferLength, Length2, DriverCompletion }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(ConnectionHandle %p, hwnd %p, ConnectionString %s, Length %d, conn_str_out %p, conn_str_out_max %d," ++ " ptr_conn_str_out %p, driver_completion %d)\n", ConnectionHandle, WindowHandle, ++ debugstr_an((const char *)ConnectionString, Length), Length, OutConnectionString, BufferLength, ++ Length2, DriverCompletion); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLDriverConnect, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLSetScrollOptions [ODBC32.069] ++ */ ++SQLRETURN WINAPI SQLSetScrollOptions(SQLHSTMT StatementHandle, SQLUSMALLINT Concurrency, SQLLEN KeySetSize, ++ SQLUSMALLINT RowSetSize) ++{ ++ struct SQLSetScrollOptions_params params = { 0, Concurrency, KeySetSize, RowSetSize }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, Concurrency %d, KeySetSize %s, RowSetSize %d)\n", StatementHandle, ++ Concurrency, debugstr_sqllen(KeySetSize), RowSetSize); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLSetScrollOptions, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++static BOOL SQLColAttributes_KnownStringAttribute(SQLUSMALLINT fDescType) ++{ ++ static const SQLUSMALLINT attrList[] = ++ { ++ SQL_COLUMN_OWNER_NAME, ++ SQL_COLUMN_QUALIFIER_NAME, ++ SQL_COLUMN_LABEL, ++ SQL_COLUMN_NAME, ++ SQL_COLUMN_TABLE_NAME, ++ SQL_COLUMN_TYPE_NAME, ++ SQL_DESC_BASE_COLUMN_NAME, ++ SQL_DESC_BASE_TABLE_NAME, ++ SQL_DESC_CATALOG_NAME, ++ SQL_DESC_LABEL, ++ SQL_DESC_LITERAL_PREFIX, ++ SQL_DESC_LITERAL_SUFFIX, ++ SQL_DESC_LOCAL_TYPE_NAME, ++ SQL_DESC_NAME, ++ SQL_DESC_SCHEMA_NAME, ++ SQL_DESC_TABLE_NAME, ++ SQL_DESC_TYPE_NAME, ++ }; ++ unsigned int i; ++ ++ for (i = 0; i < ARRAY_SIZE(attrList); i++) { ++ if (attrList[i] == fDescType) return TRUE; ++ } ++ return FALSE; ++} ++ ++/************************************************************************* ++ * SQLColAttributesW [ODBC32.106] ++ */ ++SQLRETURN WINAPI SQLColAttributesW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, ++ SQLPOINTER CharacterAttributes, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, ++ SQLLEN *NumericAttributes) ++{ ++ struct SQLColAttributesW_params params = { 0, ColumnNumber, FieldIdentifier, CharacterAttributes, BufferLength, ++ StringLength }; ++ struct handle *handle = StatementHandle; ++ INT64 attrs; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttributes %p, BufferLength %d, " ++ "StringLength %p, NumericAttributes %p)\n", StatementHandle, ColumnNumber, FieldIdentifier, ++ CharacterAttributes, BufferLength, StringLength, NumericAttributes); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ params.NumericAttributes = &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; ++ } ++ ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLConnectW [ODBC32.107] ++ */ ++SQLRETURN WINAPI SQLConnectW(SQLHDBC ConnectionHandle, WCHAR *ServerName, SQLSMALLINT NameLength1, ++ WCHAR *UserName, SQLSMALLINT NameLength2, WCHAR *Authentication, ++ SQLSMALLINT NameLength3) ++{ ++ struct SQLConnectW_params params = { 0, ServerName, NameLength1, UserName, NameLength2, Authentication, ++ NameLength3 }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLConnectW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLDescribeColW [ODBC32.108] ++ */ ++SQLRETURN WINAPI SQLDescribeColW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, WCHAR *ColumnName, ++ SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType, ++ SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) ++{ ++ struct SQLDescribeColW_params params = { 0, ColumnNumber, ColumnName, BufferLength, NameLength, DataType, ++ NULL, DecimalDigits, Nullable }; ++ struct handle *handle = StatementHandle; ++ SQLSMALLINT dummy; ++ UINT64 size; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," ++ " ColumnSize %p, DecimalDigits %p, Nullable %p)\n", StatementHandle, ColumnNumber, ColumnName, ++ BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ if (!NameLength) params.NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ ++ params.ColumnSize = &size; ++ if (SUCCESS((ret = ODBC_CALL( SQLDescribeColW, ¶ms )))) ++ { ++ if (ColumnName && NameLength) TRACE("ColumnName %s\n", debugstr_wn(ColumnName, *NameLength)); ++ if (DataType) TRACE("DataType %d\n", *DataType); ++ if (ColumnSize) ++ { ++ *ColumnSize = size; ++ TRACE("ColumnSize %s\n", debugstr_sqlulen(*ColumnSize)); ++ } ++ if (DecimalDigits) TRACE("DecimalDigits %d\n", *DecimalDigits); ++ if (Nullable) TRACE("Nullable %d\n", *Nullable); ++ } ++ ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLErrorW [ODBC32.110] ++ */ ++SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, ++ WCHAR *SqlState, SQLINTEGER *NativeError, WCHAR *MessageText, ++ SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) ++{ ++ struct SQLErrorW_params params = { 0, 0, 0, SqlState, NativeError, MessageText, BufferLength, TextLength }; ++ struct handle *env = EnvironmentHandle, *con = ConnectionHandle, *stmt = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, SqlState %p, NativeError %p," ++ " MessageText %p, BufferLength %d, TextLength %p)\n", EnvironmentHandle, ConnectionHandle, ++ StatementHandle, SqlState, NativeError, MessageText, BufferLength, TextLength); ++ ++ if (env) params.EnvironmentHandle = env->unix_handle; ++ if (con) params.ConnectionHandle = con->unix_handle; ++ if (stmt) params.StatementHandle = stmt->unix_handle; ++ if (SUCCESS((ret = ODBC_CALL( SQLErrorW, ¶ms )))) ++ { ++ TRACE(" SqlState %s\n", debugstr_wn(SqlState, 5)); ++ TRACE(" Error %d\n", *NativeError); ++ TRACE(" MessageText %s\n", debugstr_wn(MessageText, *TextLength)); ++ } ++ ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLExecDirectW [ODBC32.111] ++ */ ++SQLRETURN WINAPI SQLExecDirectW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength) ++{ ++ struct SQLExecDirectW_params params = { 0, StatementText, TextLength }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, ++ debugstr_wn(StatementText, TextLength), TextLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLExecDirectW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetCursorNameW [ODBC32.117] ++ */ ++SQLRETURN WINAPI SQLGetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, SQLSMALLINT BufferLength, ++ SQLSMALLINT *NameLength) ++{ ++ struct SQLGetCursorNameW_params params = { 0, CursorName, BufferLength, NameLength }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle, CursorName, ++ BufferLength, NameLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetCursorNameW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLPrepareW [ODBC32.119] ++ */ ++SQLRETURN WINAPI SQLPrepareW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength) ++{ ++ struct SQLPrepareW_params params = { 0, StatementText, TextLength }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, ++ debugstr_wn(StatementText, TextLength), TextLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLPrepareW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLSetCursorNameW [ODBC32.121] ++ */ ++SQLRETURN WINAPI SQLSetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, SQLSMALLINT NameLength) ++{ ++ struct SQLSetCursorNameW_params params = { 0, CursorName, NameLength }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle, ++ debugstr_wn(CursorName, NameLength), NameLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLSetCursorNameW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLColAttributeW [ODBC32.127] ++ */ ++SQLRETURN WINAPI SQLColAttributeW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, ++ SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttribute, ++ SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, ++ SQLLEN *NumericAttribute) ++{ ++ struct SQLColAttributeW_params params = { 0, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength, ++ StringLength }; ++ struct handle *handle = StatementHandle; ++ INT64 attr; ++ SQLRETURN ret; ++ ++ TRACE("StatementHandle %p ColumnNumber %d FieldIdentifier %d CharacterAttribute %p BufferLength %d" ++ " StringLength %p NumericAttribute %p\n", StatementHandle, ColumnNumber, FieldIdentifier, ++ CharacterAttribute, BufferLength, StringLength, NumericAttribute); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ params.NumericAttribute = &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; ++ } ++ ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetConnectAttrW [ODBC32.132] ++ */ ++SQLRETURN WINAPI SQLGetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, ++ SQLINTEGER BufferLength, SQLINTEGER *StringLength) ++{ ++ struct SQLGetConnectAttrW_params params = { 0, Attribute, Value, BufferLength, StringLength }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, ++ Attribute, Value, BufferLength, StringLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetConnectAttrW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetDescFieldW [ODBC32.133] ++ */ ++SQLRETURN WINAPI SQLGetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, ++ SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) ++{ ++ struct SQLGetDescFieldW_params params = { 0, RecNumber, FieldIdentifier, Value, BufferLength, StringLength }; ++ struct handle *handle = DescriptorHandle; ++ SQLRETURN ret; ++ ++ TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n", ++ DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength, StringLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.DescriptorHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetDescFieldW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetDescRecW [ODBC32.134] ++ */ ++SQLRETURN WINAPI SQLGetDescRecW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, WCHAR *Name, ++ SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLSMALLINT *Type, ++ SQLSMALLINT *SubType, SQLLEN *Length, SQLSMALLINT *Precision, ++ SQLSMALLINT *Scale, SQLSMALLINT *Nullable) ++{ ++ struct SQLGetDescRecW_params params = { 0, RecNumber, Name, BufferLength, StringLength, Type, SubType, ++ NULL, Precision, Scale, Nullable }; ++ struct handle *handle = DescriptorHandle; ++ INT64 len; ++ SQLRETURN ret; ++ ++ TRACE("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p," ++ " Length %p, Precision %p, Scale %p, Nullable %p)\n", DescriptorHandle, RecNumber, Name, BufferLength, ++ StringLength, Type, SubType, Length, Precision, Scale, Nullable); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.DescriptorHandle = handle->unix_handle; ++ params.Length = &len; ++ if (SUCCESS((ret = ODBC_CALL( SQLGetDescRecW, ¶ms )))) *Length = len; ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetDiagFieldW [ODBC32.135] ++ */ ++SQLRETURN WINAPI SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, ++ SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, ++ SQLSMALLINT *StringLength) ++{ ++ struct SQLGetDiagFieldW_params params = { HandleType, 0, RecNumber, DiagIdentifier, DiagInfo, BufferLength, ++ StringLength }; ++ struct handle *handle = Handle; ++ SQLRETURN ret; ++ ++ TRACE("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," ++ " StringLength %p)\n", HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.Handle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetDiagFieldW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetDiagRecW [ODBC32.136] ++ */ ++SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, WCHAR *SqlState, ++ SQLINTEGER *NativeError, WCHAR *MessageText, SQLSMALLINT BufferLength, ++ SQLSMALLINT *TextLength) ++{ ++ struct SQLGetDiagRecW_params params = { HandleType, 0, RecNumber, SqlState, NativeError, MessageText, ++ BufferLength, TextLength }; ++ struct handle *handle = Handle; ++ SQLRETURN ret; ++ ++ TRACE("(HandleType %d, Handle %p, RecNumber %d, SqlState %p, NativeError %p, MessageText %p, BufferLength %d," ++ " TextLength %p)\n", HandleType, Handle, RecNumber, SqlState, NativeError, MessageText, BufferLength, ++ TextLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.Handle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetDiagRecW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetStmtAttrW [ODBC32.138] ++ */ ++SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, ++ SQLINTEGER BufferLength, SQLINTEGER *StringLength) ++{ ++ struct SQLGetStmtAttrW_params params = { 0, Attribute, Value, BufferLength, StringLength }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, ++ Attribute, Value, BufferLength, StringLength); ++ ++ if (!Value) ++ { ++ WARN("Unexpected NULL Value return address\n"); ++ return SQL_ERROR; ++ } ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetStmtAttrW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLSetConnectAttrW [ODBC32.139] ++ */ ++SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, ++ SQLINTEGER StringLength) ++{ ++ struct SQLSetConnectAttrW_params params = { 0, Attribute, Value, StringLength }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, ++ Value, StringLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLSetConnectAttrW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLColumnsW [ODBC32.140] ++ */ ++SQLRETURN WINAPI SQLColumnsW(SQLHSTMT StatementHandle, WCHAR *CatalogName, SQLSMALLINT NameLength1, ++ WCHAR *SchemaName, SQLSMALLINT NameLength2, WCHAR *TableName, ++ SQLSMALLINT NameLength3, WCHAR *ColumnName, SQLSMALLINT NameLength4) ++{ ++ struct SQLColumnsW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, ++ NameLength3, ColumnName, NameLength4 }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLColumnsW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLDriverConnectW [ODBC32.141] ++ */ ++SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandle, WCHAR *InConnectionString, ++ SQLSMALLINT Length, WCHAR *OutConnectionString, SQLSMALLINT BufferLength, ++ SQLSMALLINT *Length2, SQLUSMALLINT DriverCompletion) ++{ ++ struct SQLDriverConnectW_params params = { 0, WindowHandle, InConnectionString, Length, OutConnectionString, ++ BufferLength, Length2, DriverCompletion }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ 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, ++ DriverCompletion); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLDriverConnectW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetConnectOptionW [ODBC32.142] ++ */ ++SQLRETURN WINAPI SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value) ++{ ++ struct SQLGetConnectOptionW_params params = { 0, Option, Value }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(ConnectionHandle %p, Option %d, Value %p)\n", ConnectionHandle, Option, Value); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetConnectOptionW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetInfoW [ODBC32.145] ++ */ ++SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, ++ SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) ++{ ++ struct SQLGetInfoW_params params = { 0, InfoType, InfoValue, BufferLength, StringLength }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, ++ InfoType, InfoValue, BufferLength, StringLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetInfoW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetTypeInfoW [ODBC32.147] ++ */ ++SQLRETURN WINAPI SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType) ++{ ++ struct SQLGetTypeInfoW_params params = { 0, DataType }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLGetTypeInfoW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLSetConnectOptionW [ODBC32.150] ++ */ ++SQLRETURN WINAPI SQLSetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value) ++{ ++ struct SQLSetConnectOptionW_params params = { 0, Option, Value }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle, Option, debugstr_sqllen(Value)); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLSetConnectOptionW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLSpecialColumnsW [ODBC32.152] ++ */ ++SQLRETURN WINAPI SQLSpecialColumnsW(SQLHSTMT StatementHandle, SQLUSMALLINT IdentifierType, ++ SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, SQLWCHAR *SchemaName, ++ SQLSMALLINT NameLength2, SQLWCHAR *TableName, SQLSMALLINT NameLength3, ++ SQLUSMALLINT Scope, SQLUSMALLINT Nullable) ++{ ++ struct SQLSpecialColumnsW_params params = { 0, IdentifierType, CatalogName, NameLength1, SchemaName, NameLength2, ++ TableName, NameLength3, Scope, Nullable }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLSpecialColumnsW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLStatisticsW [ODBC32.153] ++ */ ++SQLRETURN WINAPI SQLStatisticsW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, ++ SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, ++ SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved) ++{ ++ struct SQLStatisticsW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, ++ NameLength3, Unique, Reserved }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLStatisticsW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLTablesW [ODBC32.154] ++ */ ++SQLRETURN WINAPI SQLTablesW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, ++ SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, ++ SQLSMALLINT NameLength3, SQLWCHAR *TableType, SQLSMALLINT NameLength4) ++{ ++ struct SQLTablesW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, ++ NameLength3, TableType, NameLength4 }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLTablesW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLBrowseConnectW [ODBC32.155] ++ */ ++SQLRETURN WINAPI SQLBrowseConnectW(SQLHDBC ConnectionHandle, SQLWCHAR *InConnectionString, SQLSMALLINT StringLength1, ++ SQLWCHAR *OutConnectionString, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength2) ++{ ++ struct SQLBrowseConnectW_params params = { 0, InConnectionString, StringLength1, OutConnectionString, ++ BufferLength, StringLength2 }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(ConnectionHandle %p, InConnectionString %s, StringLength1 %d, OutConnectionString %p, BufferLength %d, " ++ "StringLength2 %p)\n", ConnectionHandle, debugstr_wn(InConnectionString, StringLength1), StringLength1, ++ OutConnectionString, BufferLength, StringLength2); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLBrowseConnectW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLColumnPrivilegesW [ODBC32.156] ++ */ ++SQLRETURN WINAPI SQLColumnPrivilegesW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, ++ SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, ++ SQLSMALLINT NameLength3, SQLWCHAR *ColumnName, SQLSMALLINT NameLength4) ++{ ++ struct SQLColumnPrivilegesW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, ++ TableName, NameLength3, ColumnName, NameLength4 }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLColumnPrivilegesW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLDataSourcesW [ODBC32.157] ++ */ ++SQLRETURN WINAPI SQLDataSourcesW(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, WCHAR *ServerName, ++ SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, WCHAR *Description, ++ SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2) ++{ ++ struct SQLDataSourcesW_params params = { 0, Direction, ServerName, BufferLength1, NameLength1, Description, ++ BufferLength2, NameLength2 }; ++ struct handle *handle = EnvironmentHandle; ++ SQLRETURN ret; ++ ++ TRACE("(EnvironmentHandle %p, Direction %d, ServerName %p, BufferLength1 %d, NameLength1 %p, Description %p," ++ " BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle, Direction, ServerName, BufferLength1, ++ NameLength1, Description, BufferLength2, NameLength2); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.EnvironmentHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLDataSourcesW, ¶ms ); ++ ++ if (ret >= 0 && TRACE_ON(odbc)) ++ { ++ if (ServerName && NameLength1 && *NameLength1 > 0) ++ TRACE(" DataSource %s", debugstr_wn(ServerName, *NameLength1)); ++ if (Description && NameLength2 && *NameLength2 > 0) ++ TRACE(" Description %s", debugstr_wn(Description, *NameLength2)); ++ TRACE("\n"); ++ } ++ ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLForeignKeysW [ODBC32.160] ++ */ ++SQLRETURN WINAPI SQLForeignKeysW(SQLHSTMT StatementHandle, SQLWCHAR *PkCatalogName, SQLSMALLINT NameLength1, ++ SQLWCHAR *PkSchemaName, SQLSMALLINT NameLength2, SQLWCHAR *PkTableName, ++ SQLSMALLINT NameLength3, SQLWCHAR *FkCatalogName, SQLSMALLINT NameLength4, ++ SQLWCHAR *FkSchemaName, SQLSMALLINT NameLength5, SQLWCHAR *FkTableName, ++ SQLSMALLINT NameLength6) ++{ ++ struct SQLForeignKeysW_params params = { 0, PkCatalogName, NameLength1, PkSchemaName, NameLength2, ++ PkTableName, NameLength2, FkCatalogName, NameLength3, ++ FkSchemaName, NameLength5, FkTableName, NameLength6 }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLForeignKeysW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLNativeSqlW [ODBC32.162] ++ */ ++SQLRETURN WINAPI SQLNativeSqlW(SQLHDBC ConnectionHandle, SQLWCHAR *InStatementText, SQLINTEGER TextLength1, ++ SQLWCHAR *OutStatementText, SQLINTEGER BufferLength, SQLINTEGER *TextLength2) ++{ ++ struct SQLNativeSqlW_params params = { 0, InStatementText, TextLength1, OutStatementText, BufferLength, ++ TextLength2 }; ++ struct handle *handle = ConnectionHandle; ++ SQLRETURN ret; ++ ++ TRACE("(ConnectionHandle %p, InStatementText %s, TextLength1 %d, OutStatementText %p, BufferLength %d, " ++ "TextLength2 %p)\n", ConnectionHandle, debugstr_wn(InStatementText, TextLength1), TextLength1, ++ OutStatementText, BufferLength, TextLength2); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.ConnectionHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLNativeSqlW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLPrimaryKeysW [ODBC32.165] ++ */ ++SQLRETURN WINAPI SQLPrimaryKeysW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, ++ SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, ++ SQLSMALLINT NameLength3) ++{ ++ struct SQLPrimaryKeysW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, ++ NameLength2 }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLPrimaryKeysW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLProcedureColumnsW [ODBC32.166] ++ */ ++SQLRETURN WINAPI SQLProcedureColumnsW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, ++ SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *ProcName, ++ SQLSMALLINT NameLength3, SQLWCHAR *ColumnName, SQLSMALLINT NameLength4 ) ++{ ++ struct SQLProcedureColumnsW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, ++ ProcName, NameLength3, ColumnName, NameLength4 }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLProcedureColumnsW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLProceduresW [ODBC32.167] ++ */ ++SQLRETURN WINAPI SQLProceduresW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, ++ SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *ProcName, ++ SQLSMALLINT NameLength3) ++{ ++ struct SQLProceduresW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, ProcName, ++ NameLength3 }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLProceduresW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLTablePrivilegesW [ODBC32.170] ++ */ ++SQLRETURN WINAPI SQLTablePrivilegesW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, ++ SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, ++ SQLSMALLINT NameLength3) ++{ ++ struct SQLTablePrivilegesW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, ++ NameLength3 }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ 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); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLTablePrivilegesW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLDriversW [ODBC32.171] ++ */ ++SQLRETURN WINAPI SQLDriversW(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLWCHAR *DriverDescription, ++ SQLSMALLINT BufferLength1, SQLSMALLINT *DescriptionLength, SQLWCHAR *DriverAttributes, ++ SQLSMALLINT BufferLength2, SQLSMALLINT *AttributesLength) ++{ ++ struct SQLDriversW_params params = { 0, Direction, DriverDescription, BufferLength1, DescriptionLength, ++ DriverAttributes, BufferLength2, AttributesLength }; ++ struct handle *handle = EnvironmentHandle; ++ SQLRETURN ret; ++ ++ TRACE("(EnvironmentHandle %p, Direction %d, DriverDescription %p, BufferLength1 %d, DescriptionLength %p," ++ " DriverAttributes %p, BufferLength2 %d, AttributesLength %p)\n", EnvironmentHandle, Direction, ++ DriverDescription, BufferLength1, DescriptionLength, DriverAttributes, BufferLength2, AttributesLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.EnvironmentHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLDriversW, ¶ms ); ++ ++ if (ret == SQL_NO_DATA && Direction == SQL_FETCH_FIRST) ++ ERR_(winediag)("No ODBC drivers could be found. Check the settings for your libodbc provider.\n"); ++ ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLSetDescFieldW [ODBC32.173] ++ */ ++SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, ++ SQLPOINTER Value, SQLINTEGER BufferLength) ++{ ++ struct SQLSetDescFieldW_params params = { 0, RecNumber, FieldIdentifier, Value, BufferLength }; ++ struct handle *handle = DescriptorHandle; ++ SQLRETURN ret; ++ ++ TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle, ++ RecNumber, FieldIdentifier, Value, BufferLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.DescriptorHandle = handle->unix_handle; ++ ret = ODBC_CALL( SQLSetDescFieldW, ¶ms ); ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLSetStmtAttrW [ODBC32.176] ++ */ ++SQLRETURN WINAPI SQLSetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, ++ SQLINTEGER StringLength) ++{ ++ struct SQLSetStmtAttrW_params params = { 0, Attribute, Value, StringLength }; ++ struct handle *handle = StatementHandle; ++ SQLRETURN ret; ++ ++ TRACE("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, ++ Value, StringLength); ++ ++ if (!handle) return SQL_INVALID_HANDLE; ++ ++ params.StatementHandle = handle->unix_handle; ++ if (SUCCESS((ret = ODBC_CALL( SQLSetStmtAttrW, ¶ms )))) ++ { ++ SQLULEN row_count = (SQLULEN)Value; ++ if (Attribute == SQL_ATTR_ROW_ARRAY_SIZE && row_count != handle->row_count) ++ { ++ TRACE( "resizing result length array\n" ); ++ if (!resize_result_lengths( handle, row_count )) ret = SQL_ERROR; ++ else handle->row_count = row_count; ++ } ++ } ++ ++ TRACE("Returning %d\n", ret); ++ return ret; ++} ++ ++/************************************************************************* ++ * SQLGetDiagRecA [ODBC32.236] ++ */ ++SQLRETURN WINAPI SQLGetDiagRecA(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, ++ SQLCHAR *SqlState, SQLINTEGER *NativeError, SQLCHAR *MessageText, ++ SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) ++{ ++ return SQLGetDiagRec( HandleType, Handle, RecNumber, SqlState, NativeError, MessageText, BufferLength, ++ TextLength ); ++} ++ ++/*********************************************************************** ++ * DllMain [Internal] Initializes the internal 'ODBC32.DLL'. ++ */ ++BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved) ++{ ++ TRACE("proxy ODBC: %p,%lx,%p\n", hinstDLL, reason, reserved); ++ ++ switch (reason) ++ { ++ case DLL_PROCESS_ATTACH: ++ DisableThreadLibraryCalls(hinstDLL); ++ if (!__wine_init_unix_call()) ++ { ++ if (WINE_UNIX_CALL( process_attach, NULL )) __wine_unixlib_handle = 0; ++ } ++ IsWow64Process( GetCurrentProcess(), &is_wow64 ); ++ break; ++ ++ case DLL_PROCESS_DETACH: ++ if (reserved) break; ++ } ++ ++ return TRUE; ++} +diff --git a/dlls/wineodbc/rsrc.rc b/dlls/wineodbc/rsrc.rc +new file mode 100644 +index 00000000000..b8fad8fe35b +--- /dev/null ++++ b/dlls/wineodbc/rsrc.rc +@@ -0,0 +1,26 @@ ++/* ++ * Copyright 2014 Hans Leidekker for CodeWeavers ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#define WINE_FILEDESCRIPTION_STR "Wine ODBC Library" ++#define WINE_FILENAME_STR "odbc32.dll" ++#define WINE_FILEVERSION 3,520,6301,0 ++#define WINE_FILEVERSION_STR "3.520.6301.0" ++#define WINE_PRODUCTVERSION 3,520,6301,0 ++#define WINE_PRODUCTVERSION_STR "3.520.6301.0" ++ ++#include "wine/wine_common_ver.rc" +diff --git a/dlls/odbc32/unixlib.c b/dlls/wineodbc/unixlib.c +similarity index 100% +rename from dlls/odbc32/unixlib.c +rename to dlls/wineodbc/unixlib.c +diff --git a/dlls/wineodbc/unixlib.h b/dlls/wineodbc/unixlib.h +new file mode 100644 +index 00000000000..b1f42363429 +--- /dev/null ++++ b/dlls/wineodbc/unixlib.h +@@ -0,0 +1,1291 @@ ++/* ++ * Win32 ODBC functions ++ * ++ * Copyright 1999 Xiang Li, Corel Corporation ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA ++ * ++ * NOTES: ++ * Proxy ODBC driver manager. This manager delegates all ODBC ++ * calls to a real ODBC driver manager named by the environment ++ * variable LIB_ODBC_DRIVER_MANAGER, or to libodbc.so if the ++ * variable is not set. ++ */ ++ ++#include ++#include "windef.h" ++#include "winbase.h" ++#include "wine/unixlib.h" ++ ++static inline BOOL SUCCESS( SQLRETURN ret ) { return ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO; } ++ ++enum sql_funcs ++{ ++ process_attach, ++ unix_SQLAllocConnect, ++ unix_SQLAllocEnv, ++ unix_SQLAllocHandle, ++ unix_SQLAllocHandleStd, ++ unix_SQLAllocStmt, ++ unix_SQLBindCol, ++ unix_SQLBindParam, ++ unix_SQLBindParameter, ++ unix_SQLBrowseConnect, ++ unix_SQLBrowseConnectW, ++ unix_SQLBulkOperations, ++ unix_SQLCancel, ++ unix_SQLCloseCursor, ++ unix_SQLColAttribute, ++ unix_SQLColAttributeW, ++ unix_SQLColAttributes, ++ unix_SQLColAttributesW, ++ unix_SQLColumnPrivileges, ++ unix_SQLColumnPrivilegesW, ++ unix_SQLColumns, ++ unix_SQLColumnsW, ++ unix_SQLConnect, ++ unix_SQLConnectW, ++ unix_SQLCopyDesc, ++ unix_SQLDataSources, ++ unix_SQLDataSourcesW, ++ unix_SQLDescribeCol, ++ unix_SQLDescribeColW, ++ unix_SQLDescribeParam, ++ unix_SQLDisconnect, ++ unix_SQLDriverConnect, ++ unix_SQLDriverConnectW, ++ unix_SQLDrivers, ++ unix_SQLDriversW, ++ unix_SQLEndTran, ++ unix_SQLError, ++ unix_SQLErrorW, ++ unix_SQLExecDirect, ++ unix_SQLExecDirectW, ++ unix_SQLExecute, ++ unix_SQLExtendedFetch, ++ unix_SQLFetch, ++ unix_SQLFetchScroll, ++ unix_SQLForeignKeys, ++ unix_SQLForeignKeysW, ++ unix_SQLFreeConnect, ++ unix_SQLFreeEnv, ++ unix_SQLFreeHandle, ++ unix_SQLFreeStmt, ++ unix_SQLGetConnectAttr, ++ unix_SQLGetConnectAttrW, ++ unix_SQLGetConnectOption, ++ unix_SQLGetConnectOptionW, ++ unix_SQLGetCursorName, ++ unix_SQLGetCursorNameW, ++ unix_SQLGetData, ++ unix_SQLGetDescField, ++ unix_SQLGetDescFieldW, ++ unix_SQLGetDescRec, ++ unix_SQLGetDescRecW, ++ unix_SQLGetDiagField, ++ unix_SQLGetDiagFieldW, ++ unix_SQLGetDiagRec, ++ unix_SQLGetDiagRecW, ++ unix_SQLGetEnvAttr, ++ unix_SQLGetFunctions, ++ unix_SQLGetInfo, ++ unix_SQLGetInfoW, ++ unix_SQLGetStmtAttr, ++ unix_SQLGetStmtAttrW, ++ unix_SQLGetStmtOption, ++ unix_SQLGetTypeInfo, ++ unix_SQLGetTypeInfoW, ++ unix_SQLMoreResults, ++ unix_SQLNativeSql, ++ unix_SQLNativeSqlW, ++ unix_SQLNumParams, ++ unix_SQLNumResultCols, ++ unix_SQLParamData, ++ unix_SQLParamOptions, ++ unix_SQLPrepare, ++ unix_SQLPrepareW, ++ unix_SQLPrimaryKeys, ++ unix_SQLPrimaryKeysW, ++ unix_SQLProcedureColumns, ++ unix_SQLProcedureColumnsW, ++ unix_SQLProcedures, ++ unix_SQLProceduresW, ++ unix_SQLPutData, ++ unix_SQLRowCount, ++ unix_SQLSetConnectAttr, ++ unix_SQLSetConnectAttrW, ++ unix_SQLSetConnectOption, ++ unix_SQLSetConnectOptionW, ++ unix_SQLSetCursorName, ++ unix_SQLSetCursorNameW, ++ unix_SQLSetDescField, ++ unix_SQLSetDescFieldW, ++ unix_SQLSetDescRec, ++ unix_SQLSetEnvAttr, ++ unix_SQLSetParam, ++ unix_SQLSetPos, ++ unix_SQLSetScrollOptions, ++ unix_SQLSetStmtAttr, ++ unix_SQLSetStmtAttrW, ++ unix_SQLSetStmtOption, ++ unix_SQLSpecialColumns, ++ unix_SQLSpecialColumnsW, ++ unix_SQLStatistics, ++ unix_SQLStatisticsW, ++ unix_SQLTablePrivileges, ++ unix_SQLTablePrivilegesW, ++ unix_SQLTables, ++ unix_SQLTablesW, ++ unix_SQLTransact, ++ unix_funcs_count ++}; ++ ++struct bind_col_args ++{ ++ INT16 target_type; ++ void *target_value; ++ INT64 buffer_length; ++}; ++ ++struct bind_param_args ++{ ++ INT16 value_type; ++ INT16 parameter_type; ++ UINT64 length_precision; ++ INT16 parameter_scale; ++ void *parameter_value; ++}; ++ ++struct bind_parameter_args ++{ ++ INT16 input_output_type; ++ INT16 value_type; ++ INT16 parameter_type; ++ UINT64 column_size; ++ INT16 decimal_digits; ++ void *parameter_value; ++ INT64 buffer_length; ++}; ++ ++struct param ++{ ++ INT16 type; ++ union ++ { ++ struct bind_col_args col; ++ struct bind_param_args param; ++ struct bind_parameter_args parameter; ++ }; ++ UINT8 *len; /* result length array stored in Unix lib */ ++ void *ptr; /* result length ptr passed by client */ ++}; ++ ++struct param_binding ++{ ++ UINT32 count; ++ struct param *param; ++}; ++ ++struct handle ++{ ++ UINT64 unix_handle; ++ struct param_binding bind_col; ++ struct param_binding bind_param; ++ struct param_binding bind_parameter; ++ UINT32 row_count; /* number of rows returned by SQLFetch() */ ++}; ++ ++struct SQLAllocConnect_params ++{ ++ UINT64 EnvironmentHandle; ++ UINT64 ConnectionHandle; ++}; ++ ++struct SQLAllocEnv_params ++{ ++ UINT64 EnvironmentHandle; ++}; ++ ++struct SQLAllocHandle_params ++{ ++ INT16 HandleType; ++ UINT64 InputHandle; ++ UINT64 OutputHandle; ++}; ++ ++struct SQLAllocHandleStd_params ++{ ++ INT16 HandleType; ++ UINT64 InputHandle; ++ UINT64 OutputHandle; ++}; ++ ++struct SQLAllocStmt_params ++{ ++ UINT64 ConnectionHandle; ++ UINT64 StatementHandle; ++}; ++ ++struct SQLBindCol_params ++{ ++ UINT64 StatementHandle; ++ UINT16 ColumnNumber; ++ INT16 TargetType; ++ void *TargetValue; ++ INT64 BufferLength; ++ void *StrLen_or_Ind; ++}; ++ ++struct SQLBindParam_params ++{ ++ UINT64 StatementHandle; ++ UINT16 ParameterNumber; ++ INT16 ValueType; ++ INT16 ParameterType; ++ UINT64 LengthPrecision; ++ INT16 ParameterScale; ++ void *ParameterValue; ++ void *StrLen_or_Ind; ++}; ++ ++struct SQLBindParameter_params ++{ ++ UINT64 StatementHandle; ++ UINT16 ParameterNumber; ++ INT16 InputOutputType; ++ INT16 ValueType; ++ INT16 ParameterType; ++ UINT64 ColumnSize; ++ INT16 DecimalDigits; ++ void *ParameterValue; ++ INT64 BufferLength; ++ void *StrLen_or_Ind; ++}; ++ ++struct SQLBrowseConnect_params ++{ ++ UINT64 ConnectionHandle; ++ UCHAR *InConnectionString; ++ INT16 StringLength1; ++ UCHAR *OutConnectionString; ++ INT16 BufferLength; ++ INT16 *StringLength2; ++}; ++ ++struct SQLBrowseConnectW_params ++{ ++ UINT64 ConnectionHandle; ++ WCHAR *InConnectionString; ++ INT16 StringLength1; ++ WCHAR *OutConnectionString; ++ INT16 BufferLength; ++ INT16 *StringLength2; ++}; ++ ++struct SQLBulkOperations_params ++{ ++ UINT64 StatementHandle; ++ INT16 Operation; ++}; ++ ++struct SQLCancel_params ++{ ++ UINT64 StatementHandle; ++}; ++ ++struct SQLCloseCursor_params ++{ ++ UINT64 StatementHandle; ++}; ++ ++struct SQLColAttribute_params ++{ ++ UINT64 StatementHandle; ++ UINT16 ColumnNumber; ++ UINT16 FieldIdentifier; ++ void *CharacterAttribute; ++ INT16 BufferLength; ++ INT16 *StringLength; ++ INT64 *NumericAttribute; ++}; ++ ++struct SQLColAttributeW_params ++{ ++ UINT64 StatementHandle; ++ UINT16 ColumnNumber; ++ UINT16 FieldIdentifier; ++ void *CharacterAttribute; ++ INT16 BufferLength; ++ INT16 *StringLength; ++ INT64 *NumericAttribute; ++}; ++ ++struct SQLColAttributes_params ++{ ++ UINT64 StatementHandle; ++ UINT16 ColumnNumber; ++ UINT16 FieldIdentifier; ++ void *CharacterAttributes; ++ INT16 BufferLength; ++ INT16 *StringLength; ++ INT64 *NumericAttributes; ++}; ++ ++struct SQLColAttributesW_params ++{ ++ UINT64 StatementHandle; ++ UINT16 ColumnNumber; ++ UINT16 FieldIdentifier; ++ void *CharacterAttributes; ++ INT16 BufferLength; ++ INT16 *StringLength; ++ INT64 *NumericAttributes; ++}; ++ ++struct SQLColumnPrivileges_params ++{ ++ UINT64 StatementHandle; ++ UCHAR *CatalogName; ++ INT16 NameLength1; ++ UCHAR *SchemaName; ++ INT16 NameLength2; ++ UCHAR *TableName; ++ INT16 NameLength3; ++ UCHAR *ColumnName; ++ INT16 NameLength4; ++}; ++ ++struct SQLColumnPrivilegesW_params ++{ ++ UINT64 StatementHandle; ++ WCHAR *CatalogName; ++ INT16 NameLength1; ++ WCHAR *SchemaName; ++ INT16 NameLength2; ++ WCHAR *TableName; ++ INT16 NameLength3; ++ WCHAR *ColumnName; ++ INT16 NameLength4; ++}; ++ ++struct SQLColumns_params ++{ ++ UINT64 StatementHandle; ++ UCHAR *CatalogName; ++ INT16 NameLength1; ++ UCHAR *SchemaName; ++ INT16 NameLength2; ++ UCHAR *TableName; ++ INT16 NameLength3; ++ UCHAR *ColumnName; ++ INT16 NameLength4; ++}; ++ ++struct SQLColumnsW_params ++{ ++ UINT64 StatementHandle; ++ WCHAR *CatalogName; ++ INT16 NameLength1; ++ WCHAR *SchemaName; ++ INT16 NameLength2; ++ WCHAR *TableName; ++ INT16 NameLength3; ++ WCHAR *ColumnName; ++ INT16 NameLength4; ++}; ++ ++struct SQLConnect_params ++{ ++ UINT64 ConnectionHandle; ++ UCHAR *ServerName; ++ INT16 NameLength1; ++ UCHAR *UserName; ++ INT16 NameLength2; ++ UCHAR *Authentication; ++ INT16 NameLength3; ++}; ++ ++struct SQLConnectW_params ++{ ++ UINT64 ConnectionHandle; ++ WCHAR *ServerName; ++ INT16 NameLength1; ++ WCHAR *UserName; ++ INT16 NameLength2; ++ WCHAR *Authentication; ++ INT16 NameLength3; ++}; ++ ++struct SQLCopyDesc_params ++{ ++ UINT64 SourceDescHandle; ++ UINT64 TargetDescHandle; ++}; ++ ++struct SQLDataSources_params ++{ ++ UINT64 EnvironmentHandle; ++ UINT16 Direction; ++ UCHAR *ServerName; ++ INT16 BufferLength1; ++ INT16 *NameLength1; ++ UCHAR *Description; ++ INT16 BufferLength2; ++ INT16 *NameLength2; ++}; ++ ++struct SQLDataSourcesW_params ++{ ++ UINT64 EnvironmentHandle; ++ UINT16 Direction; ++ WCHAR *ServerName; ++ INT16 BufferLength1; ++ INT16 *NameLength1; ++ WCHAR *Description; ++ INT16 BufferLength2; ++ INT16 *NameLength2; ++}; ++ ++struct SQLDescribeCol_params ++{ ++ UINT64 StatementHandle; ++ UINT16 ColumnNumber; ++ UCHAR *ColumnName; ++ INT16 BufferLength; ++ INT16 *NameLength; ++ INT16 *DataType; ++ UINT64 *ColumnSize; ++ INT16 *DecimalDigits; ++ INT16 *Nullable; ++}; ++ ++struct SQLDescribeColW_params ++{ ++ UINT64 StatementHandle; ++ UINT16 ColumnNumber; ++ WCHAR *ColumnName; ++ INT16 BufferLength; ++ INT16 *NameLength; ++ INT16 *DataType; ++ UINT64 *ColumnSize; ++ INT16 *DecimalDigits; ++ INT16 *Nullable; ++}; ++ ++struct SQLDescribeParam_params ++{ ++ UINT64 StatementHandle; ++ UINT16 ParameterNumber; ++ INT16 *DataType; ++ UINT64 *ParameterSize; ++ INT16 *DecimalDigits; ++ INT16 *Nullable; ++}; ++ ++struct SQLDisconnect_params ++{ ++ UINT64 ConnectionHandle; ++}; ++ ++struct SQLDriverConnect_params ++{ ++ UINT64 ConnectionHandle; ++ void *WindowHandle; ++ UCHAR *ConnectionString; ++ INT16 Length; ++ UCHAR *OutConnectionString; ++ INT16 BufferLength; ++ INT16 *Length2; ++ UINT16 DriverCompletion; ++}; ++ ++struct SQLDriverConnectW_params ++{ ++ UINT64 ConnectionHandle; ++ void *WindowHandle; ++ WCHAR *InConnectionString; ++ INT16 Length; ++ WCHAR *OutConnectionString; ++ INT16 BufferLength; ++ INT16 *Length2; ++ UINT16 DriverCompletion; ++}; ++ ++struct SQLDrivers_params ++{ ++ UINT64 EnvironmentHandle; ++ UINT16 Direction; ++ UCHAR *DriverDescription; ++ INT16 BufferLength1; ++ INT16 *DescriptionLength; ++ UCHAR *DriverAttributes; ++ INT16 BufferLength2; ++ INT16 *AttributesLength; ++}; ++ ++struct SQLDriversW_params ++{ ++ UINT64 EnvironmentHandle; ++ UINT16 Direction; ++ WCHAR *DriverDescription; ++ INT16 BufferLength1; ++ INT16 *DescriptionLength; ++ WCHAR *DriverAttributes; ++ INT16 BufferLength2; ++ INT16 *AttributesLength; ++}; ++ ++struct SQLEndTran_params ++{ ++ INT16 HandleType; ++ UINT64 Handle; ++ INT16 CompletionType; ++}; ++ ++struct SQLError_params ++{ ++ UINT64 EnvironmentHandle; ++ UINT64 ConnectionHandle; ++ UINT64 StatementHandle; ++ UCHAR *SqlState; ++ INT32 *NativeError; ++ UCHAR *MessageText; ++ INT16 BufferLength; ++ INT16 *TextLength; ++}; ++ ++struct SQLErrorW_params ++{ ++ UINT64 EnvironmentHandle; ++ UINT64 ConnectionHandle; ++ UINT64 StatementHandle; ++ WCHAR *SqlState; ++ INT32 *NativeError; ++ WCHAR *MessageText; ++ INT16 BufferLength; ++ INT16 *TextLength; ++}; ++ ++struct SQLExecDirect_params ++{ ++ UINT64 StatementHandle; ++ UCHAR *StatementText; ++ INT32 TextLength; ++}; ++ ++struct SQLExecDirectW_params ++{ ++ UINT64 StatementHandle; ++ WCHAR *StatementText; ++ INT32 TextLength; ++}; ++ ++struct SQLExecute_params ++{ ++ UINT64 StatementHandle; ++}; ++ ++struct SQLExtendedFetch_params ++{ ++ UINT64 StatementHandle; ++ UINT16 FetchOrientation; ++ INT64 FetchOffset; ++ UINT64 *RowCount; ++ UINT16 *RowStatusArray; ++}; ++ ++struct SQLFetch_params ++{ ++ UINT64 StatementHandle; ++}; ++ ++struct SQLFetchScroll_params ++{ ++ UINT64 StatementHandle; ++ INT16 FetchOrientation; ++ INT64 FetchOffset; ++}; ++ ++struct SQLForeignKeys_params ++{ ++ UINT64 StatementHandle; ++ UCHAR *PkCatalogName; ++ INT16 NameLength1; ++ UCHAR *PkSchemaName; ++ INT16 NameLength2; ++ UCHAR *PkTableName; ++ INT16 NameLength3; ++ UCHAR *FkCatalogName; ++ INT16 NameLength4; ++ UCHAR *FkSchemaName; ++ INT16 NameLength5; ++ UCHAR *FkTableName; ++ INT16 NameLength6; ++}; ++ ++struct SQLForeignKeysW_params ++{ ++ UINT64 StatementHandle; ++ WCHAR *PkCatalogName; ++ INT16 NameLength1; ++ WCHAR *PkSchemaName; ++ INT16 NameLength2; ++ WCHAR *PkTableName; ++ INT16 NameLength3; ++ WCHAR *FkCatalogName; ++ INT16 NameLength4; ++ WCHAR *FkSchemaName; ++ INT16 NameLength5; ++ WCHAR *FkTableName; ++ INT16 NameLength6; ++}; ++ ++struct SQLFreeConnect_params ++{ ++ UINT64 ConnectionHandle; ++}; ++ ++struct SQLFreeEnv_params ++{ ++ UINT64 EnvironmentHandle; ++}; ++ ++struct SQLFreeHandle_params ++{ ++ INT16 HandleType; ++ UINT64 Handle; ++}; ++ ++struct SQLFreeStmt_params ++{ ++ UINT64 StatementHandle; ++ UINT16 Option; ++}; ++ ++struct SQLGetConnectAttr_params ++{ ++ UINT64 ConnectionHandle; ++ INT32 Attribute; ++ void *Value; ++ INT32 BufferLength; ++ INT32 *StringLength; ++}; ++ ++struct SQLGetConnectAttrW_params ++{ ++ UINT64 ConnectionHandle; ++ INT32 Attribute; ++ void *Value; ++ INT32 BufferLength; ++ INT32 *StringLength; ++}; ++ ++struct SQLGetConnectOption_params ++{ ++ UINT64 ConnectionHandle; ++ UINT16 Option; ++ void *Value; ++}; ++ ++struct SQLGetConnectOptionW_params ++{ ++ UINT64 ConnectionHandle; ++ INT16 Option; ++ void *Value; ++}; ++ ++struct SQLGetCursorName_params ++{ ++ UINT64 StatementHandle; ++ UCHAR *CursorName; ++ INT16 BufferLength; ++ INT16 *NameLength; ++}; ++ ++struct SQLGetCursorNameW_params ++{ ++ UINT64 StatementHandle; ++ WCHAR *CursorName; ++ INT16 BufferLength; ++ INT16 *NameLength; ++}; ++ ++struct SQLGetData_params ++{ ++ UINT64 StatementHandle; ++ UINT16 ColumnNumber; ++ INT16 TargetType; ++ void *TargetValue; ++ INT64 BufferLength; ++ INT64 *StrLen_or_Ind; ++}; ++ ++struct SQLGetDescField_params ++{ ++ UINT64 DescriptorHandle; ++ INT16 RecNumber; ++ INT16 FieldIdentifier; ++ void *Value; ++ INT32 BufferLength; ++ INT32 *StringLength; ++} ++; ++struct SQLGetDescFieldW_params ++{ ++ UINT64 DescriptorHandle; ++ INT16 RecNumber; ++ INT16 FieldIdentifier; ++ void *Value; ++ INT32 BufferLength; ++ INT32 *StringLength; ++}; ++ ++struct SQLGetDescRec_params ++{ ++ UINT64 DescriptorHandle; ++ INT16 RecNumber; ++ UCHAR *Name; ++ INT16 BufferLength; ++ INT16 *StringLength; ++ INT16 *Type; ++ INT16 *SubType; ++ INT64 *Length; ++ INT16 *Precision; ++ INT16 *Scale; ++ INT16 *Nullable; ++}; ++ ++struct SQLGetDescRecW_params ++{ ++ UINT64 DescriptorHandle; ++ INT16 RecNumber; ++ WCHAR *Name; ++ INT16 BufferLength; ++ INT16 *StringLength; ++ INT16 *Type; ++ INT16 *SubType; ++ INT64 *Length; ++ INT16 *Precision; ++ INT16 *Scale; ++ INT16 *Nullable; ++}; ++ ++struct SQLGetDiagField_params ++{ ++ INT16 HandleType; ++ UINT64 Handle; ++ INT16 RecNumber; ++ INT16 DiagIdentifier; ++ void *DiagInfo; ++ INT16 BufferLength; ++ INT16 *StringLength; ++}; ++ ++struct SQLGetDiagFieldW_params ++{ ++ INT16 HandleType; ++ UINT64 Handle; ++ INT16 RecNumber; ++ INT16 DiagIdentifier; ++ void *DiagInfo; ++ INT16 BufferLength; ++ INT16 *StringLength; ++}; ++ ++struct SQLGetDiagRec_params ++{ ++ INT16 HandleType; ++ UINT64 Handle; ++ INT16 RecNumber; ++ UCHAR *SqlState; ++ INT32 *NativeError; ++ UCHAR *MessageText; ++ INT16 BufferLength; ++ INT16 *TextLength; ++}; ++ ++struct SQLGetDiagRecW_params ++{ ++ INT16 HandleType; ++ UINT64 Handle; ++ INT16 RecNumber; ++ WCHAR *SqlState; ++ INT32 *NativeError; ++ WCHAR *MessageText; ++ INT16 BufferLength; ++ INT16 *TextLength; ++}; ++ ++struct SQLGetEnvAttr_params ++{ ++ UINT64 EnvironmentHandle; ++ INT32 Attribute; ++ void *Value; ++ INT32 BufferLength; ++ INT32 *StringLength; ++}; ++ ++struct SQLGetFunctions_params ++{ ++ UINT64 ConnectionHandle; ++ UINT16 FunctionId; ++ UINT16 *Supported; ++}; ++ ++struct SQLGetInfo_params ++{ ++ UINT64 ConnectionHandle; ++ UINT16 InfoType; ++ void *InfoValue; ++ INT16 BufferLength; ++ INT16 *StringLength; ++}; ++ ++struct SQLGetInfoW_params ++{ ++ UINT64 ConnectionHandle; ++ UINT16 InfoType; ++ void *InfoValue; ++ INT16 BufferLength; ++ INT16 *StringLength; ++}; ++ ++struct SQLGetStmtAttr_params ++{ ++ UINT64 StatementHandle; ++ INT32 Attribute; ++ void *Value; ++ INT32 BufferLength; ++ INT32 *StringLength; ++}; ++ ++struct SQLGetStmtAttrW_params ++{ ++ UINT64 StatementHandle; ++ INT32 Attribute; ++ void *Value; ++ INT32 BufferLength; ++ INT32 *StringLength; ++}; ++ ++struct SQLGetStmtOption_params ++{ ++ UINT64 StatementHandle; ++ UINT16 Option; ++ void *Value; ++}; ++ ++struct SQLGetTypeInfo_params ++{ ++ UINT64 StatementHandle; ++ INT16 DataType; ++}; ++ ++struct SQLGetTypeInfoW_params ++{ ++ UINT64 StatementHandle; ++ INT16 DataType; ++}; ++ ++struct SQLMoreResults_params ++{ ++ UINT64 StatementHandle; ++}; ++ ++struct SQLNativeSql_params ++{ ++ UINT64 ConnectionHandle; ++ UCHAR *InStatementText; ++ INT32 TextLength1; ++ UCHAR *OutStatementText; ++ INT32 BufferLength; ++ INT32 *TextLength2; ++}; ++ ++struct SQLNativeSqlW_params ++{ ++ UINT64 ConnectionHandle; ++ WCHAR *InStatementText; ++ INT32 TextLength1; ++ WCHAR *OutStatementText; ++ INT32 BufferLength; ++ INT32 *TextLength2; ++}; ++ ++struct SQLNumParams_params ++{ ++ UINT64 StatementHandle; ++ INT16 *ParameterCount; ++}; ++ ++struct SQLNumResultCols_params ++{ ++ UINT64 StatementHandle; ++ INT16 *ColumnCount; ++}; ++ ++struct SQLParamData_params ++{ ++ UINT64 StatementHandle; ++ void *Value; ++}; ++ ++struct SQLParamOptions_params ++{ ++ UINT64 StatementHandle; ++ UINT64 RowCount; ++ UINT64 *RowNumber; ++}; ++ ++struct SQLPrepare_params ++{ ++ UINT64 StatementHandle; ++ UCHAR *StatementText; ++ INT32 TextLength; ++}; ++ ++struct SQLPrepareW_params ++{ ++ UINT64 StatementHandle; ++ WCHAR *StatementText; ++ INT32 TextLength; ++}; ++ ++struct SQLPrimaryKeys_params ++{ ++ UINT64 StatementHandle; ++ UCHAR *CatalogName; ++ INT16 NameLength1; ++ UCHAR *SchemaName; ++ INT16 NameLength2; ++ UCHAR *TableName; ++ INT16 NameLength3; ++}; ++ ++struct SQLPrimaryKeysW_params ++{ ++ UINT64 StatementHandle; ++ WCHAR *CatalogName; ++ INT16 NameLength1; ++ WCHAR *SchemaName; ++ INT16 NameLength2; ++ WCHAR *TableName; ++ INT16 NameLength3; ++}; ++ ++struct SQLProcedureColumns_params ++{ ++ UINT64 StatementHandle; ++ UCHAR *CatalogName; ++ INT16 NameLength1; ++ UCHAR *SchemaName; ++ INT16 NameLength2; ++ UCHAR *ProcName; ++ INT16 NameLength3; ++ UCHAR *ColumnName; ++ INT16 NameLength4; ++}; ++ ++struct SQLProcedureColumnsW_params ++{ ++ UINT64 StatementHandle; ++ WCHAR *CatalogName; ++ INT16 NameLength1; ++ WCHAR *SchemaName; ++ INT16 NameLength2; ++ WCHAR *ProcName; ++ INT16 NameLength3; ++ WCHAR *ColumnName; ++ INT16 NameLength4; ++}; ++ ++struct SQLProcedures_params ++{ ++ UINT64 StatementHandle; ++ UCHAR *CatalogName; ++ INT16 NameLength1; ++ UCHAR *SchemaName; ++ INT16 NameLength2; ++ UCHAR *ProcName; ++ INT16 NameLength3; ++}; ++ ++struct SQLProceduresW_params ++{ ++ UINT64 StatementHandle; ++ WCHAR *CatalogName; ++ INT16 NameLength1; ++ WCHAR *SchemaName; ++ INT16 NameLength2; ++ WCHAR *ProcName; ++ INT16 NameLength3; ++}; ++ ++struct SQLPutData_params ++{ ++ UINT64 StatementHandle; ++ void *Data; ++ INT64 StrLen_or_Ind; ++}; ++ ++struct SQLRowCount_params ++{ ++ UINT64 StatementHandle; ++ INT64 *RowCount; ++}; ++ ++struct SQLSetConnectAttr_params ++{ ++ UINT64 ConnectionHandle; ++ INT32 Attribute; ++ void *Value; ++ INT32 StringLength; ++}; ++ ++struct SQLSetConnectAttrW_params ++{ ++ UINT64 ConnectionHandle; ++ INT32 Attribute; ++ void *Value; ++ INT32 StringLength; ++}; ++ ++struct SQLSetConnectOption_params ++{ ++ UINT64 ConnectionHandle; ++ UINT16 Option; ++ UINT64 Value; ++}; ++ ++struct SQLSetConnectOptionW_params ++{ ++ UINT64 ConnectionHandle; ++ UINT16 Option; ++ UINT64 Value; ++}; ++ ++struct SQLSetCursorName_params ++{ ++ UINT64 StatementHandle; ++ UCHAR *CursorName; ++ INT16 NameLength; ++}; ++ ++struct SQLSetCursorNameW_params ++{ ++ UINT64 StatementHandle; ++ WCHAR *CursorName; ++ INT16 NameLength; ++}; ++ ++struct SQLSetDescField_params ++{ ++ UINT64 DescriptorHandle; ++ INT16 RecNumber; ++ INT16 FieldIdentifier; ++ void *Value; ++ INT32 BufferLength; ++}; ++ ++struct SQLSetDescFieldW_params ++{ ++ UINT64 DescriptorHandle; ++ INT16 RecNumber; ++ INT16 FieldIdentifier; ++ void *Value; ++ INT32 BufferLength; ++}; ++ ++struct SQLSetDescRec_params ++{ ++ UINT64 DescriptorHandle; ++ INT16 RecNumber; ++ INT16 Type; ++ INT16 SubType; ++ INT64 Length; ++ INT16 Precision; ++ INT16 Scale; ++ void *Data; ++ INT64 *StringLength; ++ INT64 *Indicator; ++}; ++ ++struct SQLSetEnvAttr_params ++{ ++ UINT64 EnvironmentHandle; ++ INT32 Attribute; ++ void *Value; ++ INT32 StringLength; ++}; ++ ++struct SQLSetParam_params ++{ ++ UINT64 StatementHandle; ++ UINT16 ParameterNumber; ++ INT16 ValueType; ++ INT16 ParameterType; ++ UINT64 LengthPrecision; ++ INT16 ParameterScale; ++ void *ParameterValue; ++ INT64 *StrLen_or_Ind; ++}; ++ ++struct SQLSetPos_params ++{ ++ UINT64 StatementHandle; ++ UINT64 RowNumber; ++ UINT16 Operation; ++ UINT16 LockType; ++}; ++ ++struct SQLSetScrollOptions_params ++{ ++ UINT64 StatementHandle; ++ UINT16 Concurrency; ++ INT64 KeySetSize; ++ UINT16 RowSetSize; ++}; ++ ++struct SQLSetStmtAttr_params ++{ ++ UINT64 StatementHandle; ++ INT32 Attribute; ++ void *Value; ++ INT32 StringLength; ++}; ++ ++struct SQLSetStmtAttrW_params ++{ ++ UINT64 StatementHandle; ++ INT32 Attribute; ++ void *Value; ++ INT32 StringLength; ++}; ++ ++struct SQLSetStmtOption_params ++{ ++ UINT64 StatementHandle; ++ UINT16 Option; ++ UINT64 Value; ++}; ++ ++struct SQLSpecialColumns_params ++{ ++ UINT64 StatementHandle; ++ UINT16 IdentifierType; ++ UCHAR *CatalogName; ++ INT16 NameLength1; ++ UCHAR *SchemaName; ++ INT16 NameLength2; ++ UCHAR *TableName; ++ INT16 NameLength3; ++ UINT16 Scope; ++ UINT16 Nullable; ++}; ++ ++struct SQLSpecialColumnsW_params ++{ ++ UINT64 StatementHandle; ++ UINT16 IdentifierType; ++ WCHAR *CatalogName; ++ INT16 NameLength1; ++ WCHAR *SchemaName; ++ INT16 NameLength2; ++ WCHAR *TableName; ++ INT16 NameLength3; ++ UINT16 Scope; ++ UINT16 Nullable; ++}; ++ ++struct SQLStatistics_params ++{ ++ UINT64 StatementHandle; ++ UCHAR *CatalogName; ++ INT16 NameLength1; ++ UCHAR *SchemaName; ++ INT16 NameLength2; ++ UCHAR *TableName; ++ INT16 NameLength3; ++ UINT16 Unique; ++ UINT16 Reserved; ++}; ++ ++struct SQLStatisticsW_params ++{ ++ UINT64 StatementHandle; ++ WCHAR *CatalogName; ++ INT16 NameLength1; ++ WCHAR *SchemaName; ++ INT16 NameLength2; ++ WCHAR *TableName; ++ INT16 NameLength3; ++ UINT16 Unique; ++ UINT16 Reserved; ++}; ++ ++struct SQLTablePrivileges_params ++{ ++ UINT64 StatementHandle; ++ UCHAR *CatalogName; ++ INT16 NameLength1; ++ UCHAR *SchemaName; ++ INT16 NameLength2; ++ UCHAR *TableName; ++ INT16 NameLength3; ++}; ++ ++struct SQLTablePrivilegesW_params ++{ ++ UINT64 StatementHandle; ++ WCHAR *CatalogName; ++ INT16 NameLength1; ++ WCHAR *SchemaName; ++ INT16 NameLength2; ++ WCHAR *TableName; ++ INT16 NameLength3; ++}; ++ ++struct SQLTables_params ++{ ++ UINT64 StatementHandle; ++ UCHAR *CatalogName; ++ INT16 NameLength1; ++ UCHAR *SchemaName; ++ INT16 NameLength2; ++ UCHAR *TableName; ++ INT16 NameLength3; ++ UCHAR *TableType; ++ INT16 NameLength4; ++}; ++ ++struct SQLTablesW_params ++{ ++ UINT64 StatementHandle; ++ WCHAR *CatalogName; ++ INT16 NameLength1; ++ WCHAR *SchemaName; ++ INT16 NameLength2; ++ WCHAR *TableName; ++ INT16 NameLength3; ++ WCHAR *TableType; ++ INT16 NameLength4; ++}; ++ ++struct SQLTransact_params ++{ ++ UINT64 EnvironmentHandle; ++ UINT64 ConnectionHandle; ++ UINT16 CompletionType; ++}; +diff --git a/dlls/wineodbc/wineodbc.spec b/dlls/wineodbc/wineodbc.spec +new file mode 100644 +index 00000000000..f94eaabea26 +--- /dev/null ++++ b/dlls/wineodbc/wineodbc.spec +@@ -0,0 +1,176 @@ ++ 1 stdcall SQLAllocConnect(long ptr) ++ 2 stdcall SQLAllocEnv(ptr) ++ 3 stdcall SQLAllocStmt(long ptr) ++ 4 stdcall SQLBindCol(long long long ptr long ptr) ++ 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) ++ 9 stdcall SQLDisconnect(long) ++ 10 stdcall SQLError(long long long str ptr str 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) ++ 18 stdcall SQLNumResultCols(long ptr) ++ 19 stdcall SQLPrepare(long str long) ++ 20 stdcall SQLRowCount(long ptr) ++ 21 stdcall SQLSetCursorName(long str long) ++ 22 stdcall SQLSetParam(long long long long long long ptr ptr) ++ 23 stdcall SQLTransact(long long long) ++ 24 stdcall SQLAllocHandle(long long ptr) ++ 25 stdcall SQLBindParam(long long long long long long ptr ptr) ++ 26 stdcall SQLCloseCursor(long) ++ 27 stdcall SQLColAttribute(long long long ptr long ptr ptr) ++ 28 stdcall SQLCopyDesc(long long) ++ 29 stdcall SQLEndTran(long long long) ++ 30 stdcall SQLFetchScroll(long long long) ++ 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) ++ 35 stdcall SQLGetDiagField(long long long long ptr long ptr) ++ 36 stdcall SQLGetDiagRec(long long long str ptr str 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) ++ 42 stdcall SQLGetConnectOption(long long ptr) ++ 43 stdcall SQLGetData(long long long ptr long ptr) ++ 44 stdcall SQLGetFunctions(long long ptr) ++ 45 stdcall SQLGetInfo(long long ptr long ptr) ++ 46 stdcall SQLGetStmtOption(long long ptr) ++ 47 stdcall SQLGetTypeInfo(long long) ++ 48 stdcall SQLParamData(long ptr) ++ 49 stdcall SQLPutData(long ptr long) ++ 50 stdcall SQLSetConnectOption(long long long) ++ 51 stdcall SQLSetStmtOption(long long long) ++ 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) ++ 56 stdcall SQLColumnPrivileges(long str long str long str long str long) ++ 57 stdcall SQLDataSources(long long str long ptr str 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) ++ 63 stdcall SQLNumParams(long ptr) ++ 64 stdcall SQLParamOptions(long long ptr) ++ 65 stdcall SQLPrimaryKeys(long str long str long str long) ++ 66 stdcall SQLProcedureColumns(long str long str long str long str long) ++ 67 stdcall SQLProcedures(long str long str long str long) ++ 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) ++ 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) ++ 75 stdcall SQLSetEnvAttr(long long ptr long) ++ 76 stdcall SQLSetStmtAttr(long long ptr long) ++ 77 stdcall SQLAllocHandleStd(long long ptr) ++ 78 stdcall SQLBulkOperations(long long) ++ 79 stub CloseODBCPerfData ++ 80 stub CollectODBCPerfData ++ 81 stub CursorLibLockDbc ++ 82 stub CursorLibLockDesc ++ 83 stub CursorLibLockStmt ++ 84 stub ODBCGetTryWaitValue ++ 85 stub CursorLibTransact ++ 86 stub ODBSetTryWaitValue ++ 89 stub ODBCSharedPerfMon ++ 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) ++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) ++135 stdcall SQLGetDiagFieldW(long long long long ptr long ptr) ++136 stdcall SQLGetDiagRecW(long long long wstr ptr wstr 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) ++142 stdcall SQLGetConnectOptionW(long long ptr) ++145 stdcall SQLGetInfoW(long long ptr long ptr) ++147 stdcall SQLGetTypeInfoW(long long) ++150 stdcall SQLSetConnectOptionW(long long long) ++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) ++156 stdcall SQLColumnPrivilegesW(long wstr long wstr long wstr long wstr long) ++157 stdcall SQLDataSourcesW(long long wstr long ptr wstr 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) ++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) ++173 stdcall SQLSetDescFieldW(long long long ptr long) ++176 stdcall SQLSetStmtAttrW(long long ptr long) ++206 stub SQLColAttributesA ++207 stub SQLConnectA ++208 stub SQLDescribeColA ++210 stub SQLErrorA ++211 stub SQLExecDirectA ++217 stub SQLGetCursorNameA ++219 stub SQLPrepareA ++221 stub SQLSetCursorNameA ++227 stub SQLColAttributeA ++232 stub SQLGetConnectAttrA ++233 stub SQLGetDescFieldA ++234 stub SQLGetDescRecA ++235 stub SQLGetDiagFieldA ++236 stdcall SQLGetDiagRecA(long long long ptr ptr ptr long ptr) ++238 stub SQLGetStmtAttrA ++239 stub SQLSetConnectAttrA ++240 stub SQLColumnsA ++241 stub SQLDriverConnectA ++242 stub SQLGetConnectOptionA ++245 stub SQLGetInfoA ++247 stub SQLGetTypeInfoA ++250 stub SQLSetConnectOptionA ++252 stub SQLSpecialColumnsA ++253 stub SQLStatisticsA ++254 stub SQLTablesA ++255 stub SQLBrowseConnectA ++256 stub SQLColumnPrivilegesA ++257 stdcall SQLDataSourcesA(long long str long ptr str long ptr) ++260 stub SQLForeignKeysA ++262 stub SQLNativeSqlA ++265 stub SQLPrimaryKeysA ++266 stub SQLProcedureColumnsA ++267 stub SQLProceduresA ++270 stub SQLTablePrivilegesA ++271 stub SQLDriversA ++273 stub SQLSetDescFieldA ++276 stub SQLSetStmtAttrA ++300 stub ODBCSharedTraceFlag ++301 stub ODBCQualifyFileDSNW ++ ++ ++ @ stub LockHandle ++ @ stub ODBCInternalConnectW ++ @ stub OpenODBCPerfData ++ @ stub PostComponentError ++ @ stub PostODBCComponentError ++ @ stub PostODBCError ++ @ stub SearchStatusCode ++ @ stub VFreeErrors ++ @ stub VRetrieveDriverErrorsRowCol ++ @ stub ValidateErrorQueue +-- +2.43.0 + diff --git a/patches/odbc-remove-unixodbc/0002-wineodbc-Register-as-Driver.patch b/patches/odbc-remove-unixodbc/0002-wineodbc-Register-as-Driver.patch new file mode 100644 index 00000000..3d46168f --- /dev/null +++ b/patches/odbc-remove-unixodbc/0002-wineodbc-Register-as-Driver.patch @@ -0,0 +1,54 @@ +From 54841f013e3f88c885ad4bc252083e6aa5958472 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Sun, 23 Jun 2024 16:45:43 +1000 +Subject: [PATCH] wineodbc: Register as Driver + +--- + dlls/wineodbc/rsrc.rc | 3 +++ + dlls/wineodbc/wineodbc.rgs | 23 +++++++++++++++++++++++ + 2 files changed, 26 insertions(+) + create mode 100644 dlls/wineodbc/wineodbc.rgs + +diff --git a/dlls/wineodbc/rsrc.rc b/dlls/wineodbc/rsrc.rc +index b8fad8fe35b..9bc9d2934ab 100644 +--- a/dlls/wineodbc/rsrc.rc ++++ b/dlls/wineodbc/rsrc.rc +@@ -24,3 +24,6 @@ + #define WINE_PRODUCTVERSION_STR "3.520.6301.0" + + #include "wine/wine_common_ver.rc" ++ ++/* @makedep: wineodbc.rgs */ ++1 WINE_REGISTRY wineodbc.rgs +diff --git a/dlls/wineodbc/wineodbc.rgs b/dlls/wineodbc/wineodbc.rgs +new file mode 100644 +index 00000000000..c83d37976d7 +--- /dev/null ++++ b/dlls/wineodbc/wineodbc.rgs +@@ -0,0 +1,23 @@ ++HKLM ++{ ++ NoRemove Software ++ { ++ NoRemove ODBC ++ { ++ NoRemove ODBCINST.INI ++ { ++ 'Wine ODBC Driver' ++ { ++ val 'Driver' = s '%MODULE%' ++ val 'DriverODBCVer' = s '03.50' ++ val 'Setup' = s '%MODULE%' ++ } ++ ++ NoRemove ODBC Drivers ++ { ++ val 'Wine ODBC Driver' = s 'Installed' ++ } ++ } ++ } ++ } ++} +-- +2.43.0 + diff --git a/patches/odbc-remove-unixodbc/0002-odbc32-Implement-SQLAllocEnv-SQLFreeEnv.patch b/patches/odbc-remove-unixodbc/0003-odbc32-Implement-SQLAllocEnv-SQLFreeEnv.patch similarity index 91% rename from patches/odbc-remove-unixodbc/0002-odbc32-Implement-SQLAllocEnv-SQLFreeEnv.patch rename to patches/odbc-remove-unixodbc/0003-odbc32-Implement-SQLAllocEnv-SQLFreeEnv.patch index 0127a81a..77ce72ac 100644 --- a/patches/odbc-remove-unixodbc/0002-odbc32-Implement-SQLAllocEnv-SQLFreeEnv.patch +++ b/patches/odbc-remove-unixodbc/0003-odbc32-Implement-SQLAllocEnv-SQLFreeEnv.patch @@ -1,14 +1,14 @@ -From b866665b60bc2c29105d45a0e071db8e259ac229 Mon Sep 17 00:00:00 2001 +From 4f4f45e8aad723b7372d422f01df15e2320d23d6 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 3 Feb 2023 11:44:19 +1100 -Subject: [PATCH 02/42] odbc32: Implement SQLAllocEnv/SQLFreeEnv +Subject: [PATCH] odbc32: Implement SQLAllocEnv/SQLFreeEnv --- dlls/odbc32/proxyodbc.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index e8574430e74..24e84883aa5 100644 +index 89e4545f068..48ba33bb0f5 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -43,6 +43,11 @@ @@ -70,5 +70,5 @@ index e8574430e74..24e84883aa5 100644 /************************************************************************* -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0003-odbc32-Support-SQL_ATTR_CONNECTION_POOLING-in-SQLGet.patch b/patches/odbc-remove-unixodbc/0004-odbc32-Support-SQL_ATTR_CONNECTION_POOLING-in-SQLGet.patch similarity index 95% rename from patches/odbc-remove-unixodbc/0003-odbc32-Support-SQL_ATTR_CONNECTION_POOLING-in-SQLGet.patch rename to patches/odbc-remove-unixodbc/0004-odbc32-Support-SQL_ATTR_CONNECTION_POOLING-in-SQLGet.patch index 792c2c0b..2395ef94 100644 --- a/patches/odbc-remove-unixodbc/0003-odbc32-Support-SQL_ATTR_CONNECTION_POOLING-in-SQLGet.patch +++ b/patches/odbc-remove-unixodbc/0004-odbc32-Support-SQL_ATTR_CONNECTION_POOLING-in-SQLGet.patch @@ -1,7 +1,7 @@ -From cd4b544dc92159ca8c80e790c25a36e93b848145 Mon Sep 17 00:00:00 2001 +From 35c784055b2af9d8d19f69f1d46bb257d9a70de3 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 3 Feb 2023 13:41:20 +1100 -Subject: [PATCH 03/42] odbc32: Support SQL_ATTR_CONNECTION_POOLING in +Subject: [PATCH] odbc32: Support SQL_ATTR_CONNECTION_POOLING in SQLGetEnvAttr/SQLSetEnvAttr --- @@ -9,7 +9,7 @@ Subject: [PATCH 03/42] odbc32: Support SQL_ATTR_CONNECTION_POOLING in 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 24e84883aa5..1330c4c33fe 100644 +index 48ba33bb0f5..89b8663d888 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -46,6 +46,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(odbc); @@ -110,5 +110,5 @@ index 24e84883aa5..1330c4c33fe 100644 /************************************************************************* -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0004-odbc32-Add-initial-tests.patch b/patches/odbc-remove-unixodbc/0005-odbc32-Add-initial-tests.patch similarity index 93% rename from patches/odbc-remove-unixodbc/0004-odbc32-Add-initial-tests.patch rename to patches/odbc-remove-unixodbc/0005-odbc32-Add-initial-tests.patch index 2fba95aa..e6cf2acf 100644 --- a/patches/odbc-remove-unixodbc/0004-odbc32-Add-initial-tests.patch +++ b/patches/odbc-remove-unixodbc/0005-odbc32-Add-initial-tests.patch @@ -1,4 +1,4 @@ -From b129fd1a7b4de4959f8929f03ece4688b3e1a6fd Mon Sep 17 00:00:00 2001 +From 4e1a78cfdba25f67e93f40ce9d4881cd15abf180 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 3 Feb 2023 14:16:21 +1100 Subject: [PATCH] odbc32: Add initial tests @@ -8,7 +8,7 @@ Subject: [PATCH] odbc32: Add initial tests 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/tests/odbc32.c b/dlls/odbc32/tests/odbc32.c -index 8a744f23834..7e1f62e559f 100644 +index 57bb17ef617..fa877c295d1 100644 --- a/dlls/odbc32/tests/odbc32.c +++ b/dlls/odbc32/tests/odbc32.c @@ -28,7 +28,7 @@ @@ -42,7 +42,7 @@ index 8a744f23834..7e1f62e559f 100644 ret = SQLFreeEnv( 0 ); ok( ret == SQL_INVALID_HANDLE, "got %d\n", ret ); } -@@ -302,6 +310,47 @@ static void test_SQLExecDirect( void ) +@@ -393,6 +401,47 @@ static void test_SQLExecDirect( void ) ok( ret == SQL_SUCCESS, "got %d\n", ret ); } @@ -90,7 +90,7 @@ index 8a744f23834..7e1f62e559f 100644 START_TEST(odbc32) { test_SQLAllocHandle(); -@@ -309,4 +358,5 @@ START_TEST(odbc32) +@@ -400,4 +449,5 @@ START_TEST(odbc32) test_SQLDataSources(); test_SQLDrivers(); test_SQLExecDirect(); diff --git a/patches/odbc-remove-unixodbc/0005-odbc32-Implement-SQLAllocConnect.patch b/patches/odbc-remove-unixodbc/0006-odbc32-Implement-SQLAllocConnect.patch similarity index 92% rename from patches/odbc-remove-unixodbc/0005-odbc32-Implement-SQLAllocConnect.patch rename to patches/odbc-remove-unixodbc/0006-odbc32-Implement-SQLAllocConnect.patch index 4c122440..3da5db2a 100644 --- a/patches/odbc-remove-unixodbc/0005-odbc32-Implement-SQLAllocConnect.patch +++ b/patches/odbc-remove-unixodbc/0006-odbc32-Implement-SQLAllocConnect.patch @@ -1,14 +1,14 @@ -From 8d5b34c895f776ed4944fa5aeed0df3ddc847015 Mon Sep 17 00:00:00 2001 +From 0f67768bd11cc1c58d9ad84640260e2ea66ea8ff Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 3 Feb 2023 14:40:03 +1100 -Subject: [PATCH 05/42] odbc32: Implement SQLAllocConnect +Subject: [PATCH] odbc32: Implement SQLAllocConnect --- dlls/odbc32/proxyodbc.c | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 1330c4c33fe..b3680b7759d 100644 +index 89b8663d888..8cc89f2c7ba 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -49,17 +49,35 @@ struct SQLHENV_data @@ -77,5 +77,5 @@ index 1330c4c33fe..b3680b7759d 100644 /************************************************************************* -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0006-odbc32-SQLGetInfo-W-support-InfoType-SQL_ODBC_VER.patch b/patches/odbc-remove-unixodbc/0007-odbc32-SQLGetInfo-W-support-InfoType-SQL_ODBC_VER.patch similarity index 93% rename from patches/odbc-remove-unixodbc/0006-odbc32-SQLGetInfo-W-support-InfoType-SQL_ODBC_VER.patch rename to patches/odbc-remove-unixodbc/0007-odbc32-SQLGetInfo-W-support-InfoType-SQL_ODBC_VER.patch index 22288418..2af031f4 100644 --- a/patches/odbc-remove-unixodbc/0006-odbc32-SQLGetInfo-W-support-InfoType-SQL_ODBC_VER.patch +++ b/patches/odbc-remove-unixodbc/0007-odbc32-SQLGetInfo-W-support-InfoType-SQL_ODBC_VER.patch @@ -1,14 +1,14 @@ -From c4739858fb4397522f5e09e88400c5433a7cecf2 Mon Sep 17 00:00:00 2001 +From cb3c9bd4e9eae60f11dc97f3a1fd2cd76e430ed7 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 3 Feb 2023 14:46:44 +1100 -Subject: [PATCH 06/42] odbc32: SQLGetInfo/W support InfoType SQL_ODBC_VER +Subject: [PATCH] odbc32: SQLGetInfo/W support InfoType SQL_ODBC_VER --- dlls/odbc32/proxyodbc.c | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index b3680b7759d..c19f0248ef8 100644 +index 8cc89f2c7ba..7d654f1131b 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -658,12 +658,24 @@ SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT Function @@ -68,5 +68,5 @@ index b3680b7759d..c19f0248ef8 100644 /************************************************************************* -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0007-odbc32-Support-SQL_ATTR_LOGIN_TIMEOUT-in-SQLSetConne.patch b/patches/odbc-remove-unixodbc/0008-odbc32-Support-SQL_ATTR_LOGIN_TIMEOUT-in-SQLSetConne.patch similarity index 91% rename from patches/odbc-remove-unixodbc/0007-odbc32-Support-SQL_ATTR_LOGIN_TIMEOUT-in-SQLSetConne.patch rename to patches/odbc-remove-unixodbc/0008-odbc32-Support-SQL_ATTR_LOGIN_TIMEOUT-in-SQLSetConne.patch index 275d421a..4a4b9a98 100644 --- a/patches/odbc-remove-unixodbc/0007-odbc32-Support-SQL_ATTR_LOGIN_TIMEOUT-in-SQLSetConne.patch +++ b/patches/odbc-remove-unixodbc/0008-odbc32-Support-SQL_ATTR_LOGIN_TIMEOUT-in-SQLSetConne.patch @@ -1,15 +1,14 @@ -From a6061eab04f7b9432acf1eb86eb47d3286d97f0e Mon Sep 17 00:00:00 2001 +From 7f9ebc7aec32bd0a6a53c94dbf96b39fe4cdd2ce Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 3 Feb 2023 15:18:21 +1100 -Subject: [PATCH 07/42] odbc32: Support SQL_ATTR_LOGIN_TIMEOUT in - SQLSetConnectAttrW +Subject: [PATCH] odbc32: Support SQL_ATTR_LOGIN_TIMEOUT in SQLSetConnectAttrW --- dlls/odbc32/proxyodbc.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index c19f0248ef8..b4ec548b09c 100644 +index 7d654f1131b..070f0197742 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -53,6 +53,8 @@ struct SQLHDBC_data @@ -65,5 +64,5 @@ index c19f0248ef8..b4ec548b09c 100644 /************************************************************************* -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0008-odbc32-Implement-SQLDriverConnectW.patch b/patches/odbc-remove-unixodbc/0009-odbc32-Implement-SQLDriverConnectW.patch similarity index 99% rename from patches/odbc-remove-unixodbc/0008-odbc32-Implement-SQLDriverConnectW.patch rename to patches/odbc-remove-unixodbc/0009-odbc32-Implement-SQLDriverConnectW.patch index 9e8e657b..6235a26a 100644 --- a/patches/odbc-remove-unixodbc/0008-odbc32-Implement-SQLDriverConnectW.patch +++ b/patches/odbc-remove-unixodbc/0009-odbc32-Implement-SQLDriverConnectW.patch @@ -1,4 +1,4 @@ -From 64af6ff6f7ac46823bc98e5b70bff87c46652aab Mon Sep 17 00:00:00 2001 +From 63629981578a8ed97d1498b8c2e69484f3d85828 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Sat, 4 Feb 2023 09:16:29 +1100 Subject: [PATCH] odbc32: Implement SQLDriverConnectW diff --git a/patches/odbc-remove-unixodbc/0009-odbc32-Foward-SQLGetInfo-W-requests-onto-the-driver.patch b/patches/odbc-remove-unixodbc/0010-odbc32-Foward-SQLGetInfo-W-requests-onto-the-driver.patch similarity index 86% rename from patches/odbc-remove-unixodbc/0009-odbc32-Foward-SQLGetInfo-W-requests-onto-the-driver.patch rename to patches/odbc-remove-unixodbc/0010-odbc32-Foward-SQLGetInfo-W-requests-onto-the-driver.patch index 61d7af7b..c5aa64dc 100644 --- a/patches/odbc-remove-unixodbc/0009-odbc32-Foward-SQLGetInfo-W-requests-onto-the-driver.patch +++ b/patches/odbc-remove-unixodbc/0010-odbc32-Foward-SQLGetInfo-W-requests-onto-the-driver.patch @@ -1,17 +1,17 @@ -From 721fddbb419b2bdaf710c023b9d33851b77e1684 Mon Sep 17 00:00:00 2001 +From 55674ad31123cfdcf664d8f1c28710185aa0388d Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 08:47:46 +1100 -Subject: [PATCH 09/42] odbc32: Foward SQLGetInfo/W requests onto the driver +Subject: [PATCH] odbc32: Foward SQLGetInfo/W requests onto the driver --- dlls/odbc32/proxyodbc.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index ebb6b53d62d..6e4e1a68011 100644 +index 30baf1866a4..50083a23e25 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -911,7 +911,9 @@ SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT Function +@@ -902,7 +902,9 @@ SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT Function SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) { @@ -21,7 +21,7 @@ index ebb6b53d62d..6e4e1a68011 100644 TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, InfoType, InfoValue, BufferLength, StringLength); -@@ -924,11 +926,19 @@ SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQL +@@ -915,11 +917,19 @@ SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQL *StringLength = strlen(ptr); break; default: @@ -44,7 +44,7 @@ index ebb6b53d62d..6e4e1a68011 100644 } /************************************************************************* -@@ -1973,7 +1983,9 @@ SQLRETURN WINAPI SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Opt +@@ -1994,7 +2004,9 @@ SQLRETURN WINAPI SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Opt SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) { @@ -54,7 +54,7 @@ index ebb6b53d62d..6e4e1a68011 100644 TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, InfoType, InfoValue, BufferLength, StringLength); -@@ -1986,11 +1998,19 @@ SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQ +@@ -2007,11 +2019,19 @@ SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQ *StringLength = wcslen(ptr); break; default: @@ -78,5 +78,5 @@ index ebb6b53d62d..6e4e1a68011 100644 /************************************************************************* -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0010-odbc32-Foward-SQLSetConnectAttr-requets-onto-the-dri.patch b/patches/odbc-remove-unixodbc/0011-odbc32-Foward-SQLSetConnectAttr-requets-onto-the-dri.patch similarity index 91% rename from patches/odbc-remove-unixodbc/0010-odbc32-Foward-SQLSetConnectAttr-requets-onto-the-dri.patch rename to patches/odbc-remove-unixodbc/0011-odbc32-Foward-SQLSetConnectAttr-requets-onto-the-dri.patch index 9226b5be..1e0191b6 100644 --- a/patches/odbc-remove-unixodbc/0010-odbc32-Foward-SQLSetConnectAttr-requets-onto-the-dri.patch +++ b/patches/odbc-remove-unixodbc/0011-odbc32-Foward-SQLSetConnectAttr-requets-onto-the-dri.patch @@ -1,4 +1,4 @@ -From 827ccc5a0ef8a1b1e1290d7225f25619ca11fcf0 Mon Sep 17 00:00:00 2001 +From 7db07cc12c6e62ab86b429d0c0b0f88426ddb681 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 08:55:12 +1100 Subject: [PATCH] odbc32: Foward SQLSetConnectAttr requets onto the driver @@ -8,10 +8,10 @@ Subject: [PATCH] odbc32: Foward SQLSetConnectAttr requets onto the driver 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index e816caa0daa..00822d9d263 100644 +index 50083a23e25..f817b3b524c 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -1042,11 +1042,40 @@ SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount) +@@ -1043,11 +1043,40 @@ SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount) SQLRETURN WINAPI SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength) { @@ -54,7 +54,7 @@ index e816caa0daa..00822d9d263 100644 return ret; } -@@ -1802,6 +1831,7 @@ SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribu +@@ -1803,6 +1832,7 @@ SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribu SQLINTEGER StringLength) { struct SQLHDBC_data *hdbc = ConnectionHandle; @@ -62,7 +62,7 @@ index e816caa0daa..00822d9d263 100644 TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value, StringLength); -@@ -1821,11 +1851,20 @@ SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribu +@@ -1822,11 +1852,20 @@ SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribu hdbc->login_timeout = 0; break; default: diff --git a/patches/odbc-remove-unixodbc/0011-odbc32-Forward-SQLGetFunctions-requets-onto-the-driv.patch b/patches/odbc-remove-unixodbc/0012-odbc32-Forward-SQLGetFunctions-requets-onto-the-driv.patch similarity index 79% rename from patches/odbc-remove-unixodbc/0011-odbc32-Forward-SQLGetFunctions-requets-onto-the-driv.patch rename to patches/odbc-remove-unixodbc/0012-odbc32-Forward-SQLGetFunctions-requets-onto-the-driv.patch index e581dc73..bde01214 100644 --- a/patches/odbc-remove-unixodbc/0011-odbc32-Forward-SQLGetFunctions-requets-onto-the-driv.patch +++ b/patches/odbc-remove-unixodbc/0012-odbc32-Forward-SQLGetFunctions-requets-onto-the-driv.patch @@ -1,17 +1,17 @@ -From 8b3bcc595990b84b8632397707a3ba756f1b2892 Mon Sep 17 00:00:00 2001 +From 25b167b0027c64be079c7203b994dac1b5627446 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 09:02:34 +1100 -Subject: [PATCH 11/42] odbc32: Forward SQLGetFunctions requets onto the driver +Subject: [PATCH] odbc32: Forward SQLGetFunctions requets onto the driver --- dlls/odbc32/proxyodbc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 89062e9cadf..7e92b90b10c 100644 +index f817b3b524c..3ed0a484972 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -898,9 +898,15 @@ SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, +@@ -889,9 +889,15 @@ SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, */ SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported) { @@ -29,5 +29,5 @@ index 89062e9cadf..7e92b90b10c 100644 return ret; } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0012-odbc32-Forward-SQLGetConnectAttr-W-requets-onto-the-.patch b/patches/odbc-remove-unixodbc/0013-odbc32-Forward-SQLGetConnectAttr-W-requets-onto-the-.patch similarity index 92% rename from patches/odbc-remove-unixodbc/0012-odbc32-Forward-SQLGetConnectAttr-W-requets-onto-the-.patch rename to patches/odbc-remove-unixodbc/0013-odbc32-Forward-SQLGetConnectAttr-W-requets-onto-the-.patch index 387eabed..1ff941b0 100644 --- a/patches/odbc-remove-unixodbc/0012-odbc32-Forward-SQLGetConnectAttr-W-requets-onto-the-.patch +++ b/patches/odbc-remove-unixodbc/0013-odbc32-Forward-SQLGetConnectAttr-W-requets-onto-the-.patch @@ -1,4 +1,4 @@ -From 618ae30847043d66cc952fd6a58c319a8eee698d Mon Sep 17 00:00:00 2001 +From 53e0846f51522be5a2f7574f12ff35d16c44d1de Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 09:08:27 +1100 Subject: [PATCH] odbc32: Forward SQLGetConnectAttr/W requets onto the driver @@ -8,10 +8,10 @@ Subject: [PATCH] odbc32: Forward SQLGetConnectAttr/W requets onto the driver 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 3a1d8ba1d08..333d040be8c 100644 +index 3ed0a484972..886fe07efb9 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -729,11 +729,30 @@ SQLRETURN WINAPI SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option) +@@ -730,11 +730,30 @@ SQLRETURN WINAPI SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option) SQLRETURN WINAPI SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) { @@ -43,7 +43,7 @@ index 3a1d8ba1d08..333d040be8c 100644 return ret; } -@@ -1711,11 +1730,30 @@ SQLRETURN WINAPI SQLColAttributeW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnN +@@ -1741,11 +1760,30 @@ SQLRETURN WINAPI SQLColAttributeW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnN SQLRETURN WINAPI SQLGetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) { diff --git a/patches/odbc-remove-unixodbc/0013-odbc32-Foward-SQLDisconnect-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0014-odbc32-Foward-SQLDisconnect-request-onto-driver.patch similarity index 79% rename from patches/odbc-remove-unixodbc/0013-odbc32-Foward-SQLDisconnect-request-onto-driver.patch rename to patches/odbc-remove-unixodbc/0014-odbc32-Foward-SQLDisconnect-request-onto-driver.patch index eed7952e..7485c90a 100644 --- a/patches/odbc-remove-unixodbc/0013-odbc32-Foward-SQLDisconnect-request-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0014-odbc32-Foward-SQLDisconnect-request-onto-driver.patch @@ -1,17 +1,17 @@ -From 3a815fdc2731ffe21a617668e7cd4570196e02c5 Mon Sep 17 00:00:00 2001 +From fc34342d52977928717c0b9f45bff99613461201 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 09:26:57 +1100 -Subject: [PATCH 13/42] odbc32: Foward SQLDisconnect request onto driver +Subject: [PATCH] odbc32: Foward SQLDisconnect request onto driver --- dlls/odbc32/proxyodbc.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 96357cd3f1d..65f882968c6 100644 +index 886fe07efb9..eb274c5da5b 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -583,9 +583,23 @@ SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNum +@@ -574,9 +574,23 @@ SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNum */ SQLRETURN WINAPI SQLDisconnect(SQLHDBC ConnectionHandle) { @@ -37,5 +37,5 @@ index 96357cd3f1d..65f882968c6 100644 return ret; } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0014-odbc32-Implement-SQLAllocStmt.patch b/patches/odbc-remove-unixodbc/0015-odbc32-Implement-SQLAllocStmt.patch similarity index 87% rename from patches/odbc-remove-unixodbc/0014-odbc32-Implement-SQLAllocStmt.patch rename to patches/odbc-remove-unixodbc/0015-odbc32-Implement-SQLAllocStmt.patch index 71c6ca16..e26f557e 100644 --- a/patches/odbc-remove-unixodbc/0014-odbc32-Implement-SQLAllocStmt.patch +++ b/patches/odbc-remove-unixodbc/0015-odbc32-Implement-SQLAllocStmt.patch @@ -1,17 +1,17 @@ -From 2bda5feb6297ec6c01a022a3c13338c2c6f6ff27 Mon Sep 17 00:00:00 2001 +From a09926caf2fd91460ab75d75c3aba98a153f97fa Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 09:53:34 +1100 -Subject: [PATCH 14/42] odbc32: Implement SQLAllocStmt +Subject: [PATCH] odbc32: Implement SQLAllocStmt --- dlls/odbc32/proxyodbc.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 65f882968c6..4ec5ecfcb83 100644 +index eb274c5da5b..1e6ee80c03d 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -178,6 +178,13 @@ struct SQLHDBC_data +@@ -174,6 +174,13 @@ struct SQLHDBC_data SQLUINTEGER login_timeout; }; @@ -25,7 +25,7 @@ index 65f882968c6..4ec5ecfcb83 100644 static void connection_bind_sql_funcs(struct SQLHDBC_data *connection) { #define LOAD_FUNCPTR(f) if((connection->p##f = (void*)GetProcAddress(connection->module, #f)) == NULL) \ -@@ -374,11 +381,41 @@ SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, S +@@ -365,11 +372,41 @@ SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, S */ SQLRETURN WINAPI SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandle) { @@ -69,5 +69,5 @@ index 65f882968c6..4ec5ecfcb83 100644 } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0015-odbc32-Forward-SQLSetStmtAttr-W-request-to-driver.patch b/patches/odbc-remove-unixodbc/0016-odbc32-Forward-SQLSetStmtAttr-W-request-to-driver.patch similarity index 91% rename from patches/odbc-remove-unixodbc/0015-odbc32-Forward-SQLSetStmtAttr-W-request-to-driver.patch rename to patches/odbc-remove-unixodbc/0016-odbc32-Forward-SQLSetStmtAttr-W-request-to-driver.patch index eb4f0feb..cef496c6 100644 --- a/patches/odbc-remove-unixodbc/0015-odbc32-Forward-SQLSetStmtAttr-W-request-to-driver.patch +++ b/patches/odbc-remove-unixodbc/0016-odbc32-Forward-SQLSetStmtAttr-W-request-to-driver.patch @@ -1,4 +1,4 @@ -From ae3542748782dea8b9213c0d015f09ac94c13bf9 Mon Sep 17 00:00:00 2001 +From 2f3d8481978439bdc657f5f020e255c9c2c634d1 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 09:59:14 +1100 Subject: [PATCH] odbc32: Forward SQLSetStmtAttr/W request to driver @@ -8,10 +8,10 @@ Subject: [PATCH] odbc32: Forward SQLSetStmtAttr/W request to driver 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index b3b10917660..0f868331ac9 100644 +index 1e6ee80c03d..999d1e64916 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -1265,11 +1265,28 @@ SQLRETURN WINAPI SQLSetParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNum +@@ -1266,11 +1266,28 @@ SQLRETURN WINAPI SQLSetParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNum SQLRETURN WINAPI SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength) { @@ -41,7 +41,7 @@ index b3b10917660..0f868331ac9 100644 return ret; } -@@ -2430,11 +2447,28 @@ SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumb +@@ -2438,11 +2455,28 @@ SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumb SQLRETURN WINAPI SQLSetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength) { diff --git a/patches/odbc-remove-unixodbc/0016-odbc32-Forward-SQLParamOptions-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0017-odbc32-Forward-SQLParamOptions-request-onto-driver.patch similarity index 80% rename from patches/odbc-remove-unixodbc/0016-odbc32-Forward-SQLParamOptions-request-onto-driver.patch rename to patches/odbc-remove-unixodbc/0017-odbc32-Forward-SQLParamOptions-request-onto-driver.patch index 0592a453..43b7caf0 100644 --- a/patches/odbc-remove-unixodbc/0016-odbc32-Forward-SQLParamOptions-request-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0017-odbc32-Forward-SQLParamOptions-request-onto-driver.patch @@ -1,17 +1,17 @@ -From e93822d6974d17a4f649228222fb6cd2f513d2a4 Mon Sep 17 00:00:00 2001 +From e2dcd4d6536d1ad99549920cdda96b4ce23b7b05 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 10:50:26 +1100 -Subject: [PATCH 16/42] odbc32: Forward SQLParamOptions request onto driver +Subject: [PATCH] odbc32: Forward SQLParamOptions request onto driver --- dlls/odbc32/proxyodbc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index d0be7b600bf..10de992e83e 100644 +index 999d1e64916..2b1db217467 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -1501,10 +1501,23 @@ SQLRETURN WINAPI SQLNumParams(SQLHSTMT hstmt, SQLSMALLINT *pcpar) +@@ -1529,10 +1529,23 @@ SQLRETURN WINAPI SQLNumParams(SQLHSTMT hstmt, SQLSMALLINT *pcpar) */ SQLRETURN WINAPI SQLParamOptions(SQLHSTMT hstmt, SQLULEN crow, SQLULEN *pirow) { @@ -37,5 +37,5 @@ index d0be7b600bf..10de992e83e 100644 } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0017-odbc32-Forward-SQLExecDirect-W-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0018-odbc32-Forward-SQLExecDirect-W-request-onto-driver.patch similarity index 83% rename from patches/odbc-remove-unixodbc/0017-odbc32-Forward-SQLExecDirect-W-request-onto-driver.patch rename to patches/odbc-remove-unixodbc/0018-odbc32-Forward-SQLExecDirect-W-request-onto-driver.patch index f0f4be64..f8701d91 100644 --- a/patches/odbc-remove-unixodbc/0017-odbc32-Forward-SQLExecDirect-W-request-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0018-odbc32-Forward-SQLExecDirect-W-request-onto-driver.patch @@ -1,14 +1,17 @@ -From 7b0b4f665836d2008dd679d27c9995c25895f1bb Mon Sep 17 00:00:00 2001 +From c7285c3ce19b3e5ff0d6a90ff84fa3c497776511 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 10:53:29 +1100 -Subject: odbc32: Forward SQLExecDirect/W request onto driver +Subject: [PATCH] odbc32: Forward SQLExecDirect/W request onto driver +--- + dlls/odbc32/proxyodbc.c | 36 ++++++++++++++++++++++++++++++++---- + 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 10de992e83e..bbcaa2487db 100644 +index 2b1db217467..6508c9b1d73 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -674,11 +674,25 @@ SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, S +@@ -665,11 +665,25 @@ SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, S */ SQLRETURN WINAPI SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength) { @@ -36,7 +39,7 @@ index 10de992e83e..bbcaa2487db 100644 return ret; } -@@ -1742,11 +1756,25 @@ SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, +@@ -1770,11 +1784,25 @@ SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, */ SQLRETURN WINAPI SQLExecDirectW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength) { @@ -64,3 +67,6 @@ index 10de992e83e..bbcaa2487db 100644 return ret; } +-- +2.43.0 + diff --git a/patches/odbc-remove-unixodbc/0018-odbc32-Forward-SQLGetStmtAttr-W-onto-driver.patch b/patches/odbc-remove-unixodbc/0019-odbc32-Forward-SQLGetStmtAttr-W-onto-driver.patch similarity index 89% rename from patches/odbc-remove-unixodbc/0018-odbc32-Forward-SQLGetStmtAttr-W-onto-driver.patch rename to patches/odbc-remove-unixodbc/0019-odbc32-Forward-SQLGetStmtAttr-W-onto-driver.patch index e8fcdbe2..2e701e03 100644 --- a/patches/odbc-remove-unixodbc/0018-odbc32-Forward-SQLGetStmtAttr-W-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0019-odbc32-Forward-SQLGetStmtAttr-W-onto-driver.patch @@ -1,17 +1,17 @@ -From e1399a4847627be9772aa411c24f3c9a7269c18d Mon Sep 17 00:00:00 2001 +From 2f915fc78edc974c6ef926ec3b3b4da81b64b72a Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 11:04:32 +1100 -Subject: [PATCH 18/42] odbc32: Forward SQLGetStmtAttr/W onto driver +Subject: [PATCH] odbc32: Forward SQLGetStmtAttr/W onto driver --- dlls/odbc32/proxyodbc.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index b43f2a0f876..ae790cd3651 100644 +index 6508c9b1d73..ecc208ac21b 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -1032,17 +1032,31 @@ SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQL +@@ -1028,17 +1028,31 @@ SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQL SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) { @@ -44,7 +44,7 @@ index b43f2a0f876..ae790cd3651 100644 return ret; } -@@ -1930,17 +1944,31 @@ SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMA +@@ -1964,17 +1978,31 @@ SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMA SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength) { @@ -78,5 +78,5 @@ index b43f2a0f876..ae790cd3651 100644 } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0019-odbc32-Forward-SQLRowCount-onto-driver.patch b/patches/odbc-remove-unixodbc/0020-odbc32-Forward-SQLRowCount-onto-driver.patch similarity index 81% rename from patches/odbc-remove-unixodbc/0019-odbc32-Forward-SQLRowCount-onto-driver.patch rename to patches/odbc-remove-unixodbc/0020-odbc32-Forward-SQLRowCount-onto-driver.patch index cc33f6aa..4a4dc0a7 100644 --- a/patches/odbc-remove-unixodbc/0019-odbc32-Forward-SQLRowCount-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0020-odbc32-Forward-SQLRowCount-onto-driver.patch @@ -1,17 +1,17 @@ -From 31d7dbc51491735cfadd4732d1a8cc64be18de14 Mon Sep 17 00:00:00 2001 +From 711377cb7cad345eda0432fdf035b6f5466ef1c4 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 11:08:41 +1100 -Subject: [PATCH 19/42] odbc32: Forward SQLRowCount onto driver +Subject: [PATCH] odbc32: Forward SQLRowCount onto driver --- dlls/odbc32/proxyodbc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index ae790cd3651..32c61eea427 100644 +index ecc208ac21b..c76b8ff3c2a 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -1138,10 +1138,23 @@ SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN St +@@ -1134,10 +1134,23 @@ SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN St */ SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount) { @@ -37,5 +37,5 @@ index ae790cd3651..32c61eea427 100644 } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0020-odbc32-Forward-SQLNumResultCols-onto-driver.patch b/patches/odbc-remove-unixodbc/0021-odbc32-Forward-SQLNumResultCols-onto-driver.patch similarity index 81% rename from patches/odbc-remove-unixodbc/0020-odbc32-Forward-SQLNumResultCols-onto-driver.patch rename to patches/odbc-remove-unixodbc/0021-odbc32-Forward-SQLNumResultCols-onto-driver.patch index e7ef6eb3..dc9636f8 100644 --- a/patches/odbc-remove-unixodbc/0020-odbc32-Forward-SQLNumResultCols-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0021-odbc32-Forward-SQLNumResultCols-onto-driver.patch @@ -1,17 +1,17 @@ -From 7359117d8a80ac80ca0602ca81a3b2b3ce2d26c1 Mon Sep 17 00:00:00 2001 +From 1a21b4f8c22e0b8911a9ebd43cc4a5f665192494 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 11:10:54 +1100 -Subject: [PATCH 20/42] odbc32: Forward SQLNumResultCols onto driver +Subject: [PATCH] odbc32: Forward SQLNumResultCols onto driver --- dlls/odbc32/proxyodbc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 32c61eea427..1d1c575ca11 100644 +index c76b8ff3c2a..12b6e9e113b 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -1089,10 +1089,23 @@ SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) +@@ -1085,10 +1085,23 @@ SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) */ SQLRETURN WINAPI SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnCount) { @@ -37,5 +37,5 @@ index 32c61eea427..1d1c575ca11 100644 } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0021-odbc32-Forward-SQLMoreResults-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0022-odbc32-Forward-SQLMoreResults-request-onto-driver.patch similarity index 79% rename from patches/odbc-remove-unixodbc/0021-odbc32-Forward-SQLMoreResults-request-onto-driver.patch rename to patches/odbc-remove-unixodbc/0022-odbc32-Forward-SQLMoreResults-request-onto-driver.patch index 76d71ded..ed4b9ded 100644 --- a/patches/odbc-remove-unixodbc/0021-odbc32-Forward-SQLMoreResults-request-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0022-odbc32-Forward-SQLMoreResults-request-onto-driver.patch @@ -1,17 +1,17 @@ -From 7c1897a48423d319430c3bea7252d2335a1148d5 Mon Sep 17 00:00:00 2001 +From cdebd6c62d542e1c4a3e6edd3885e7a14bb796cc Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 11:12:20 +1100 -Subject: [PATCH 21/42] odbc32: Forward SQLMoreResults request onto driver +Subject: [PATCH] odbc32: Forward SQLMoreResults request onto driver --- dlls/odbc32/proxyodbc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 1d1c575ca11..e5b0ae63afb 100644 +index 12b6e9e113b..61877bfb4a7 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -1516,10 +1516,23 @@ SQLRETURN WINAPI SQLForeignKeys(SQLHSTMT hstmt, SQLCHAR *szPkCatalogName, SQLSMA +@@ -1545,10 +1545,23 @@ SQLRETURN WINAPI SQLForeignKeys(SQLHSTMT hstmt, SQLCHAR *szPkCatalogName, SQLSMA */ SQLRETURN WINAPI SQLMoreResults(SQLHSTMT StatementHandle) { @@ -37,5 +37,5 @@ index 1d1c575ca11..e5b0ae63afb 100644 } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0022-odbc32-Forward-SQLDescribeCol-w-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0023-odbc32-Forward-SQLDescribeCol-w-request-onto-driver.patch similarity index 90% rename from patches/odbc-remove-unixodbc/0022-odbc32-Forward-SQLDescribeCol-w-request-onto-driver.patch rename to patches/odbc-remove-unixodbc/0023-odbc32-Forward-SQLDescribeCol-w-request-onto-driver.patch index d3099c25..505abb40 100644 --- a/patches/odbc-remove-unixodbc/0022-odbc32-Forward-SQLDescribeCol-w-request-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0023-odbc32-Forward-SQLDescribeCol-w-request-onto-driver.patch @@ -1,17 +1,17 @@ -From 4f1d0d9509469e410e151671da2a8baf53df09b3 Mon Sep 17 00:00:00 2001 +From af020a2a8380fc6640ae91385840d624842a428e Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 11:17:59 +1100 -Subject: [PATCH 22/42] odbc32: Forward SQLDescribeCol/w request onto driver +Subject: [PATCH] odbc32: Forward SQLDescribeCol/w request onto driver --- dlls/odbc32/proxyodbc.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index e5b0ae63afb..318aba1cc48 100644 +index 61877bfb4a7..ae7794917f3 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -606,12 +606,29 @@ SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNum +@@ -597,12 +597,29 @@ SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNum SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType, SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) { @@ -42,7 +42,7 @@ index e5b0ae63afb..318aba1cc48 100644 return ret; } -@@ -1775,15 +1792,29 @@ SQLRETURN WINAPI SQLDescribeColW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNu +@@ -1804,15 +1821,29 @@ SQLRETURN WINAPI SQLDescribeColW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNu SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType, SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) { @@ -74,5 +74,5 @@ index e5b0ae63afb..318aba1cc48 100644 } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0023-odbc32-Forward-SQLColAttributes-W-request-onto-drive.patch b/patches/odbc-remove-unixodbc/0024-odbc32-Forward-SQLColAttributes-W-request-onto-drive.patch similarity index 89% rename from patches/odbc-remove-unixodbc/0023-odbc32-Forward-SQLColAttributes-W-request-onto-drive.patch rename to patches/odbc-remove-unixodbc/0024-odbc32-Forward-SQLColAttributes-W-request-onto-drive.patch index d50f58c0..100b842f 100644 --- a/patches/odbc-remove-unixodbc/0023-odbc32-Forward-SQLColAttributes-W-request-onto-drive.patch +++ b/patches/odbc-remove-unixodbc/0024-odbc32-Forward-SQLColAttributes-W-request-onto-drive.patch @@ -1,17 +1,17 @@ -From 85be83ac84dea5b5e5aa43770d1c7e78ad07dbd5 Mon Sep 17 00:00:00 2001 +From 575797d61cb119102a9db030ee57e20e0ce466c6 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 11:30:58 +1100 -Subject: [PATCH 23/42] odbc32: Forward SQLColAttributes/W request onto driver +Subject: [PATCH] odbc32: Forward SQLColAttributes/W request onto driver --- dlls/odbc32/proxyodbc.c | 55 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 318aba1cc48..8360cd0684f 100644 +index ae7794917f3..b4f143dab45 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -1449,11 +1449,26 @@ SQLRETURN WINAPI SQLColAttributes(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLIN +@@ -1478,11 +1478,26 @@ SQLRETURN WINAPI SQLColAttributes(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLIN SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, SQLLEN *pfDesc) { @@ -39,7 +39,7 @@ index 318aba1cc48..8360cd0684f 100644 return ret; } -@@ -1754,6 +1769,21 @@ SQLRETURN WINAPI SQLSetScrollOptions(SQLHSTMT statement_handle, SQLUSMALLINT f_c +@@ -1783,6 +1798,21 @@ SQLRETURN WINAPI SQLSetScrollOptions(SQLHSTMT statement_handle, SQLUSMALLINT f_c return ret; } @@ -61,7 +61,7 @@ index 318aba1cc48..8360cd0684f 100644 /************************************************************************* * SQLColAttributesW [ODBC32.106] */ -@@ -1761,11 +1791,32 @@ SQLRETURN WINAPI SQLColAttributesW(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLI +@@ -1790,11 +1820,32 @@ SQLRETURN WINAPI SQLColAttributesW(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLI SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, SQLLEN *pfDesc) { @@ -96,5 +96,5 @@ index 318aba1cc48..8360cd0684f 100644 } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0024-odbc32-Forward-SQLNativeSql-W-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0025-odbc32-Forward-SQLNativeSql-W-request-onto-driver.patch similarity index 88% rename from patches/odbc-remove-unixodbc/0024-odbc32-Forward-SQLNativeSql-W-request-onto-driver.patch rename to patches/odbc-remove-unixodbc/0025-odbc32-Forward-SQLNativeSql-W-request-onto-driver.patch index 58d219e8..b23a0737 100644 --- a/patches/odbc-remove-unixodbc/0024-odbc32-Forward-SQLNativeSql-W-request-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0025-odbc32-Forward-SQLNativeSql-W-request-onto-driver.patch @@ -1,17 +1,17 @@ -From 04b5940c19de8c92269f9da73e6d98d9777a3020 Mon Sep 17 00:00:00 2001 +From 3bd355283d087071c17eab5f4799f092dd42d8d1 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 11:36:33 +1100 -Subject: [PATCH 24/42] odbc32: Forward SQLNativeSql/W request onto driver +Subject: [PATCH] odbc32: Forward SQLNativeSql/W request onto driver --- dlls/odbc32/proxyodbc.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 8360cd0684f..5b63fded654 100644 +index b4f143dab45..6e599a385a1 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -1574,11 +1574,25 @@ SQLRETURN WINAPI SQLMoreResults(SQLHSTMT StatementHandle) +@@ -1603,11 +1603,25 @@ SQLRETURN WINAPI SQLMoreResults(SQLHSTMT StatementHandle) SQLRETURN WINAPI SQLNativeSql(SQLHDBC hdbc, SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLCHAR *szSqlStr, SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr) { @@ -38,7 +38,7 @@ index 8360cd0684f..5b63fded654 100644 return ret; } -@@ -2465,11 +2479,25 @@ SQLRETURN WINAPI SQLForeignKeysW(SQLHSTMT hstmt, SQLWCHAR *szPkCatalogName, SQLS +@@ -2531,11 +2545,25 @@ SQLRETURN WINAPI SQLForeignKeysW(SQLHSTMT hstmt, SQLWCHAR *szPkCatalogName, SQLS SQLRETURN WINAPI SQLNativeSqlW(SQLHDBC hdbc, SQLWCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLWCHAR *szSqlStr, SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr) { @@ -66,5 +66,5 @@ index 8360cd0684f..5b63fded654 100644 } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0025-odbc32-Forward-SQLPrepare-W-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0026-odbc32-Forward-SQLPrepare-W-request-onto-driver.patch similarity index 83% rename from patches/odbc-remove-unixodbc/0025-odbc32-Forward-SQLPrepare-W-request-onto-driver.patch rename to patches/odbc-remove-unixodbc/0026-odbc32-Forward-SQLPrepare-W-request-onto-driver.patch index ee2949e3..f67e0294 100644 --- a/patches/odbc-remove-unixodbc/0025-odbc32-Forward-SQLPrepare-W-request-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0026-odbc32-Forward-SQLPrepare-W-request-onto-driver.patch @@ -1,14 +1,17 @@ -From 95d92cec6ceebb2f3fc7624180f89e7764e2430f Mon Sep 17 00:00:00 2001 +From 69dc39b9dbf854da2f2b21069ca6407de8fc77e0 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 11:44:00 +1100 -Subject: odbc32: Forward SQLPrepare/W request onto driver +Subject: [PATCH] odbc32: Forward SQLPrepare/W request onto driver +--- + dlls/odbc32/proxyodbc.c | 34 +++++++++++++++++++++++++++++++--- + 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 5b63fded654..fae384ca411 100644 +index 6e599a385a1..12d75fd1fcc 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -1143,11 +1143,25 @@ SQLRETURN WINAPI SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value) +@@ -1139,11 +1139,25 @@ SQLRETURN WINAPI SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value) */ SQLRETURN WINAPI SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength) { @@ -25,17 +28,17 @@ index 5b63fded654..fae384ca411 100644 + WARN("Wrong handle type %d\n", statement->type); + return SQL_ERROR; + } - ++ + if (statement->connection->pSQLPrepare) + { + ret = statement->connection->pSQLPrepare(statement->driver_stmt, StatementText, TextLength); + } -+ + + TRACE("ret %d\n", ret); return ret; } -@@ -1944,11 +1958,25 @@ SQLRETURN WINAPI SQLGetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, +@@ -1974,11 +1988,25 @@ SQLRETURN WINAPI SQLGetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, */ SQLRETURN WINAPI SQLPrepareW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength) { @@ -47,13 +50,13 @@ index 5b63fded654..fae384ca411 100644 + TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, + TextLength > 0 ? debugstr_wn(StatementText, TextLength) : debugstr_w(StatementText), + TextLength); -+ + + if (statement->type != SQL_HANDLE_STMT) + { + WARN("Wrong handle type %d\n", statement->type); + return SQL_ERROR; + } - ++ + if (statement->connection->pSQLPrepareW) + { + ret = statement->connection->pSQLPrepareW(statement->driver_stmt, StatementText, TextLength); @@ -63,3 +66,6 @@ index 5b63fded654..fae384ca411 100644 return ret; } +-- +2.43.0 + diff --git a/patches/odbc-remove-unixodbc/0026-odbc32-Implement-SQLFreeStmt.patch b/patches/odbc-remove-unixodbc/0027-odbc32-Implement-SQLFreeStmt.patch similarity index 82% rename from patches/odbc-remove-unixodbc/0026-odbc32-Implement-SQLFreeStmt.patch rename to patches/odbc-remove-unixodbc/0027-odbc32-Implement-SQLFreeStmt.patch index fe6d4ddd..3b9dd817 100644 --- a/patches/odbc-remove-unixodbc/0026-odbc32-Implement-SQLFreeStmt.patch +++ b/patches/odbc-remove-unixodbc/0027-odbc32-Implement-SQLFreeStmt.patch @@ -1,17 +1,17 @@ -From 20e5843387fd2daf28414b529dddd83dafa23cae Mon Sep 17 00:00:00 2001 +From bf680aa668ce942e0f7d37333c3680561ec45b84 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 11:47:40 +1100 -Subject: [PATCH 26/42] odbc32: Implement SQLFreeStmt +Subject: [PATCH] odbc32: Implement SQLFreeStmt --- dlls/odbc32/proxyodbc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 821c769c865..18efa222945 100644 +index 12d75fd1fcc..c457c4ac203 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -807,10 +807,23 @@ SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) +@@ -799,10 +799,23 @@ SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) */ SQLRETURN WINAPI SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option) { @@ -37,5 +37,5 @@ index 821c769c865..18efa222945 100644 } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0027-odbc32-Forward-SQLBindCol-requets-onto-driver.patch b/patches/odbc-remove-unixodbc/0028-odbc32-Forward-SQLBindCol-requets-onto-driver.patch similarity index 85% rename from patches/odbc-remove-unixodbc/0027-odbc32-Forward-SQLBindCol-requets-onto-driver.patch rename to patches/odbc-remove-unixodbc/0028-odbc32-Forward-SQLBindCol-requets-onto-driver.patch index 07cb1e46..45ee076d 100644 --- a/patches/odbc-remove-unixodbc/0027-odbc32-Forward-SQLBindCol-requets-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0028-odbc32-Forward-SQLBindCol-requets-onto-driver.patch @@ -1,17 +1,17 @@ -From 2eed70f4cf636fc2f3e6549d480e8be80b8fcaca Mon Sep 17 00:00:00 2001 +From 3a2481213f3f96ab6befa4b052d1c7266cb82af6 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 11:57:00 +1100 -Subject: [PATCH 27/42] odbc32: Forward SQLBindCol requets onto driver +Subject: [PATCH] odbc32: Forward SQLBindCol requets onto driver --- dlls/odbc32/proxyodbc.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 18efa222945..48b89731ed0 100644 +index c457c4ac203..257375f568a 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -447,11 +447,25 @@ static const char *debugstr_sqllen( SQLLEN len ) +@@ -438,11 +438,25 @@ static const char *debugstr_sqllen( SQLLEN len ) SQLRETURN WINAPI SQLBindCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind) { @@ -39,5 +39,5 @@ index 18efa222945..48b89731ed0 100644 } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0028-odbc32-Forward-SQLExtendedFetch-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0029-odbc32-Forward-SQLExtendedFetch-request-onto-driver.patch similarity index 84% rename from patches/odbc-remove-unixodbc/0028-odbc32-Forward-SQLExtendedFetch-request-onto-driver.patch rename to patches/odbc-remove-unixodbc/0029-odbc32-Forward-SQLExtendedFetch-request-onto-driver.patch index 6967eb07..a016d0c7 100644 --- a/patches/odbc-remove-unixodbc/0028-odbc32-Forward-SQLExtendedFetch-request-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0029-odbc32-Forward-SQLExtendedFetch-request-onto-driver.patch @@ -1,17 +1,17 @@ -From 2ad199088b8f666c3d7418eac6ec35e639f8260b Mon Sep 17 00:00:00 2001 +From 4b29416728af78c52d707adacc3d8ca7ffa01cd6 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 12:35:26 +1100 -Subject: [PATCH 28/42] odbc32: Forward SQLExtendedFetch request onto driver +Subject: [PATCH] odbc32: Forward SQLExtendedFetch request onto driver --- dlls/odbc32/proxyodbc.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 48b89731ed0..5a03ea3d757 100644 +index 257375f568a..de63be77ce2 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -1551,11 +1551,25 @@ SQLRETURN WINAPI SQLDescribeParam(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT +@@ -1581,11 +1581,25 @@ SQLRETURN WINAPI SQLDescribeParam(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT SQLRETURN WINAPI SQLExtendedFetch(SQLHSTMT hstmt, SQLUSMALLINT fFetchType, SQLLEN irow, SQLULEN *pcrow, SQLUSMALLINT *rgfRowStatus) { @@ -39,5 +39,5 @@ index 48b89731ed0..5a03ea3d757 100644 } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0029-odbc32-Forward-SQLExecute-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0030-odbc32-Forward-SQLExecute-request-onto-driver.patch similarity index 79% rename from patches/odbc-remove-unixodbc/0029-odbc32-Forward-SQLExecute-request-onto-driver.patch rename to patches/odbc-remove-unixodbc/0030-odbc32-Forward-SQLExecute-request-onto-driver.patch index 362a5dea..95c98924 100644 --- a/patches/odbc-remove-unixodbc/0029-odbc32-Forward-SQLExecute-request-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0030-odbc32-Forward-SQLExecute-request-onto-driver.patch @@ -1,17 +1,17 @@ -From 04ef2a6e51678a60daac117cec90ed48d5fb3fa6 Mon Sep 17 00:00:00 2001 +From 3af824cbff508603882029571b0799fa61c6526f Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 13:14:19 +1100 -Subject: [PATCH 29/42] odbc32: Forward SQLExecute request onto driver +Subject: [PATCH] odbc32: Forward SQLExecute request onto driver --- dlls/odbc32/proxyodbc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 5a03ea3d757..846b788b76b 100644 +index de63be77ce2..6dd8f9ac0fb 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -743,10 +743,23 @@ SQLRETURN WINAPI SQLExecute(SQLHSTMT StatementHandle) +@@ -735,10 +735,23 @@ SQLRETURN WINAPI SQLExecute(SQLHSTMT StatementHandle) */ SQLRETURN WINAPI SQLFetch(SQLHSTMT StatementHandle) { @@ -37,5 +37,5 @@ index 5a03ea3d757..846b788b76b 100644 } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0030-odbc32-Forward-SQLGetDiagField-W-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0031-odbc32-Forward-SQLGetDiagField-W-request-onto-driver.patch similarity index 92% rename from patches/odbc-remove-unixodbc/0030-odbc32-Forward-SQLGetDiagField-W-request-onto-driver.patch rename to patches/odbc-remove-unixodbc/0031-odbc32-Forward-SQLGetDiagField-W-request-onto-driver.patch index 4259b1cc..2d267949 100644 --- a/patches/odbc-remove-unixodbc/0030-odbc32-Forward-SQLGetDiagField-W-request-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0031-odbc32-Forward-SQLGetDiagField-W-request-onto-driver.patch @@ -1,4 +1,4 @@ -From a760ceac67ab2ba73b7a5245793a9b720da3ec49 Mon Sep 17 00:00:00 2001 +From 3c2a0b102b6525589dfc58a481a9b769f2d40c57 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 13:15:48 +1100 Subject: [PATCH] odbc32: Forward SQLGetDiagField/W request onto driver @@ -8,10 +8,10 @@ Subject: [PATCH] odbc32: Forward SQLGetDiagField/W request onto driver 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 407da1e4c1a..cc907f4fc2e 100644 +index 6dd8f9ac0fb..ac30e8aed81 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -958,9 +958,31 @@ SQLRETURN WINAPI SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSM +@@ -959,9 +959,31 @@ SQLRETURN WINAPI SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSM { SQLRETURN ret = SQL_NO_DATA; @@ -44,7 +44,7 @@ index 407da1e4c1a..cc907f4fc2e 100644 return ret; } -@@ -2166,9 +2188,31 @@ SQLRETURN WINAPI SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLS +@@ -2167,9 +2189,31 @@ SQLRETURN WINAPI SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLS { SQLRETURN ret = SQL_NO_DATA; diff --git a/patches/odbc-remove-unixodbc/0031-odbc32-SQLGetStmtAttr-store-some-driver-HDESC-values.patch b/patches/odbc-remove-unixodbc/0032-odbc32-SQLGetStmtAttr-store-some-driver-HDESC-values.patch similarity index 94% rename from patches/odbc-remove-unixodbc/0031-odbc32-SQLGetStmtAttr-store-some-driver-HDESC-values.patch rename to patches/odbc-remove-unixodbc/0032-odbc32-SQLGetStmtAttr-store-some-driver-HDESC-values.patch index 9232c947..0e9137ef 100644 --- a/patches/odbc-remove-unixodbc/0031-odbc32-SQLGetStmtAttr-store-some-driver-HDESC-values.patch +++ b/patches/odbc-remove-unixodbc/0032-odbc32-SQLGetStmtAttr-store-some-driver-HDESC-values.patch @@ -1,17 +1,17 @@ -From a3e0c12cbbdc7a8a81b5d7278659104d6b4d325a Mon Sep 17 00:00:00 2001 +From 9da2063aee1a4ffc92b76e204392bad4fcb63431 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 14:00:41 +1100 -Subject: [PATCH 31/42] odbc32: SQLGetStmtAttr store some driver HDESC values +Subject: [PATCH] odbc32: SQLGetStmtAttr store some driver HDESC values --- dlls/odbc32/proxyodbc.c | 81 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 78 insertions(+), 3 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 74e5d70cfef..27e4f1a4baa 100644 +index ac30e8aed81..62f8fdc40a5 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -178,11 +178,22 @@ struct SQLHDBC_data +@@ -174,11 +174,22 @@ struct SQLHDBC_data SQLUINTEGER login_timeout; }; @@ -34,7 +34,7 @@ index 74e5d70cfef..27e4f1a4baa 100644 }; static void connection_bind_sql_funcs(struct SQLHDBC_data *connection) -@@ -1130,8 +1141,40 @@ SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, +@@ -1127,8 +1138,40 @@ SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, if (statement->connection->pSQLGetStmtAttr) { @@ -76,7 +76,7 @@ index 74e5d70cfef..27e4f1a4baa 100644 } TRACE("ret %d\n", ret); -@@ -2221,8 +2264,40 @@ SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, +@@ -2259,8 +2302,40 @@ SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, if (statement->connection->pSQLGetStmtAttrW) { @@ -120,5 +120,5 @@ index 74e5d70cfef..27e4f1a4baa 100644 TRACE("ret %d\n", ret); -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0032-odbc32-Forward-SQLSetDescFieldW-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0033-odbc32-Forward-SQLSetDescFieldW-request-onto-driver.patch similarity index 86% rename from patches/odbc-remove-unixodbc/0032-odbc32-Forward-SQLSetDescFieldW-request-onto-driver.patch rename to patches/odbc-remove-unixodbc/0033-odbc32-Forward-SQLSetDescFieldW-request-onto-driver.patch index 22baffc0..4ff00d8e 100644 --- a/patches/odbc-remove-unixodbc/0032-odbc32-Forward-SQLSetDescFieldW-request-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0033-odbc32-Forward-SQLSetDescFieldW-request-onto-driver.patch @@ -1,4 +1,4 @@ -From 9023d5ee59640a56a4015db678e9630e32d168b6 Mon Sep 17 00:00:00 2001 +From 2a12908474e8cbd6c032d0af426f66b0c3ac2f7f Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 14:11:44 +1100 Subject: [PATCH] odbc32: Forward SQLSetDescFieldW request onto driver @@ -8,10 +8,10 @@ Subject: [PATCH] odbc32: Forward SQLSetDescFieldW request onto driver 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index d06683f1852..4ea07470b05 100644 +index 62f8fdc40a5..f7032a66ca6 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -2185,6 +2185,7 @@ SQLRETURN WINAPI SQLGetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribu +@@ -2186,6 +2186,7 @@ SQLRETURN WINAPI SQLGetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribu { ret = connection->pSQLGetConnectOptionW(connection->driver_hdbc, Attribute, Value); } @@ -19,7 +19,7 @@ index d06683f1852..4ea07470b05 100644 TRACE("ret %d\n", ret); -@@ -2852,11 +2853,17 @@ SQLRETURN WINAPI SQLDriversW(SQLHENV EnvironmentHandle, SQLUSMALLINT fDirection, +@@ -2860,11 +2861,17 @@ SQLRETURN WINAPI SQLDriversW(SQLHENV EnvironmentHandle, SQLUSMALLINT fDirection, SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength) { diff --git a/patches/odbc-remove-unixodbc/0033-odbc32-Forward-SQLGetData-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0034-odbc32-Forward-SQLGetData-request-onto-driver.patch similarity index 97% rename from patches/odbc-remove-unixodbc/0033-odbc32-Forward-SQLGetData-request-onto-driver.patch rename to patches/odbc-remove-unixodbc/0034-odbc32-Forward-SQLGetData-request-onto-driver.patch index aa962dc1..ce92f73d 100644 --- a/patches/odbc-remove-unixodbc/0033-odbc32-Forward-SQLGetData-request-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0034-odbc32-Forward-SQLGetData-request-onto-driver.patch @@ -1,4 +1,4 @@ -From 204e31dd1d93a967f57b35678e196c3271b2cd49 Mon Sep 17 00:00:00 2001 +From cd89d8e94f385756bc6c5505c44401cf2e69abb1 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 15:13:09 +1100 Subject: [PATCH] odbc32: Forward SQLGetData request onto driver diff --git a/patches/odbc-remove-unixodbc/0034-odbc32-Forward-SQLGetTypeInfo-W-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0035-odbc32-Forward-SQLGetTypeInfo-W-request-onto-driver.patch similarity index 85% rename from patches/odbc-remove-unixodbc/0034-odbc32-Forward-SQLGetTypeInfo-W-request-onto-driver.patch rename to patches/odbc-remove-unixodbc/0035-odbc32-Forward-SQLGetTypeInfo-W-request-onto-driver.patch index c7709c0d..222a22cf 100644 --- a/patches/odbc-remove-unixodbc/0034-odbc32-Forward-SQLGetTypeInfo-W-request-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0035-odbc32-Forward-SQLGetTypeInfo-W-request-onto-driver.patch @@ -1,17 +1,17 @@ -From edf0a873027a3b95e1bf84750efbb29939aee60e Mon Sep 17 00:00:00 2001 +From d84771b086426a52b39dff76e07530eda7096072 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 15:23:30 +1100 -Subject: [PATCH 34/42] odbc32: Forward SQLGetTypeInfo/W request onto driver +Subject: [PATCH] odbc32: Forward SQLGetTypeInfo/W request onto driver --- dlls/odbc32/proxyodbc.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 4e98c8c7caa..7f8cc57e968 100644 +index c8e715bdd67..fd8e78f451b 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -1212,10 +1212,23 @@ SQLRETURN WINAPI SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, +@@ -1219,10 +1219,23 @@ SQLRETURN WINAPI SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, */ SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) { @@ -36,7 +36,7 @@ index 4e98c8c7caa..7f8cc57e968 100644 return ret; } -@@ -2540,10 +2553,23 @@ SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQ +@@ -2620,10 +2633,23 @@ SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQ */ SQLRETURN WINAPI SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType) { @@ -62,5 +62,5 @@ index 4e98c8c7caa..7f8cc57e968 100644 } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0035-odbc32-Forward-SQLBindParameter-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0036-odbc32-Forward-SQLBindParameter-request-onto-driver.patch similarity index 93% rename from patches/odbc-remove-unixodbc/0035-odbc32-Forward-SQLBindParameter-request-onto-driver.patch rename to patches/odbc-remove-unixodbc/0036-odbc32-Forward-SQLBindParameter-request-onto-driver.patch index 8d42bd19..449b0741 100644 --- a/patches/odbc-remove-unixodbc/0035-odbc32-Forward-SQLBindParameter-request-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0036-odbc32-Forward-SQLBindParameter-request-onto-driver.patch @@ -1,4 +1,4 @@ -From b6d2054d5cd0787c18631e520594e9442c76781d Mon Sep 17 00:00:00 2001 +From dc9fe6444cb0c42d70cf78032cdb4808fed5eb68 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 15:40:24 +1100 Subject: [PATCH] odbc32: Forward SQLBindParameter request onto driver @@ -8,10 +8,10 @@ Subject: [PATCH] odbc32: Forward SQLBindParameter request onto driver 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 40128395b32..4d2f472740c 100644 +index fd8e78f451b..f2ece198084 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -1893,12 +1893,47 @@ SQLRETURN WINAPI SQLBindParameter(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT +@@ -1942,12 +1942,47 @@ SQLRETURN WINAPI SQLBindParameter(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT SQLSMALLINT ibScale, SQLPOINTER rgbValue, SQLLEN cbValueMax, SQLLEN *pcbValue) { diff --git a/patches/odbc-remove-unixodbc/0036-odbc32-Forward-SQLTransact-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0037-odbc32-Forward-SQLTransact-request-onto-driver.patch similarity index 83% rename from patches/odbc-remove-unixodbc/0036-odbc32-Forward-SQLTransact-request-onto-driver.patch rename to patches/odbc-remove-unixodbc/0037-odbc32-Forward-SQLTransact-request-onto-driver.patch index e6c79a3b..66e88ea8 100644 --- a/patches/odbc-remove-unixodbc/0036-odbc32-Forward-SQLTransact-request-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0037-odbc32-Forward-SQLTransact-request-onto-driver.patch @@ -1,17 +1,17 @@ -From 0930c5f0fe4e4608957cc5c16c2d8e63d805d5e4 Mon Sep 17 00:00:00 2001 +From 931936f51db30da1b5d0583a9be3231b0f7678f0 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 6 Feb 2023 16:03:58 +1100 -Subject: [PATCH 36/42] odbc32: Forward SQLTransact request onto driver +Subject: [PATCH] odbc32: Forward SQLTransact request onto driver --- dlls/odbc32/proxyodbc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index f73daad254f..c73912b38cf 100644 +index f2ece198084..e78b51d7486 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -1550,11 +1550,24 @@ SQLRETURN WINAPI SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSM +@@ -1591,11 +1591,24 @@ SQLRETURN WINAPI SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSM */ SQLRETURN WINAPI SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType) { @@ -38,5 +38,5 @@ index f73daad254f..c73912b38cf 100644 } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0037-odbc32-Forward-SQLGetDiagRecW-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0038-odbc32-Forward-SQLGetDiagRecW-request-onto-driver.patch similarity index 93% rename from patches/odbc-remove-unixodbc/0037-odbc32-Forward-SQLGetDiagRecW-request-onto-driver.patch rename to patches/odbc-remove-unixodbc/0038-odbc32-Forward-SQLGetDiagRecW-request-onto-driver.patch index de113301..8e059ae7 100644 --- a/patches/odbc-remove-unixodbc/0037-odbc32-Forward-SQLGetDiagRecW-request-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0038-odbc32-Forward-SQLGetDiagRecW-request-onto-driver.patch @@ -1,4 +1,4 @@ -From 76850074a3e3f4a1de4503eb81748af85e4bdd13 Mon Sep 17 00:00:00 2001 +From 76ed07ea89b4375d721fb993e04b4c99b3592996 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Tue, 7 Feb 2023 14:18:20 +1100 Subject: [PATCH] odbc32: Forward SQLGetDiagRecW request onto driver @@ -8,10 +8,10 @@ Subject: [PATCH] odbc32: Forward SQLGetDiagRecW request onto driver 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index a5a3c0186eb..692324a93a3 100644 +index e78b51d7486..b8c2eb43055 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -2280,10 +2280,50 @@ SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMA +@@ -2355,10 +2355,50 @@ SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMA { SQLRETURN ret = SQL_ERROR; diff --git a/patches/odbc-remove-unixodbc/0038-odbc32-SQLGetEnvAttr-Support-SQL_ATTR_ODBC_VERSION-a.patch b/patches/odbc-remove-unixodbc/0039-odbc32-SQLGetEnvAttr-Support-SQL_ATTR_ODBC_VERSION-a.patch similarity index 80% rename from patches/odbc-remove-unixodbc/0038-odbc32-SQLGetEnvAttr-Support-SQL_ATTR_ODBC_VERSION-a.patch rename to patches/odbc-remove-unixodbc/0039-odbc32-SQLGetEnvAttr-Support-SQL_ATTR_ODBC_VERSION-a.patch index 085d2407..1aa2d777 100644 --- a/patches/odbc-remove-unixodbc/0038-odbc32-SQLGetEnvAttr-Support-SQL_ATTR_ODBC_VERSION-a.patch +++ b/patches/odbc-remove-unixodbc/0039-odbc32-SQLGetEnvAttr-Support-SQL_ATTR_ODBC_VERSION-a.patch @@ -1,7 +1,7 @@ -From 99696a933b6393903df0aa314190a220cea635ac Mon Sep 17 00:00:00 2001 +From 14e00b2574f64b47ee25028cc59476949db6cf84 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 8 Feb 2023 08:39:26 +1100 -Subject: [PATCH 38/42] odbc32: SQLGetEnvAttr: Support SQL_ATTR_ODBC_VERSION +Subject: [PATCH] odbc32: SQLGetEnvAttr: Support SQL_ATTR_ODBC_VERSION attribute --- @@ -9,7 +9,7 @@ Subject: [PATCH 38/42] odbc32: SQLGetEnvAttr: Support SQL_ATTR_ODBC_VERSION 1 file changed, 16 insertions(+) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index bdd8361d221..46872add8b0 100644 +index b8c2eb43055..cf3455c45b4 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -47,6 +47,7 @@ struct SQLHENV_data @@ -20,7 +20,7 @@ index bdd8361d221..46872add8b0 100644 }; struct SQLHDBC_data -@@ -368,6 +369,7 @@ SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle) +@@ -359,6 +360,7 @@ SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle) henv->type = SQL_HANDLE_ENV; henv->pooling = SQL_CP_OFF; @@ -28,7 +28,7 @@ index bdd8361d221..46872add8b0 100644 *EnvironmentHandle = henv; -@@ -1067,6 +1069,14 @@ SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, +@@ -1074,6 +1076,14 @@ SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, } *(SQLUINTEGER*)Value = data->pooling; break; @@ -43,7 +43,7 @@ index bdd8361d221..46872add8b0 100644 default: FIXME("Unhandle attribute %d\n", Attribute); return SQL_ERROR; -@@ -1426,6 +1436,12 @@ SQLRETURN WINAPI SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, +@@ -1463,6 +1473,12 @@ SQLRETURN WINAPI SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, else data->pooling = SQL_CP_OFF; break; @@ -57,5 +57,5 @@ index bdd8361d221..46872add8b0 100644 FIXME("Unhandle attribute %d\n", Attribute); return SQL_ERROR; -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0039-odbc32-Pass-ODBC-version-when-creating-driver-enviro.patch b/patches/odbc-remove-unixodbc/0040-odbc32-Pass-ODBC-version-when-creating-driver-enviro.patch similarity index 76% rename from patches/odbc-remove-unixodbc/0039-odbc32-Pass-ODBC-version-when-creating-driver-enviro.patch rename to patches/odbc-remove-unixodbc/0040-odbc32-Pass-ODBC-version-when-creating-driver-enviro.patch index 7a89bb0b..dc544a24 100644 --- a/patches/odbc-remove-unixodbc/0039-odbc32-Pass-ODBC-version-when-creating-driver-enviro.patch +++ b/patches/odbc-remove-unixodbc/0040-odbc32-Pass-ODBC-version-when-creating-driver-enviro.patch @@ -1,14 +1,17 @@ -From b05ebe79d74d84c7354cecb3072812697839a61f Mon Sep 17 00:00:00 2001 +From 014cadef9d41657c315f140daa0cbed19d43f02a Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 8 Feb 2023 09:03:40 +1100 -Subject: odbc32: Pass ODBC version when creating driver environment +Subject: [PATCH] odbc32: Pass ODBC version when creating driver environment +--- + dlls/odbc32/proxyodbc.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index d590a5af0fe..389148b625a 100644 +index cf3455c45b4..6e02d37548c 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -2644,11 +2644,15 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl +@@ -2654,11 +2654,15 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl if (connection->pSQLAllocHandle) { connection->pSQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &connection->driver_env); @@ -25,3 +28,6 @@ index d590a5af0fe..389148b625a 100644 } /* ODBC 2.x */ else if(connection->pSQLAllocConnect && connection->pSQLAllocEnv) +-- +2.43.0 + diff --git a/patches/odbc-remove-unixodbc/0040-odbc32-SQLBindCol-convert-to-ODBC2-types-if-required.patch b/patches/odbc-remove-unixodbc/0041-odbc32-SQLBindCol-convert-to-ODBC2-types-if-required.patch similarity index 82% rename from patches/odbc-remove-unixodbc/0040-odbc32-SQLBindCol-convert-to-ODBC2-types-if-required.patch rename to patches/odbc-remove-unixodbc/0041-odbc32-SQLBindCol-convert-to-ODBC2-types-if-required.patch index 496fbe19..d0cf7387 100644 --- a/patches/odbc-remove-unixodbc/0040-odbc32-SQLBindCol-convert-to-ODBC2-types-if-required.patch +++ b/patches/odbc-remove-unixodbc/0041-odbc32-SQLBindCol-convert-to-ODBC2-types-if-required.patch @@ -1,17 +1,17 @@ -From e73aae5f26b1af29ce14f3edaa84569bd3c86bc4 Mon Sep 17 00:00:00 2001 +From c9f90dfeff20eb7faa55bdc00add8f4d18fbb1b5 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 8 Feb 2023 14:16:24 +1100 -Subject: [PATCH 40/42] odbc32: SQLBindCol convert to ODBC2 types if required +Subject: [PATCH] odbc32: SQLBindCol convert to ODBC2 types if required --- dlls/odbc32/proxyodbc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 851d2535ca1..c6d19b58e1c 100644 +index 6e02d37548c..d760481fa9b 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -474,6 +474,20 @@ SQLRETURN WINAPI SQLBindCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, +@@ -465,6 +465,20 @@ SQLRETURN WINAPI SQLBindCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, if (statement->connection->pSQLBindCol) { @@ -33,5 +33,5 @@ index 851d2535ca1..c6d19b58e1c 100644 TargetValue, BufferLength, StrLen_or_Ind); } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0041-odbc32-Implement-SQLAllocHandle.patch b/patches/odbc-remove-unixodbc/0042-odbc32-Implement-SQLAllocHandle.patch similarity index 81% rename from patches/odbc-remove-unixodbc/0041-odbc32-Implement-SQLAllocHandle.patch rename to patches/odbc-remove-unixodbc/0042-odbc32-Implement-SQLAllocHandle.patch index 11e48a74..c137b700 100644 --- a/patches/odbc-remove-unixodbc/0041-odbc32-Implement-SQLAllocHandle.patch +++ b/patches/odbc-remove-unixodbc/0042-odbc32-Implement-SQLAllocHandle.patch @@ -1,17 +1,17 @@ -From dca052a02225fb151237d0ba36dbf35d3fdab4fe Mon Sep 17 00:00:00 2001 +From 0a67d651b40335e9b8ee09e47c8f54845101c6f7 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 8 Feb 2023 15:22:00 +1100 -Subject: [PATCH 41/42] odbc32: Implement SQLAllocHandle +Subject: [PATCH] odbc32: Implement SQLAllocHandle --- dlls/odbc32/proxyodbc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index c6d19b58e1c..15171a0d028 100644 +index d760481fa9b..879808add00 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -383,9 +383,22 @@ SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, S +@@ -374,9 +374,22 @@ SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, S { SQLRETURN ret = SQL_ERROR; @@ -36,5 +36,5 @@ index c6d19b58e1c..15171a0d028 100644 } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0042-odbc32-Forward-SQLConnectW-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0043-odbc32-Forward-SQLConnectW-request-onto-driver.patch similarity index 88% rename from patches/odbc-remove-unixodbc/0042-odbc32-Forward-SQLConnectW-request-onto-driver.patch rename to patches/odbc-remove-unixodbc/0043-odbc32-Forward-SQLConnectW-request-onto-driver.patch index 72de211c..f45d81ae 100644 --- a/patches/odbc-remove-unixodbc/0042-odbc32-Forward-SQLConnectW-request-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0043-odbc32-Forward-SQLConnectW-request-onto-driver.patch @@ -1,17 +1,17 @@ -From ec35258befb2b050e2cd2087dc6ea9ea66155403 Mon Sep 17 00:00:00 2001 +From bbad2699c06c230f2fddecfc4a8159b763e6d233 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 8 Feb 2023 15:34:18 +1100 -Subject: [PATCH 42/42] odbc32: Forward SQLConnectW request onto driver +Subject: [PATCH] odbc32: Forward SQLConnectW request onto driver --- dlls/odbc32/proxyodbc.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 15171a0d028..6f6d502e772 100644 +index 879808add00..89ebf0e5141 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -2069,12 +2069,28 @@ SQLRETURN WINAPI SQLConnectW(SQLHDBC ConnectionHandle, WCHAR *ServerName, SQLSMA +@@ -2131,12 +2131,28 @@ SQLRETURN WINAPI SQLConnectW(SQLHDBC ConnectionHandle, WCHAR *ServerName, SQLSMA WCHAR *UserName, SQLSMALLINT NameLength2, WCHAR *Authentication, SQLSMALLINT NameLength3) { @@ -44,5 +44,5 @@ index 15171a0d028..6f6d502e772 100644 } -- -2.39.1 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0043-odbc32-Forward-SQLColAttribute-W-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0044-odbc32-Forward-SQLColAttribute-W-request-onto-driver.patch similarity index 96% rename from patches/odbc-remove-unixodbc/0043-odbc32-Forward-SQLColAttribute-W-request-onto-driver.patch rename to patches/odbc-remove-unixodbc/0044-odbc32-Forward-SQLColAttribute-W-request-onto-driver.patch index c2d766db..1c72aef9 100644 --- a/patches/odbc-remove-unixodbc/0043-odbc32-Forward-SQLColAttribute-W-request-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0044-odbc32-Forward-SQLColAttribute-W-request-onto-driver.patch @@ -1,4 +1,4 @@ -From d3bfdb5fc584ae6a2bab70056f0cad11e4b741cd Mon Sep 17 00:00:00 2001 +From 46c661c38a41172cd11430bfa266f7e0cddf1f8d Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 8 Feb 2023 20:19:44 +1100 Subject: [PATCH] odbc32: Forward SQLColAttribute/W request onto driver @@ -8,7 +8,7 @@ Subject: [PATCH] odbc32: Forward SQLColAttribute/W request onto driver 1 file changed, 102 insertions(+), 17 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 3eca2ce9999..25e8249f8fc 100644 +index 89ebf0e5141..409bc428230 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -314,6 +314,36 @@ static void connection_bind_sql_funcs(struct SQLHDBC_data *connection) @@ -97,7 +97,7 @@ index 3eca2ce9999..25e8249f8fc 100644 return ret; } -@@ -2063,21 +2128,6 @@ SQLRETURN WINAPI SQLSetScrollOptions(SQLHSTMT statement_handle, SQLUSMALLINT f_c +@@ -2073,21 +2138,6 @@ SQLRETURN WINAPI SQLSetScrollOptions(SQLHSTMT statement_handle, SQLUSMALLINT f_c return ret; } @@ -119,7 +119,7 @@ index 3eca2ce9999..25e8249f8fc 100644 /************************************************************************* * SQLColAttributesW [ODBC32.106] */ -@@ -2284,12 +2334,47 @@ SQLRETURN WINAPI SQLColAttributeW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnN +@@ -2294,12 +2344,47 @@ SQLRETURN WINAPI SQLColAttributeW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnN SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLLEN *NumericAttribute) { diff --git a/patches/odbc-remove-unixodbc/0044-odbc32-Forward-SQLGetDiagRec-request-to-driver.patch b/patches/odbc-remove-unixodbc/0045-odbc32-Forward-SQLGetDiagRec-request-to-driver.patch similarity index 93% rename from patches/odbc-remove-unixodbc/0044-odbc32-Forward-SQLGetDiagRec-request-to-driver.patch rename to patches/odbc-remove-unixodbc/0045-odbc32-Forward-SQLGetDiagRec-request-to-driver.patch index 1fca7f14..675979de 100644 --- a/patches/odbc-remove-unixodbc/0044-odbc32-Forward-SQLGetDiagRec-request-to-driver.patch +++ b/patches/odbc-remove-unixodbc/0045-odbc32-Forward-SQLGetDiagRec-request-to-driver.patch @@ -1,4 +1,4 @@ -From 2d319fb624bf217beded8f6e40b942331ea7670d Mon Sep 17 00:00:00 2001 +From 8e284b4208c85a42e4aa1723876aaba208cea3d3 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 8 Feb 2023 21:03:47 +1100 Subject: [PATCH] odbc32: Forward SQLGetDiagRec request to driver @@ -8,10 +8,10 @@ Subject: [PATCH] odbc32: Forward SQLGetDiagRec request to driver 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 5389579d3ae..ab843b9ecb9 100644 +index 409bc428230..25e9d5651cd 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -3147,9 +3147,41 @@ SQLRETURN WINAPI SQLGetDiagRecA(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMA +@@ -3201,9 +3201,41 @@ SQLRETURN WINAPI SQLGetDiagRecA(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMA { SQLRETURN ret = SQL_ERROR; diff --git a/patches/odbc-remove-unixodbc/0045-odbc32-Forward-SQLPrimaryKeysW-request-to-driver.patch b/patches/odbc-remove-unixodbc/0046-odbc32-Forward-SQLPrimaryKeysW-request-to-driver.patch similarity index 90% rename from patches/odbc-remove-unixodbc/0045-odbc32-Forward-SQLPrimaryKeysW-request-to-driver.patch rename to patches/odbc-remove-unixodbc/0046-odbc32-Forward-SQLPrimaryKeysW-request-to-driver.patch index 32b474db..b4aa01ce 100644 --- a/patches/odbc-remove-unixodbc/0045-odbc32-Forward-SQLPrimaryKeysW-request-to-driver.patch +++ b/patches/odbc-remove-unixodbc/0046-odbc32-Forward-SQLPrimaryKeysW-request-to-driver.patch @@ -1,4 +1,4 @@ -From ef625c118f33b0056161d72e8caabe9dc76fca31 Mon Sep 17 00:00:00 2001 +From 0bf2bde719089038889e6001991eaacc93718daa Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 4 Oct 2023 15:09:56 +1100 Subject: [PATCH] odbc32: Forward SQLPrimaryKeysW request to driver. @@ -8,10 +8,10 @@ Subject: [PATCH] odbc32: Forward SQLPrimaryKeysW request to driver. 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index f4798febbf1..5ee63893e06 100644 +index 25e9d5651cd..b3e4ebfe450 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -2927,14 +2927,28 @@ SQLRETURN WINAPI SQLPrimaryKeysW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMA +@@ -3062,14 +3062,28 @@ SQLRETURN WINAPI SQLPrimaryKeysW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMA SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, SQLSMALLINT cbTableName) { @@ -42,5 +42,5 @@ index f4798febbf1..5ee63893e06 100644 } -- -2.42.0 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0046-odbc32-Forward-SQLStatisticsW-request-to-driver.patch b/patches/odbc-remove-unixodbc/0047-odbc32-Forward-SQLStatisticsW-request-to-driver.patch similarity index 90% rename from patches/odbc-remove-unixodbc/0046-odbc32-Forward-SQLStatisticsW-request-to-driver.patch rename to patches/odbc-remove-unixodbc/0047-odbc32-Forward-SQLStatisticsW-request-to-driver.patch index cb0870b5..116d7f9a 100644 --- a/patches/odbc-remove-unixodbc/0046-odbc32-Forward-SQLStatisticsW-request-to-driver.patch +++ b/patches/odbc-remove-unixodbc/0047-odbc32-Forward-SQLStatisticsW-request-to-driver.patch @@ -1,4 +1,4 @@ -From 851b22050c35cc6a94bd2d19f509b5402f9cacd1 Mon Sep 17 00:00:00 2001 +From 4d2d26b889f8ce32d774df667625401eceb9b694 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 4 Oct 2023 15:30:49 +1100 Subject: [PATCH] odbc32: Forward SQLStatisticsW request to driver. @@ -8,10 +8,10 @@ Subject: [PATCH] odbc32: Forward SQLStatisticsW request to driver. 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 5ee63893e06..32d061411e5 100644 +index b3e4ebfe450..35ddd14e49f 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -2791,13 +2791,30 @@ SQLRETURN WINAPI SQLStatisticsW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, +@@ -2926,13 +2926,30 @@ SQLRETURN WINAPI SQLStatisticsW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved) { @@ -44,5 +44,5 @@ index 5ee63893e06..32d061411e5 100644 } -- -2.42.0 +2.43.0 diff --git a/patches/odbc-remove-unixodbc/0047-odbc32-Forward-SQLError-W-onto-driver.patch b/patches/odbc-remove-unixodbc/0048-odbc32-Forward-SQLError-W-onto-driver.patch similarity index 91% rename from patches/odbc-remove-unixodbc/0047-odbc32-Forward-SQLError-W-onto-driver.patch rename to patches/odbc-remove-unixodbc/0048-odbc32-Forward-SQLError-W-onto-driver.patch index c3204a80..5875b67d 100644 --- a/patches/odbc-remove-unixodbc/0047-odbc32-Forward-SQLError-W-onto-driver.patch +++ b/patches/odbc-remove-unixodbc/0048-odbc32-Forward-SQLError-W-onto-driver.patch @@ -1,4 +1,4 @@ -From 0ea6cb924d626265873019518672111b7c0fb963 Mon Sep 17 00:00:00 2001 +From d417f9fe271eb9b84e0afb9fd1a9c3950f1fb9b0 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 10 Jun 2024 08:40:09 +1000 Subject: [PATCH] odbc32: Forward SQLError/W onto driver @@ -8,10 +8,10 @@ Subject: [PATCH] odbc32: Forward SQLError/W onto driver 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 89aaf1e8417..19027fdb83e 100644 +index 35ddd14e49f..ce2a74310bb 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -735,12 +735,20 @@ SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, S +@@ -787,12 +787,20 @@ SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, S SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText, SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) { @@ -33,7 +33,7 @@ index 89aaf1e8417..19027fdb83e 100644 return ret; } -@@ -2240,12 +2248,20 @@ SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, +@@ -2246,12 +2254,20 @@ SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, WCHAR *Sqlstate, SQLINTEGER *NativeError, WCHAR *MessageText, SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) { diff --git a/patches/odbc-remove-unixodbc/0048-odbc32-Implement-SQLFreeHandle.patch b/patches/odbc-remove-unixodbc/0049-odbc32-Implement-SQLFreeHandle.patch similarity index 96% rename from patches/odbc-remove-unixodbc/0048-odbc32-Implement-SQLFreeHandle.patch rename to patches/odbc-remove-unixodbc/0049-odbc32-Implement-SQLFreeHandle.patch index eca4f92f..cb56bd6a 100644 --- a/patches/odbc-remove-unixodbc/0048-odbc32-Implement-SQLFreeHandle.patch +++ b/patches/odbc-remove-unixodbc/0049-odbc32-Implement-SQLFreeHandle.patch @@ -1,4 +1,4 @@ -From f7460292e7db5cc684ab8a59d90b7bd30a0ddf02 Mon Sep 17 00:00:00 2001 +From 506812cfd989ab515dd0c0fd11bc64dc4cdcdae7 Mon Sep 17 00:00:00 2001 From: Steve Fawcett Date: Wed, 12 Jun 2024 09:27:31 +1000 Subject: [PATCH] odbc32: Implement SQLFreeHandle