From d8260944bed4eacedfc0db81d16bb3a8be55023e Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 15 May 2024 08:24:14 +1000 Subject: [PATCH] Rebase against 6a31983779479b42e0c2e5320a1dfa962767c28e. --- .../0001-odbc32-Remove-unixODBC-support.patch | 7272 +++++++++++++---- .../0004-odbc32-Add-initial-tests.patch | 220 +- ...e-generic-hardware-in-HKEY_DYN_DATA-.patch | 12 +- staging/upstream-commit | 2 +- 4 files changed, 5551 insertions(+), 1955 deletions(-) diff --git a/patches/odbc-remove-unixodbc/0001-odbc32-Remove-unixODBC-support.patch b/patches/odbc-remove-unixodbc/0001-odbc32-Remove-unixODBC-support.patch index 244a3866..90d74da6 100644 --- a/patches/odbc-remove-unixodbc/0001-odbc32-Remove-unixODBC-support.patch +++ b/patches/odbc-remove-unixodbc/0001-odbc32-Remove-unixODBC-support.patch @@ -1,38 +1,49 @@ -From ee5b1fc178c80194f3a104800e9f8a361cacb2ff Mon Sep 17 00:00:00 2001 +From f7f5c6d628fe1daf849b97f28cfe2c536cb6081e 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 | 3 - - dlls/odbc32/Makefile.in | 3 +- - dlls/odbc32/proxyodbc.c | 1326 ++++++---------------------------- - dlls/odbc32/unixlib.c | 1501 --------------------------------------- - dlls/odbc32/unixlib.h | 278 -------- - include/config.h.in | 3 - - 6 files changed, 237 insertions(+), 2877 deletions(-) + configure.ac | 10 - + dlls/odbc32/Makefile.in | 5 +- + dlls/odbc32/proxyodbc.c | 1970 +++++---------------- + dlls/odbc32/unixlib.c | 3673 --------------------------------------- + dlls/odbc32/unixlib.h | 1256 ------------- + 5 files changed, 419 insertions(+), 6495 deletions(-) delete mode 100644 dlls/odbc32/unixlib.c delete mode 100644 dlls/odbc32/unixlib.h diff --git a/configure.ac b/configure.ac -index bcbb3d19c6e..b928eda2b92 100644 +index db3f14bb970..2cca343becc 100644 --- a/configure.ac +++ b/configure.ac -@@ -1813,9 +1813,6 @@ then - AC_SUBST(PROCSTAT_LIBS,"-lprocstat")]) - fi +@@ -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 **** --WINE_CHECK_SONAME(odbc,SQLConnect,,[AC_DEFINE_UNQUOTED(SONAME_LIBODBC,["libodbc.$LIBEXT"])]) +-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 libnetapi **** - if test "x$with_netapi" != "xno" + dnl **** Check for inotify **** + if test "x$with_inotify" != "xno" then diff --git a/dlls/odbc32/Makefile.in b/dlls/odbc32/Makefile.in -index 44962ca4896..65d481facd9 100644 +index 0ec0ae8eaf4..a42f1473d67 100644 --- a/dlls/odbc32/Makefile.in +++ b/dlls/odbc32/Makefile.in -@@ -5,5 +5,4 @@ IMPORTS = advapi32 +@@ -1,10 +1,7 @@ + MODULE = odbc32.dll +-UNIXLIB = odbc32.so + IMPORTLIB = odbc32 + IMPORTS = advapi32 +-UNIX_LIBS = $(ODBC_LIBS) SOURCES = \ proxyodbc.c \ @@ -40,10 +51,10 @@ index 44962ca4896..65d481facd9 100644 - unixlib.c + rsrc.rc diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 679f3d7380e..3927d00673e 100644 +index c1c43ab8641..3927d00673e 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -40,315 +40,19 @@ +@@ -40,36 +40,19 @@ #include "sql.h" #include "sqltypes.h" #include "sqlext.h" @@ -53,337 +64,69 @@ index 679f3d7380e..3927d00673e 100644 -WINE_DECLARE_DEBUG_CHANNEL(winediag); -#define ODBC_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params ) -- --/*********************************************************************** -- * ODBC_ReplicateODBCInstToRegistry -- * -- * PARAMS -- * -- * RETURNS -- * -- * Utility to ODBC_ReplicateToRegistry 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 ODBC_ReplicateODBCInstToRegistry (SQLHENV hEnv) --{ -- HKEY hODBCInst; -- LONG reg_ret; -- BOOL success; -- -- success = FALSE; -- TRACE ("Driver settings are not currently replicated to the registry\n"); -- if ((reg_ret = RegCreateKeyExA (HKEY_LOCAL_MACHINE, -- "Software\\ODBC\\ODBCINST.INI", 0, NULL, -- REG_OPTION_NON_VOLATILE, -- KEY_ALL_ACCESS /* a couple more than we need */, NULL, -- &hODBCInst, NULL)) == ERROR_SUCCESS) -- { -- HKEY hDrivers; -- if ((reg_ret = RegCreateKeyExA (hODBCInst, "ODBC Drivers", 0, -- NULL, REG_OPTION_NON_VOLATILE, -- KEY_ALL_ACCESS /* overkill */, NULL, &hDrivers, NULL)) -- == ERROR_SUCCESS) -- { -- SQLRETURN sql_ret; -- SQLUSMALLINT dirn; -- CHAR desc [256]; -- SQLSMALLINT sizedesc; -- -- success = TRUE; -- dirn = SQL_FETCH_FIRST; -- while ((sql_ret = SQLDrivers (hEnv, dirn, (SQLCHAR*)desc, sizeof(desc), -- &sizedesc, NULL, 0, NULL)) == SQL_SUCCESS || -- sql_ret == SQL_SUCCESS_WITH_INFO) -- { -- /* FIXME Do some proper handling of the SUCCESS_WITH_INFO */ -- dirn = SQL_FETCH_NEXT; -- if (sizedesc == lstrlenA(desc)) -- { -- HKEY hThis; -- if ((reg_ret = RegQueryValueExA (hDrivers, desc, NULL, -- NULL, NULL, NULL)) == ERROR_FILE_NOT_FOUND) -- { -- if ((reg_ret = RegSetValueExA (hDrivers, desc, 0, -- REG_SZ, (const BYTE *)"Installed", 10)) != ERROR_SUCCESS) -- { -- TRACE ("Error %ld replicating driver %s\n", -- reg_ret, desc); -- success = FALSE; -- } -- } -- else if (reg_ret != ERROR_SUCCESS) -- { -- TRACE ("Error %ld checking for %s in drivers\n", -- reg_ret, desc); -- success = FALSE; -- } -- if ((reg_ret = RegCreateKeyExA (hODBCInst, desc, 0, -- NULL, REG_OPTION_NON_VOLATILE, -- KEY_ALL_ACCESS, NULL, &hThis, NULL)) -- == ERROR_SUCCESS) -- { -- /* FIXME This is where the settings go. -- * I suggest that if the disposition says it -- * exists then we leave it alone. Alternatively -- * include an extra value to flag that it is -- * a replication of the unixODBC/iODBC/... -- */ -- if ((reg_ret = RegCloseKey (hThis)) != -- ERROR_SUCCESS) -- TRACE ("Error %ld closing %s key\n", reg_ret, -- desc); -- } -- else -- { -- TRACE ("Error %ld ensuring driver key %s\n", -- reg_ret, desc); -- success = FALSE; -- } -- } -- else -- { -- WARN ("Unusually long driver name %s not replicated\n", -- desc); -- success = FALSE; -- } -- } -- if (sql_ret != SQL_NO_DATA) -- { -- TRACE ("Error %d enumerating drivers\n", (int)sql_ret); -- success = FALSE; -- } -- if ((reg_ret = RegCloseKey (hDrivers)) != ERROR_SUCCESS) -- { -- TRACE ("Error %ld closing hDrivers\n", reg_ret); -- } -- } -- else -- { -- TRACE ("Error %ld opening HKLM\\S\\O\\OI\\Drivers\n", reg_ret); -- } -- if ((reg_ret = RegCloseKey (hODBCInst)) != ERROR_SUCCESS) -- { -- TRACE ("Error %ld closing HKLM\\S\\O\\ODBCINST.INI\n", reg_ret); -- } -- } -- else -- { -- TRACE ("Error %ld opening HKLM\\S\\O\\ODBCINST.INI\n", reg_ret); -- } -- if (!success) -- { -- WARN ("May not have replicated all ODBC drivers to the registry\n"); -- } --} -- --/*********************************************************************** -- * ODBC_ReplicateODBCToRegistry -- * -- * PARAMS -- * -- * RETURNS -- * -- * Utility to ODBC_ReplicateToRegistry to replicate either the USER or -- * SYSTEM dsns -- * -- * 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 -- * ODBC_ReplicateODBCInstToRegistry) -- */ --static void ODBC_ReplicateODBCToRegistry (BOOL is_user, SQLHENV hEnv) --{ -- HKEY hODBC; -- LONG reg_ret; -- SQLRETURN sql_ret; -- SQLUSMALLINT dirn; -- CHAR dsn [SQL_MAX_DSN_LENGTH + 1]; -- SQLSMALLINT sizedsn; -- CHAR desc [256]; -- SQLSMALLINT sizedesc; -- BOOL success; -- const char *which = is_user ? "user" : "system"; -- -- success = FALSE; -- if ((reg_ret = RegCreateKeyExA ( -- is_user ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE, -- "Software\\ODBC\\ODBC.INI", 0, NULL, REG_OPTION_NON_VOLATILE, -- KEY_ALL_ACCESS /* a couple more than we need */, NULL, &hODBC, -- NULL)) == ERROR_SUCCESS) -- { -- success = TRUE; -- dirn = is_user ? SQL_FETCH_FIRST_USER : SQL_FETCH_FIRST_SYSTEM; -- while ((sql_ret = SQLDataSources (hEnv, dirn, -- (SQLCHAR*)dsn, sizeof(dsn), &sizedsn, -- (SQLCHAR*)desc, sizeof(desc), &sizedesc)) == SQL_SUCCESS -- || sql_ret == SQL_SUCCESS_WITH_INFO) -- { -- /* FIXME Do some proper handling of the SUCCESS_WITH_INFO */ -- dirn = SQL_FETCH_NEXT; -- if (sizedsn == lstrlenA(dsn) && sizedesc == lstrlenA(desc)) -- { -- HKEY hDSN; -- if ((reg_ret = RegCreateKeyExA (hODBC, dsn, 0, -- NULL, REG_OPTION_NON_VOLATILE, -- KEY_ALL_ACCESS, NULL, &hDSN, NULL)) -- == ERROR_SUCCESS) -- { -- static const char DRIVERKEY[] = "Driver"; -- if ((reg_ret = RegQueryValueExA (hDSN, DRIVERKEY, -- NULL, NULL, NULL, NULL)) -- == ERROR_FILE_NOT_FOUND) -- { -- if ((reg_ret = RegSetValueExA (hDSN, DRIVERKEY, 0, -- REG_SZ, (LPBYTE)desc, sizedesc)) != ERROR_SUCCESS) -- { -- TRACE ("Error %ld replicating description of " -- "%s(%s)\n", reg_ret, dsn, desc); -- success = FALSE; -- } -- } -- else if (reg_ret != ERROR_SUCCESS) -- { -- TRACE ("Error %ld checking for description of %s\n", -- reg_ret, dsn); -- success = FALSE; -- } -- if ((reg_ret = RegCloseKey (hDSN)) != ERROR_SUCCESS) -- { -- TRACE ("Error %ld closing %s DSN key %s\n", -- reg_ret, which, dsn); -- } -- } -- else -- { -- TRACE ("Error %ld opening %s DSN key %s\n", -- reg_ret, which, dsn); -- success = FALSE; -- } -- } -- else -- { -- WARN ("Unusually long %s data source name %s (%s) not " -- "replicated\n", which, dsn, desc); -- success = FALSE; -- } -- } -- if (sql_ret != SQL_NO_DATA) -- { -- TRACE ("Error %d enumerating %s datasources\n", -- (int)sql_ret, which); -- success = FALSE; -- } -- if ((reg_ret = RegCloseKey (hODBC)) != ERROR_SUCCESS) -- { -- TRACE ("Error %ld closing %s ODBC.INI registry key\n", reg_ret, -- which); -- } -- } -- else -- { -- TRACE ("Error %ld creating/opening %s ODBC.INI registry key\n", -- reg_ret, which); -- } -- if (!success) -- { -- WARN ("May not have replicated all %s ODBC DSNs to the registry\n", -- which); -- } --} -- --/*********************************************************************** -- * ODBC_ReplicateToRegistry -- * -- * PARAMS -- * -- * RETURNS -- * -- * 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 ODBC_ReplicateToRegistry (void) --{ -- SQLRETURN sql_ret; -- SQLHENV hEnv; -- -- if ((sql_ret = SQLAllocEnv(&hEnv)) == SQL_SUCCESS) -- { -- ODBC_ReplicateODBCInstToRegistry (hEnv); -- ODBC_ReplicateODBCToRegistry (FALSE /* system dsns */, hEnv); -- ODBC_ReplicateODBCToRegistry (TRUE /* user dsns */, hEnv); -- -- if ((sql_ret = SQLFreeEnv(hEnv)) != SQL_SUCCESS) -- { -- TRACE ("Error %d freeing the SQL environment.\n", (int)sql_ret); -- } -- } -- else -- { -- TRACE ("Error %d opening an SQL environment.\n", (int)sql_ret); -- WARN ("The external ODBC settings have not been replicated to the" -- " Wine registry\n"); -- } --} /************************************************************************* * SQLAllocConnect [ODBC32.001] */ SQLRETURN WINAPI SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionHandle) { -- struct SQLAllocConnect_params params = { EnvironmentHandle, ConnectionHandle }; +- struct SQLAllocConnect_params params; +- struct handle *con, *env = EnvironmentHandle; - SQLRETURN ret; -- -- TRACE("(EnvironmentHandle %p, ConnectionHandle %p)\n", EnvironmentHandle, ConnectionHandle); + SQLRETURN ret = SQL_ERROR; -+ FIXME("(EnvironmentHandle %p, ConnectionHandle %p)\n", EnvironmentHandle, ConnectionHandle); - *ConnectionHandle = SQL_NULL_HDBC; -- ret = ODBC_CALL( SQLAllocConnect, ¶ms ); +- TRACE("(EnvironmentHandle %p, ConnectionHandle %p)\n", EnvironmentHandle, ConnectionHandle); +- +- *ConnectionHandle = 0; +- if (!(con = calloc( 1, sizeof(*con) ))) 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; } -@@ -357,14 +61,12 @@ SQLRETURN WINAPI SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionH +@@ -78,23 +61,12 @@ SQLRETURN WINAPI SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionH */ SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle) { -- struct SQLAllocEnv_params params = { EnvironmentHandle }; +- struct SQLAllocEnv_params params; +- struct handle *env; - SQLRETURN ret; +- +- TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle); + SQLRETURN ret = SQL_ERROR; -- TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle); +- *EnvironmentHandle = 0; +- if (!(env = calloc( 1, sizeof(*env) ))) return SQL_ERROR; + FIXME("(EnvironmentHandle %p)\n", EnvironmentHandle); - *EnvironmentHandle = SQL_NULL_HENV; -- ret = ODBC_CALL( SQLAllocEnv, ¶ms ); +- 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; } -@@ -373,14 +75,11 @@ SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle) +@@ -103,25 +75,11 @@ SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle) */ SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle) { -- struct SQLAllocHandle_params params = { HandleType, InputHandle, OutputHandle }; +- struct SQLAllocHandle_params params; +- struct handle *output, *input = InputHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -391,33 +134,55 @@ index 679f3d7380e..3927d00673e 100644 + FIXME("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); *OutputHandle = 0; -- ret = ODBC_CALL( SQLAllocHandle, ¶ms ); -- TRACE("Returning %d, Handle %p\n", ret, *OutputHandle); +- if (!(output = calloc( 1, sizeof(*output) ))) 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; } -@@ -389,14 +88,11 @@ SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, S +@@ -130,24 +88,11 @@ SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, S */ SQLRETURN WINAPI SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandle) { -- struct SQLAllocStmt_params params = { ConnectionHandle, 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 = SQL_NULL_HSTMT; -- ret = ODBC_CALL( SQLAllocStmt, ¶ms ); +- *StatementHandle = 0; +- if (!(stmt = calloc( 1, sizeof(*stmt) ))) 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; } -@@ -405,14 +101,11 @@ SQLRETURN WINAPI SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandl +@@ -156,25 +101,11 @@ SQLRETURN WINAPI SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandl */ SQLRETURN WINAPI SQLAllocHandleStd(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle) { -- struct SQLAllocHandleStd_params params = { HandleType, InputHandle, OutputHandle }; +- struct SQLAllocHandleStd_params params; +- struct handle *output, *input = InputHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -425,17 +190,46 @@ index 679f3d7380e..3927d00673e 100644 + FIXME("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); *OutputHandle = 0; -- ret = ODBC_CALL( SQLAllocHandleStd, ¶ms ); +- if (!(output = calloc( 1, sizeof(*output) ))) 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; } -@@ -431,15 +124,11 @@ static const char *debugstr_sqllen( SQLLEN len ) +@@ -187,43 +118,17 @@ static const char *debugstr_sqllen( SQLLEN len ) + #endif + } + +-static BOOL resize_binding( struct param_binding *binding, UINT32 count ) +-{ +- struct param *tmp; +- UINT32 new_count = max( binding->count, count ); +- +- if (!(tmp = realloc( binding->param, new_count * sizeof(*tmp) ))) return FALSE; +- memset( tmp + binding->count, 0, (new_count - binding->count) * sizeof(*tmp) ); +- binding->param = tmp; +- binding->count = new_count; +- 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 = { StatementHandle, ColumnNumber, TargetType, TargetValue, -- BufferLength, 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; @@ -443,17 +237,28 @@ index 679f3d7380e..3927d00673e 100644 + 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); -- ret = ODBC_CALL( SQLBindCol, ¶ms ); +- if (!handle) return SQL_INVALID_HANDLE; +- if (!ColumnNumber) +- { +- FIXME( "column 0 not handled\n" ); +- return SQL_ERROR; +- } +- if (!resize_binding( &handle->bind_col, ColumnNumber )) return SQL_ERROR; +- params.StatementHandle = handle->unix_handle; +- 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; } -@@ -459,16 +148,12 @@ SQLRETURN WINAPI SQLBindParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNu +@@ -243,28 +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 = { StatementHandle, ParameterNumber, ValueType, ParameterType, -- LengthPrecision, ParameterScale, ParameterValue, 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; @@ -462,49 +267,75 @@ index 679f3d7380e..3927d00673e 100644 " ParameterScale %d, ParameterValue %p, StrLen_or_Ind %p)\n", StatementHandle, ParameterNumber, ValueType, ParameterType, debugstr_sqlulen(LengthPrecision), ParameterScale, ParameterValue, StrLen_or_Ind); -- ret = ODBC_CALL( SQLBindParam, ¶ms ); +- if (!handle) return SQL_INVALID_HANDLE; +- if (!ParameterNumber) +- { +- FIXME( "parameter 0 not handled\n" ); +- return SQL_ERROR; +- } +- if (!resize_binding( &handle->bind_param, ParameterNumber )) return SQL_ERROR; +- +- params.StatementHandle = handle->unix_handle; +- params.StrLen_or_Ind = &handle->bind_param.param[i].len; +- if (SUCCESS(( ret = ODBC_CALL( SQLBindParam, ¶ms )))) handle->bind_param.param[i].ptr = StrLen_or_Ind; - TRACE ("Returning %d\n", ret); return ret; } -@@ -477,13 +162,10 @@ SQLRETURN WINAPI SQLBindParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNu +@@ -273,17 +162,10 @@ SQLRETURN WINAPI SQLBindParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNu */ SQLRETURN WINAPI SQLCancel(SQLHSTMT StatementHandle) { -- struct SQLCancel_params params = { 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; } -@@ -492,13 +174,10 @@ SQLRETURN WINAPI SQLCancel(SQLHSTMT StatementHandle) +@@ -292,43 +174,27 @@ SQLRETURN WINAPI SQLCancel(SQLHSTMT StatementHandle) */ SQLRETURN WINAPI SQLCloseCursor(SQLHSTMT StatementHandle) { -- struct SQLCloseCursor_params params = { StatementHandle }; +- struct SQLCloseCursor_params params; +- struct handle *handle = StatementHandle; - SQLRETURN ret; +- +- TRACE("(StatementHandle %p)\n", StatementHandle); + SQLRETURN ret = SQL_ERROR; -- TRACE("(StatementHandle %p)\n", StatementHandle); +- 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; } -@@ -510,16 +189,12 @@ SQLRETURN WINAPI SQLColAttribute(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNu - SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, + /************************************************************************* + * 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 = { StatementHandle, ColumnNumber, FieldIdentifier, -- CharacterAttribute, BufferLength, StringLength, 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; @@ -513,17 +344,22 @@ index 679f3d7380e..3927d00673e 100644 " StringLength %p, NumericAttribute %p)\n", StatementHandle, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength, StringLength, NumericAttribute); -- ret = ODBC_CALL( SQLColAttribute, ¶ms ); +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- params.NumericAttribute = &num_attr; +- if (SUCCESS(( ret = ODBC_CALL( SQLColAttribute, ¶ms )))) *NumericAttribute = num_attr; - TRACE("Returning %d\n", ret); return ret; } -@@ -530,19 +205,15 @@ SQLRETURN WINAPI SQLColumns(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLS +@@ -339,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 = { StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, -- TableName, NameLength3, ColumnName, NameLength4 }; +- struct SQLColumns_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, +- NameLength3, ColumnName, NameLength4 }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -535,17 +371,20 @@ index 679f3d7380e..3927d00673e 100644 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; } -@@ -553,18 +224,14 @@ SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSM +@@ -366,21 +224,14 @@ SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSM SQLCHAR *UserName, SQLSMALLINT NameLength2, SQLCHAR *Authentication, SQLSMALLINT NameLength3) { -- struct SQLConnect_params params = { ConnectionHandle, ServerName, NameLength1, UserName, NameLength2, -- Authentication, NameLength3 }; +- struct SQLConnect_params params = { 0, ServerName, NameLength1, UserName, NameLength2, Authentication, NameLength3 }; +- struct handle *handle = ConnectionHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -556,33 +395,42 @@ index 679f3d7380e..3927d00673e 100644 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; } -@@ -573,13 +240,10 @@ SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSM +@@ -389,18 +240,10 @@ SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSM */ SQLRETURN WINAPI SQLCopyDesc(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle) { -- struct SQLCopyDesc_params params = { SourceDescHandle, TargetDescHandle }; +- struct SQLCopyDesc_params params; +- struct handle *source = SourceDescHandle, *target = TargetDescHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; - TRACE("(SourceDescHandle %p, TargetDescHandle %p)\n", SourceDescHandle, TargetDescHandle); + FIXME("(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; } -@@ -590,25 +254,12 @@ SQLRETURN WINAPI SQLDataSources(SQLHENV EnvironmentHandle, SQLUSMALLINT Directio +@@ -411,28 +254,12 @@ SQLRETURN WINAPI SQLDataSources(SQLHENV EnvironmentHandle, SQLUSMALLINT Directio SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, SQLCHAR *Description, SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2) { -- struct SQLDataSources_params params = { EnvironmentHandle, Direction, ServerName, BufferLength1, -- NameLength1, Description, BufferLength2, NameLength2 }; +- struct SQLDataSources_params params = { 0, Direction, ServerName, BufferLength1, NameLength1, Description, +- BufferLength2, NameLength2 }; +- struct handle *handle = EnvironmentHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_NO_DATA; @@ -591,8 +439,10 @@ index 679f3d7380e..3927d00673e 100644 " BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle, Direction, ServerName, BufferLength1, NameLength1, Description, BufferLength2, NameLength2); -- ret = ODBC_CALL( SQLDataSources, ¶ms ); -- if (ret >= 0 && TRACE_ON(odbc)) +- 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)); @@ -605,40 +455,30 @@ index 679f3d7380e..3927d00673e 100644 return ret; } -@@ -616,25 +267,12 @@ SQLRETURN WINAPI SQLDataSourcesA(SQLHENV EnvironmentHandle, SQLUSMALLINT Directi +@@ -440,8 +267,13 @@ SQLRETURN WINAPI SQLDataSourcesA(SQLHENV EnvironmentHandle, SQLUSMALLINT Directi SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, SQLCHAR *Description, SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2) { -- struct SQLDataSourcesA_params params = { EnvironmentHandle, Direction, ServerName, BufferLength1, -- NameLength1, Description, BufferLength2, NameLength2 }; -- SQLRETURN ret; +- return SQLDataSources( EnvironmentHandle, Direction, ServerName, BufferLength1, NameLength1, Description, +- BufferLength2, NameLength2 ); + 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); - -- ret = ODBC_CALL( SQLDataSourcesA, ¶ms ); -- if (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; ++ " BufferLength2 %d, NameLength2 %p)\n", EnvironmentHandle, Direction, ServerName, BufferLength1, ++ NameLength1, Description, BufferLength2, NameLength2); ++ ++ return ret; } -@@ -645,28 +283,12 @@ SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNum + /************************************************************************* +@@ -451,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 = { StatementHandle, ColumnNumber, ColumnName, BufferLength, -- NameLength, DataType, ColumnSize, DecimalDigits, 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; @@ -648,14 +488,20 @@ index 679f3d7380e..3927d00673e 100644 " ColumnSize %p, DecimalDigits %p, Nullable %p)\n", StatementHandle, ColumnNumber, ColumnName, BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); -- if (!params.NameLength) params.NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ +- if (!handle) return SQL_INVALID_HANDLE; - -- ret = ODBC_CALL( SQLDescribeCol, ¶ms ); -- if (ret >= 0) +- 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) TRACE(" ColumnSize %s\n", debugstr_sqlulen(*ColumnSize)); +- 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); - } @@ -664,57 +510,71 @@ index 679f3d7380e..3927d00673e 100644 return ret; } -@@ -675,13 +297,10 @@ SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNum +@@ -489,17 +297,10 @@ SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNum */ SQLRETURN WINAPI SQLDisconnect(SQLHDBC ConnectionHandle) { -- struct SQLDisconnect_params params = { ConnectionHandle }; +- struct SQLDisconnect_params params; +- struct handle *handle = ConnectionHandle; - SQLRETURN ret; +- +- TRACE("(ConnectionHandle %p)\n", ConnectionHandle); + SQLRETURN ret = SQL_ERROR; -- TRACE("(ConnectionHandle %p)\n", ConnectionHandle); +- if (!handle) return SQL_INVALID_HANDLE; + FIXME("(ConnectionHandle %p)\n", ConnectionHandle); +- params.ConnectionHandle = handle->unix_handle; - ret = ODBC_CALL( SQLDisconnect, ¶ms ); - TRACE("Returning %d\n", ret); return ret; } -@@ -690,13 +309,10 @@ SQLRETURN WINAPI SQLDisconnect(SQLHDBC ConnectionHandle) +@@ -508,17 +309,10 @@ SQLRETURN WINAPI SQLDisconnect(SQLHDBC ConnectionHandle) */ SQLRETURN WINAPI SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType) { -- struct SQLEndTran_params params = { HandleType, Handle, CompletionType }; +- struct SQLEndTran_params params = { HandleType, 0, CompletionType }; +- struct handle *handle = Handle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; - TRACE("(HandleType %d, Handle %p, CompletionType %d)\n", HandleType, Handle, CompletionType); + FIXME("(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; } -@@ -707,24 +323,12 @@ SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, S - SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText, +@@ -526,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 = { EnvironmentHandle, ConnectionHandle, StatementHandle, Sqlstate, -- NativeError, MessageText, BufferLength, 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," +- 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); ++ StatementHandle, Sqlstate, NativeError, MessageText, BufferLength, TextLength); -- ret = ODBC_CALL( SQLError, ¶ms ); -- -- if (ret == SQL_SUCCESS) +- 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(" SqlState %s\n", debugstr_an((const char *)SqlState, 5)); - TRACE(" Error %d\n", *NativeError); - TRACE(" MessageText %s\n", debugstr_an((const char *)MessageText, *TextLength)); - } @@ -723,11 +583,12 @@ index 679f3d7380e..3927d00673e 100644 return ret; } -@@ -733,14 +337,11 @@ SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, S +@@ -556,18 +337,11 @@ SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, S */ SQLRETURN WINAPI SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength) { -- struct SQLExecDirect_params params = { StatementHandle, StatementText, TextLength }; +- struct SQLExecDirect_params params = { 0, StatementText, TextLength }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -735,48 +596,83 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -749,13 +350,10 @@ SQLRETURN WINAPI SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, +@@ -576,58 +350,22 @@ SQLRETURN WINAPI SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, */ SQLRETURN WINAPI SQLExecute(SQLHSTMT StatementHandle) { -- struct SQLExecute_params params = { 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; - ret = ODBC_CALL( SQLExecute, ¶ms ); - TRACE("Returning %d\n", ret); return ret; } -@@ -764,13 +362,10 @@ SQLRETURN WINAPI SQLExecute(SQLHSTMT StatementHandle) +-static void update_result_lengths( struct handle *handle ) +-{ +- UINT i; +- for (i = 0; i < handle->bind_col.count; i++) +- { +- if (handle->bind_col.param[i].ptr) +- *(SQLLEN *)handle->bind_col.param[i].ptr = handle->bind_col.param[i].len; +- } +- for (i = 0; i < handle->bind_param.count; i++) +- { +- if (handle->bind_param.param[i].ptr) +- *(SQLLEN *)handle->bind_param.param[i].ptr = handle->bind_param.param[i].len; +- } +- for (i = 0; i < handle->bind_parameter.count; i++) +- { +- if (handle->bind_parameter.param[i].ptr) +- { +- *(SQLLEN *)handle->bind_parameter.param[i].ptr = handle->bind_parameter.param[i].len; +- } +- } +-} +- + /************************************************************************* + * SQLFetch [ODBC32.013] */ SQLRETURN WINAPI SQLFetch(SQLHSTMT StatementHandle) { -- struct SQLFetch_params params = { StatementHandle }; +- struct SQLFetch_params params; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; - TRACE("(StatementHandle %p)\n", StatementHandle); + FIXME("(StatementHandle %p)\n", StatementHandle); -- ret = ODBC_CALL( SQLFetch, ¶ms ); +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- if (SUCCESS(( ret = ODBC_CALL( SQLFetch, ¶ms )))) update_result_lengths( handle ); - TRACE("Returning %d\n", ret); return ret; } -@@ -779,14 +374,11 @@ SQLRETURN WINAPI SQLFetch(SQLHSTMT StatementHandle) +@@ -636,18 +374,11 @@ SQLRETURN WINAPI SQLFetch(SQLHSTMT StatementHandle) */ SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset) { -- struct SQLFetchScroll_params params = { StatementHandle, FetchOrientation, FetchOffset }; +- struct SQLFetchScroll_params params = { 0, FetchOrientation, FetchOffset }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -784,80 +680,116 @@ index 679f3d7380e..3927d00673e 100644 + FIXME("(StatementHandle %p, FetchOrientation %d, FetchOffset %s)\n", StatementHandle, FetchOrientation, debugstr_sqllen(FetchOffset)); -- ret = ODBC_CALL( SQLFetchScroll, ¶ms ); +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- if (SUCCESS(( ret = ODBC_CALL( SQLFetchScroll, ¶ms )))) update_result_lengths( handle ); - TRACE("Returning %d\n", ret); return ret; } -@@ -795,13 +387,10 @@ SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrien +@@ -656,18 +387,10 @@ SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrien */ SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle) { -- struct SQLFreeConnect_params params = { ConnectionHandle }; +- struct SQLFreeConnect_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( SQLFreeConnect, ¶ms ); +- free( handle ); - TRACE("Returning %d\n", ret); return ret; } -@@ -810,13 +399,10 @@ SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle) +@@ -676,47 +399,22 @@ SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle) */ SQLRETURN WINAPI SQLFreeEnv(SQLHENV EnvironmentHandle) { -- struct SQLFreeEnv_params params = { EnvironmentHandle }; +- struct SQLFreeEnv_params params; +- struct handle *handle = EnvironmentHandle; - SQLRETURN ret; +- +- TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle); + SQLRETURN ret = SQL_ERROR; -- TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle); +- if (!handle) return SQL_INVALID_HANDLE; + FIXME("(EnvironmentHandle %p)\n", EnvironmentHandle); +- params.EnvironmentHandle = handle->unix_handle; - ret = ODBC_CALL( SQLFreeEnv, ¶ms ); +- free( handle ); - TRACE("Returning %d\n", ret); return ret; } -@@ -825,13 +411,10 @@ SQLRETURN WINAPI SQLFreeEnv(SQLHENV EnvironmentHandle) +-static void free_bindings( struct handle *handle ) +-{ +- free( handle->bind_col.param ); +- free( handle->bind_param.param ); +- free( handle->bind_parameter.param ); +-} +- + /************************************************************************* + * SQLFreeHandle [ODBC32.031] */ SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) { -- struct SQLFreeHandle_params params = { HandleType, 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; } -@@ -840,13 +423,10 @@ SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) +@@ -725,20 +423,10 @@ SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) */ SQLRETURN WINAPI SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option) { -- struct SQLFreeStmt_params params = { StatementHandle, Option }; +- struct SQLFreeStmt_params params; +- struct handle *handle = StatementHandle; - SQLRETURN ret; +- +- TRACE("(StatementHandle %p, Option %d)\n", StatementHandle, Option); + SQLRETURN ret = SQL_ERROR; -- TRACE("(StatementHandle %p, Option %d)\n", StatementHandle, Option); +- 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; } -@@ -856,14 +436,11 @@ SQLRETURN WINAPI SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option) +@@ -748,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 = { ConnectionHandle, Attribute, Value, BufferLength, StringLength }; +- struct SQLGetConnectAttr_params params = { 0, Attribute, Value, BufferLength, StringLength }; +- struct handle *handle = ConnectionHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -865,32 +797,40 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -872,13 +449,10 @@ SQLRETURN WINAPI SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribut +@@ -768,17 +449,10 @@ SQLRETURN WINAPI SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribut */ SQLRETURN WINAPI SQLGetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value) { -- struct SQLGetConnectOption_params params = { ConnectionHandle, Option, 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; -- TRACE("(ConnectionHandle %p, Option %d, Value %p)\n", ConnectionHandle, Option, Value); +- 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; } -@@ -888,14 +462,11 @@ SQLRETURN WINAPI SQLGetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Opti +@@ -788,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 = { StatementHandle, CursorName, BufferLength, NameLength }; +- struct SQLGetCursorName_params params = { 0, CursorName, BufferLength, NameLength }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -898,17 +838,21 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -905,15 +476,11 @@ SQLRETURN WINAPI SQLGetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, +@@ -809,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 = { StatementHandle, ColumnNumber, TargetType, TargetValue, -- BufferLength, StrLen_or_Ind }; +- struct SQLGetData_params params = { 0, ColumnNumber, TargetType, TargetValue, BufferLength }; +- struct handle *handle = StatementHandle; +- INT64 len; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -916,17 +860,21 @@ index 679f3d7380e..3927d00673e 100644 + 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); -- ret = ODBC_CALL( SQLGetData, ¶ms ); +- 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; } -@@ -923,15 +490,11 @@ SQLRETURN WINAPI SQLGetData(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, +@@ -832,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 = { DescriptorHandle, RecNumber, FieldIdentifier, Value, -- BufferLength, StringLength }; +- struct SQLGetDescField_params params = { 0, RecNumber, FieldIdentifier, Value, BufferLength, StringLength }; +- struct handle *handle = DescriptorHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -934,17 +882,22 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -943,16 +506,12 @@ SQLRETURN WINAPI SQLGetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, +@@ -855,22 +506,12 @@ SQLRETURN WINAPI SQLGetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT *SubType, SQLLEN *Length, SQLSMALLINT *Precision, SQLSMALLINT *Scale, SQLSMALLINT *Nullable) { -- struct SQLGetDescRec_params params = { DescriptorHandle, RecNumber, Name, BufferLength, StringLength, -- Type, SubType, Length, Precision, Scale, 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; @@ -953,17 +906,22 @@ index 679f3d7380e..3927d00673e 100644 " Length %p, Precision %p, Scale %p, Nullable %p)\n", DescriptorHandle, RecNumber, Name, BufferLength, StringLength, Type, SubType, Length, Precision, Scale, Nullable); -- ret = ODBC_CALL( SQLGetDescRec, ¶ms ); +- 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; } -@@ -963,15 +522,11 @@ SQLRETURN WINAPI SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSM +@@ -881,19 +522,11 @@ SQLRETURN WINAPI SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSM SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) { -- struct SQLGetDiagField_params params = { HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, -- BufferLength, StringLength }; +- struct SQLGetDiagField_params params = { HandleType, 0, RecNumber, DiagIdentifier, DiagInfo, BufferLength, +- StringLength }; +- struct handle *handle = Handle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -971,35 +929,48 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -982,16 +537,12 @@ SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMAL - SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText, +@@ -901,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, Handle, RecNumber, Sqlstate, NativeError, -- MessageText, BufferLength, TextLength }; +- struct SQLGetDiagRec_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," +- 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 %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; } -@@ -1001,14 +552,11 @@ SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMAL +@@ -927,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 = { EnvironmentHandle, Attribute, Value, BufferLength, StringLength }; +- struct SQLGetEnvAttr_params params = { 0, Attribute, Value, BufferLength, StringLength }; +- struct handle *handle = EnvironmentHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -1007,32 +978,40 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -1017,13 +565,10 @@ SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, +@@ -947,17 +565,10 @@ SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, */ SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported) { -- struct SQLGetFunctions_params params = { ConnectionHandle, FunctionId, 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; -- TRACE("(ConnectionHandle %p, FunctionId %d, Supported %p)\n", ConnectionHandle, FunctionId, Supported); +- 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; } -@@ -1033,14 +578,11 @@ SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT Function +@@ -967,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 = { ConnectionHandle, InfoType, InfoValue, BufferLength, StringLength }; +- struct SQLGetInfo_params params = { 0, InfoType, InfoValue, BufferLength, StringLength }; +- struct handle *handle = ConnectionHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -1040,16 +1019,20 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -1050,10 +592,9 @@ SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQL +@@ -988,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 = { StatementHandle, Attribute, Value, BufferLength, StringLength }; +- struct SQLGetStmtAttr_params params = { 0, Attribute, Value, BufferLength, StringLength }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -1058,84 +1041,104 @@ index 679f3d7380e..3927d00673e 100644 Attribute, Value, BufferLength, StringLength); if (!Value) -@@ -1062,8 +603,6 @@ SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, +@@ -1001,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; } -@@ -1072,13 +611,10 @@ SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, +@@ -1014,17 +611,10 @@ SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, */ SQLRETURN WINAPI SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLPOINTER Value) { -- struct SQLGetStmtOption_params params = { StatementHandle, Option, 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; } -@@ -1087,13 +623,10 @@ SQLRETURN WINAPI SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, +@@ -1033,17 +623,10 @@ SQLRETURN WINAPI SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, */ SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) { -- struct SQLGetTypeInfo_params params = { StatementHandle, 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; -- TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); +- 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; } -@@ -1102,13 +635,10 @@ SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) +@@ -1052,17 +635,10 @@ SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) */ SQLRETURN WINAPI SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnCount) { -- struct SQLNumResultCols_params params = { StatementHandle, 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; } -@@ -1117,13 +647,10 @@ SQLRETURN WINAPI SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnC +@@ -1071,17 +647,10 @@ SQLRETURN WINAPI SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnC */ SQLRETURN WINAPI SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value) { -- struct SQLParamData_params params = { StatementHandle, 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; -- TRACE("(StatementHandle %p, Value %p)\n", StatementHandle, Value); +- 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; } -@@ -1132,14 +659,11 @@ SQLRETURN WINAPI SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value) +@@ -1090,18 +659,11 @@ SQLRETURN WINAPI SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value) */ SQLRETURN WINAPI SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength) { -- struct SQLPrepare_params params = { StatementHandle, StatementText, TextLength }; +- struct SQLPrepare_params params = { 0, StatementText, TextLength }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -1143,49 +1146,66 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -1148,13 +672,10 @@ SQLRETURN WINAPI SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQ +@@ -1110,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 = { StatementHandle, Data, StrLen_or_Ind }; +- struct SQLPutData_params params = { 0, Data, StrLen_or_Ind }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; - TRACE("(StatementHandle %p, Data %p, StrLen_or_Ind %s)\n", StatementHandle, Data, debugstr_sqllen(StrLen_or_Ind)); + FIXME("(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; } -@@ -1163,14 +684,10 @@ SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN St +@@ -1129,23 +684,10 @@ SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN St */ SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount) { -- struct SQLRowCount_params params = { StatementHandle, RowCount }; +- struct SQLRowCount_params params; +- struct handle *handle = StatementHandle; +- INT64 count; - SQLRETURN ret; +- +- TRACE("(StatementHandle %p, RowCount %p)\n", StatementHandle, RowCount); + SQLRETURN ret = SQL_ERROR; -- TRACE("(StatementHandle %p, RowCount %p)\n", StatementHandle, RowCount); +- if (!handle) return SQL_INVALID_HANDLE; + FIXME("(StatementHandle %p, RowCount %p)\n", StatementHandle, RowCount); -- ret = ODBC_CALL( SQLRowCount, ¶ms ); -- if (ret == SQL_SUCCESS && RowCount) TRACE(" RowCount %s\n", debugstr_sqllen(*RowCount)); +- 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; } -@@ -1180,14 +697,11 @@ SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount) +@@ -1155,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 = { ConnectionHandle, Attribute, Value, StringLength }; +- struct SQLSetConnectAttr_params params = { 0, Attribute, Value, StringLength }; +- struct handle *handle = ConnectionHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -1193,32 +1213,40 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -1196,13 +710,10 @@ SQLRETURN WINAPI SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribut +@@ -1175,17 +710,10 @@ SQLRETURN WINAPI SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribut */ SQLRETURN WINAPI SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value) { -- struct SQLSetConnectOption_params params = { ConnectionHandle, Option, 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)); + SQLRETURN ret = SQL_ERROR; -- TRACE("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle, Option, debugstr_sqlulen(Value)); +- if (!handle) return SQL_INVALID_HANDLE; + FIXME("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle, Option, debugstr_sqlulen(Value)); +- params.ConnectionHandle = handle->unix_handle; - ret = ODBC_CALL( SQLSetConnectOption, ¶ms ); - TRACE("Returning %d\n", ret); return ret; } -@@ -1211,14 +722,11 @@ SQLRETURN WINAPI SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Opti +@@ -1194,18 +722,11 @@ SQLRETURN WINAPI SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Opti */ SQLRETURN WINAPI SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT NameLength) { -- struct SQLSetCursorName_params params = { StatementHandle, CursorName, NameLength }; +- struct SQLSetCursorName_params params = { 0, CursorName, NameLength }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -1226,16 +1254,20 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -1228,14 +736,11 @@ SQLRETURN WINAPI SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, +@@ -1215,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 = { DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength }; +- struct SQLSetDescField_params params = { 0, RecNumber, FieldIdentifier, Value, BufferLength }; +- struct handle *handle = DescriptorHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -1243,16 +1275,21 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -1246,15 +751,12 @@ SQLRETURN WINAPI SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, +@@ -1237,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 = { DescriptorHandle, RecNumber, Type, SubType, Length, Precision, Scale, Data, StringLength, 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; @@ -1261,16 +1298,26 @@ index 679f3d7380e..3927d00673e 100644 " StringLength %p, Indicator %p)\n", DescriptorHandle, RecNumber, Type, SubType, debugstr_sqllen(Length), Precision, Scale, Data, StringLength, Indicator); -- ret = ODBC_CALL( SQLSetDescRec, ¶ms ); +- 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; } -@@ -1264,14 +766,11 @@ SQLRETURN WINAPI SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, +@@ -1266,18 +766,11 @@ SQLRETURN WINAPI SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLRETURN WINAPI SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength) { -- struct SQLSetEnvAttr_params params = { EnvironmentHandle, Attribute, Value, StringLength }; +- struct SQLSetEnvAttr_params params = { 0, Attribute, Value, StringLength }; +- struct handle *handle = EnvironmentHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -1278,17 +1325,22 @@ index 679f3d7380e..3927d00673e 100644 + FIXME("(EnvironmentHandle %p, Attribute %d, Value %p, StringLength %d)\n", EnvironmentHandle, Attribute, Value, StringLength); +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.EnvironmentHandle = handle->unix_handle; - ret = ODBC_CALL( SQLSetEnvAttr, ¶ms ); - TRACE("Returning %d\n", ret); return ret; } -@@ -1282,16 +781,12 @@ SQLRETURN WINAPI SQLSetParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNum +@@ -1288,22 +781,12 @@ SQLRETURN WINAPI SQLSetParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNum SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, SQLLEN *StrLen_or_Ind) { -- struct SQLSetParam_params params = { StatementHandle, ParameterNumber, ValueType, ParameterType, -- LengthPrecision, ParameterScale, ParameterValue, 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; @@ -1297,16 +1349,21 @@ index 679f3d7380e..3927d00673e 100644 " ParameterScale %d, ParameterValue %p, StrLen_or_Ind %p)\n", StatementHandle, ParameterNumber, ValueType, ParameterType, debugstr_sqlulen(LengthPrecision), ParameterScale, ParameterValue, StrLen_or_Ind); -- ret = ODBC_CALL( SQLSetParam, ¶ms ); +- 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; } -@@ -1301,14 +796,11 @@ SQLRETURN WINAPI SQLSetParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNum +@@ -1313,18 +796,11 @@ SQLRETURN WINAPI SQLSetParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNum SQLRETURN WINAPI SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength) { -- struct SQLSetStmtAttr_params params = { StatementHandle, Attribute, Value, StringLength }; +- struct SQLSetStmtAttr_params params = { 0, Attribute, Value, StringLength }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -1314,33 +1371,41 @@ index 679f3d7380e..3927d00673e 100644 + 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; - ret = ODBC_CALL( SQLSetStmtAttr, ¶ms ); - TRACE("Returning %d\n", ret); return ret; } -@@ -1317,13 +809,10 @@ SQLRETURN WINAPI SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, +@@ -1333,17 +809,10 @@ SQLRETURN WINAPI SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, */ SQLRETURN WINAPI SQLSetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLULEN Value) { -- struct SQLSetStmtOption_params params = { StatementHandle, Option, 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; } -@@ -1335,18 +824,14 @@ SQLRETURN WINAPI SQLSpecialColumns(SQLHSTMT StatementHandle, SQLUSMALLINT Identi +@@ -1355,22 +824,14 @@ SQLRETURN WINAPI SQLSpecialColumns(SQLHSTMT StatementHandle, SQLUSMALLINT Identi SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Scope, SQLUSMALLINT Nullable) { -- struct SQLSpecialColumns_params params = { StatementHandle, IdentifierType, CatalogName, NameLength1, -- SchemaName, NameLength2, TableName, NameLength3, Scope, 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; @@ -1351,17 +1416,21 @@ index 679f3d7380e..3927d00673e 100644 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; } -@@ -1357,18 +842,14 @@ SQLRETURN WINAPI SQLStatistics(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, S +@@ -1381,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 = { StatementHandle, CatalogName, NameLength1, SchemaName, -- NameLength2, TableName, NameLength3, Unique, Reserved }; +- struct SQLStatistics_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, +- NameLength3, Unique, Reserved }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -1372,17 +1441,21 @@ index 679f3d7380e..3927d00673e 100644 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; } -@@ -1379,19 +860,15 @@ SQLRETURN WINAPI SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSM +@@ -1407,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 = { StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, -- TableName, NameLength3, TableType, NameLength4 }; +- struct SQLTables_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, +- NameLength3, TableType, NameLength4 }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -1394,16 +1467,20 @@ index 679f3d7380e..3927d00673e 100644 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; } -@@ -1400,14 +877,11 @@ SQLRETURN WINAPI SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSM +@@ -1432,42 +877,27 @@ SQLRETURN WINAPI SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSM */ SQLRETURN WINAPI SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType) { -- struct SQLTransact_params params = { EnvironmentHandle, ConnectionHandle, CompletionType }; +- struct SQLTransact_params params = { 0, 0, CompletionType }; +- struct handle *env = EnvironmentHandle, *con = ConnectionHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -1411,385 +1488,633 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -1418,16 +892,12 @@ SQLRETURN WINAPI SQLBrowseConnect(SQLHDBC hdbc, SQLCHAR *szConnStrIn, SQLSMALLIN - SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, - SQLSMALLINT *pcbConnStrOut) + /************************************************************************* + * 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 = { hdbc, szConnStrIn, cbConnStrIn, szConnStrOut, -- cbConnStrOutMax, 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; -- TRACE("(hdbc %p, szConnStrIn %s, cbConnStrIn %d, szConnStrOut %p, cbConnStrOutMax %d, pcbConnStrOut %p)\n", +- 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); ++ 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; } -@@ -1436,13 +906,10 @@ SQLRETURN WINAPI SQLBrowseConnect(SQLHDBC hdbc, SQLCHAR *szConnStrIn, SQLSMALLIN +@@ -1476,149 +906,96 @@ SQLRETURN WINAPI SQLBrowseConnect(SQLHDBC ConnectionHandle, SQLCHAR *InConnectio */ SQLRETURN WINAPI SQLBulkOperations(SQLHSTMT StatementHandle, SQLSMALLINT Operation) { -- struct SQLBulkOperations_params params = { StatementHandle, Operation }; +- struct SQLBulkOperations_params params = { 0, Operation }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; +- +- TRACE("(StatementHandle %p, Operation %d)\n", StatementHandle, Operation); + SQLRETURN ret = SQL_ERROR; -- TRACE("(StatementHandle %p, Operation %d)\n", StatementHandle, Operation); +- if (!handle) return SQL_INVALID_HANDLE; + FIXME("(StatementHandle %p, Operation %d)\n", StatementHandle, Operation); -- ret = ODBC_CALL( SQLBulkOperations, ¶ms ); +- params.StatementHandle = handle->unix_handle; +- if (SUCCESS(( ret = ODBC_CALL( SQLBulkOperations, ¶ms )))) update_result_lengths( handle ); - TRACE("Returning %d\n", ret); return ret; } -@@ -1453,14 +920,11 @@ SQLRETURN WINAPI SQLColAttributes(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLIN - SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, - SQLLEN *pfDesc) + /************************************************************************* + * 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 = { hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc }; +- struct SQLColAttributes_params params = { 0, ColumnNumber, FieldIdentifier, CharacterAttributes, BufferLength, +- StringLength }; +- struct handle *handle = StatementHandle; +- INT64 attrs; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; -- TRACE("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol, +- TRACE("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttributes %p, BufferLength %d, " +- "StringLength %p, NumericAttributes %p)\n", StatementHandle, ColumnNumber, FieldIdentifier, +- CharacterAttributes, BufferLength, StringLength, NumericAttributes); + FIXME("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol, - fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); ++ fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); -- ret = ODBC_CALL( SQLColAttributes, ¶ms ); +- 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; } -@@ -1471,19 +935,15 @@ SQLRETURN WINAPI SQLColumnPrivileges(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQL - SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, - SQLSMALLINT cbTableName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName) + /************************************************************************* + * 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 = { hstmt, szCatalogName, cbCatalogName, szSchemaName, -- cbSchemaName, szTableName, cbTableName, szColumnName, cbColumnName }; +- 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); + SQLRETURN ret = SQL_ERROR; -- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," +- 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); ++ " 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; } -@@ -1493,14 +953,11 @@ SQLRETURN WINAPI SQLColumnPrivileges(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQL - SQLRETURN WINAPI SQLDescribeParam(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT *pfSqlType, - SQLULEN *pcbParamDef, SQLSMALLINT *pibScale, SQLSMALLINT *pfNullable) + /************************************************************************* + * 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 = { hstmt, ipar, pfSqlType, pcbParamDef, pibScale, pfNullable }; +- 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); + SQLRETURN ret = SQL_ERROR; -- TRACE("(hstmt %p, ipar %d, pfSqlType %p, pcbParamDef %p, pibScale %p, pfNullable %p)\n", hstmt, ipar, +- if (!handle) return SQL_INVALID_HANDLE; + FIXME("(hstmt %p, ipar %d, pfSqlType %p, pcbParamDef %p, pibScale %p, pfNullable %p)\n", hstmt, ipar, - pfSqlType, pcbParamDef, pibScale, pfNullable); ++ pfSqlType, pcbParamDef, pibScale, pfNullable); -- ret = ODBC_CALL( SQLDescribeParam, ¶ms ); +- params.StatementHandle = handle->unix_handle; +- params.ParameterSize = &size; +- if (SUCCESS((ret = ODBC_CALL( SQLDescribeParam, ¶ms )))) *ParameterSize = size; - TRACE("Returning %d\n", ret); return ret; } -@@ -1510,14 +967,11 @@ SQLRETURN WINAPI SQLDescribeParam(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT - SQLRETURN WINAPI SQLExtendedFetch(SQLHSTMT hstmt, SQLUSMALLINT fFetchType, SQLLEN irow, SQLULEN *pcrow, - SQLUSMALLINT *rgfRowStatus) + /************************************************************************* + * 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 = { hstmt, fFetchType, irow, pcrow, rgfRowStatus }; +- struct SQLExtendedFetch_params params = { 0, FetchOrientation, FetchOffset, NULL, RowStatusArray }; +- struct handle *handle = StatementHandle; +- UINT64 count; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; -- TRACE("(hstmt %p, fFetchType %d, irow %s, pcrow %p, rgfRowStatus %p)\n", hstmt, fFetchType, debugstr_sqllen(irow), +- TRACE("(StatementHandle %p, FetchOrientation %d, FetchOffset %s, RowCount %p, RowStatusArray %p)\n", +- StatementHandle, FetchOrientation, debugstr_sqllen(FetchOffset), RowCount, RowStatusArray); + FIXME("(hstmt %p, fFetchType %d, irow %s, pcrow %p, rgfRowStatus %p)\n", hstmt, fFetchType, debugstr_sqllen(irow), - pcrow, rgfRowStatus); ++ pcrow, rgfRowStatus); -- ret = ODBC_CALL( SQLExtendedFetch, ¶ms ); +- 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; } -@@ -1530,13 +984,9 @@ SQLRETURN WINAPI SQLForeignKeys(SQLHSTMT hstmt, SQLCHAR *szPkCatalogName, SQLSMA - SQLSMALLINT cbFkCatalogName, SQLCHAR *szFkSchemaName, - SQLSMALLINT cbFkSchemaName, SQLCHAR *szFkTableName, SQLSMALLINT cbFkTableName) + /************************************************************************* + * 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 = { hstmt, szPkCatalogName, cbPkCatalogName, szPkSchemaName, -- cbPkSchemaName, szPkTableName, cbPkTableName, szFkCatalogName, -- cbFkCatalogName, szFkSchemaName, cbFkSchemaName, -- szFkTableName, cbFkTableName }; +- 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); + SQLRETURN ret = SQL_ERROR; -- TRACE("(hstmt %p, szPkCatalogName %s, cbPkCatalogName %d, szPkSchemaName %s, cbPkSchemaName %d," +- if (!handle) return SQL_INVALID_HANDLE; + 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, -@@ -1546,8 +996,6 @@ SQLRETURN WINAPI SQLForeignKeys(SQLHSTMT hstmt, SQLCHAR *szPkCatalogName, SQLSMA - debugstr_an((const char *)szFkSchemaName, cbFkSchemaName), cbFkSchemaName, - debugstr_an((const char *)szFkTableName, cbFkTableName), cbFkTableName); ++ " 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); +- params.StatementHandle = handle->unix_handle; - ret = ODBC_CALL( SQLForeignKeys, ¶ms ); - TRACE("Returning %d\n", ret); return ret; } -@@ -1556,13 +1004,10 @@ SQLRETURN WINAPI SQLForeignKeys(SQLHSTMT hstmt, SQLCHAR *szPkCatalogName, SQLSMA +@@ -1627,381 +1004,213 @@ SQLRETURN WINAPI SQLForeignKeys(SQLHSTMT StatementHandle, SQLCHAR *PkCatalogName */ SQLRETURN WINAPI SQLMoreResults(SQLHSTMT StatementHandle) { -- struct SQLMoreResults_params params = { StatementHandle }; +- struct SQLMoreResults_params params; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; - TRACE("(%p)\n", StatementHandle); + FIXME("(%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; } -@@ -1572,14 +1017,11 @@ SQLRETURN WINAPI SQLMoreResults(SQLHSTMT StatementHandle) - SQLRETURN WINAPI SQLNativeSql(SQLHDBC hdbc, SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLCHAR *szSqlStr, - SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr) + /************************************************************************* + * 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 = { hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr }; +- 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); + SQLRETURN ret = SQL_ERROR; -- TRACE("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc, +- if (!handle) return SQL_INVALID_HANDLE; + 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); ++ debugstr_an((const char *)szSqlStrIn, cbSqlStrIn), cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr); +- params.ConnectionHandle = handle->unix_handle; - ret = ODBC_CALL( SQLNativeSql, ¶ms ); - TRACE("Returning %d\n", ret); return ret; } -@@ -1588,13 +1030,10 @@ SQLRETURN WINAPI SQLNativeSql(SQLHDBC hdbc, SQLCHAR *szSqlStrIn, SQLINTEGER cbSq + /************************************************************************* + * SQLNumParams [ODBC32.063] */ - SQLRETURN WINAPI SQLNumParams(SQLHSTMT hstmt, SQLSMALLINT *pcpar) +-SQLRETURN WINAPI SQLNumParams(SQLHSTMT StatementHandle, SQLSMALLINT *ParameterCount) ++SQLRETURN WINAPI SQLNumParams(SQLHSTMT hstmt, SQLSMALLINT *pcpar) { -- struct SQLNumParams_params params = { hstmt, pcpar }; +- struct SQLNumParams_params params = { 0, ParameterCount }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; -- TRACE("(hstmt %p, pcpar %p)\n", hstmt, pcpar); +- TRACE("(StatementHandle %p, pcpar %p)\n", StatementHandle, ParameterCount); + FIXME("(hstmt %p, pcpar %p)\n", hstmt, pcpar); +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; - ret = ODBC_CALL( SQLNumParams, ¶ms ); - TRACE("Returning %d\n", ret); return ret; } -@@ -1603,13 +1042,10 @@ SQLRETURN WINAPI SQLNumParams(SQLHSTMT hstmt, SQLSMALLINT *pcpar) + /************************************************************************* + * SQLParamOptions [ODBC32.064] */ - SQLRETURN WINAPI SQLParamOptions(SQLHSTMT hstmt, SQLULEN crow, SQLULEN *pirow) +-SQLRETURN WINAPI SQLParamOptions(SQLHSTMT StatementHandle, SQLULEN RowCount, SQLULEN *RowNumber) ++SQLRETURN WINAPI SQLParamOptions(SQLHSTMT hstmt, SQLULEN crow, SQLULEN *pirow) { -- struct SQLParamOptions_params params = { hstmt, crow, pirow }; +- 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); + SQLRETURN ret = SQL_ERROR; -- TRACE("(hstmt %p, crow %s, pirow %p)\n", hstmt, debugstr_sqlulen(crow), pirow); +- if (!handle) return SQL_INVALID_HANDLE; + FIXME("(hstmt %p, crow %s, pirow %p)\n", hstmt, debugstr_sqlulen(crow), pirow); -- ret = ODBC_CALL( SQLParamOptions, ¶ms ); +- params.StatementHandle = handle->unix_handle; +- params.RowNumber = &row; +- if (SUCCESS((ret = ODBC_CALL( SQLParamOptions, ¶ms )))) *RowNumber = row; - TRACE("Returning %d\n", ret); return ret; } -@@ -1620,18 +1056,14 @@ SQLRETURN WINAPI SQLPrimaryKeys(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALL - SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, - SQLSMALLINT cbTableName) + /************************************************************************* + * 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 = { hstmt, szCatalogName, cbCatalogName, szSchemaName, -- cbSchemaName, szTableName, cbTableName }; +- struct SQLPrimaryKeys_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, +- NameLength3 }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; -- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," +- 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; + 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); ++ " 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; } -@@ -1642,20 +1074,15 @@ SQLRETURN WINAPI SQLProcedureColumns(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQL - SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName, - SQLSMALLINT cbProcName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName) + /************************************************************************* + * 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 = { hstmt, szCatalogName, cbCatalogName, szSchemaName, -- cbSchemaName, szProcName, cbProcName, -- szColumnName, cbColumnName }; +- 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); + SQLRETURN ret = SQL_ERROR; -- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," +- 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_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); ++ " 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); +- params.StatementHandle = handle->unix_handle; - ret = ODBC_CALL( SQLProcedureColumns, ¶ms ); - TRACE("Returning %d\n", ret); return ret; } -@@ -1666,18 +1093,14 @@ SQLRETURN WINAPI SQLProcedures(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLI - SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName, - SQLSMALLINT cbProcName) + /************************************************************************* + * 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 = { hstmt, szCatalogName, cbCatalogName, szSchemaName, -- cbSchemaName, szProcName, cbProcName }; +- struct SQLProcedures_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, ProcName, +- NameLength3 }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; -- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," +- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, ProcName %s," +- " NameLength3 %d)\n", StatementHandle, +- debugstr_an((const char *)CatalogName, NameLength1), NameLength1, +- debugstr_an((const char *)SchemaName, NameLength2), NameLength2, +- debugstr_an((const char *)ProcName, NameLength3), NameLength3); + 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); ++ " 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); +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; - ret = ODBC_CALL( SQLProcedures, ¶ms ); - TRACE("Returning %d\n", ret); return ret; } -@@ -1686,13 +1109,10 @@ SQLRETURN WINAPI SQLProcedures(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLI + /************************************************************************* + * SQLSetPos [ODBC32.068] */ - SQLRETURN WINAPI SQLSetPos(SQLHSTMT hstmt, SQLSETPOSIROW irow, SQLUSMALLINT fOption, SQLUSMALLINT fLock) +-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 = { hstmt, irow, fOption, fLock }; +- 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); + SQLRETURN ret = SQL_ERROR; -- TRACE("(hstmt %p, irow %s, fOption %d, fLock %d)\n", hstmt, debugstr_sqlulen(irow), fOption, fLock); +- if (!handle) return SQL_INVALID_HANDLE; + FIXME("(hstmt %p, irow %s, fOption %d, fLock %d)\n", hstmt, debugstr_sqlulen(irow), fOption, fLock); -- ret = ODBC_CALL( SQLSetPos, ¶ms ); +- params.StatementHandle = handle->unix_handle; +- if (SUCCESS(( ret = ODBC_CALL( SQLSetPos, ¶ms ))) && Operation == SQL_REFRESH) +- update_result_lengths( handle ); - TRACE("Returning %d\n", ret); return ret; } -@@ -1703,18 +1123,14 @@ SQLRETURN WINAPI SQLTablePrivileges(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLS - SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, - SQLSMALLINT cbTableName) + /************************************************************************* + * 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 = { hstmt, szCatalogName, cbCatalogName, szSchemaName, -- cbSchemaName, szTableName, 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; -- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," +- 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); ++ " 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; } -@@ -1726,20 +1142,12 @@ SQLRETURN WINAPI SQLDrivers(SQLHENV EnvironmentHandle, SQLUSMALLINT fDirection, - SQLCHAR *szDriverAttributes, SQLSMALLINT cbDriverAttrMax, - SQLSMALLINT *pcbDriverAttr) + /************************************************************************* + * 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 = { EnvironmentHandle, fDirection, szDriverDesc, cbDriverDescMax, -- pcbDriverDesc, szDriverAttributes, cbDriverAttrMax, 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, szDriverDesc %p, cbDriverDescMax %d, pcbDriverDesc %p," +- 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); ++ " 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 && fDirection == SQL_FETCH_FIRST) +- 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; } -@@ -1751,16 +1159,12 @@ SQLRETURN WINAPI SQLBindParameter(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT - SQLSMALLINT ibScale, SQLPOINTER rgbValue, SQLLEN cbValueMax, - SQLLEN *pcbValue) + /************************************************************************* + * 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 = { hstmt, ipar, fParamType, fCType, fSqlType, cbColDef, -- ibScale, rgbValue, cbValueMax, 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; -- TRACE("(hstmt %p, ipar %d, fParamType %d, fCType %d, fSqlType %d, cbColDef %s, ibScale %d, rgbValue %p," +- if (!handle) return SQL_INVALID_HANDLE; +- if (!ParameterNumber) +- { +- FIXME( "parameter 0 not handled\n" ); +- return SQL_ERROR; +- } +- if (!resize_binding( &handle->bind_parameter, ParameterNumber )) return SQL_ERROR; + 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); ++ " cbValueMax %s, pcbValue %p)\n", hstmt, ipar, fParamType, fCType, fSqlType, debugstr_sqlulen(cbColDef), ++ ibScale, rgbValue, debugstr_sqllen(cbValueMax), pcbValue); -- ret = ODBC_CALL( SQLBindParameter, ¶ms ); +- params.StatementHandle = handle->unix_handle; +- params.StrLen_or_Ind = &handle->bind_parameter.param[i].len; +- if (SUCCESS((ret = ODBC_CALL( SQLBindParameter, ¶ms )))) handle->bind_parameter.param[i].ptr = StrLen_or_Ind; - TRACE("Returning %d\n", ret); return ret; } -@@ -1771,17 +1175,13 @@ SQLRETURN WINAPI SQLDriverConnect(SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR *Connectio - SQLCHAR *conn_str_out, SQLSMALLINT conn_str_out_max, - SQLSMALLINT *ptr_conn_str_out, SQLUSMALLINT driver_completion) + /************************************************************************* + * 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 = { hdbc, hwnd, ConnectionString, Length, conn_str_out, -- conn_str_out_max, ptr_conn_str_out, driver_completion }; +- struct SQLDriverConnect_params params = { 0, WindowHandle, ConnectionString, Length, OutConnectionString, +- BufferLength, Length2, DriverCompletion }; +- struct handle *handle = ConnectionHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; -- TRACE("(hdbc %p, hwnd %p, ConnectionString %s, Length %d, conn_str_out %p, conn_str_out_max %d," +- 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); + 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); ++ " 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); +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.ConnectionHandle = handle->unix_handle; - ret = ODBC_CALL( SQLDriverConnect, ¶ms ); - TRACE("Returning %d\n", ret); return ret; } -@@ -1791,47 +1191,14 @@ SQLRETURN WINAPI SQLDriverConnect(SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR *Connectio - SQLRETURN WINAPI SQLSetScrollOptions(SQLHSTMT statement_handle, SQLUSMALLINT f_concurrency, SQLLEN crow_keyset, - SQLUSMALLINT crow_rowset) + /************************************************************************* + * 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 = { statement_handle, f_concurrency, crow_keyset, crow_rowset }; +- 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); + SQLRETURN ret = SQL_ERROR; -- TRACE("(statement_handle %p, f_concurrency %d, crow_keyset %s, crow_rowset %d)\n", statement_handle, +- if (!handle) return SQL_INVALID_HANDLE; + FIXME("(statement_handle %p, f_concurrency %d, crow_keyset %s, crow_rowset %d)\n", statement_handle, - f_concurrency, debugstr_sqllen(crow_keyset), crow_rowset); ++ f_concurrency, debugstr_sqllen(crow_keyset), crow_rowset); +- params.StatementHandle = handle->unix_handle; - ret = ODBC_CALL( SQLSetScrollOptions, ¶ms ); - TRACE("Returning %d\n", ret); return ret; @@ -1828,37 +2153,50 @@ index 679f3d7380e..3927d00673e 100644 /************************************************************************* * SQLColAttributesW [ODBC32.106] */ -@@ -1839,22 +1206,11 @@ SQLRETURN WINAPI SQLColAttributesW(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLI - SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, - SQLLEN *pfDesc) +-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 = { hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc }; +- struct SQLColAttributesW_params params = { 0, ColumnNumber, FieldIdentifier, CharacterAttributes, BufferLength, +- StringLength }; +- struct handle *handle = StatementHandle; +- INT64 attrs; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; -- TRACE("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol, +- TRACE("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttributes %p, BufferLength %d, " +- "StringLength %p, NumericAttributes %p)\n", StatementHandle, ColumnNumber, FieldIdentifier, +- CharacterAttributes, BufferLength, StringLength, NumericAttributes); + FIXME("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol, - fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); ++ fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); -- ret = ODBC_CALL( SQLColAttributesW, ¶ms ); +- if (!handle) return SQL_INVALID_HANDLE; - -- if (ret == SQL_SUCCESS && SQLColAttributes_KnownStringAttribute(fDescType) && rgbDesc && pcbDesc && -- *pcbDesc != lstrlenW(rgbDesc) * 2) +- 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"); -- *pcbDesc = lstrlenW(rgbDesc) * 2; +- *StringLength = wcslen(CharacterAttributes) * 2; - } - - TRACE("Returning %d\n", ret); return ret; } -@@ -1865,16 +1221,12 @@ SQLRETURN WINAPI SQLConnectW(SQLHDBC ConnectionHandle, WCHAR *ServerName, SQLSMA +@@ -2012,20 +1221,12 @@ SQLRETURN WINAPI SQLConnectW(SQLHDBC ConnectionHandle, WCHAR *ServerName, SQLSMA WCHAR *UserName, SQLSMALLINT NameLength2, WCHAR *Authentication, SQLSMALLINT NameLength3) { -- struct SQLConnectW_params params = { ConnectionHandle, ServerName, NameLength1, UserName, NameLength2, -- Authentication, NameLength3 }; +- struct SQLConnectW_params params = { 0, ServerName, NameLength1, UserName, NameLength2, Authentication, +- NameLength3 }; +- struct handle *handle = ConnectionHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -1867,18 +2205,23 @@ index 679f3d7380e..3927d00673e 100644 " 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; } -@@ -1885,28 +1237,15 @@ SQLRETURN WINAPI SQLDescribeColW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNu +@@ -2036,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 = { StatementHandle, ColumnNumber, ColumnName, BufferLength, -- NameLength, DataType, ColumnSize, DecimalDigits, 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; @@ -1887,41 +2230,54 @@ index 679f3d7380e..3927d00673e 100644 " ColumnSize %p, DecimalDigits %p, Nullable %p)\n", StatementHandle, ColumnNumber, ColumnName, BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); - if (!NameLength) NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ - -- ret = ODBC_CALL( SQLDescribeColW, ¶ms ); -- if (ret >= 0) +- 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) TRACE("ColumnSize %s\n", debugstr_sqlulen(*ColumnSize)); +- 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); - } -- ++ if (!NameLength) NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ + - TRACE("Returning %d\n", ret); return ret; } -@@ -1917,24 +1256,12 @@ SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, - WCHAR *Sqlstate, SQLINTEGER *NativeError, WCHAR *MessageText, +@@ -2073,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 = { EnvironmentHandle, ConnectionHandle, StatementHandle, Sqlstate, -- NativeError, MessageText, BufferLength, 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," +- 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); ++ StatementHandle, Sqlstate, NativeError, MessageText, BufferLength, TextLength); -- ret = ODBC_CALL( SQLErrorW, ¶ms ); -- -- if (ret == SQL_SUCCESS) +- 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(" SqlState %s\n", debugstr_wn(SqlState, 5)); - TRACE(" Error %d\n", *NativeError); - TRACE(" MessageText %s\n", debugstr_wn(MessageText, *TextLength)); - } @@ -1930,11 +2286,12 @@ index 679f3d7380e..3927d00673e 100644 return ret; } -@@ -1943,14 +1270,11 @@ SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, +@@ -2103,18 +1270,11 @@ SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, */ SQLRETURN WINAPI SQLExecDirectW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength) { -- struct SQLExecDirectW_params params = { StatementHandle, StatementText, TextLength }; +- struct SQLExecDirectW_params params = { 0, StatementText, TextLength }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -1942,16 +2299,20 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -1960,14 +1284,11 @@ SQLRETURN WINAPI SQLExecDirectW(SQLHSTMT StatementHandle, WCHAR *StatementText, +@@ -2124,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 = { StatementHandle, CursorName, BufferLength, NameLength }; +- struct SQLGetCursorNameW_params params = { 0, CursorName, BufferLength, NameLength }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -1959,16 +2320,20 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -1976,14 +1297,11 @@ SQLRETURN WINAPI SQLGetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, +@@ -2144,18 +1297,11 @@ SQLRETURN WINAPI SQLGetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, */ SQLRETURN WINAPI SQLPrepareW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength) { -- struct SQLPrepareW_params params = { StatementHandle, StatementText, TextLength }; +- struct SQLPrepareW_params params = { 0, StatementText, TextLength }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -1976,16 +2341,20 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -1992,14 +1310,11 @@ SQLRETURN WINAPI SQLPrepareW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQL +@@ -2164,18 +1310,11 @@ SQLRETURN WINAPI SQLPrepareW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQL */ SQLRETURN WINAPI SQLSetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, SQLSMALLINT NameLength) { -- struct SQLSetCursorNameW_params params = { StatementHandle, CursorName, NameLength }; +- struct SQLSetCursorNameW_params params = { 0, CursorName, NameLength }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -1993,18 +2362,22 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -2011,25 +1326,12 @@ SQLRETURN WINAPI SQLColAttributeW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnN +@@ -2187,30 +1326,12 @@ SQLRETURN WINAPI SQLColAttributeW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnN SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLLEN *NumericAttribute) { -- struct SQLColAttributeW_params params = { StatementHandle, ColumnNumber, FieldIdentifier, -- CharacterAttribute, BufferLength, StringLength, -- NumericAttribute }; +- struct SQLColAttributeW_params params = { 0, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength, +- StringLength }; +- struct handle *handle = StatementHandle; +- INT64 attr; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -2013,25 +2386,29 @@ index 679f3d7380e..3927d00673e 100644 " StringLength %p NumericAttribute %p\n", StatementHandle, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength, StringLength, NumericAttribute); -- ret = ODBC_CALL( SQLColAttributeW, ¶ms ); +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; +- params.NumericAttribute = &attr; +- if (SUCCESS((ret = ODBC_CALL( SQLColAttributeW, ¶ms )))) *NumericAttribute = attr; - - if (ret == SQL_SUCCESS && CharacterAttribute != NULL && SQLColAttributes_KnownStringAttribute(FieldIdentifier) && -- StringLength && *StringLength != lstrlenW(CharacterAttribute) * 2) +- StringLength && *StringLength != wcslen(CharacterAttribute) * 2) - { - TRACE("CHEAT: resetting name length for ADO\n"); -- *StringLength = lstrlenW(CharacterAttribute) * 2; +- *StringLength = wcslen(CharacterAttribute) * 2; - } - - TRACE("Returning %d\n", ret); return ret; } -@@ -2039,15 +1341,11 @@ SQLRETURN WINAPI SQLColAttributeW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnN +@@ -2220,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 = { ConnectionHandle, Attribute, Value, -- BufferLength, StringLength }; +- struct SQLGetConnectAttrW_params params = { 0, Attribute, Value, BufferLength, StringLength }; +- struct handle *handle = ConnectionHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -2039,17 +2416,20 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -2057,15 +1355,11 @@ SQLRETURN WINAPI SQLGetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribu +@@ -2241,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 = { DescriptorHandle, RecNumber, FieldIdentifier, Value, -- BufferLength, StringLength }; +- struct SQLGetDescFieldW_params params = { 0, RecNumber, FieldIdentifier, Value, BufferLength, StringLength }; +- struct handle *handle = DescriptorHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -2057,17 +2437,22 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -2077,16 +1371,12 @@ SQLRETURN WINAPI SQLGetDescRecW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber +@@ -2264,22 +1371,12 @@ SQLRETURN WINAPI SQLGetDescRecW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber SQLSMALLINT *SubType, SQLLEN *Length, SQLSMALLINT *Precision, SQLSMALLINT *Scale, SQLSMALLINT *Nullable) { -- struct SQLGetDescRecW_params params = { DescriptorHandle, RecNumber, Name, BufferLength, StringLength, -- Type, SubType, Length, Precision, Scale, 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; @@ -2076,17 +2461,22 @@ index 679f3d7380e..3927d00673e 100644 " Length %p, Precision %p, Scale %p, Nullable %p)\n", DescriptorHandle, RecNumber, Name, BufferLength, StringLength, Type, SubType, Length, Precision, Scale, Nullable); -- ret = ODBC_CALL( SQLGetDescRecW, ¶ms ); +- 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; } -@@ -2097,15 +1387,11 @@ SQLRETURN WINAPI SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLS +@@ -2290,43 +1387,27 @@ SQLRETURN WINAPI SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLS SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) { -- struct SQLGetDiagFieldW_params params = { HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, -- BufferLength, StringLength }; +- struct SQLGetDiagFieldW_params params = { HandleType, 0, RecNumber, DiagIdentifier, DiagInfo, BufferLength, +- StringLength }; +- struct handle *handle = Handle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -2094,35 +2484,50 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -2116,16 +1402,12 @@ SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMA - WCHAR *Sqlstate, SQLINTEGER *NativeError, WCHAR *MessageText, - SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) + /************************************************************************* + * 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, Handle, RecNumber, Sqlstate, NativeError, -- MessageText, BufferLength, 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," +- 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 %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; } -@@ -2135,10 +1417,9 @@ SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMA +@@ -2336,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 = { StatementHandle, Attribute, Value, BufferLength, StringLength }; +- struct SQLGetStmtAttrW_params params = { 0, Attribute, Value, BufferLength, StringLength }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -2131,38 +2536,47 @@ index 679f3d7380e..3927d00673e 100644 Attribute, Value, BufferLength, StringLength); if (!Value) -@@ -2147,8 +1428,6 @@ SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, +@@ -2349,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; } -@@ -2158,14 +1437,11 @@ SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, +@@ -2363,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 = { ConnectionHandle, Attribute, Value, 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, +- 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); ++ StringLength); +- params.ConnectionHandle = handle->unix_handle; - ret = ODBC_CALL( SQLSetConnectAttrW, ¶ms ); - TRACE("Returning %d\n", ret); return ret; } -@@ -2176,17 +1452,14 @@ SQLRETURN WINAPI SQLColumnsW(SQLHSTMT StatementHandle, WCHAR *CatalogName, SQLSM +@@ -2385,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 = { StatementHandle, CatalogName, NameLength1, SchemaName, -- NameLength2, TableName, NameLength3, ColumnName, NameLength4 }; +- struct SQLColumnsW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, +- NameLength3, ColumnName, NameLength4 }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -2172,18 +2586,22 @@ index 679f3d7380e..3927d00673e 100644 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; } -@@ -2197,17 +1470,13 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl +@@ -2410,21 +1470,13 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl SQLSMALLINT Length, WCHAR *OutConnectionString, SQLSMALLINT BufferLength, SQLSMALLINT *Length2, SQLUSMALLINT DriverCompletion) { -- struct SQLDriverConnectW_params params = { ConnectionHandle, WindowHandle, InConnectionString, Length, -- OutConnectionString, BufferLength, Length2, DriverCompletion }; +- struct SQLDriverConnectW_params params = { 0, WindowHandle, InConnectionString, Length, OutConnectionString, +- BufferLength, Length2, DriverCompletion }; +- struct handle *handle = ConnectionHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -2193,32 +2611,40 @@ index 679f3d7380e..3927d00673e 100644 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; } -@@ -2216,13 +1485,10 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl +@@ -2433,17 +1485,10 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl */ SQLRETURN WINAPI SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value) { -- struct SQLGetConnectOptionW_params params = { ConnectionHandle, Option, 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; } -@@ -2232,14 +1498,11 @@ SQLRETURN WINAPI SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Opt +@@ -2453,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 = { ConnectionHandle, InfoType, InfoValue, BufferLength, StringLength }; +- struct SQLGetInfoW_params params = { 0, InfoType, InfoValue, BufferLength, StringLength }; +- struct handle *handle = ConnectionHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -2226,49 +2652,61 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -2248,13 +1511,10 @@ SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQ +@@ -2473,17 +1511,10 @@ SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQ */ SQLRETURN WINAPI SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType) { -- struct SQLGetTypeInfoW_params params = { StatementHandle, DataType }; +- struct SQLGetTypeInfoW_params params = { 0, DataType }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; +- +- TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); + SQLRETURN ret = SQL_ERROR; -- TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); +- if (!handle) return SQL_INVALID_HANDLE; + FIXME("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); +- params.StatementHandle = handle->unix_handle; - ret = ODBC_CALL( SQLGetTypeInfoW, ¶ms ); - TRACE("Returning %d\n", ret); return ret; } -@@ -2263,13 +1523,10 @@ SQLRETURN WINAPI SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType) +@@ -2492,17 +1523,10 @@ SQLRETURN WINAPI SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType) */ SQLRETURN WINAPI SQLSetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLLEN Value) { -- struct SQLSetConnectOptionW_params params = { ConnectionHandle, Option, Value }; +- struct SQLSetConnectOptionW_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_sqllen(Value)); + FIXME("(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; } -@@ -2281,17 +1538,13 @@ SQLRETURN WINAPI SQLSpecialColumnsW(SQLHSTMT StatementHandle, SQLUSMALLINT Ident +@@ -2514,21 +1538,13 @@ SQLRETURN WINAPI SQLSpecialColumnsW(SQLHSTMT StatementHandle, SQLUSMALLINT Ident SQLSMALLINT NameLength2, SQLWCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Scope, SQLUSMALLINT Nullable) { -- struct SQLSpecialColumnsW_params params = { StatementHandle, IdentifierType, CatalogName, NameLength1, -- SchemaName, NameLength2, TableName, NameLength3, Scope, 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; @@ -2278,17 +2716,21 @@ index 679f3d7380e..3927d00673e 100644 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; } -@@ -2302,17 +1555,13 @@ SQLRETURN WINAPI SQLStatisticsW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, +@@ -2539,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 = { StatementHandle, CatalogName, NameLength1, SchemaName, -- NameLength2, TableName, NameLength3, Unique, Reserved }; +- struct SQLStatisticsW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, +- NameLength3, Unique, Reserved }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -2298,17 +2740,21 @@ index 679f3d7380e..3927d00673e 100644 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; } -@@ -2323,17 +1572,13 @@ SQLRETURN WINAPI SQLTablesW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQL +@@ -2564,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 = { StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, -- TableName, NameLength3, TableType, NameLength4 }; +- struct SQLTablesW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, TableName, +- NameLength3, TableType, NameLength4 }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -2318,58 +2764,87 @@ index 679f3d7380e..3927d00673e 100644 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; } -@@ -2344,15 +1589,11 @@ SQLRETURN WINAPI SQLBrowseConnectW(SQLHDBC hdbc, SQLWCHAR *szConnStrIn, SQLSMALL - SQLWCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, - SQLSMALLINT *pcbConnStrOut) + /************************************************************************* + * 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 = { hdbc, szConnStrIn, cbConnStrIn, szConnStrOut, -- cbConnStrOutMax, pcbConnStrOut }; +- struct SQLBrowseConnectW_params params = { 0, InConnectionString, StringLength1, OutConnectionString, +- BufferLength, StringLength2 }; +- struct handle *handle = ConnectionHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; -- TRACE("(hdbc %p, szConnStrIn %s, cbConnStrIn %d, szConnStrOut %p, cbConnStrOutMax %d, pcbConnStrOut %p)\n", +- TRACE("(ConnectionHandle %p, InConnectionString %s, StringLength1 %d, OutConnectionString %p, BufferLength %d, " +- "StringLength2 %p)\n", ConnectionHandle, debugstr_wn(InConnectionString, StringLength1), StringLength1, +- OutConnectionString, BufferLength, StringLength2); + FIXME("(hdbc %p, szConnStrIn %s, cbConnStrIn %d, szConnStrOut %p, cbConnStrOutMax %d, pcbConnStrOut %p)\n", - hdbc, debugstr_wn(szConnStrIn, cbConnStrIn), cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut); ++ hdbc, debugstr_wn(szConnStrIn, cbConnStrIn), cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut); +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.ConnectionHandle = handle->unix_handle; - ret = ODBC_CALL( SQLBrowseConnectW, ¶ms ); - TRACE("Returning %d\n", ret); return ret; } -@@ -2363,20 +1604,15 @@ SQLRETURN WINAPI SQLColumnPrivilegesW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, S - SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, - SQLSMALLINT cbTableName, SQLWCHAR *szColumnName, SQLSMALLINT cbColumnName) + /************************************************************************* + * 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 = { hstmt, szCatalogName, cbCatalogName, szSchemaName, -- cbSchemaName, szTableName, cbTableName, szColumnName, -- cbColumnName }; +- 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); + SQLRETURN ret = SQL_ERROR; -- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," +- 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_wn(szCatalogName, cbCatalogName), cbCatalogName, - debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, - debugstr_wn(szTableName, cbTableName), cbTableName, - debugstr_wn(szColumnName, cbColumnName), cbColumnName); ++ " 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); +- params.StatementHandle = handle->unix_handle; - ret = ODBC_CALL( SQLColumnPrivilegesW, ¶ms ); - TRACE("Returning %d\n", ret); return ret; } -@@ -2387,26 +1623,12 @@ SQLRETURN WINAPI SQLDataSourcesW(SQLHENV EnvironmentHandle, SQLUSMALLINT Directi +@@ -2639,215 +1623,136 @@ SQLRETURN WINAPI SQLDataSourcesW(SQLHENV EnvironmentHandle, SQLUSMALLINT Directi SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, WCHAR *Description, SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2) { -- struct SQLDataSourcesW_params params = { EnvironmentHandle, Direction, ServerName, BufferLength1, -- NameLength1, Description, BufferLength2, NameLength2 }; +- struct SQLDataSourcesW_params params = { 0, Direction, ServerName, BufferLength1, NameLength1, Description, +- BufferLength2, NameLength2 }; +- struct handle *handle = EnvironmentHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_NO_DATA; @@ -2378,6 +2853,9 @@ index 679f3d7380e..3927d00673e 100644 " 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)) @@ -2393,158 +2871,258 @@ index 679f3d7380e..3927d00673e 100644 return ret; } -@@ -2419,13 +1641,9 @@ SQLRETURN WINAPI SQLForeignKeysW(SQLHSTMT hstmt, SQLWCHAR *szPkCatalogName, SQLS - SQLSMALLINT cbFkCatalogName, SQLWCHAR *szFkSchemaName, - SQLSMALLINT cbFkSchemaName, SQLWCHAR *szFkTableName, SQLSMALLINT cbFkTableName) + /************************************************************************* + * 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 = { hstmt, szPkCatalogName, cbPkCatalogName, szPkSchemaName, -- cbPkSchemaName, szPkTableName, cbPkTableName, szFkCatalogName, -- cbFkCatalogName, szFkSchemaName, cbFkSchemaName, szFkTableName, -- 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("(hstmt %p, szPkCatalogName %s, cbPkCatalogName %d, szPkSchemaName %s, cbPkSchemaName %d," +- 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, -@@ -2435,8 +1653,6 @@ SQLRETURN WINAPI SQLForeignKeysW(SQLHSTMT hstmt, SQLWCHAR *szPkCatalogName, SQLS - debugstr_wn(szFkSchemaName, cbFkSchemaName), cbFkSchemaName, - debugstr_wn(szFkTableName, cbFkTableName), cbFkTableName); ++ " 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; } -@@ -2446,14 +1662,11 @@ SQLRETURN WINAPI SQLForeignKeysW(SQLHSTMT hstmt, SQLWCHAR *szPkCatalogName, SQLS - SQLRETURN WINAPI SQLNativeSqlW(SQLHDBC hdbc, SQLWCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLWCHAR *szSqlStr, - SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr) + /************************************************************************* + * 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 = { hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, 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; -- TRACE("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc, +- 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); ++ 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; } -@@ -2464,18 +1677,14 @@ SQLRETURN WINAPI SQLPrimaryKeysW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMA - SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, - SQLSMALLINT cbTableName) + /************************************************************************* + * 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 = { hstmt, szCatalogName, cbCatalogName, szSchemaName, -- cbSchemaName, szTableName, cbTableName }; +- 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); + SQLRETURN ret = SQL_ERROR; -- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," +- if (!handle) return SQL_INVALID_HANDLE; + 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); ++ " cbTableName %d)\n", hstmt, ++ debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName, ++ debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, ++ debugstr_wn(szTableName, cbTableName), cbTableName); +- params.StatementHandle = handle->unix_handle; - ret = ODBC_CALL( SQLPrimaryKeysW, ¶ms ); - TRACE("Returning %d\n", ret); return ret; } -@@ -2486,20 +1695,15 @@ SQLRETURN WINAPI SQLProcedureColumnsW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, S - SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szProcName, - SQLSMALLINT cbProcName, SQLWCHAR *szColumnName, SQLSMALLINT cbColumnName) + /************************************************************************* + * 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 = { hstmt, szCatalogName, cbCatalogName, szSchemaName, -- cbSchemaName, szProcName, cbProcName, -- szColumnName, cbColumnName }; +- struct SQLProcedureColumnsW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, +- ProcName, NameLength3, ColumnName, NameLength4 }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; -- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," +- 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; + 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); ++ " 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; } -@@ -2510,16 +1714,12 @@ SQLRETURN WINAPI SQLProceduresW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMAL - SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szProcName, - SQLSMALLINT cbProcName) + /************************************************************************* + * 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 = { hstmt, szCatalogName, cbCatalogName, szSchemaName, -- cbSchemaName, szProcName, cbProcName }; +- struct SQLProceduresW_params params = { 0, CatalogName, NameLength1, SchemaName, NameLength2, ProcName, +- NameLength3 }; +- struct handle *handle = StatementHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; -- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," +- 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); + 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); ++ " cbProcName %d)\n", hstmt, debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName, ++ debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, debugstr_wn(szProcName, cbProcName), cbProcName); +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.StatementHandle = handle->unix_handle; - ret = ODBC_CALL( SQLProceduresW, ¶ms ); - TRACE("Returning %d\n", ret); return ret; } -@@ -2530,16 +1730,12 @@ SQLRETURN WINAPI SQLTablePrivilegesW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQ - SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, - SQLSMALLINT cbTableName) + /************************************************************************* + * 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 = { hstmt, szCatalogName, cbCatalogName, szSchemaName, -- cbSchemaName, szTableName, cbTableName }; +- 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); + SQLRETURN ret = SQL_ERROR; -- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," +- if (!handle) return SQL_INVALID_HANDLE; + 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); ++ " cbTableName %d)\n", hstmt, debugstr_wn(szCatalogName, cbCatalogName), cbCatalogName, ++ debugstr_wn(szSchemaName, cbSchemaName), cbSchemaName, debugstr_wn(szTableName, cbTableName), cbTableName); +- params.StatementHandle = handle->unix_handle; - ret = ODBC_CALL( SQLTablePrivilegesW, ¶ms ); - TRACE("Returning %d\n", ret); return ret; } -@@ -2551,20 +1747,12 @@ SQLRETURN WINAPI SQLDriversW(SQLHENV EnvironmentHandle, SQLUSMALLINT fDirection, - SQLWCHAR *szDriverAttributes, SQLSMALLINT cbDriverAttrMax, - SQLSMALLINT *pcbDriverAttr) + /************************************************************************* + * 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 = { EnvironmentHandle, fDirection, szDriverDesc, cbDriverDescMax, -- pcbDriverDesc, szDriverAttributes, cbDriverAttrMax, 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); +- +- if (!handle) return SQL_INVALID_HANDLE; +- +- params.EnvironmentHandle = handle->unix_handle; +- ret = ODBC_CALL( SQLDriversW, ¶ms ); + SQLRETURN ret = SQL_NO_DATA; -- TRACE("(EnvironmentHandle %p, Direction %d, szDriverDesc %p, cbDriverDescMax %d, pcbDriverDesc %p," -+ 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); - -- ret = ODBC_CALL( SQLDriversW, ¶ms ); -- -- if (ret == SQL_NO_DATA && fDirection == SQL_FETCH_FIRST) +- 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"); -- ++ 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); + - TRACE("Returning %d\n", ret); return ret; } -@@ -2574,14 +1762,11 @@ SQLRETURN WINAPI SQLDriversW(SQLHENV EnvironmentHandle, SQLUSMALLINT fDirection, +@@ -2857,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 = { DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength }; +- struct SQLSetDescFieldW_params params = { 0, RecNumber, FieldIdentifier, Value, BufferLength }; +- struct handle *handle = DescriptorHandle; - SQLRETURN ret; + SQLRETURN ret = SQL_ERROR; @@ -2552,53 +3130,53 @@ index 679f3d7380e..3927d00673e 100644 + 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; } -@@ -2591,20 +1776,11 @@ SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumb +@@ -2878,24 +1776,11 @@ SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumb SQLRETURN WINAPI SQLSetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength) { -- struct SQLSetStmtAttrW_params params = { StatementHandle, Attribute, Value, 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; -- 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; - ret = ODBC_CALL( SQLSetStmtAttrW, ¶ms ); - if (ret == SQL_ERROR && (Attribute == SQL_ROWSET_SIZE || Attribute == SQL_ATTR_ROW_ARRAY_SIZE)) - { - TRACE("CHEAT: returning SQL_SUCCESS to ADO\n"); - return SQL_SUCCESS; - } -- ++ FIXME("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value, ++ StringLength); + - TRACE("Returning %d\n", ret); return ret; } -@@ -2615,41 +1791,11 @@ SQLRETURN WINAPI SQLGetDiagRecA(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMA - SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText, +@@ -2903,33 +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) { -- struct SQLGetDiagRecA_params params = { HandleType, Handle, RecNumber, Sqlstate, NativeError, -- MessageText, BufferLength, TextLength }; -- SQLRETURN ret; -+ SQLRETURN ret = SQL_ERROR; - -- TRACE("(HandleType %d, Handle %p, RecNumber %d, Sqlstate %p, NativeError %p, MessageText %p, BufferLength %d," -+ 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); - -- ret = ODBC_CALL( SQLGetDiagRecA, ¶ms ); -- TRACE("Returning %d\n", ret); - return ret; - } -- +- return SQLGetDiagRec( HandleType, Handle, RecNumber, SqlState, NativeError, MessageText, BufferLength, +- TextLength ); +-} - -/*********************************************************************** - * DllMain [Internal] Initializes the internal 'ODBC32.DLL'. @@ -2606,30 +3184,34 @@ index 679f3d7380e..3927d00673e 100644 -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() && !WINE_UNIX_CALL( process_attach, NULL )) +- if (!__wine_init_unix_call()) - { -- ODBC_ReplicateToRegistry(); +- if (WINE_UNIX_CALL( process_attach, NULL )) __wine_unixlib_handle = 0; - } - break; - - case DLL_PROCESS_DETACH: - if (reserved) break; -- WINE_UNIX_CALL( process_detach, NULL ); - } -- ++ 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 2883a5fb56a..00000000000 +index dbc0da8d274..00000000000 --- a/dlls/odbc32/unixlib.c +++ /dev/null -@@ -1,1501 +0,0 @@ +@@ -1,3673 +0,0 @@ -/* - * Win32 ODBC functions - * @@ -2648,12 +3230,6 @@ index 2883a5fb56a..00000000000 - * 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. - */ - -#if 0 @@ -2672,1210 +3248,1121 @@ index 2883a5fb56a..00000000000 -#include "windef.h" -#include "winbase.h" -#include "winternl.h" --#include "wine/debug.h" -#include "sql.h" --#include "sqltypes.h" +-#include "sqlucode.h" -#include "sqlext.h" - --#include "unixlib.h" -#include "wine/debug.h" +-#include "unixlib.h" - --WINE_DECLARE_DEBUG_CHANNEL(winediag); +-WINE_DEFAULT_DEBUG_CHANNEL(odbc); - --static void *libodbc; +-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 SQLRETURN (*pSQLAllocConnect)(SQLHENV,SQLHDBC*); --static SQLRETURN (*pSQLAllocEnv)(SQLHENV*); --static SQLRETURN (*pSQLAllocHandle)(SQLSMALLINT,SQLHANDLE,SQLHANDLE*); --static SQLRETURN (*pSQLAllocHandleStd)(SQLSMALLINT,SQLHANDLE,SQLHANDLE*); --static SQLRETURN (*pSQLAllocStmt)(SQLHDBC,SQLHSTMT*); --static SQLRETURN (*pSQLBindCol)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*); --static SQLRETURN (*pSQLBindParam)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN*); --static SQLRETURN (*pSQLBindParameter)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*); --static SQLRETURN (*pSQLBrowseConnect)(SQLHDBC,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); --static SQLRETURN (*pSQLBrowseConnectW)(SQLHDBC,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*); --static SQLRETURN (*pSQLBulkOperations)(SQLHSTMT,SQLSMALLINT); --static SQLRETURN (*pSQLCancel)(SQLHSTMT); --static SQLRETURN (*pSQLCloseCursor)(SQLHSTMT); --static SQLRETURN (*pSQLColAttribute)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*); --static SQLRETURN (*pSQLColAttributeW)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*); --static SQLRETURN (*pSQLColAttributes)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*); --static SQLRETURN (*pSQLColAttributesW)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*); --static SQLRETURN (*pSQLColumnPrivileges)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLColumnPrivilegesW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLColumns)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLColumnsW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLConnect)(SQLHDBC,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLConnectW)(SQLHDBC,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLCopyDesc)(SQLHDESC,SQLHDESC); --static SQLRETURN (*pSQLDataSources)(SQLHENV,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); --static SQLRETURN (*pSQLDataSourcesA)(SQLHENV,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); --static SQLRETURN (*pSQLDataSourcesW)(SQLHENV,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*); --static SQLRETURN (*pSQLDescribeCol)(SQLHSTMT,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*); --static SQLRETURN (*pSQLDescribeColW)(SQLHSTMT,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*); --static SQLRETURN (*pSQLDescribeParam)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*); --static SQLRETURN (*pSQLDisconnect)(SQLHDBC); --static SQLRETURN (*pSQLDriverConnect)(SQLHDBC,SQLHWND,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLUSMALLINT); --static SQLRETURN (*pSQLDriverConnectW)(SQLHDBC,SQLHWND,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLUSMALLINT); --static SQLRETURN (*pSQLDrivers)(SQLHENV,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); --static SQLRETURN (*pSQLDriversW)(SQLHENV,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*); --static SQLRETURN (*pSQLEndTran)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT); --static SQLRETURN (*pSQLError)(SQLHENV,SQLHDBC,SQLHSTMT,SQLCHAR*,SQLINTEGER*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); --static SQLRETURN (*pSQLErrorW)(SQLHENV,SQLHDBC,SQLHSTMT,SQLWCHAR*,SQLINTEGER*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*); --static SQLRETURN (*pSQLExecDirect)(SQLHSTMT,SQLCHAR*,SQLINTEGER); --static SQLRETURN (*pSQLExecDirectW)(SQLHSTMT,SQLWCHAR*,SQLINTEGER); --static SQLRETURN (*pSQLExecute)(SQLHSTMT); --static SQLRETURN (*pSQLExtendedFetch)(SQLHSTMT,SQLUSMALLINT,SQLLEN,SQLULEN*,SQLUSMALLINT*); --static SQLRETURN (*pSQLFetch)(SQLHSTMT); --static SQLRETURN (*pSQLFetchScroll)(SQLHSTMT,SQLSMALLINT,SQLLEN); --static SQLRETURN (*pSQLForeignKeys)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLForeignKeysW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLFreeConnect)(SQLHDBC); --static SQLRETURN (*pSQLFreeEnv)(SQLHENV); --static SQLRETURN (*pSQLFreeHandle)(SQLSMALLINT,SQLHANDLE); --static SQLRETURN (*pSQLFreeStmt)(SQLHSTMT,SQLUSMALLINT); --static SQLRETURN (*pSQLGetConnectAttr)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*); --static SQLRETURN (*pSQLGetConnectAttrW)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*); --static SQLRETURN (*pSQLGetConnectOption)(SQLHDBC,SQLUSMALLINT,SQLPOINTER); --static SQLRETURN (*pSQLGetConnectOptionW)(SQLHDBC,SQLUSMALLINT,SQLPOINTER); --static SQLRETURN (*pSQLGetCursorName)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); --static SQLRETURN (*pSQLGetCursorNameW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*); --static SQLRETURN (*pSQLGetData)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*); --static SQLRETURN (*pSQLGetDescField)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLINTEGER*); --static SQLRETURN (*pSQLGetDescFieldW)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLINTEGER*); --static SQLRETURN (*pSQLGetDescRec)(SQLHDESC,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*,SQLLEN*,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*); --static SQLRETURN (*pSQLGetDescRecW)(SQLHDESC,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*,SQLLEN*,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*); --static SQLRETURN (*pSQLGetDiagField)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*); --static SQLRETURN (*pSQLGetDiagFieldW)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*); --static SQLRETURN (*pSQLGetDiagRec)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLCHAR*,SQLINTEGER*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); --static SQLRETURN (*pSQLGetDiagRecA)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLCHAR*,SQLINTEGER*, SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); --static SQLRETURN (*pSQLGetDiagRecW)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLWCHAR*,SQLINTEGER*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*); --static SQLRETURN (*pSQLGetEnvAttr)(SQLHENV,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*); --static SQLRETURN (*pSQLGetFunctions)(SQLHDBC,SQLUSMALLINT,SQLUSMALLINT*); --static SQLRETURN (*pSQLGetInfo)(SQLHDBC,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*); --static SQLRETURN (*pSQLGetInfoW)(SQLHDBC,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*); --static SQLRETURN (*pSQLGetStmtAttr)(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*); --static SQLRETURN (*pSQLGetStmtAttrW)(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*); --static SQLRETURN (*pSQLGetStmtOption)(SQLHSTMT,SQLUSMALLINT,SQLPOINTER); --static SQLRETURN (*pSQLGetTypeInfo)(SQLHSTMT,SQLSMALLINT); --static SQLRETURN (*pSQLGetTypeInfoW)(SQLHSTMT,SQLSMALLINT); --static SQLRETURN (*pSQLMoreResults)(SQLHSTMT); --static SQLRETURN (*pSQLNativeSql)(SQLHDBC,SQLCHAR*,SQLINTEGER,SQLCHAR*,SQLINTEGER,SQLINTEGER*); --static SQLRETURN (*pSQLNativeSqlW)(SQLHDBC,SQLWCHAR*,SQLINTEGER,SQLWCHAR*,SQLINTEGER,SQLINTEGER*); --static SQLRETURN (*pSQLNumParams)(SQLHSTMT,SQLSMALLINT*); --static SQLRETURN (*pSQLNumResultCols)(SQLHSTMT,SQLSMALLINT*); --static SQLRETURN (*pSQLParamData)(SQLHSTMT,SQLPOINTER*); --static SQLRETURN (*pSQLParamOptions)(SQLHSTMT,SQLULEN,SQLULEN*); --static SQLRETURN (*pSQLPrepare)(SQLHSTMT,SQLCHAR*,SQLINTEGER); --static SQLRETURN (*pSQLPrepareW)(SQLHSTMT,SQLWCHAR*,SQLINTEGER); --static SQLRETURN (*pSQLPrimaryKeys)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLPrimaryKeysW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLProcedureColumns)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLProcedureColumnsW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLProcedures)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLProceduresW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLPutData)(SQLHSTMT,SQLPOINTER,SQLLEN); --static SQLRETURN (*pSQLRowCount)(SQLHSTMT,SQLLEN*); --static SQLRETURN (*pSQLSetConnectAttr)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER); --static SQLRETURN (*pSQLSetConnectAttrW)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER); --static SQLRETURN (*pSQLSetConnectOption)(SQLHDBC,SQLUSMALLINT,SQLULEN); --static SQLRETURN (*pSQLSetConnectOptionW)(SQLHDBC,SQLUSMALLINT,SQLULEN); --static SQLRETURN (*pSQLSetCursorName)(SQLHSTMT,SQLCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLSetCursorNameW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLSetDescField)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER); --static SQLRETURN (*pSQLSetDescFieldW)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER); --static SQLRETURN (*pSQLSetDescRec)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLLEN,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN*,SQLLEN*); --static SQLRETURN (*pSQLSetEnvAttr)(SQLHENV,SQLINTEGER,SQLPOINTER,SQLINTEGER); --static SQLRETURN (*pSQLSetParam)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN*); --static SQLRETURN (*pSQLSetPos)(SQLHSTMT,SQLSETPOSIROW,SQLUSMALLINT,SQLUSMALLINT); --static SQLRETURN (*pSQLSetScrollOptions)(SQLHSTMT,SQLUSMALLINT,SQLLEN,SQLUSMALLINT); --static SQLRETURN (*pSQLSetStmtAttr)(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER); --static SQLRETURN (*pSQLSetStmtAttrW)(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER); --static SQLRETURN (*pSQLSetStmtOption)(SQLHSTMT,SQLUSMALLINT,SQLULEN); --static SQLRETURN (*pSQLSpecialColumns)(SQLHSTMT,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT); --static SQLRETURN (*pSQLSpecialColumnsW)(SQLHSTMT,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT); --static SQLRETURN (*pSQLStatistics)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT); --static SQLRETURN (*pSQLStatisticsW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT); --static SQLRETURN (*pSQLTablePrivileges)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLTablePrivilegesW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLTables)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLTablesW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); --static SQLRETURN (*pSQLTransact)(SQLHENV,SQLHDBC,SQLUSMALLINT); +-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; - --static NTSTATUS load_odbc(void); +- 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 ) -{ -- if (!load_odbc()) return STATUS_DLL_NOT_FOUND; -- return STATUS_SUCCESS; --} -- --static NTSTATUS odbc_process_detach( void *args ) --{ -- if (libodbc) dlclose( libodbc ); -- libodbc = NULL; +- replicate_to_registry(); - return STATUS_SUCCESS; -} - -static NTSTATUS wrap_SQLAllocConnect( void *args ) -{ - struct SQLAllocConnect_params *params = args; -- -- if (!pSQLAllocConnect) return SQL_ERROR; -- return pSQLAllocConnect(params->EnvironmentHandle, params->ConnectionHandle); +- return SQLAllocConnect( (SQLHENV)(ULONG_PTR)params->EnvironmentHandle, (SQLHDBC *)¶ms->ConnectionHandle ); -} - -static NTSTATUS wrap_SQLAllocEnv( void *args ) -{ - struct SQLAllocEnv_params *params = args; -- -- if (!pSQLAllocEnv) return SQL_ERROR; -- return pSQLAllocEnv(params->EnvironmentHandle); +- return SQLAllocEnv( (SQLHENV *)¶ms->EnvironmentHandle ); -} - -static NTSTATUS wrap_SQLAllocHandle( void *args ) -{ - struct SQLAllocHandle_params *params = args; -- -- if (!pSQLAllocHandle) return SQL_ERROR; -- return pSQLAllocHandle(params->HandleType, params->InputHandle, params->OutputHandle); +- return SQLAllocHandle( params->HandleType, (SQLHANDLE)(ULONG_PTR)params->InputHandle, +- (SQLHANDLE *)¶ms->OutputHandle ); -} - -static NTSTATUS wrap_SQLAllocHandleStd( void *args ) -{ - struct SQLAllocHandleStd_params *params = args; -- -- if (!pSQLAllocHandleStd) return SQL_ERROR; -- return pSQLAllocHandleStd(params->HandleType, params->InputHandle, params->OutputHandle); +- return SQLAllocHandleStd( params->HandleType, (SQLHANDLE)(ULONG_PTR)params->InputHandle, +- (SQLHANDLE *)¶ms->OutputHandle ); -} - -static NTSTATUS wrap_SQLAllocStmt( void *args ) -{ - struct SQLAllocStmt_params *params = args; -- -- if (!pSQLAllocStmt) return SQL_ERROR; -- return pSQLAllocStmt(params->ConnectionHandle, params->StatementHandle); +- return SQLAllocStmt( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, (SQLHSTMT *)¶ms->StatementHandle ); -} - -static NTSTATUS wrap_SQLBindCol( void *args ) -{ - struct SQLBindCol_params *params = args; -- -- if (!pSQLBindCol) return SQL_ERROR; -- return pSQLBindCol(params->StatementHandle, params->ColumnNumber, params->TargetType, -- params->TargetValue, params->BufferLength, params->StrLen_or_Ind); +- return SQLBindCol( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ColumnNumber, params->TargetType, +- params->TargetValue, params->BufferLength, (SQLLEN *)(ULONG_PTR)params->StrLen_or_Ind ); -} - -static NTSTATUS wrap_SQLBindParam( void *args ) -{ - struct SQLBindParam_params *params = args; -- -- if (!pSQLBindParam) return SQL_ERROR; -- return pSQLBindParam(params->StatementHandle, params->ParameterNumber, params->ValueType, +- return SQLBindParam( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ParameterNumber, params->ValueType, - params->ParameterType, params->LengthPrecision, params->ParameterScale, -- params->ParameterValue, params->StrLen_or_Ind); +- params->ParameterValue, (SQLLEN *)(ULONG_PTR)params->StrLen_or_Ind ); -} - -static NTSTATUS wrap_SQLBindParameter( void *args ) -{ - struct SQLBindParameter_params *params = args; -- -- if (!pSQLBindParameter) return SQL_ERROR; -- return pSQLBindParameter(params->hstmt, params->ipar, params->fParamType, params->fCType, -- params->fSqlType, params->cbColDef, params->ibScale, params->rgbValue, -- params->cbValueMax, params->pcbValue); +- return SQLBindParameter( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ParameterNumber, +- params->InputOutputType, params->ValueType, params->ParameterType, params->ColumnSize, +- params->DecimalDigits, params->ParameterValue, params->BufferLength, +- (SQLLEN *)(ULONG_PTR)params->StrLen_or_Ind ); -} - -static NTSTATUS wrap_SQLBrowseConnect( void *args ) -{ - struct SQLBrowseConnect_params *params = args; -- -- if (!pSQLBrowseConnect) return SQL_ERROR; -- return pSQLBrowseConnect(params->hdbc, params->szConnStrIn, params->cbConnStrIn, params->szConnStrOut, -- params->cbConnStrOutMax, params->pcbConnStrOut); +- 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; -- -- if (!pSQLBrowseConnectW) return SQL_ERROR; -- return pSQLBrowseConnectW(params->hdbc, params->szConnStrIn, params->cbConnStrIn, params->szConnStrOut, -- params->cbConnStrOutMax, params->pcbConnStrOut); +- 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; -- -- if (!pSQLBulkOperations) return SQL_ERROR; -- return pSQLBulkOperations(params->StatementHandle, params->Operation); +- return SQLBulkOperations( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Operation ); -} - -static NTSTATUS wrap_SQLCancel( void *args ) -{ - struct SQLCancel_params *params = args; -- -- if (!pSQLCancel) return SQL_ERROR; -- return pSQLCancel(params->StatementHandle); +- return SQLCancel( (SQLHSTMT)(ULONG_PTR)params->StatementHandle ); -} - -static NTSTATUS wrap_SQLCloseCursor( void *args ) -{ - struct SQLCloseCursor_params *params = args; -- -- if (!pSQLCloseCursor) return SQL_ERROR; -- return pSQLCloseCursor(params->StatementHandle); +- return SQLCloseCursor( (SQLHSTMT)(ULONG_PTR)params->StatementHandle ); -} - -static NTSTATUS wrap_SQLColAttribute( void *args ) -{ - struct SQLColAttribute_params *params = args; -- -- if (!pSQLColAttribute) return SQL_ERROR; -- return pSQLColAttribute(params->StatementHandle, params->ColumnNumber, params->FieldIdentifier, -- params->CharacterAttribute, params->BufferLength, params->StringLength, -- params->NumericAttribute); +- 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; -- -- if (!pSQLColAttributeW) return SQL_ERROR; -- return pSQLColAttributeW(params->StatementHandle, params->ColumnNumber, params->FieldIdentifier, -- params->CharacterAttribute, params->BufferLength, params->StringLength, -- params->NumericAttribute); +- 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; -- -- if (!pSQLColAttributes) return SQL_ERROR; -- return pSQLColAttributes(params->hstmt, params->icol, params->fDescType, params->rgbDesc, -- params->cbDescMax, params->pcbDesc, params->pfDesc); +- 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; -- -- if (!pSQLColAttributesW) return SQL_ERROR; -- return pSQLColAttributesW(params->hstmt, params->icol, params->fDescType, params->rgbDesc, -- params->cbDescMax, params->pcbDesc, params->pfDesc); +- 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; -- -- if (!pSQLColumnPrivileges) return SQL_ERROR; -- return pSQLColumnPrivileges(params->hstmt, params->szCatalogName, params->cbCatalogName, -- params->szSchemaName, params->cbSchemaName, params->szTableName, -- params->cbTableName, params->szColumnName, params->cbColumnName); +- 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; -- -- if (!pSQLColumnPrivilegesW) return SQL_ERROR; -- return pSQLColumnPrivilegesW(params->hstmt, params->szCatalogName, params->cbCatalogName, -- params->szSchemaName, params->cbSchemaName, params->szTableName, -- params->cbTableName, params->szColumnName, params->cbColumnName); +- 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; -- -- if (!pSQLColumns) return SQL_ERROR; -- return pSQLColumns(params->StatementHandle, params->CatalogName, params->NameLength1, +- return SQLColumns( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, params->NameLength1, - params->SchemaName, params->NameLength2, params->TableName, params->NameLength3, -- params->ColumnName, params->NameLength4); +- params->ColumnName, params->NameLength4 ); -} - -static NTSTATUS wrap_SQLColumnsW( void *args ) -{ - struct SQLColumnsW_params *params = args; -- -- if (!pSQLColumnsW) return SQL_ERROR; -- return pSQLColumnsW(params->StatementHandle, params->CatalogName, params->NameLength1, +- return SQLColumnsW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, params->NameLength1, - params->SchemaName, params->NameLength2, params->TableName, params->NameLength3, -- params->ColumnName, params->NameLength4); +- params->ColumnName, params->NameLength4 ); -} - -static NTSTATUS wrap_SQLConnect( void *args ) -{ - struct SQLConnect_params *params = args; -- -- if (!pSQLConnect) return SQL_ERROR; -- return pSQLConnect(params->ConnectionHandle, params->ServerName, params->NameLength1, params->UserName, -- params->NameLength2, params->Authentication, params->NameLength3); +- 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; -- -- if (!pSQLConnectW) return SQL_ERROR; -- return pSQLConnectW(params->ConnectionHandle, params->ServerName, params->NameLength1, -- params->UserName, params->NameLength2, params->Authentication, params->NameLength3); +- 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; -- -- if (!pSQLCopyDesc) return SQL_ERROR; -- return pSQLCopyDesc(params->SourceDescHandle, params->TargetDescHandle); +- return SQLCopyDesc( (SQLHDESC)(ULONG_PTR)params->SourceDescHandle, (SQLHDESC)(ULONG_PTR)params->TargetDescHandle ); -} - -static NTSTATUS wrap_SQLDataSources( void *args ) -{ - struct SQLDataSources_params *params = args; -- -- if (!pSQLDataSources) return SQL_ERROR; -- return pSQLDataSources(params->EnvironmentHandle, params->Direction, params->ServerName, +- return SQLDataSources( (SQLHENV)(ULONG_PTR)params->EnvironmentHandle, params->Direction, params->ServerName, - params->BufferLength1, params->NameLength1, params->Description, -- params->BufferLength2, params->NameLength2); --} -- --static NTSTATUS wrap_SQLDataSourcesA( void *args ) --{ -- struct SQLDataSourcesA_params *params = args; -- -- if (!pSQLDataSourcesA) return SQL_ERROR; -- return pSQLDataSourcesA(params->EnvironmentHandle, params->Direction, params->ServerName, -- params->BufferLength1, params->NameLength1, params->Description, -- params->BufferLength2, params->NameLength2); +- params->BufferLength2, params->NameLength2 ); -} - -static NTSTATUS wrap_SQLDataSourcesW( void *args ) -{ - struct SQLDataSourcesW_params *params = args; -- -- if (!pSQLDataSourcesW) return SQL_ERROR; -- return pSQLDataSourcesW(params->EnvironmentHandle, params->Direction, params->ServerName, +- return SQLDataSourcesW( (SQLHENV)(ULONG_PTR)params->EnvironmentHandle, params->Direction, params->ServerName, - params->BufferLength1, params->NameLength1, params->Description, -- params->BufferLength2, params->NameLength2); +- params->BufferLength2, params->NameLength2 ); -} - -static NTSTATUS wrap_SQLDescribeCol( void *args ) -{ - struct SQLDescribeCol_params *params = args; -- -- if (!pSQLDescribeCol) return SQL_ERROR; -- return pSQLDescribeCol(params->StatementHandle, params->ColumnNumber, params->ColumnName, +- return SQLDescribeCol( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ColumnNumber, params->ColumnName, - params->BufferLength, params->NameLength, params->DataType, -- params->ColumnSize, params->DecimalDigits, params->Nullable); +- (SQLULEN *)(ULONG_PTR)params->ColumnSize, params->DecimalDigits, params->Nullable ); -} - -static NTSTATUS wrap_SQLDescribeColW( void *args ) -{ - struct SQLDescribeColW_params *params = args; -- -- if (!pSQLDescribeColW) return SQL_ERROR; -- return pSQLDescribeColW(params->StatementHandle, params->ColumnNumber, params->ColumnName, +- return SQLDescribeColW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ColumnNumber, params->ColumnName, - params->BufferLength, params->NameLength, params->DataType, -- params->ColumnSize, params->DecimalDigits, params->Nullable); +- (SQLULEN *)(ULONG_PTR)params->ColumnSize, params->DecimalDigits, params->Nullable ); -} - -static NTSTATUS wrap_SQLDescribeParam( void *args ) -{ - struct SQLDescribeParam_params *params = args; -- -- if (!pSQLDescribeParam) return SQL_ERROR; -- return pSQLDescribeParam(params->hstmt, params->ipar, params->pfSqlType, params->pcbParamDef, -- params->pibScale, params->pfNullable); +- 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; -- -- if (!pSQLDisconnect) return SQL_ERROR; -- return pSQLDisconnect(params->ConnectionHandle); +- return SQLDisconnect( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle ); -} - -static NTSTATUS wrap_SQLDriverConnect( void *args ) -{ - struct SQLDriverConnect_params *params = args; -- -- if (!pSQLDriverConnect) return SQL_ERROR; -- return pSQLDriverConnect(params->hdbc, params->hwnd, params->ConnectionString, params->Length, -- params->conn_str_out, params->conn_str_out_max, -- params->ptr_conn_str_out, params->driver_completion); +- 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; -- -- if (!pSQLDriverConnectW) return SQL_ERROR; -- return pSQLDriverConnectW(params->ConnectionHandle, params->WindowHandle, params->InConnectionString, -- params->Length, params->OutConnectionString, params->BufferLength, -- params->Length2, params->DriverCompletion); +- 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; -- -- if (!pSQLDrivers) return SQL_ERROR; -- return pSQLDrivers(params->EnvironmentHandle, params->fDirection, params->szDriverDesc, -- params->cbDriverDescMax, params->pcbDriverDesc, params->szDriverAttributes, -- params->cbDriverAttrMax, params->pcbDriverAttr); +- 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; -- -- if (!pSQLDriversW) return SQL_ERROR; -- return pSQLDriversW(params->EnvironmentHandle, params->fDirection, params->szDriverDesc, -- params->cbDriverDescMax, params->pcbDriverDesc, params->szDriverAttributes, -- params->cbDriverAttrMax, params->pcbDriverAttr); +- 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; -- -- if (!pSQLEndTran) return SQL_ERROR; -- return pSQLEndTran(params->HandleType, params->Handle, params->CompletionType); +- return SQLEndTran( params->HandleType, (SQLHANDLE)(ULONG_PTR)params->Handle, params->CompletionType ); -} - -static NTSTATUS wrap_SQLError( void *args ) -{ - struct SQLError_params *params = args; -- -- if (!pSQLError) return SQL_ERROR; -- return pSQLError(params->EnvironmentHandle, params->ConnectionHandle, params->StatementHandle, -- params->Sqlstate, params->NativeError, params->MessageText, -- params->BufferLength, params->TextLength); +- 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; -- -- if (!pSQLErrorW) return SQL_ERROR; -- return pSQLErrorW(params->EnvironmentHandle, params->ConnectionHandle, params->StatementHandle, -- params->Sqlstate, params->NativeError, params->MessageText, -- params->BufferLength, params->TextLength); +- 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; -- -- if (!pSQLExecDirect) return SQL_ERROR; -- return pSQLExecDirect(params->StatementHandle, params->StatementText, params->TextLength); +- return SQLExecDirect( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->StatementText, params->TextLength ); -} - -static NTSTATUS wrap_SQLExecDirectW( void *args ) -{ - struct SQLExecDirectW_params *params = args; -- -- if (!pSQLExecDirectW) return SQL_ERROR; -- return pSQLExecDirectW(params->StatementHandle, params->StatementText, params->TextLength); +- return SQLExecDirectW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->StatementText, params->TextLength ); -} - -static NTSTATUS wrap_SQLExecute( void *args ) -{ - struct SQLExecute_params *params = args; -- -- if (!pSQLExecute) return SQL_ERROR; -- return pSQLExecute(params->StatementHandle); +- return SQLExecute( (SQLHSTMT)(ULONG_PTR)params->StatementHandle ); -} - -static NTSTATUS wrap_SQLExtendedFetch( void *args ) -{ - struct SQLExtendedFetch_params *params = args; -- -- if (!pSQLExtendedFetch) return SQL_ERROR; -- return pSQLExtendedFetch(params->hstmt, params->fFetchType, params->irow, -- params->pcrow, params->rgfRowStatus); +- 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; -- -- if (!pSQLFetch) return SQL_ERROR; -- return pSQLFetch(params->StatementHandle); +- return SQLFetch( (SQLHSTMT)(ULONG_PTR)params->StatementHandle ); -} - -static NTSTATUS wrap_SQLFetchScroll( void *args ) -{ - struct SQLFetchScroll_params *params = args; -- -- if (!pSQLFetchScroll) return SQL_ERROR; -- return pSQLFetchScroll(params->StatementHandle, params->FetchOrientation, params->FetchOffset); +- return SQLFetchScroll( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->FetchOrientation, +- params->FetchOffset ); -} - -static NTSTATUS wrap_SQLForeignKeys( void *args ) -{ - struct SQLForeignKeys_params *params = args; -- -- if (!pSQLForeignKeys) return SQL_ERROR; -- return pSQLForeignKeys(params->hstmt, params->szPkCatalogName, params->cbPkCatalogName, -- params->szPkSchemaName, params->cbPkSchemaName, params->szPkTableName, -- params->cbPkTableName, params->szFkCatalogName, params->cbFkCatalogName, -- params->szFkSchemaName, params->cbFkSchemaName, params->szFkTableName, -- params->cbFkTableName); +- 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; -- -- if (!pSQLForeignKeysW) return SQL_ERROR; -- return pSQLForeignKeysW(params->hstmt, params->szPkCatalogName, params->cbPkCatalogName, -- params->szPkSchemaName, params->cbPkSchemaName, params->szPkTableName, -- params->cbPkTableName, params->szFkCatalogName, params->cbFkCatalogName, -- params->szFkSchemaName, params->cbFkSchemaName, params->szFkTableName, -- params->cbFkTableName); +- 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; -- -- if (!pSQLFreeConnect) return SQL_ERROR; -- return pSQLFreeConnect(params->ConnectionHandle); +- return SQLFreeConnect( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle ); -} - -static NTSTATUS wrap_SQLFreeEnv( void *args ) -{ - struct SQLFreeEnv_params *params = args; -- -- if (!pSQLFreeEnv) return SQL_ERROR; -- return pSQLFreeEnv(params->EnvironmentHandle); +- return SQLFreeEnv( (SQLHENV)(ULONG_PTR)params->EnvironmentHandle ); -} - -static NTSTATUS wrap_SQLFreeHandle( void *args ) -{ - struct SQLFreeHandle_params *params = args; -- -- if (!pSQLFreeHandle) return SQL_ERROR; -- return pSQLFreeHandle(params->HandleType, params->Handle); +- return SQLFreeHandle( params->HandleType, (SQLHANDLE)(ULONG_PTR)params->Handle ); -} - -static NTSTATUS wrap_SQLFreeStmt( void *args ) -{ - struct SQLFreeStmt_params *params = args; -- -- if (!pSQLFreeStmt) return SQL_ERROR; -- return pSQLFreeStmt(params->StatementHandle, params->Option); +- return SQLFreeStmt( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Option ); -} - -static NTSTATUS wrap_SQLGetConnectAttr( void *args ) -{ - struct SQLGetConnectAttr_params *params = args; -- -- if (!pSQLGetConnectAttr) return SQL_ERROR; -- return pSQLGetConnectAttr(params->ConnectionHandle, params->Attribute, params->Value, -- params->BufferLength, params->StringLength); +- 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; -- -- if (!pSQLGetConnectAttrW) return SQL_ERROR; -- return pSQLGetConnectAttrW(params->ConnectionHandle, params->Attribute, params->Value, -- params->BufferLength, params->StringLength); +- 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; -- -- if (!pSQLGetConnectOption) return SQL_ERROR; -- return pSQLGetConnectOption(params->ConnectionHandle, params->Option, params->Value); +- return SQLGetConnectOption( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->Option, params->Value ); -} - -static NTSTATUS wrap_SQLGetConnectOptionW( void *args ) -{ - struct SQLGetConnectOptionW_params *params = args; -- -- if (!pSQLGetConnectOptionW) return SQL_ERROR; -- return pSQLGetConnectOptionW(params->ConnectionHandle, params->Option, params->Value); +- return SQLGetConnectOptionW( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->Option, params->Value ); -} - -static NTSTATUS wrap_SQLGetCursorName( void *args ) -{ - struct SQLGetCursorName_params *params = args; -- -- if (!pSQLGetCursorName) return SQL_ERROR; -- return pSQLGetCursorName(params->StatementHandle, params->CursorName, params->BufferLength, -- params->NameLength); +- return SQLGetCursorName( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CursorName, params->BufferLength, +- params->NameLength ); -} - -static NTSTATUS wrap_SQLGetCursorNameW( void *args ) -{ - struct SQLGetCursorNameW_params *params = args; -- -- if (!pSQLGetCursorNameW) return SQL_ERROR; -- return pSQLGetCursorNameW(params->StatementHandle, params->CursorName, params->BufferLength, -- params->NameLength); +- return SQLGetCursorNameW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CursorName, params->BufferLength, +- params->NameLength ); -} - -static NTSTATUS wrap_SQLGetData( void *args ) -{ - struct SQLGetData_params *params = args; -- -- if (!pSQLGetData) return SQL_ERROR; -- return pSQLGetData(params->StatementHandle, params->ColumnNumber, params->TargetType, -- params->TargetValue, params->BufferLength, params->StrLen_or_Ind); +- 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; -- -- if (!pSQLGetDescField) return SQL_ERROR; -- return pSQLGetDescField(params->DescriptorHandle, params->RecNumber, params->FieldIdentifier, -- params->Value, params->BufferLength, params->StringLength); +- 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; -- -- if (!pSQLGetDescFieldW) return SQL_ERROR; -- return pSQLGetDescFieldW(params->DescriptorHandle, params->RecNumber, params->FieldIdentifier, -- params->Value, params->BufferLength, params->StringLength); +- 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; -- -- if (!pSQLGetDescRec) return SQL_ERROR; -- return pSQLGetDescRec(params->DescriptorHandle, params->RecNumber, params->Name, params->BufferLength, -- params->StringLength, params->Type, params->SubType, params->Length, -- params->Precision, params->Scale, params->Nullable); +- 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; -- -- if (!pSQLGetDescRecW) return SQL_ERROR; -- return pSQLGetDescRecW(params->DescriptorHandle, params->RecNumber, params->Name, params->BufferLength, -- params->StringLength, params->Type, params->SubType, params->Length, -- params->Precision, params->Scale, params->Nullable); +- 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; -- -- if (!pSQLGetDiagField) return SQL_ERROR; -- return pSQLGetDiagField(params->HandleType, params->Handle, params->RecNumber, params->DiagIdentifier, -- params->DiagInfo, params->BufferLength, params->StringLength); +- 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; -- -- if (!pSQLGetDiagFieldW) return SQL_ERROR; -- return pSQLGetDiagFieldW(params->HandleType, params->Handle, params->RecNumber, params->DiagIdentifier, -- params->DiagInfo, params->BufferLength, params->StringLength); +- 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; -- -- if (!pSQLGetDiagRec) return SQL_ERROR; -- return pSQLGetDiagRec(params->HandleType, params->Handle, params->RecNumber, params->Sqlstate, -- params->NativeError, params->MessageText, params->BufferLength, -- params->TextLength); --} -- --static NTSTATUS wrap_SQLGetDiagRecA( void *args ) --{ -- struct SQLGetDiagRecA_params *params = args; -- -- if (!pSQLGetDiagRecA) return SQL_ERROR; -- return pSQLGetDiagRecA(params->HandleType, params->Handle, params->RecNumber, params->Sqlstate, -- params->NativeError, params->MessageText, params->BufferLength, -- params->TextLength); +- 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; -- -- if (!pSQLGetDiagRecW) return SQL_ERROR; -- return pSQLGetDiagRecW(params->HandleType, params->Handle, params->RecNumber, params->Sqlstate, -- params->NativeError, params->MessageText, params->BufferLength, -- params->TextLength); +- 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; -- -- if (!pSQLGetEnvAttr) return SQL_ERROR; -- return pSQLGetEnvAttr(params->EnvironmentHandle, params->Attribute, params->Value, -- params->BufferLength, params->StringLength); +- 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; -- -- if (!pSQLGetFunctions) return SQL_ERROR; -- return pSQLGetFunctions(params->ConnectionHandle, params->FunctionId, params->Supported); +- return SQLGetFunctions( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->FunctionId, params->Supported ); -} - -static NTSTATUS wrap_SQLGetInfo( void *args ) -{ - struct SQLGetInfo_params *params = args; -- -- if (!pSQLGetInfo) return SQL_ERROR; -- return pSQLGetInfo(params->ConnectionHandle, params->InfoType, params->InfoValue, -- params->BufferLength, params->StringLength); +- 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; -- -- if (!pSQLGetInfoW) return SQL_ERROR; -- return pSQLGetInfoW(params->ConnectionHandle, params->InfoType, params->InfoValue, -- params->BufferLength, params->StringLength); +- 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; -- -- if (!pSQLGetStmtAttr) return SQL_ERROR; -- return pSQLGetStmtAttr(params->StatementHandle, params->Attribute, params->Value, -- params->BufferLength, params->StringLength); +- 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; -- -- if (!pSQLGetStmtAttrW) return SQL_ERROR; -- return pSQLGetStmtAttrW(params->StatementHandle, params->Attribute, params->Value, -- params->BufferLength, params->StringLength); +- 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; -- -- if (!pSQLGetStmtOption) return SQL_ERROR; -- return pSQLGetStmtOption(params->StatementHandle, params->Option, params->Value); +- return SQLGetStmtOption( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Option, params->Value ); -} - -static NTSTATUS wrap_SQLGetTypeInfo( void *args ) -{ - struct SQLGetTypeInfo_params *params = args; -- -- if (!pSQLGetTypeInfo) return SQL_ERROR; -- return pSQLGetTypeInfo(params->StatementHandle, params->DataType); +- return SQLGetTypeInfo( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->DataType ); -} - -static NTSTATUS wrap_SQLGetTypeInfoW( void *args ) -{ - struct SQLGetTypeInfoW_params *params = args; -- -- if (!pSQLGetTypeInfoW) return SQL_ERROR; -- return pSQLGetTypeInfoW(params->StatementHandle, params->DataType); +- return SQLGetTypeInfoW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->DataType ); -} - -static NTSTATUS wrap_SQLMoreResults( void *args ) -{ - struct SQLMoreResults_params *params = args; -- -- if (!pSQLMoreResults) return SQL_ERROR; -- return pSQLMoreResults(params->StatementHandle); +- return SQLMoreResults( (SQLHSTMT)(ULONG_PTR)params->StatementHandle ); -} - -static NTSTATUS wrap_SQLNativeSql( void *args ) -{ - struct SQLNativeSql_params *params = args; -- -- if (!pSQLNativeSql) return SQL_ERROR; -- return pSQLNativeSql(params->hdbc, params->szSqlStrIn, params->cbSqlStrIn, params->szSqlStr, -- params->cbSqlStrMax, params->pcbSqlStr); +- 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; -- -- if (!pSQLNativeSqlW) return SQL_ERROR; -- return pSQLNativeSqlW(params->hdbc, params->szSqlStrIn, params->cbSqlStrIn, params->szSqlStr, -- params->cbSqlStrMax, params->pcbSqlStr); +- 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; -- -- if (!pSQLNumParams) return SQL_ERROR; -- return pSQLNumParams(params->hstmt, params->pcpar); +- return SQLNumParams( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ParameterCount ); -} - -static NTSTATUS wrap_SQLNumResultCols( void *args ) -{ - struct SQLNumResultCols_params *params = args; -- -- if (!pSQLNumResultCols) return SQL_ERROR; -- return pSQLNumResultCols(params->StatementHandle, params->ColumnCount); +- return SQLNumResultCols( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ColumnCount ); -} - -static NTSTATUS wrap_SQLParamData( void *args ) -{ - struct SQLParamData_params *params = args; -- -- if (!pSQLParamData) return SQL_ERROR; -- return pSQLParamData(params->StatementHandle, params->Value); +- return SQLParamData( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Value ); -} - -static NTSTATUS wrap_SQLParamOptions( void *args ) -{ - struct SQLParamOptions_params *params = args; -- -- if (!pSQLParamOptions) return SQL_ERROR; -- return pSQLParamOptions(params->hstmt, params->crow, params->pirow); +- 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; -- -- if (!pSQLPrepare) return SQL_ERROR; -- return pSQLPrepare(params->StatementHandle, params->StatementText, params->TextLength); +- return SQLPrepare( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->StatementText, params->TextLength ); -} - -static NTSTATUS wrap_SQLPrepareW( void *args ) -{ - struct SQLPrepareW_params *params = args; -- -- if (!pSQLPrepareW) return SQL_ERROR; -- return pSQLPrepareW(params->StatementHandle, params->StatementText, params->TextLength); +- return SQLPrepareW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->StatementText, params->TextLength ); -} - -static NTSTATUS wrap_SQLPrimaryKeys( void *args ) -{ - struct SQLPrimaryKeys_params *params = args; -- -- if (!pSQLPrimaryKeys) return SQL_ERROR; -- return pSQLPrimaryKeys(params->hstmt, params->szCatalogName, params->cbCatalogName, -- params->szSchemaName, params->cbSchemaName, -- params->szTableName, params->cbTableName); +- 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; -- -- if (!pSQLPrimaryKeysW) return SQL_ERROR; -- return pSQLPrimaryKeysW(params->hstmt, params->szCatalogName, params->cbCatalogName, -- params->szSchemaName, params->cbSchemaName, -- params->szTableName, params->cbTableName); +- 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; -- -- if (!pSQLProcedureColumns) return SQL_ERROR; -- return pSQLProcedureColumns(params->hstmt, params->szCatalogName, params->cbCatalogName, -- params->szSchemaName, params->cbSchemaName, params->szProcName, -- params->cbProcName, params->szColumnName, params->cbColumnName); +- 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; -- -- if (!pSQLProcedureColumnsW) return SQL_ERROR; -- return pSQLProcedureColumnsW(params->hstmt, params->szCatalogName, params->cbCatalogName, -- params->szSchemaName, params->cbSchemaName, params->szProcName, -- params->cbProcName, params->szColumnName, params->cbColumnName); +- 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; -- -- if (!pSQLProcedures) return SQL_ERROR; -- return pSQLProcedures(params->hstmt, params->szCatalogName, params->cbCatalogName, -- params->szSchemaName, params->cbSchemaName, params->szProcName, -- params->cbProcName); +- 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; -- -- if (!pSQLProceduresW) return SQL_ERROR; -- return pSQLProceduresW(params->hstmt, params->szCatalogName, params->cbCatalogName, -- params->szSchemaName, params->cbSchemaName, params->szProcName, -- params->cbProcName); +- 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; -- -- if (!pSQLPutData) return SQL_ERROR; -- return pSQLPutData(params->StatementHandle, params->Data, params->StrLen_or_Ind); +- return SQLPutData( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Data, params->StrLen_or_Ind ); -} - -static NTSTATUS wrap_SQLRowCount( void *args ) -{ - struct SQLRowCount_params *params = args; -- -- if (!pSQLRowCount) return SQL_ERROR; -- return pSQLRowCount(params->StatementHandle, params->RowCount); +- return SQLRowCount( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, (SQLLEN *)(ULONG_PTR)params->RowCount ); -} - -static NTSTATUS wrap_SQLSetConnectAttr( void *args ) -{ - struct SQLSetConnectAttr_params *params = args; -- -- if (!pSQLSetConnectAttr) return SQL_ERROR; -- return pSQLSetConnectAttr(params->ConnectionHandle, params->Attribute, params->Value, -- params->StringLength); +- return SQLSetConnectAttr( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->Attribute, params->Value, +- params->StringLength ); -} - -static NTSTATUS wrap_SQLSetConnectAttrW( void *args ) -{ - struct SQLSetConnectAttrW_params *params = args; -- -- if (!pSQLSetConnectAttrW) return SQL_ERROR; -- return pSQLSetConnectAttrW(params->ConnectionHandle, params->Attribute, params->Value, -- params->StringLength); +- return SQLSetConnectAttrW( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->Attribute, params->Value, +- params->StringLength ); -} - -static NTSTATUS wrap_SQLSetConnectOption( void *args ) -{ - struct SQLSetConnectOption_params *params = args; -- -- if (!pSQLSetConnectOption) return SQL_ERROR; -- return pSQLSetConnectOption(params->ConnectionHandle, params->Option, params->Value); +- return SQLSetConnectOption( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->Option, params->Value ); -} - -static NTSTATUS wrap_SQLSetConnectOptionW( void *args ) -{ - struct SQLSetConnectOptionW_params *params = args; -- -- if (!pSQLSetConnectOptionW) return SQL_ERROR; -- return pSQLSetConnectOptionW(params->ConnectionHandle, params->Option, params->Value); +- return SQLSetConnectOptionW( (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, params->Option, params->Value ); -} - -static NTSTATUS wrap_SQLSetCursorName( void *args ) -{ - struct SQLSetCursorName_params *params = args; -- -- if (!pSQLSetCursorName) return SQL_ERROR; -- return pSQLSetCursorName(params->StatementHandle, params->CursorName, params->NameLength); +- return SQLSetCursorName( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CursorName, params->NameLength ); -} - -static NTSTATUS wrap_SQLSetCursorNameW( void *args ) -{ - struct SQLSetCursorNameW_params *params = args; -- -- if (!pSQLSetCursorNameW) return SQL_ERROR; -- return pSQLSetCursorNameW(params->StatementHandle, params->CursorName, params->NameLength); +- return SQLSetCursorNameW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CursorName, params->NameLength ); -} - -static NTSTATUS wrap_SQLSetDescField( void *args ) -{ - struct SQLSetDescField_params *params = args; -- -- if (!pSQLSetDescField) return SQL_ERROR; -- return pSQLSetDescField(params->DescriptorHandle, params->RecNumber, params->FieldIdentifier, -- params->Value, params->BufferLength); +- 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; -- -- if (!pSQLSetDescFieldW) return SQL_ERROR; -- return pSQLSetDescFieldW(params->DescriptorHandle, params->RecNumber, params->FieldIdentifier, -- params->Value, params->BufferLength); +- 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; -- -- if (!pSQLSetDescRec) return SQL_ERROR; -- return pSQLSetDescRec(params->DescriptorHandle, params->RecNumber, params->Type, params->SubType, -- params->Length, params->Precision, params->Scale, params->Data, -- params->StringLength, params->Indicator); +- 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; -- -- if (!pSQLSetEnvAttr) return SQL_ERROR; -- return pSQLSetEnvAttr(params->EnvironmentHandle, params->Attribute, params->Value, params->StringLength); +- return SQLSetEnvAttr( (SQLHENV)(ULONG_PTR)params->EnvironmentHandle, params->Attribute, params->Value, +- params->StringLength ); -} - -static NTSTATUS wrap_SQLSetParam( void *args ) -{ - struct SQLSetParam_params *params = args; -- -- if (!pSQLSetParam) return SQL_ERROR; -- return pSQLSetParam(params->StatementHandle, params->ParameterNumber, params->ValueType, +- return SQLSetParam( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ParameterNumber, params->ValueType, - params->ParameterType, params->LengthPrecision, params->ParameterScale, -- params->ParameterValue, params->StrLen_or_Ind); +- params->ParameterValue, (SQLLEN *)(ULONG_PTR)params->StrLen_or_Ind ); -} - -static NTSTATUS wrap_SQLSetPos( void *args ) -{ - struct SQLSetPos_params *params = args; -- -- if (!pSQLSetPos) return SQL_ERROR; -- return pSQLSetPos(params->hstmt, params->irow, params->fOption, params->fLock); +- return SQLSetPos( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->RowNumber, params->Operation, +- params->LockType ); -} - -static NTSTATUS wrap_SQLSetScrollOptions( void *args ) -{ - struct SQLSetScrollOptions_params *params = args; -- -- if (!pSQLSetScrollOptions) return SQL_ERROR; -- return pSQLSetScrollOptions(params->statement_handle, params->f_concurrency, -- params->crow_keyset, params->crow_rowset); +- return SQLSetScrollOptions( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Concurrency, +- params->KeySetSize, params->RowSetSize ); -} - -static NTSTATUS wrap_SQLSetStmtAttr( void *args ) -{ - struct SQLSetStmtAttr_params *params = args; -- -- if (!pSQLSetStmtAttr) return SQL_ERROR; -- return pSQLSetStmtAttr(params->StatementHandle, params->Attribute, params->Value, params->StringLength); +- return SQLSetStmtAttr( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Attribute, params->Value, +- params->StringLength ); -} - -static NTSTATUS wrap_SQLSetStmtAttrW( void *args ) -{ - struct SQLSetStmtAttrW_params *params = args; -- -- if (!pSQLSetStmtAttrW) return SQL_ERROR; -- return pSQLSetStmtAttrW(params->StatementHandle, params->Attribute, params->Value, params->StringLength); +- return SQLSetStmtAttrW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Attribute, params->Value, +- params->StringLength ); -} - -static NTSTATUS wrap_SQLSetStmtOption( void *args ) -{ - struct SQLSetStmtOption_params *params = args; -- -- if (!pSQLSetStmtOption) return SQL_ERROR; -- return pSQLSetStmtOption(params->StatementHandle, params->Option, params->Value); +- return SQLSetStmtOption( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->Option, params->Value ); -} - -static NTSTATUS wrap_SQLSpecialColumns( void *args ) -{ - struct SQLSpecialColumns_params *params = args; -- -- if (!pSQLSpecialColumns) return SQL_ERROR; -- return pSQLSpecialColumns(params->StatementHandle, params->IdentifierType, params->CatalogName, -- params->NameLength1, params->SchemaName, params->NameLength2, -- params->TableName, params->NameLength3, params->Scope, params->Nullable); +- 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; -- -- if (!pSQLSpecialColumnsW) return SQL_ERROR; -- return pSQLSpecialColumnsW(params->StatementHandle, params->IdentifierType, params->CatalogName, -- params->NameLength1, params->SchemaName, params->NameLength2, -- params->TableName, params->NameLength3, params->Scope, params->Nullable); +- 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; -- -- if (!pSQLStatistics) return SQL_ERROR; -- return pSQLStatistics(params->StatementHandle, params->CatalogName, params->NameLength1, +- return SQLStatistics( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, params->NameLength1, - params->SchemaName, params->NameLength2, params->TableName, -- params->NameLength3, params->Unique, params->Reserved); +- params->NameLength3, params->Unique, params->Reserved ); -} - -static NTSTATUS wrap_SQLStatisticsW( void *args ) -{ - struct SQLStatisticsW_params *params = args; -- -- if (!pSQLStatisticsW) return SQL_ERROR; -- return pSQLStatisticsW(params->StatementHandle, params->CatalogName, params->NameLength1, +- return SQLStatisticsW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, params->NameLength1, - params->SchemaName, params->NameLength2, params->TableName, -- params->NameLength3, params->Unique, params->Reserved); +- params->NameLength3, params->Unique, params->Reserved ); -} - -static NTSTATUS wrap_SQLTablePrivileges( void *args ) -{ - struct SQLTablePrivileges_params *params = args; -- -- if (!pSQLTablePrivileges) return SQL_ERROR; -- return pSQLTablePrivileges(params->hstmt, params->szCatalogName, params->cbCatalogName, -- params->szSchemaName, params->cbSchemaName, params->szTableName, -- params->cbTableName); +- 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; -- -- if (!pSQLTablePrivilegesW) return SQL_ERROR; -- return pSQLTablePrivilegesW(params->hstmt, params->szCatalogName, params->cbCatalogName, -- params->szSchemaName, params->cbSchemaName, params->szTableName, -- params->cbTableName); +- 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; -- -- if (!pSQLTables) return SQL_ERROR; -- return pSQLTables(params->StatementHandle, params->CatalogName, params->NameLength1, +- return SQLTables( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, params->NameLength1, - params->SchemaName, params->NameLength2, params->TableName, -- params->NameLength3, params->TableType, params->NameLength4); +- params->NameLength3, params->TableType, params->NameLength4 ); -} - -static NTSTATUS wrap_SQLTablesW( void *args ) -{ - struct SQLTablesW_params *params = args; -- -- if (!pSQLTablesW) return SQL_ERROR; -- return pSQLTablesW(params->StatementHandle, params->CatalogName, params->NameLength1, +- return SQLTablesW( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->CatalogName, params->NameLength1, - params->SchemaName, params->NameLength2, params->TableName, -- params->NameLength3, params->TableType, params->NameLength4); +- params->NameLength3, params->TableType, params->NameLength4 ); -} - -static NTSTATUS wrap_SQLTransact( void *args ) -{ - struct SQLTransact_params *params = args; -- -- if (!pSQLTransact) return SQL_ERROR; -- return pSQLTransact(params->EnvironmentHandle, params->ConnectionHandle, params->CompletionType); +- return SQLTransact( (SQLHENV)(ULONG_PTR)params->EnvironmentHandle, (SQLHDBC)(ULONG_PTR)params->ConnectionHandle, +- params->CompletionType ); -} - --const unixlib_entry_t __wine_unix_call_funcs[NB_ODBC_FUNCS] = +-const unixlib_entry_t __wine_unix_call_funcs[] = -{ - odbc_process_attach, -- odbc_process_detach, - wrap_SQLAllocConnect, - wrap_SQLAllocEnv, - wrap_SQLAllocHandle, @@ -3901,7 +4388,6 @@ index 2883a5fb56a..00000000000 - wrap_SQLConnectW, - wrap_SQLCopyDesc, - wrap_SQLDataSources, -- wrap_SQLDataSourcesA, - wrap_SQLDataSourcesW, - wrap_SQLDescribeCol, - wrap_SQLDescribeColW, @@ -3940,7 +4426,6 @@ index 2883a5fb56a..00000000000 - wrap_SQLGetDiagField, - wrap_SQLGetDiagFieldW, - wrap_SQLGetDiagRec, -- wrap_SQLGetDiagRecA, - wrap_SQLGetDiagRecW, - wrap_SQLGetEnvAttr, - wrap_SQLGetFunctions, @@ -3995,148 +4480,2417 @@ index 2883a5fb56a..00000000000 - wrap_SQLTransact, -}; - --static NTSTATUS load_odbc(void) +-C_ASSERT( ARRAYSIZE( __wine_unix_call_funcs) == unix_funcs_count ); +- +-#ifdef _WIN64 +- +-typedef ULONG PTR32; +- +-static NTSTATUS wow64_SQLBindCol( void *args ) -{ -- const char *s = getenv("LIB_ODBC_DRIVER_MANAGER"); +- struct +- { +- UINT64 StatementHandle; +- INT16 ColumnNumber; +- INT16 TargetType; +- PTR32 TargetValue; +- INT64 BufferLength; +- PTR32 StrLen_or_Ind; +- } const *params32 = args; - --#ifdef SONAME_LIBODBC -- if (!s || !s[0]) s = SONAME_LIBODBC; --#endif -- if (!s || !s[0] || !(libodbc = dlopen( s, RTLD_LAZY | RTLD_GLOBAL ))) -- { -- ERR_(winediag)("failed to open library %s: %s\n", debugstr_a(s), dlerror()); -- return STATUS_DLL_NOT_FOUND; -- } +- struct SQLBindCol_params params = +- { +- params32->StatementHandle, +- params32->ColumnNumber, +- params32->TargetType, +- ULongToPtr(params32->TargetValue), +- params32->BufferLength, +- ULongToPtr(params32->StrLen_or_Ind) +- }; - --#define LOAD_FUNC(name) \ -- p##name = dlsym( libodbc, #name ); -- -- LOAD_FUNC(SQLAllocConnect); -- LOAD_FUNC(SQLAllocEnv); -- LOAD_FUNC(SQLAllocHandle); -- LOAD_FUNC(SQLAllocHandleStd); -- LOAD_FUNC(SQLAllocStmt); -- LOAD_FUNC(SQLBindCol); -- LOAD_FUNC(SQLBindParam); -- LOAD_FUNC(SQLBindParameter); -- LOAD_FUNC(SQLBrowseConnect); -- LOAD_FUNC(SQLBrowseConnectW); -- LOAD_FUNC(SQLBulkOperations); -- LOAD_FUNC(SQLCancel); -- LOAD_FUNC(SQLCloseCursor); -- LOAD_FUNC(SQLColAttribute); -- LOAD_FUNC(SQLColAttributeW); -- LOAD_FUNC(SQLColAttributes); -- LOAD_FUNC(SQLColAttributesW); -- LOAD_FUNC(SQLColumnPrivileges); -- LOAD_FUNC(SQLColumnPrivilegesW); -- LOAD_FUNC(SQLColumns); -- LOAD_FUNC(SQLColumnsW); -- LOAD_FUNC(SQLConnect); -- LOAD_FUNC(SQLConnectW); -- LOAD_FUNC(SQLCopyDesc); -- LOAD_FUNC(SQLDataSources); -- LOAD_FUNC(SQLDataSourcesA); -- LOAD_FUNC(SQLDataSourcesW); -- LOAD_FUNC(SQLDescribeCol); -- LOAD_FUNC(SQLDescribeColW); -- LOAD_FUNC(SQLDescribeParam); -- LOAD_FUNC(SQLDisconnect); -- LOAD_FUNC(SQLDriverConnect); -- LOAD_FUNC(SQLDriverConnectW); -- LOAD_FUNC(SQLDrivers); -- LOAD_FUNC(SQLDriversW); -- LOAD_FUNC(SQLEndTran); -- LOAD_FUNC(SQLError); -- LOAD_FUNC(SQLErrorW); -- LOAD_FUNC(SQLExecDirect); -- LOAD_FUNC(SQLExecDirectW); -- LOAD_FUNC(SQLExecute); -- LOAD_FUNC(SQLExtendedFetch); -- LOAD_FUNC(SQLFetch); -- LOAD_FUNC(SQLFetchScroll); -- LOAD_FUNC(SQLForeignKeys); -- LOAD_FUNC(SQLForeignKeysW); -- LOAD_FUNC(SQLFreeConnect); -- LOAD_FUNC(SQLFreeEnv); -- LOAD_FUNC(SQLFreeHandle); -- LOAD_FUNC(SQLFreeStmt); -- LOAD_FUNC(SQLGetConnectAttr); -- LOAD_FUNC(SQLGetConnectAttrW); -- LOAD_FUNC(SQLGetConnectOption); -- LOAD_FUNC(SQLGetConnectOptionW); -- LOAD_FUNC(SQLGetCursorName); -- LOAD_FUNC(SQLGetCursorNameW); -- LOAD_FUNC(SQLGetData); -- LOAD_FUNC(SQLGetDescField); -- LOAD_FUNC(SQLGetDescFieldW); -- LOAD_FUNC(SQLGetDescRec); -- LOAD_FUNC(SQLGetDescRecW); -- LOAD_FUNC(SQLGetDiagField); -- LOAD_FUNC(SQLGetDiagFieldW); -- LOAD_FUNC(SQLGetDiagRec); -- LOAD_FUNC(SQLGetDiagRecA); -- LOAD_FUNC(SQLGetDiagRecW); -- LOAD_FUNC(SQLGetEnvAttr); -- LOAD_FUNC(SQLGetFunctions); -- LOAD_FUNC(SQLGetInfo); -- LOAD_FUNC(SQLGetInfoW); -- LOAD_FUNC(SQLGetStmtAttr); -- LOAD_FUNC(SQLGetStmtAttrW); -- LOAD_FUNC(SQLGetStmtOption); -- LOAD_FUNC(SQLGetTypeInfo); -- LOAD_FUNC(SQLGetTypeInfoW); -- LOAD_FUNC(SQLMoreResults); -- LOAD_FUNC(SQLNativeSql); -- LOAD_FUNC(SQLNativeSqlW); -- LOAD_FUNC(SQLNumParams); -- LOAD_FUNC(SQLNumResultCols); -- LOAD_FUNC(SQLParamData); -- LOAD_FUNC(SQLParamOptions); -- LOAD_FUNC(SQLPrepare); -- LOAD_FUNC(SQLPrepareW); -- LOAD_FUNC(SQLPrimaryKeys); -- LOAD_FUNC(SQLPrimaryKeysW); -- LOAD_FUNC(SQLProcedureColumns); -- LOAD_FUNC(SQLProcedureColumnsW); -- LOAD_FUNC(SQLProcedures); -- LOAD_FUNC(SQLProceduresW); -- LOAD_FUNC(SQLPutData); -- LOAD_FUNC(SQLRowCount); -- LOAD_FUNC(SQLSetConnectAttr); -- LOAD_FUNC(SQLSetConnectAttrW); -- LOAD_FUNC(SQLSetConnectOption); -- LOAD_FUNC(SQLSetConnectOptionW); -- LOAD_FUNC(SQLSetCursorName); -- LOAD_FUNC(SQLSetCursorNameW); -- LOAD_FUNC(SQLSetDescField); -- LOAD_FUNC(SQLSetDescFieldW); -- LOAD_FUNC(SQLSetDescRec); -- LOAD_FUNC(SQLSetEnvAttr); -- LOAD_FUNC(SQLSetParam); -- LOAD_FUNC(SQLSetPos); -- LOAD_FUNC(SQLSetScrollOptions); -- LOAD_FUNC(SQLSetStmtAttr); -- LOAD_FUNC(SQLSetStmtAttrW); -- LOAD_FUNC(SQLSetStmtOption); -- LOAD_FUNC(SQLSpecialColumns); -- LOAD_FUNC(SQLSpecialColumnsW); -- LOAD_FUNC(SQLStatistics); -- LOAD_FUNC(SQLStatisticsW); -- LOAD_FUNC(SQLTablePrivileges); -- LOAD_FUNC(SQLTablePrivilegesW); -- LOAD_FUNC(SQLTables); -- LOAD_FUNC(SQLTablesW); -- LOAD_FUNC(SQLTransact); --#undef LOAD_FUNC -- return STATUS_SUCCESS; +- 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 */ diff --git a/dlls/odbc32/unixlib.h b/dlls/odbc32/unixlib.h deleted file mode 100644 -index 13ce8d0883b..00000000000 +index ed5f0129fd2..00000000000 --- a/dlls/odbc32/unixlib.h +++ /dev/null -@@ -1,278 +0,0 @@ +@@ -1,1256 +0,0 @@ -/* - * Win32 ODBC functions - * @@ -4164,20 +6918,15 @@ index 13ce8d0883b..00000000000 - */ - -#include -- -#include "windef.h" -#include "winbase.h" -- --#include "sql.h" --#include "sqltypes.h" --#include "sqlext.h" -- -#include "wine/unixlib.h" - +-#define SUCCESS(ret) (ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO) +- -enum sql_funcs -{ - process_attach, -- process_detach, - unix_SQLAllocConnect, - unix_SQLAllocEnv, - unix_SQLAllocHandle, @@ -4203,7 +6952,6 @@ index 13ce8d0883b..00000000000 - unix_SQLConnectW, - unix_SQLCopyDesc, - unix_SQLDataSources, -- unix_SQLDataSourcesA, - unix_SQLDataSourcesW, - unix_SQLDescribeCol, - unix_SQLDescribeColW, @@ -4242,7 +6990,6 @@ index 13ce8d0883b..00000000000 - unix_SQLGetDiagField, - unix_SQLGetDiagFieldW, - unix_SQLGetDiagRec, -- unix_SQLGetDiagRecA, - unix_SQLGetDiagRecW, - unix_SQLGetEnvAttr, - unix_SQLGetFunctions, @@ -4295,140 +7042,1111 @@ index 13ce8d0883b..00000000000 - unix_SQLTables, - unix_SQLTablesW, - unix_SQLTransact, -- NB_ODBC_FUNCS +- unix_funcs_count -}; - --struct SQLAllocConnect_params { SQLHENV EnvironmentHandle; SQLHDBC *ConnectionHandle; }; --struct SQLAllocEnv_params { SQLHENV *EnvironmentHandle; }; --struct SQLAllocHandle_params { SQLSMALLINT HandleType; SQLHANDLE InputHandle; SQLHANDLE *OutputHandle; }; --struct SQLAllocHandleStd_params { SQLSMALLINT HandleType; SQLHANDLE InputHandle; SQLHANDLE *OutputHandle; }; --struct SQLAllocStmt_params { SQLHDBC ConnectionHandle; SQLHSTMT *StatementHandle; }; --struct SQLBindCol_params { SQLHSTMT StatementHandle; SQLUSMALLINT ColumnNumber; SQLSMALLINT TargetType; SQLPOINTER TargetValue; SQLLEN BufferLength; SQLLEN *StrLen_or_Ind; }; --struct SQLBindParam_params { SQLHSTMT StatementHandle; SQLUSMALLINT ParameterNumber; SQLSMALLINT ValueType; SQLSMALLINT ParameterType; SQLULEN LengthPrecision; SQLSMALLINT ParameterScale; SQLPOINTER ParameterValue; SQLLEN *StrLen_or_Ind; }; --struct SQLBindParameter_params { SQLHSTMT hstmt; SQLUSMALLINT ipar; SQLSMALLINT fParamType; SQLSMALLINT fCType; SQLSMALLINT fSqlType; SQLULEN cbColDef; SQLSMALLINT ibScale; SQLPOINTER rgbValue; SQLLEN cbValueMax; SQLLEN *pcbValue; }; --struct SQLBrowseConnect_params { SQLHDBC hdbc; SQLCHAR *szConnStrIn; SQLSMALLINT cbConnStrIn; SQLCHAR *szConnStrOut; SQLSMALLINT cbConnStrOutMax; SQLSMALLINT *pcbConnStrOut; }; --struct SQLBrowseConnectW_params { SQLHDBC hdbc; SQLWCHAR *szConnStrIn; SQLSMALLINT cbConnStrIn; SQLWCHAR *szConnStrOut; SQLSMALLINT cbConnStrOutMax; SQLSMALLINT *pcbConnStrOut; }; --struct SQLBulkOperations_params { SQLHSTMT StatementHandle; SQLSMALLINT Operation; }; --struct SQLCancel_params { SQLHSTMT StatementHandle; }; --struct SQLCloseCursor_params { SQLHSTMT StatementHandle; }; --struct SQLColAttribute_params { SQLHSTMT StatementHandle; SQLUSMALLINT ColumnNumber; SQLUSMALLINT FieldIdentifier; SQLPOINTER CharacterAttribute; SQLSMALLINT BufferLength; SQLSMALLINT *StringLength; SQLLEN *NumericAttribute; }; --struct SQLColAttributeW_params { SQLHSTMT StatementHandle; SQLUSMALLINT ColumnNumber; SQLUSMALLINT FieldIdentifier; SQLPOINTER CharacterAttribute; SQLSMALLINT BufferLength; SQLSMALLINT *StringLength; SQLLEN *NumericAttribute; }; --struct SQLColAttributes_params { SQLHSTMT hstmt; SQLUSMALLINT icol; SQLUSMALLINT fDescType; SQLPOINTER rgbDesc; SQLSMALLINT cbDescMax; SQLSMALLINT *pcbDesc; SQLLEN *pfDesc; }; --struct SQLColAttributesW_params { SQLHSTMT hstmt; SQLUSMALLINT icol; SQLUSMALLINT fDescType; SQLPOINTER rgbDesc; SQLSMALLINT cbDescMax; SQLSMALLINT *pcbDesc; SQLLEN *pfDesc; }; --struct SQLColumnPrivileges_params { SQLHSTMT hstmt; SQLCHAR *szCatalogName; SQLSMALLINT cbCatalogName; SQLCHAR *szSchemaName; SQLSMALLINT cbSchemaName; SQLCHAR *szTableName; SQLSMALLINT cbTableName; SQLCHAR *szColumnName; SQLSMALLINT cbColumnName; }; --struct SQLColumnPrivilegesW_params { SQLHSTMT hstmt; SQLWCHAR *szCatalogName; SQLSMALLINT cbCatalogName; SQLWCHAR *szSchemaName; SQLSMALLINT cbSchemaName; SQLWCHAR *szTableName; SQLSMALLINT cbTableName; SQLWCHAR *szColumnName; SQLSMALLINT cbColumnName; }; --struct SQLColumns_params { SQLHSTMT StatementHandle; SQLCHAR *CatalogName; SQLSMALLINT NameLength1; SQLCHAR *SchemaName; SQLSMALLINT NameLength2; SQLCHAR *TableName; SQLSMALLINT NameLength3; SQLCHAR *ColumnName; SQLSMALLINT NameLength4; }; --struct SQLColumnsW_params { SQLHSTMT StatementHandle; WCHAR *CatalogName; SQLSMALLINT NameLength1; WCHAR *SchemaName; SQLSMALLINT NameLength2; WCHAR *TableName; SQLSMALLINT NameLength3; WCHAR *ColumnName; SQLSMALLINT NameLength4; }; --struct SQLConnect_params { SQLHDBC ConnectionHandle; SQLCHAR *ServerName; SQLSMALLINT NameLength1; SQLCHAR *UserName; SQLSMALLINT NameLength2; SQLCHAR *Authentication; SQLSMALLINT NameLength3; }; --struct SQLConnectW_params { SQLHDBC ConnectionHandle; WCHAR *ServerName; SQLSMALLINT NameLength1; WCHAR *UserName; SQLSMALLINT NameLength2; WCHAR *Authentication; SQLSMALLINT NameLength3; }; --struct SQLCopyDesc_params { SQLHDESC SourceDescHandle; SQLHDESC TargetDescHandle; }; --struct SQLDataSources_params { SQLHENV EnvironmentHandle; SQLUSMALLINT Direction; SQLCHAR *ServerName; SQLSMALLINT BufferLength1; SQLSMALLINT *NameLength1; SQLCHAR *Description; SQLSMALLINT BufferLength2; SQLSMALLINT *NameLength2; }; --struct SQLDataSourcesA_params { SQLHENV EnvironmentHandle; SQLUSMALLINT Direction; SQLCHAR *ServerName; SQLSMALLINT BufferLength1; SQLSMALLINT *NameLength1; SQLCHAR *Description; SQLSMALLINT BufferLength2; SQLSMALLINT *NameLength2; }; --struct SQLDataSourcesW_params { SQLHENV EnvironmentHandle; SQLUSMALLINT Direction; WCHAR *ServerName; SQLSMALLINT BufferLength1; SQLSMALLINT *NameLength1; WCHAR *Description; SQLSMALLINT BufferLength2; SQLSMALLINT *NameLength2; }; --struct SQLDescribeCol_params { SQLHSTMT StatementHandle; SQLUSMALLINT ColumnNumber; SQLCHAR *ColumnName; SQLSMALLINT BufferLength; SQLSMALLINT *NameLength; SQLSMALLINT *DataType; SQLULEN *ColumnSize; SQLSMALLINT *DecimalDigits; SQLSMALLINT *Nullable; }; --struct SQLDescribeColW_params { SQLHSTMT StatementHandle; SQLUSMALLINT ColumnNumber; WCHAR *ColumnName; SQLSMALLINT BufferLength; SQLSMALLINT *NameLength; SQLSMALLINT *DataType; SQLULEN *ColumnSize; SQLSMALLINT *DecimalDigits; SQLSMALLINT *Nullable; }; --struct SQLDescribeParam_params { SQLHSTMT hstmt; SQLUSMALLINT ipar; SQLSMALLINT *pfSqlType; SQLULEN *pcbParamDef; SQLSMALLINT *pibScale; SQLSMALLINT *pfNullable; }; --struct SQLDisconnect_params { SQLHDBC ConnectionHandle; }; --struct SQLDriverConnect_params { 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 SQLDriverConnectW_params { SQLHDBC ConnectionHandle; SQLHWND WindowHandle; WCHAR *InConnectionString; SQLSMALLINT Length; WCHAR *OutConnectionString; SQLSMALLINT BufferLength; SQLSMALLINT *Length2; SQLUSMALLINT DriverCompletion; }; --struct SQLDrivers_params { SQLHENV EnvironmentHandle; SQLUSMALLINT fDirection; SQLCHAR *szDriverDesc; SQLSMALLINT cbDriverDescMax; SQLSMALLINT *pcbDriverDesc; SQLCHAR *szDriverAttributes; SQLSMALLINT cbDriverAttrMax; SQLSMALLINT *pcbDriverAttr; }; --struct SQLDriversW_params { SQLHENV EnvironmentHandle; SQLUSMALLINT fDirection; SQLWCHAR *szDriverDesc; SQLSMALLINT cbDriverDescMax; SQLSMALLINT *pcbDriverDesc; SQLWCHAR *szDriverAttributes; SQLSMALLINT cbDriverAttrMax; SQLSMALLINT *pcbDriverAttr; }; --struct SQLEndTran_params { SQLSMALLINT HandleType; SQLHANDLE Handle; SQLSMALLINT CompletionType; }; --struct SQLError_params { SQLHENV EnvironmentHandle; SQLHDBC ConnectionHandle; SQLHSTMT StatementHandle; SQLCHAR *Sqlstate; SQLINTEGER *NativeError; SQLCHAR *MessageText; SQLSMALLINT BufferLength; SQLSMALLINT *TextLength; }; --struct SQLErrorW_params { SQLHENV EnvironmentHandle; SQLHDBC ConnectionHandle; SQLHSTMT StatementHandle; WCHAR *Sqlstate; SQLINTEGER *NativeError; WCHAR *MessageText; SQLSMALLINT BufferLength; SQLSMALLINT *TextLength; }; --struct SQLExecDirect_params { SQLHSTMT StatementHandle; SQLCHAR *StatementText; SQLINTEGER TextLength; }; --struct SQLExecDirectW_params { SQLHSTMT StatementHandle; WCHAR *StatementText; SQLINTEGER TextLength; }; --struct SQLExecute_params { SQLHSTMT StatementHandle; }; --struct SQLExtendedFetch_params { SQLHSTMT hstmt; SQLUSMALLINT fFetchType; SQLLEN irow; SQLULEN *pcrow; SQLUSMALLINT *rgfRowStatus; }; --struct SQLFetch_params { SQLHSTMT StatementHandle; }; --struct SQLFetchScroll_params { SQLHSTMT StatementHandle; SQLSMALLINT FetchOrientation; SQLLEN FetchOffset; }; --struct SQLForeignKeys_params { 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 SQLForeignKeysW_params { 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 SQLFreeConnect_params { SQLHDBC ConnectionHandle; }; --struct SQLFreeEnv_params { SQLHENV EnvironmentHandle; }; --struct SQLFreeHandle_params { SQLSMALLINT HandleType; SQLHANDLE Handle; }; --struct SQLFreeStmt_params { SQLHSTMT StatementHandle; SQLUSMALLINT Option; }; --struct SQLGetConnectAttr_params { SQLHDBC ConnectionHandle; SQLINTEGER Attribute; SQLPOINTER Value; SQLINTEGER BufferLength; SQLINTEGER *StringLength; }; --struct SQLGetConnectAttrW_params { SQLHDBC ConnectionHandle; SQLINTEGER Attribute; SQLPOINTER Value; SQLINTEGER BufferLength; SQLINTEGER *StringLength; }; --struct SQLGetConnectOption_params { SQLHDBC ConnectionHandle; SQLUSMALLINT Option; SQLPOINTER Value; }; --struct SQLGetConnectOptionW_params { SQLHDBC ConnectionHandle; SQLUSMALLINT Option; SQLPOINTER Value; }; --struct SQLGetCursorName_params { SQLHSTMT StatementHandle; SQLCHAR *CursorName; SQLSMALLINT BufferLength; SQLSMALLINT *NameLength; }; --struct SQLGetCursorNameW_params { SQLHSTMT StatementHandle; WCHAR *CursorName; SQLSMALLINT BufferLength; SQLSMALLINT *NameLength; }; --struct SQLGetData_params { SQLHSTMT StatementHandle; SQLUSMALLINT ColumnNumber; SQLSMALLINT TargetType; SQLPOINTER TargetValue; SQLLEN BufferLength; SQLLEN *StrLen_or_Ind; }; --struct SQLGetDescField_params { SQLHDESC DescriptorHandle; SQLSMALLINT RecNumber; SQLSMALLINT FieldIdentifier; SQLPOINTER Value; SQLINTEGER BufferLength; SQLINTEGER *StringLength; }; --struct SQLGetDescFieldW_params { SQLHDESC DescriptorHandle; SQLSMALLINT RecNumber; SQLSMALLINT FieldIdentifier; SQLPOINTER Value; SQLINTEGER BufferLength; SQLINTEGER *StringLength; }; --struct SQLGetDescRec_params { SQLHDESC DescriptorHandle; SQLSMALLINT RecNumber; SQLCHAR *Name; SQLSMALLINT BufferLength; SQLSMALLINT *StringLength; SQLSMALLINT *Type; SQLSMALLINT *SubType; SQLLEN *Length; SQLSMALLINT *Precision; SQLSMALLINT *Scale; SQLSMALLINT *Nullable; }; --struct SQLGetDescRecW_params { SQLHDESC DescriptorHandle; SQLSMALLINT RecNumber; WCHAR *Name; SQLSMALLINT BufferLength; SQLSMALLINT *StringLength; SQLSMALLINT *Type; SQLSMALLINT *SubType; SQLLEN *Length; SQLSMALLINT *Precision; SQLSMALLINT *Scale; SQLSMALLINT *Nullable; }; --struct SQLGetDiagField_params { SQLSMALLINT HandleType; SQLHANDLE Handle; SQLSMALLINT RecNumber; SQLSMALLINT DiagIdentifier; SQLPOINTER DiagInfo; SQLSMALLINT BufferLength; SQLSMALLINT *StringLength; }; --struct SQLGetDiagFieldW_params { SQLSMALLINT HandleType; SQLHANDLE Handle; SQLSMALLINT RecNumber; SQLSMALLINT DiagIdentifier; SQLPOINTER DiagInfo; SQLSMALLINT BufferLength; SQLSMALLINT *StringLength; }; --struct SQLGetDiagRec_params { SQLSMALLINT HandleType; SQLHANDLE Handle; SQLSMALLINT RecNumber; SQLCHAR *Sqlstate; SQLINTEGER *NativeError; SQLCHAR *MessageText; SQLSMALLINT BufferLength; SQLSMALLINT *TextLength; }; --struct SQLGetDiagRecA_params { SQLSMALLINT HandleType; SQLHANDLE Handle; SQLSMALLINT RecNumber; SQLCHAR *Sqlstate; SQLINTEGER *NativeError; SQLCHAR *MessageText; SQLSMALLINT BufferLength; SQLSMALLINT *TextLength; }; --struct SQLGetDiagRecW_params { SQLSMALLINT HandleType; SQLHANDLE Handle; SQLSMALLINT RecNumber; WCHAR *Sqlstate; SQLINTEGER *NativeError; WCHAR *MessageText; SQLSMALLINT BufferLength; SQLSMALLINT *TextLength; }; --struct SQLGetEnvAttr_params { SQLHENV EnvironmentHandle; SQLINTEGER Attribute; SQLPOINTER Value; SQLINTEGER BufferLength; SQLINTEGER *StringLength; }; --struct SQLGetFunctions_params { SQLHDBC ConnectionHandle; SQLUSMALLINT FunctionId; SQLUSMALLINT *Supported; }; --struct SQLGetInfo_params { SQLHDBC ConnectionHandle; SQLUSMALLINT InfoType; SQLPOINTER InfoValue; SQLSMALLINT BufferLength; SQLSMALLINT *StringLength; }; --struct SQLGetInfoW_params { SQLHDBC ConnectionHandle; SQLUSMALLINT InfoType; SQLPOINTER InfoValue; SQLSMALLINT BufferLength; SQLSMALLINT *StringLength; }; --struct SQLGetStmtAttr_params { SQLHSTMT StatementHandle; SQLINTEGER Attribute; SQLPOINTER Value; SQLINTEGER BufferLength; SQLINTEGER *StringLength; }; --struct SQLGetStmtAttrW_params { SQLHSTMT StatementHandle; SQLINTEGER Attribute; SQLPOINTER Value; SQLINTEGER BufferLength; SQLINTEGER *StringLength; }; --struct SQLGetStmtOption_params { SQLHSTMT StatementHandle; SQLUSMALLINT Option; SQLPOINTER Value; }; --struct SQLGetTypeInfo_params { SQLHSTMT StatementHandle; SQLSMALLINT DataType; }; --struct SQLGetTypeInfoW_params { SQLHSTMT StatementHandle; SQLSMALLINT DataType; }; --struct SQLMoreResults_params { SQLHSTMT StatementHandle; }; --struct SQLNativeSql_params { SQLHDBC hdbc; SQLCHAR *szSqlStrIn; SQLINTEGER cbSqlStrIn; SQLCHAR *szSqlStr; SQLINTEGER cbSqlStrMax; SQLINTEGER *pcbSqlStr; }; --struct SQLNativeSqlW_params { SQLHDBC hdbc; SQLWCHAR *szSqlStrIn; SQLINTEGER cbSqlStrIn; SQLWCHAR *szSqlStr; SQLINTEGER cbSqlStrMax; SQLINTEGER *pcbSqlStr; }; --struct SQLNumParams_params { SQLHSTMT hstmt; SQLSMALLINT *pcpar; }; --struct SQLNumResultCols_params { SQLHSTMT StatementHandle; SQLSMALLINT *ColumnCount; }; --struct SQLParamData_params { SQLHSTMT StatementHandle; SQLPOINTER *Value; }; --struct SQLParamOptions_params { SQLHSTMT hstmt; SQLULEN crow; SQLULEN *pirow; }; --struct SQLPrepare_params { SQLHSTMT StatementHandle; SQLCHAR *StatementText; SQLINTEGER TextLength; }; --struct SQLPrepareW_params { SQLHSTMT StatementHandle; WCHAR *StatementText; SQLINTEGER TextLength; }; --struct SQLPrimaryKeys_params { SQLHSTMT hstmt; SQLCHAR *szCatalogName; SQLSMALLINT cbCatalogName; SQLCHAR *szSchemaName; SQLSMALLINT cbSchemaName; SQLCHAR *szTableName; SQLSMALLINT cbTableName; }; --struct SQLPrimaryKeysW_params { SQLHSTMT hstmt; SQLWCHAR *szCatalogName; SQLSMALLINT cbCatalogName; SQLWCHAR *szSchemaName; SQLSMALLINT cbSchemaName; SQLWCHAR *szTableName; SQLSMALLINT cbTableName; }; --struct SQLProcedureColumns_params { SQLHSTMT hstmt; SQLCHAR *szCatalogName; SQLSMALLINT cbCatalogName; SQLCHAR *szSchemaName; SQLSMALLINT cbSchemaName; SQLCHAR *szProcName; SQLSMALLINT cbProcName; SQLCHAR *szColumnName; SQLSMALLINT cbColumnName; }; --struct SQLProcedureColumnsW_params { SQLHSTMT hstmt; SQLWCHAR *szCatalogName; SQLSMALLINT cbCatalogName; SQLWCHAR *szSchemaName; SQLSMALLINT cbSchemaName; SQLWCHAR *szProcName; SQLSMALLINT cbProcName; SQLWCHAR *szColumnName; SQLSMALLINT cbColumnName; }; --struct SQLProcedures_params { SQLHSTMT hstmt; SQLCHAR *szCatalogName; SQLSMALLINT cbCatalogName; SQLCHAR *szSchemaName; SQLSMALLINT cbSchemaName; SQLCHAR *szProcName; SQLSMALLINT cbProcName; }; --struct SQLProceduresW_params { SQLHSTMT hstmt; SQLWCHAR *szCatalogName; SQLSMALLINT cbCatalogName; SQLWCHAR *szSchemaName; SQLSMALLINT cbSchemaName; SQLWCHAR *szProcName; SQLSMALLINT cbProcName; }; --struct SQLPutData_params { SQLHSTMT StatementHandle; SQLPOINTER Data; SQLLEN StrLen_or_Ind; }; --struct SQLRowCount_params { SQLHSTMT StatementHandle; SQLLEN *RowCount; }; --struct SQLSetConnectAttr_params { SQLHDBC ConnectionHandle; SQLINTEGER Attribute; SQLPOINTER Value; SQLINTEGER StringLength; }; --struct SQLSetConnectAttrW_params { SQLHDBC ConnectionHandle; SQLINTEGER Attribute; SQLPOINTER Value; SQLINTEGER StringLength; }; --struct SQLSetConnectOption_params { SQLHDBC ConnectionHandle; SQLUSMALLINT Option; SQLULEN Value; }; --struct SQLSetConnectOptionW_params { SQLHDBC ConnectionHandle; SQLUSMALLINT Option; SQLULEN Value; }; --struct SQLSetCursorName_params { SQLHSTMT StatementHandle; SQLCHAR *CursorName; SQLSMALLINT NameLength; }; --struct SQLSetCursorNameW_params { SQLHSTMT StatementHandle; WCHAR *CursorName; SQLSMALLINT NameLength; }; --struct SQLSetDescField_params { SQLHDESC DescriptorHandle; SQLSMALLINT RecNumber; SQLSMALLINT FieldIdentifier; SQLPOINTER Value; SQLINTEGER BufferLength; }; --struct SQLSetDescFieldW_params { SQLHDESC DescriptorHandle; SQLSMALLINT RecNumber; SQLSMALLINT FieldIdentifier; SQLPOINTER Value; SQLINTEGER BufferLength; }; --struct SQLSetDescRec_params { SQLHDESC DescriptorHandle; SQLSMALLINT RecNumber; SQLSMALLINT Type; SQLSMALLINT SubType; SQLLEN Length; SQLSMALLINT Precision; SQLSMALLINT Scale; SQLPOINTER Data; SQLLEN *StringLength; SQLLEN *Indicator; }; --struct SQLSetEnvAttr_params { SQLHENV EnvironmentHandle; SQLINTEGER Attribute; SQLPOINTER Value; SQLINTEGER StringLength; }; --struct SQLSetParam_params { SQLHSTMT StatementHandle; SQLUSMALLINT ParameterNumber; SQLSMALLINT ValueType; SQLSMALLINT ParameterType; SQLULEN LengthPrecision; SQLSMALLINT ParameterScale; SQLPOINTER ParameterValue; SQLLEN *StrLen_or_Ind; }; --struct SQLSetPos_params { SQLHSTMT hstmt; SQLSETPOSIROW irow; SQLUSMALLINT fOption; SQLUSMALLINT fLock; }; --struct SQLSetScrollOptions_params { SQLHSTMT statement_handle; SQLUSMALLINT f_concurrency; SQLLEN crow_keyset; SQLUSMALLINT crow_rowset; }; --struct SQLSetStmtAttr_params { SQLHSTMT StatementHandle; SQLINTEGER Attribute; SQLPOINTER Value; SQLINTEGER StringLength; }; --struct SQLSetStmtAttrW_params { SQLHSTMT StatementHandle; SQLINTEGER Attribute; SQLPOINTER Value; SQLINTEGER StringLength; }; --struct SQLSetStmtOption_params { SQLHSTMT StatementHandle; SQLUSMALLINT Option; SQLULEN Value; }; --struct SQLSpecialColumns_params { SQLHSTMT StatementHandle; SQLUSMALLINT IdentifierType; SQLCHAR *CatalogName; SQLSMALLINT NameLength1; SQLCHAR *SchemaName; SQLSMALLINT NameLength2; SQLCHAR *TableName; SQLSMALLINT NameLength3; SQLUSMALLINT Scope; SQLUSMALLINT Nullable; }; --struct SQLSpecialColumnsW_params { SQLHSTMT StatementHandle; SQLUSMALLINT IdentifierType; SQLWCHAR *CatalogName; SQLSMALLINT NameLength1; SQLWCHAR *SchemaName; SQLSMALLINT NameLength2; SQLWCHAR *TableName; SQLSMALLINT NameLength3; SQLUSMALLINT Scope; SQLUSMALLINT Nullable; }; --struct SQLStatistics_params { SQLHSTMT StatementHandle; SQLCHAR *CatalogName; SQLSMALLINT NameLength1; SQLCHAR *SchemaName; SQLSMALLINT NameLength2; SQLCHAR *TableName; SQLSMALLINT NameLength3; SQLUSMALLINT Unique; SQLUSMALLINT Reserved; }; --struct SQLStatisticsW_params { SQLHSTMT StatementHandle; SQLWCHAR *CatalogName; SQLSMALLINT NameLength1; SQLWCHAR *SchemaName; SQLSMALLINT NameLength2; SQLWCHAR *TableName; SQLSMALLINT NameLength3; SQLUSMALLINT Unique; SQLUSMALLINT Reserved; }; --struct SQLTablePrivileges_params { SQLHSTMT hstmt; SQLCHAR *szCatalogName; SQLSMALLINT cbCatalogName; SQLCHAR *szSchemaName; SQLSMALLINT cbSchemaName; SQLCHAR *szTableName; SQLSMALLINT cbTableName; }; --struct SQLTablePrivilegesW_params { SQLHSTMT hstmt; SQLWCHAR *szCatalogName; SQLSMALLINT cbCatalogName; SQLWCHAR *szSchemaName; SQLSMALLINT cbSchemaName; SQLWCHAR *szTableName; SQLSMALLINT cbTableName; }; --struct SQLTables_params { SQLHSTMT StatementHandle; SQLCHAR *CatalogName; SQLSMALLINT NameLength1; SQLCHAR *SchemaName; SQLSMALLINT NameLength2; SQLCHAR *TableName; SQLSMALLINT NameLength3; SQLCHAR *TableType; SQLSMALLINT NameLength4; }; --struct SQLTablesW_params { SQLHSTMT StatementHandle; SQLWCHAR *CatalogName; SQLSMALLINT NameLength1; SQLWCHAR *SchemaName; SQLSMALLINT NameLength2; SQLWCHAR *TableName; SQLSMALLINT NameLength3; SQLWCHAR *TableType; SQLSMALLINT NameLength4; }; --struct SQLTransact_params { SQLHENV EnvironmentHandle; SQLHDBC ConnectionHandle; SQLUSMALLINT CompletionType; }; -diff --git a/include/config.h.in b/include/config.h.in -index dc44f2ec4e3..6456c142308 100644 ---- a/include/config.h.in -+++ b/include/config.h.in -@@ -768,9 +768,6 @@ - /* Define to the soname of the libnetapi library. */ - #undef SONAME_LIBNETAPI - --/* Define to the soname of the libodbc library. */ --#undef SONAME_LIBODBC +-struct param +-{ +- INT64 len; /* result length stored in Unix lib */ +- void *ptr; /* result length ptr passed by client */ +-}; - - /* Define to the soname of the libOSMesa library. */ - #undef SONAME_LIBOSMESA - +-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; +-}; +- +-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; +- INT64 *StrLen_or_Ind; +-}; +- +-struct SQLBindParam_params +-{ +- UINT64 StatementHandle; +- UINT16 ParameterNumber; +- INT16 ValueType; +- INT16 ParameterType; +- UINT64 LengthPrecision; +- INT16 ParameterScale; +- void *ParameterValue; +- INT64 *StrLen_or_Ind; +-}; +- +-struct SQLBindParameter_params +-{ +- UINT64 StatementHandle; +- UINT16 ParameterNumber; +- INT16 InputOutputType; +- INT16 ValueType; +- INT16 ParameterType; +- UINT64 ColumnSize; +- INT16 DecimalDigits; +- void *ParameterValue; +- INT64 BufferLength; +- INT64 *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; +-}; -- 2.43.0 diff --git a/patches/odbc-remove-unixodbc/0004-odbc32-Add-initial-tests.patch b/patches/odbc-remove-unixodbc/0004-odbc32-Add-initial-tests.patch index 51897e07..2fba95aa 100644 --- a/patches/odbc-remove-unixodbc/0004-odbc32-Add-initial-tests.patch +++ b/patches/odbc-remove-unixodbc/0004-odbc32-Add-initial-tests.patch @@ -1,113 +1,51 @@ -From 9491dc2b72947bef59d8fb191fdc27a96bcc1c68 Mon Sep 17 00:00:00 2001 +From b129fd1a7b4de4959f8929f03ece4688b3e1a6fd 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 --- - configure | 1 + - configure.ac | 1 + - dlls/odbc32/tests/Makefile.in | 5 + - dlls/odbc32/tests/connection.c | 165 +++++++++++++++++++++++++++++++++ - 4 files changed, 172 insertions(+) - create mode 100644 dlls/odbc32/tests/Makefile.in - create mode 100644 dlls/odbc32/tests/connection.c + dlls/odbc32/tests/odbc32.c | 52 +++++++++++++++++++++++++++++++++++++- + 1 file changed, 51 insertions(+), 1 deletion(-) -diff --git a/configure b/configure -index ca6e87d4740..027f3fbe53d 100755 ---- a/configure -+++ b/configure -@@ -22137,6 +22137,7 @@ wine_fn_config_makefile dlls/ntprint enable_ntprint - wine_fn_config_makefile dlls/ntprint/tests enable_tests - wine_fn_config_makefile dlls/objsel enable_objsel - wine_fn_config_makefile dlls/odbc32 enable_odbc32 -+wine_fn_config_makefile dlls/odbc32/tests enable_tests - wine_fn_config_makefile dlls/odbcbcp enable_odbcbcp - wine_fn_config_makefile dlls/odbccp32 enable_odbccp32 - wine_fn_config_makefile dlls/odbccp32/tests enable_tests -diff --git a/configure.ac b/configure.ac -index cba55126869..fc09d145ee7 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2954,6 +2954,7 @@ WINE_CONFIG_MAKEFILE(dlls/ntprint) - WINE_CONFIG_MAKEFILE(dlls/ntprint/tests) - WINE_CONFIG_MAKEFILE(dlls/objsel) - WINE_CONFIG_MAKEFILE(dlls/odbc32) -+WINE_CONFIG_MAKEFILE(dlls/odbc32/tests) - WINE_CONFIG_MAKEFILE(dlls/odbcbcp) - WINE_CONFIG_MAKEFILE(dlls/odbccp32) - WINE_CONFIG_MAKEFILE(dlls/odbccp32/tests) -diff --git a/dlls/odbc32/tests/Makefile.in b/dlls/odbc32/tests/Makefile.in -new file mode 100644 -index 00000000000..d7a300417a0 ---- /dev/null -+++ b/dlls/odbc32/tests/Makefile.in -@@ -0,0 +1,5 @@ -+TESTDLL = odbc32.dll -+IMPORTS = odbc32 -+ -+SOURCES = \ -+ connection.c -diff --git a/dlls/odbc32/tests/connection.c b/dlls/odbc32/tests/connection.c -new file mode 100644 -index 00000000000..b04d93c42c5 ---- /dev/null -+++ b/dlls/odbc32/tests/connection.c -@@ -0,0 +1,165 @@ -+/* -+ * Copyright 2018 Alistair Leslie-Hughes -+ * -+ * 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 -+ */ -+ -+#include -+#include -+ -+#include "windef.h" -+#include "winbase.h" -+#include "sqlext.h" -+#include "sqlucode.h" -+#include "odbcinst.h" -+ -+static void test_SQLAllocEnv(void) -+{ -+ SQLRETURN ret; -+ SQLHENV sqlenv, sqlenv2; -+ -+ ret = SQLAllocEnv(NULL); -+ ok(ret == SQL_ERROR, "got %d\n", ret); -+ -+ ret = SQLAllocEnv(&sqlenv); -+ ok(ret == SQL_SUCCESS, "got %d\n", ret); -+ -+ ret = SQLAllocEnv(&sqlenv2); -+ ok(ret == SQL_SUCCESS, "got %d\n", ret); -+ ok(sqlenv != sqlenv2, "got %d\n", ret); -+ -+ ret = SQLFreeEnv(sqlenv2); -+ ok(ret == SQL_SUCCESS, "got %d\n", ret); -+ -+ ret = SQLFreeEnv(sqlenv); -+ ok(ret == SQL_SUCCESS, "got %d\n", ret); -+ -+ ret = SQLFreeEnv(sqlenv); -+ todo_wine ok(ret == SQL_INVALID_HANDLE, "got %d\n", ret); -+ -+ ret = SQLFreeEnv(SQL_NULL_HENV); -+ todo_wine ok(ret == SQL_INVALID_HANDLE, "got %d\n", ret); -+} +diff --git a/dlls/odbc32/tests/odbc32.c b/dlls/odbc32/tests/odbc32.c +index 8a744f23834..7e1f62e559f 100644 +--- a/dlls/odbc32/tests/odbc32.c ++++ b/dlls/odbc32/tests/odbc32.c +@@ -28,7 +28,7 @@ + static void test_SQLAllocHandle( void ) + { + SQLHANDLE handle; +- SQLHENV env; ++ SQLHENV env, env2; + SQLHDBC con; + SQLRETURN ret; + +@@ -46,6 +46,12 @@ static void test_SQLAllocHandle( void ) + ok( ret == SQL_SUCCESS, "got %d\n", ret ); + ok( env != (void *)0xdeadbeef, "env not set\n" ); + ++ env2 = (void *)0xdeadbeef; ++ ret = SQLAllocEnv( &env2 ); ++ ok( ret == SQL_SUCCESS, "got %d\n", ret ); ++ ok( env2 != (void *)0xdeadbeef, "env2 not set\n" ); ++ ok( env2 != env, "environment is the same\n" ); + + con = (void *)0xdeadbeef; + ret = SQLAllocConnect( env, &con ); + ok( ret == SQL_SUCCESS, "got %d\n", ret ); +@@ -57,6 +63,8 @@ static void test_SQLAllocHandle( void ) + ok( ret == SQL_INVALID_HANDLE, "got %d\n", ret ); + ret = SQLFreeEnv( env ); + ok( ret == SQL_SUCCESS, "got %d\n", ret ); ++ ret = SQLFreeEnv( env2 ); ++ ok( ret == SQL_SUCCESS, "got %d\n", ret ); + ret = SQLFreeEnv( 0 ); + ok( ret == SQL_INVALID_HANDLE, "got %d\n", ret ); + } +@@ -302,6 +310,47 @@ static void test_SQLExecDirect( void ) + ok( ret == SQL_SUCCESS, "got %d\n", ret ); + } + +void test_SQLGetEnvAttr(void) +{ + SQLRETURN ret; @@ -149,75 +87,15 @@ index 00000000000..b04d93c42c5 + ok(ret == SQL_SUCCESS, "got %d\n", ret); +} + -+static void test_SQLDriver(void) -+{ -+ SQLHENV henv = SQL_NULL_HENV; -+ SQLRETURN ret; -+ SQLCHAR driver[256]; -+ SQLCHAR attr[256]; -+ SQLSMALLINT driver_ret; -+ SQLSMALLINT attr_ret; -+ SQLUSMALLINT direction; -+ -+ ret = SQLAllocEnv(&henv); -+ ok(ret == SQL_SUCCESS, "got %d\n", ret); -+ ok(henv != SQL_NULL_HENV, "NULL handle\n"); -+ -+ direction = SQL_FETCH_FIRST; -+ -+ while(SQL_SUCCEEDED(ret = SQLDrivers(henv, direction, driver, sizeof(driver), -+ &driver_ret, attr, sizeof(attr), &attr_ret))) -+ { -+ direction = SQL_FETCH_NEXT; -+ -+ trace("%s - %s\n", driver, attr); -+ } -+ todo_wine ok(ret == SQL_NO_DATA, "got %d\n", ret); -+ -+ ret = SQLFreeEnv(henv); -+ ok(ret == SQL_SUCCESS, "got %d\n", ret); -+} -+ -+static void test_SQLGetDiagRec(void) -+{ -+ SQLHENV henv = SQL_NULL_HENV; -+ SQLHDBC connection; -+ SQLRETURN ret; -+ WCHAR version[11]; -+ WCHAR SqlState[6], Msg[SQL_MAX_MESSAGE_LENGTH]; -+ SQLINTEGER NativeError; -+ SQLSMALLINT MsgLen; -+ -+ ret = SQLAllocEnv(&henv); -+ ok(ret == SQL_SUCCESS, "got %d\n", ret); -+ ok(henv != SQL_NULL_HENV, "NULL handle\n"); -+ -+ ret = SQLAllocConnect(henv, &connection); -+ ok(ret == SQL_SUCCESS, "got %d\n", ret); -+ -+ ret = SQLGetInfoW(connection, SQL_ODBC_VER, version, 22, NULL); -+ ok(ret == SQL_SUCCESS, "got %d\n", ret); -+ trace("ODBC_VER=%s\n", wine_dbgstr_w(version)); -+ -+ ret = SQLFreeConnect(connection); -+ ok(ret == SQL_SUCCESS, "got %d\n", ret); -+ -+ NativeError = 88; -+ ret = SQLGetDiagRecW( SQL_HANDLE_ENV, henv, 1, SqlState, &NativeError, Msg, sizeof(Msg), &MsgLen); -+ todo_wine ok(ret == SQL_NO_DATA, "got %d\n", ret); -+ ok(NativeError == 88, "got %d\n", NativeError); -+ -+ ret = SQLFreeEnv(henv); -+ ok(ret == SQL_SUCCESS, "got %d\n", ret); -+} -+ -+START_TEST(connection) -+{ -+ test_SQLAllocEnv(); + START_TEST(odbc32) + { + test_SQLAllocHandle(); +@@ -309,4 +358,5 @@ START_TEST(odbc32) + test_SQLDataSources(); + test_SQLDrivers(); + test_SQLExecDirect(); + test_SQLGetEnvAttr(); -+ test_SQLDriver(); -+ test_SQLGetDiagRec(); -+} + } -- 2.43.0 diff --git a/patches/wineboot-HKEY_DYN_DATA/0001-wineboot-Add-some-generic-hardware-in-HKEY_DYN_DATA-.patch b/patches/wineboot-HKEY_DYN_DATA/0001-wineboot-Add-some-generic-hardware-in-HKEY_DYN_DATA-.patch index 750b307d..24129fdc 100644 --- a/patches/wineboot-HKEY_DYN_DATA/0001-wineboot-Add-some-generic-hardware-in-HKEY_DYN_DATA-.patch +++ b/patches/wineboot-HKEY_DYN_DATA/0001-wineboot-Add-some-generic-hardware-in-HKEY_DYN_DATA-.patch @@ -1,4 +1,4 @@ -From 5e22907c02cb6778555995421a0b8eb8e382ff3a Mon Sep 17 00:00:00 2001 +From 98419c58be94ecff277ad08c503affd6ffa133ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sun, 16 Mar 2014 03:19:39 +0100 Subject: [PATCH] wineboot: Add some generic hardware in HKEY_DYN_DATA\Config @@ -9,11 +9,11 @@ Subject: [PATCH] wineboot: Add some generic hardware in HKEY_DYN_DATA\Config 1 file changed, 100 insertions(+) diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c -index 728c41fffa9..beb29db4653 100644 +index dfa3f6dd738..77708b40122 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c -@@ -763,16 +763,116 @@ static void create_hardware_registry_keys(void) - free( power_info ); +@@ -912,16 +912,116 @@ static void create_hardware_registry_keys(void) + free( buf ); } +struct dyndata_enum_key{ @@ -128,7 +128,7 @@ index 728c41fffa9..beb29db4653 100644 + } } - /* create the platform-specific environment registry keys */ + /* create the ComputerName registry keys */ -- -2.40.1 +2.43.0 diff --git a/staging/upstream-commit b/staging/upstream-commit index d0a5bfb2..c15d0057 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -040b2a9c75666527af6ca79d9146095c8ed6a3cf +6a31983779479b42e0c2e5320a1dfa962767c28e