diff --git a/patches/odbc-remove-unixodbc/0001-odbc32-Remove-unixODBC-support.patch b/patches/odbc-remove-unixodbc/0001-odbc32-Remove-unixODBC-support.patch new file mode 100644 index 00000000..92b8bb0d --- /dev/null +++ b/patches/odbc-remove-unixodbc/0001-odbc32-Remove-unixODBC-support.patch @@ -0,0 +1,4207 @@ +From de6ee9b0358cb5d6464808751a9d33ed0564afcd Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Thu, 2 Feb 2023 14:20:44 +1100 +Subject: [PATCH 01/42] odbc32: Remove unixODBC support + +--- + configure.ac | 3 - + dlls/odbc32/Makefile.in | 3 +- + dlls/odbc32/proxyodbc.c | 1326 +++++++-------------------------------- + dlls/odbc32/unixlib.c | 1272 ------------------------------------- + dlls/odbc32/unixlib.h | 278 -------- + include/config.h.in | 3 - + 6 files changed, 237 insertions(+), 2648 deletions(-) + delete mode 100644 dlls/odbc32/unixlib.c + delete mode 100644 dlls/odbc32/unixlib.h + +diff --git a/configure.ac b/configure.ac +index 590ef29eb35..1033af2e613 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1768,9 +1768,6 @@ then + AC_SUBST(PROCSTAT_LIBS,"-lprocstat")]) + fi + +-dnl **** Check for libodbc **** +-WINE_CHECK_SONAME(odbc,SQLConnect,,[AC_DEFINE_UNQUOTED(SONAME_LIBODBC,["libodbc.$LIBEXT"])]) +- + dnl **** Check for libnetapi **** + if test "x$with_netapi" != "xno" + then +diff --git a/dlls/odbc32/Makefile.in b/dlls/odbc32/Makefile.in +index def7b4b5d67..3d644700c08 100644 +--- a/dlls/odbc32/Makefile.in ++++ b/dlls/odbc32/Makefile.in +@@ -4,7 +4,6 @@ IMPORTLIB = odbc32 + IMPORTS = advapi32 + + C_SRCS = \ +- proxyodbc.c \ +- unixlib.c ++ proxyodbc.c + + RC_SRCS = rsrc.rc +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 679f3d7380e..e8574430e74 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -40,315 +40,19 @@ + #include "sql.h" + #include "sqltypes.h" + #include "sqlext.h" +-#include "unixlib.h" + + WINE_DEFAULT_DEBUG_CHANNEL(odbc); +-WINE_DECLARE_DEBUG_CHANNEL(winediag); + +-#define ODBC_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params ) +- +-/*********************************************************************** +- * 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 }; +- 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("Returning %d, ConnectionHandle %p\n", ret, *ConnectionHandle); + return ret; + } + +@@ -357,14 +61,12 @@ SQLRETURN WINAPI SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionH + */ + SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle) + { +- struct SQLAllocEnv_params params = { EnvironmentHandle }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle); ++ FIXME("(EnvironmentHandle %p)\n", EnvironmentHandle); + + *EnvironmentHandle = SQL_NULL_HENV; +- ret = ODBC_CALL( SQLAllocEnv, ¶ms ); +- TRACE("Returning %d, EnvironmentHandle %p\n", ret, *EnvironmentHandle); ++ + return ret; + } + +@@ -373,14 +75,11 @@ SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle) + */ + SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle) + { +- struct SQLAllocHandle_params params = { HandleType, InputHandle, OutputHandle }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); ++ FIXME("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); + + *OutputHandle = 0; +- ret = ODBC_CALL( SQLAllocHandle, ¶ms ); +- TRACE("Returning %d, Handle %p\n", ret, *OutputHandle); + return ret; + } + +@@ -389,14 +88,11 @@ SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, S + */ + SQLRETURN WINAPI SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandle) + { +- struct SQLAllocStmt_params params = { ConnectionHandle, StatementHandle }; +- 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 ); +- TRACE ("Returning %d, StatementHandle %p\n", ret, *StatementHandle); + return ret; + } + +@@ -405,14 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); ++ FIXME("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); + + *OutputHandle = 0; +- ret = ODBC_CALL( SQLAllocHandleStd, ¶ms ); +- TRACE ("Returning %d, OutputHandle %p\n", ret, *OutputHandle); + return ret; + } + +@@ -431,15 +124,11 @@ static const char *debugstr_sqllen( SQLLEN len ) + 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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", ++ FIXME("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", + StatementHandle, ColumnNumber, TargetType, TargetValue, debugstr_sqllen(BufferLength), StrLen_or_Ind); + +- ret = ODBC_CALL( SQLBindCol, ¶ms ); +- TRACE ("Returning %d\n", ret); + return ret; + } + +@@ -459,16 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s," ++ FIXME("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s," + " ParameterScale %d, ParameterValue %p, StrLen_or_Ind %p)\n", StatementHandle, ParameterNumber, ValueType, + ParameterType, debugstr_sqlulen(LengthPrecision), ParameterScale, ParameterValue, StrLen_or_Ind); + +- ret = ODBC_CALL( SQLBindParam, ¶ms ); +- TRACE ("Returning %d\n", ret); + return ret; + } + +@@ -477,13 +162,10 @@ SQLRETURN WINAPI SQLBindParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNu + */ + SQLRETURN WINAPI SQLCancel(SQLHSTMT StatementHandle) + { +- struct SQLCancel_params params = { StatementHandle }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p)\n", StatementHandle); ++ FIXME("(StatementHandle %p)\n", StatementHandle); + +- ret = ODBC_CALL( SQLCancel, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -492,13 +174,10 @@ SQLRETURN WINAPI SQLCancel(SQLHSTMT StatementHandle) + */ + SQLRETURN WINAPI SQLCloseCursor(SQLHSTMT StatementHandle) + { +- struct SQLCloseCursor_params params = { StatementHandle }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p)\n", StatementHandle); ++ FIXME("(StatementHandle %p)\n", StatementHandle); + +- 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, + SQLLEN *NumericAttribute) + { +- struct SQLColAttribute_params params = { StatementHandle, ColumnNumber, FieldIdentifier, +- CharacterAttribute, BufferLength, StringLength, NumericAttribute }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttribute %p, BufferLength %d," ++ FIXME("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttribute %p, BufferLength %d," + " StringLength %p, NumericAttribute %p)\n", StatementHandle, ColumnNumber, FieldIdentifier, + CharacterAttribute, BufferLength, StringLength, NumericAttribute); + +- ret = ODBC_CALL( SQLColAttribute, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -530,19 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," ++ FIXME("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," + " NameLength3 %d, ColumnName %s, NameLength4 %d)\n", StatementHandle, + debugstr_an((const char *)CatalogName, NameLength1), NameLength1, + debugstr_an((const char *)SchemaName, NameLength2), NameLength2, + debugstr_an((const char *)TableName, NameLength3), NameLength3, + debugstr_an((const char *)ColumnName, NameLength4), NameLength4); + +- ret = ODBC_CALL( SQLColumns, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -553,18 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, ServerName %s, NameLength1 %d, UserName %s, NameLength2 %d, Authentication %s," ++ FIXME("(ConnectionHandle %p, ServerName %s, NameLength1 %d, UserName %s, NameLength2 %d, Authentication %s," + " NameLength3 %d)\n", ConnectionHandle, + debugstr_an((const char *)ServerName, NameLength1), NameLength1, + debugstr_an((const char *)UserName, NameLength2), NameLength2, + debugstr_an((const char *)Authentication, NameLength3), NameLength3); + +- ret = ODBC_CALL( SQLConnect, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -573,13 +240,10 @@ SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSM + */ + SQLRETURN WINAPI SQLCopyDesc(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle) + { +- struct SQLCopyDesc_params params = { SourceDescHandle, TargetDescHandle }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(SourceDescHandle %p, TargetDescHandle %p)\n", SourceDescHandle, TargetDescHandle); ++ FIXME("(SourceDescHandle %p, TargetDescHandle %p)\n", SourceDescHandle, TargetDescHandle); + +- ret = ODBC_CALL( SQLCopyDesc, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -590,25 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- 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( SQLDataSources, ¶ms ); +- if (ret >= 0 && 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; + } + +@@ -616,25 +267,12 @@ 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; ++ SQLRETURN ret = SQL_ERROR; + +- 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; + } + +@@ -645,28 +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 }; +- SQLSMALLINT dummy; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," ++ FIXME("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," + " ColumnSize %p, DecimalDigits %p, Nullable %p)\n", StatementHandle, ColumnNumber, ColumnName, + BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); + +- if (!params.NameLength) params.NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ +- +- ret = ODBC_CALL( SQLDescribeCol, ¶ms ); +- if (ret >= 0) +- { +- 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 (DecimalDigits) TRACE(" DecimalDigits %d\n", *DecimalDigits); +- if (Nullable) TRACE(" Nullable %d\n", *Nullable); +- } +- +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -675,13 +297,10 @@ SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNum + */ + SQLRETURN WINAPI SQLDisconnect(SQLHDBC ConnectionHandle) + { +- struct SQLDisconnect_params params = { ConnectionHandle }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p)\n", ConnectionHandle); ++ FIXME("(ConnectionHandle %p)\n", ConnectionHandle); + +- ret = ODBC_CALL( SQLDisconnect, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -690,13 +309,10 @@ SQLRETURN WINAPI SQLDisconnect(SQLHDBC ConnectionHandle) + */ + SQLRETURN WINAPI SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType) + { +- struct SQLEndTran_params params = { HandleType, Handle, CompletionType }; +- 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); + +- 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, + SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) + { +- struct SQLError_params params = { EnvironmentHandle, ConnectionHandle, StatementHandle, Sqlstate, +- NativeError, MessageText, BufferLength, TextLength }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, Sqlstate %p, NativeError %p," ++ FIXME("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, Sqlstate %p, NativeError %p," + " MessageText %p, BufferLength %d, TextLength %p)\n", EnvironmentHandle, ConnectionHandle, + StatementHandle, Sqlstate, NativeError, MessageText, BufferLength, TextLength); + +- ret = ODBC_CALL( SQLError, ¶ms ); +- +- if (ret == SQL_SUCCESS) +- { +- TRACE(" SQLState %s\n", debugstr_an((const char *)Sqlstate, 5)); +- TRACE(" Error %d\n", *NativeError); +- TRACE(" MessageText %s\n", debugstr_an((const char *)MessageText, *TextLength)); +- } +- +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -733,14 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, ++ FIXME("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, + debugstr_an((const char *)StatementText, TextLength), TextLength); + +- ret = ODBC_CALL( SQLExecDirect, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -749,13 +350,10 @@ SQLRETURN WINAPI SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, + */ + SQLRETURN WINAPI SQLExecute(SQLHSTMT StatementHandle) + { +- struct SQLExecute_params params = { StatementHandle }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p)\n", StatementHandle); ++ FIXME("(StatementHandle %p)\n", StatementHandle); + +- ret = ODBC_CALL( SQLExecute, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -764,13 +362,10 @@ SQLRETURN WINAPI SQLExecute(SQLHSTMT StatementHandle) + */ + SQLRETURN WINAPI SQLFetch(SQLHSTMT StatementHandle) + { +- struct SQLFetch_params params = { StatementHandle }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p)\n", StatementHandle); ++ FIXME("(StatementHandle %p)\n", StatementHandle); + +- ret = ODBC_CALL( SQLFetch, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -779,14 +374,11 @@ SQLRETURN WINAPI SQLFetch(SQLHSTMT StatementHandle) + */ + SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset) + { +- struct SQLFetchScroll_params params = { StatementHandle, FetchOrientation, FetchOffset }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, FetchOrientation %d, FetchOffset %s)\n", StatementHandle, FetchOrientation, ++ FIXME("(StatementHandle %p, FetchOrientation %d, FetchOffset %s)\n", StatementHandle, FetchOrientation, + debugstr_sqllen(FetchOffset)); + +- ret = ODBC_CALL( SQLFetchScroll, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -795,13 +387,10 @@ SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrien + */ + SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle) + { +- struct SQLFreeConnect_params params = { ConnectionHandle }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p)\n", ConnectionHandle); ++ FIXME("(ConnectionHandle %p)\n", ConnectionHandle); + +- ret = ODBC_CALL( SQLFreeConnect, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -810,13 +399,10 @@ SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle) + */ + SQLRETURN WINAPI SQLFreeEnv(SQLHENV EnvironmentHandle) + { +- struct SQLFreeEnv_params params = { EnvironmentHandle }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle); ++ FIXME("(EnvironmentHandle %p)\n", EnvironmentHandle); + +- ret = ODBC_CALL( SQLFreeEnv, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -825,13 +411,10 @@ SQLRETURN WINAPI SQLFreeEnv(SQLHENV EnvironmentHandle) + */ + SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) + { +- struct SQLFreeHandle_params params = { HandleType, Handle }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(HandleType %d, Handle %p)\n", HandleType, Handle); ++ FIXME("(HandleType %d, Handle %p)\n", HandleType, Handle); + +- ret = ODBC_CALL( SQLFreeHandle, ¶ms ); +- TRACE ("Returning %d\n", ret); + return ret; + } + +@@ -840,13 +423,10 @@ SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) + */ + SQLRETURN WINAPI SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option) + { +- struct SQLFreeStmt_params params = { StatementHandle, Option }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, Option %d)\n", StatementHandle, Option); ++ FIXME("(StatementHandle %p, Option %d)\n", StatementHandle, Option); + +- ret = ODBC_CALL( SQLFreeStmt, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -856,14 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, ++ FIXME("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, + Attribute, Value, BufferLength, StringLength); + +- ret = ODBC_CALL( SQLGetConnectAttr, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -872,13 +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 }; +- 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); + +- ret = ODBC_CALL( SQLGetConnectOption, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -888,14 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle, CursorName, ++ FIXME("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle, CursorName, + BufferLength, NameLength); + +- ret = ODBC_CALL( SQLGetCursorName, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -905,15 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", ++ FIXME("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", + StatementHandle, ColumnNumber, TargetType, TargetValue, debugstr_sqllen(BufferLength), StrLen_or_Ind); + +- ret = ODBC_CALL( SQLGetData, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -923,15 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n", ++ FIXME("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n", + DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength, StringLength); + +- ret = ODBC_CALL( SQLGetDescField, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -943,16 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p," ++ FIXME("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p," + " Length %p, Precision %p, Scale %p, Nullable %p)\n", DescriptorHandle, RecNumber, Name, BufferLength, + StringLength, Type, SubType, Length, Precision, Scale, Nullable); + +- ret = ODBC_CALL( SQLGetDescRec, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -963,15 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," ++ FIXME("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," + " StringLength %p)\n", HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength); + +- 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, + SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) + { +- struct SQLGetDiagRec_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( SQLGetDiagRec, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1001,14 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(EnvironmentHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ++ FIXME("(EnvironmentHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", + EnvironmentHandle, Attribute, Value, BufferLength, StringLength); + +- ret = ODBC_CALL( SQLGetEnvAttr, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1017,13 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, FunctionId %d, Supported %p)\n", ConnectionHandle, FunctionId, Supported); ++ FIXME("(ConnectionHandle %p, FunctionId %d, Supported %p)\n", ConnectionHandle, FunctionId, Supported); + +- ret = ODBC_CALL( SQLGetFunctions, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1033,14 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, ++ FIXME("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, + InfoType, InfoValue, BufferLength, StringLength); + +- ret = ODBC_CALL( SQLGetInfo, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1050,10 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, ++ FIXME("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, + Attribute, Value, BufferLength, StringLength); + + if (!Value) +@@ -1062,8 +603,6 @@ SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, + return SQL_ERROR; + } + +- ret = ODBC_CALL( SQLGetStmtAttr, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1072,13 +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 }; +- 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); + +- ret = ODBC_CALL( SQLGetStmtOption, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1087,13 +623,10 @@ SQLRETURN WINAPI SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, + */ + SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) + { +- struct SQLGetTypeInfo_params params = { StatementHandle, DataType }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); ++ FIXME("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); + +- ret = ODBC_CALL( SQLGetTypeInfo, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1102,13 +635,10 @@ SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) + */ + SQLRETURN WINAPI SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnCount) + { +- struct SQLNumResultCols_params params = { StatementHandle, ColumnCount }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, ColumnCount %p)\n", StatementHandle, ColumnCount); ++ FIXME("(StatementHandle %p, ColumnCount %p)\n", StatementHandle, ColumnCount); + +- 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 + */ + SQLRETURN WINAPI SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value) + { +- struct SQLParamData_params params = { StatementHandle, Value }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, Value %p)\n", StatementHandle, Value); ++ FIXME("(StatementHandle %p, Value %p)\n", StatementHandle, Value); + +- ret = ODBC_CALL( SQLParamData, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1132,14 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, ++ FIXME("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, + debugstr_an((const char *)StatementText, TextLength), TextLength); + +- ret = ODBC_CALL( SQLPrepare, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1148,13 +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 }; +- 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)); + +- 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 + */ + SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount) + { +- struct SQLRowCount_params params = { StatementHandle, RowCount }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, RowCount %p)\n", StatementHandle, RowCount); ++ 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)); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1180,14 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value, ++ FIXME("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value, + StringLength); + +- ret = ODBC_CALL( SQLSetConnectAttr, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1196,13 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle, Option, debugstr_sqlulen(Value)); ++ FIXME("(ConnectionHandle %p, Option %d, Value %s)\n", ConnectionHandle, Option, debugstr_sqlulen(Value)); + +- ret = ODBC_CALL( SQLSetConnectOption, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1211,14 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle, ++ FIXME("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle, + debugstr_an((const char *)CursorName, NameLength), NameLength); + +- ret = ODBC_CALL( SQLSetCursorName, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1228,14 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle, ++ FIXME("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle, + RecNumber, FieldIdentifier, Value, BufferLength); + +- ret = ODBC_CALL( SQLSetDescField, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1246,15 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(DescriptorHandle %p, RecNumber %d, Type %d, SubType %d, Length %s, Precision %d, Scale %d, Data %p," ++ FIXME("(DescriptorHandle %p, RecNumber %d, Type %d, SubType %d, Length %s, Precision %d, Scale %d, Data %p," + " StringLength %p, Indicator %p)\n", DescriptorHandle, RecNumber, Type, SubType, debugstr_sqllen(Length), + Precision, Scale, Data, StringLength, Indicator); + +- ret = ODBC_CALL( SQLSetDescRec, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1264,14 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(EnvironmentHandle %p, Attribute %d, Value %p, StringLength %d)\n", EnvironmentHandle, Attribute, Value, ++ FIXME("(EnvironmentHandle %p, Attribute %d, Value %p, StringLength %d)\n", EnvironmentHandle, Attribute, Value, + StringLength); + +- ret = ODBC_CALL( SQLSetEnvAttr, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1282,16 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s," ++ FIXME("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s," + " ParameterScale %d, ParameterValue %p, StrLen_or_Ind %p)\n", StatementHandle, ParameterNumber, ValueType, + ParameterType, debugstr_sqlulen(LengthPrecision), ParameterScale, ParameterValue, StrLen_or_Ind); + +- ret = ODBC_CALL( SQLSetParam, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1301,14 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value, ++ FIXME("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value, + StringLength); + +- ret = ODBC_CALL( SQLSetStmtAttr, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1317,13 +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 }; +- 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)); + +- ret = ODBC_CALL( SQLSetStmtOption, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1335,18 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, IdentifierType %d, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d," ++ FIXME("(StatementHandle %p, IdentifierType %d, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d," + " TableName %s, NameLength3 %d, Scope %d, Nullable %d)\n", StatementHandle, IdentifierType, + debugstr_an((const char *)CatalogName, NameLength1), NameLength1, + debugstr_an((const char *)SchemaName, NameLength2), NameLength2, + debugstr_an((const char *)TableName, NameLength3), NameLength3, Scope, Nullable); + +- ret = ODBC_CALL( SQLSpecialColumns, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1357,18 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d SchemaName %s, NameLength2 %d, TableName %s" ++ FIXME("(StatementHandle %p, CatalogName %s, NameLength1 %d SchemaName %s, NameLength2 %d, TableName %s" + " NameLength3 %d, Unique %d, Reserved %d)\n", StatementHandle, + debugstr_an((const char *)CatalogName, NameLength1), NameLength1, + debugstr_an((const char *)SchemaName, NameLength2), NameLength2, + debugstr_an((const char *)TableName, NameLength3), NameLength3, Unique, Reserved); + +- ret = ODBC_CALL( SQLStatistics, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1379,19 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," ++ FIXME("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," + " NameLength3 %d, TableType %s, NameLength4 %d)\n", StatementHandle, + debugstr_an((const char *)CatalogName, NameLength1), NameLength1, + debugstr_an((const char *)SchemaName, NameLength2), NameLength2, + debugstr_an((const char *)TableName, NameLength3), NameLength3, + debugstr_an((const char *)TableType, NameLength4), NameLength4); + +- ret = ODBC_CALL( SQLTables, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1400,14 +877,11 @@ SQLRETURN WINAPI SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSM + */ + SQLRETURN WINAPI SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType) + { +- struct SQLTransact_params params = { EnvironmentHandle, ConnectionHandle, CompletionType }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(EnvironmentHandle %p, ConnectionHandle %p, CompletionType %d)\n", EnvironmentHandle, ConnectionHandle, ++ FIXME("(EnvironmentHandle %p, ConnectionHandle %p, CompletionType %d)\n", EnvironmentHandle, ConnectionHandle, + CompletionType); + +- 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) + { +- struct SQLBrowseConnect_params params = { hdbc, szConnStrIn, cbConnStrIn, szConnStrOut, +- cbConnStrOutMax, pcbConnStrOut }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hdbc %p, szConnStrIn %s, cbConnStrIn %d, szConnStrOut %p, cbConnStrOutMax %d, pcbConnStrOut %p)\n", ++ 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); + +- ret = ODBC_CALL( SQLBrowseConnect, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1436,13 +906,10 @@ SQLRETURN WINAPI SQLBrowseConnect(SQLHDBC hdbc, SQLCHAR *szConnStrIn, SQLSMALLIN + */ + SQLRETURN WINAPI SQLBulkOperations(SQLHSTMT StatementHandle, SQLSMALLINT Operation) + { +- struct SQLBulkOperations_params params = { StatementHandle, Operation }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, Operation %d)\n", StatementHandle, Operation); ++ FIXME("(StatementHandle %p, Operation %d)\n", StatementHandle, Operation); + +- ret = ODBC_CALL( SQLBulkOperations, ¶ms ); +- 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) + { +- struct SQLColAttributes_params params = { hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol, ++ FIXME("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol, + fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); + +- ret = ODBC_CALL( SQLColAttributes, ¶ms ); +- 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) + { +- struct SQLColumnPrivileges_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName, +- cbSchemaName, szTableName, cbTableName, szColumnName, cbColumnName }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," ++ 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); + +- 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) + { +- struct SQLDescribeParam_params params = { hstmt, ipar, pfSqlType, pcbParamDef, pibScale, pfNullable }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, ipar %d, pfSqlType %p, pcbParamDef %p, pibScale %p, pfNullable %p)\n", hstmt, ipar, ++ FIXME("(hstmt %p, ipar %d, pfSqlType %p, pcbParamDef %p, pibScale %p, pfNullable %p)\n", hstmt, ipar, + pfSqlType, pcbParamDef, pibScale, pfNullable); + +- ret = ODBC_CALL( SQLDescribeParam, ¶ms ); +- 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) + { +- struct SQLExtendedFetch_params params = { hstmt, fFetchType, irow, pcrow, rgfRowStatus }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, fFetchType %d, irow %s, pcrow %p, rgfRowStatus %p)\n", hstmt, fFetchType, debugstr_sqllen(irow), ++ FIXME("(hstmt %p, fFetchType %d, irow %s, pcrow %p, rgfRowStatus %p)\n", hstmt, fFetchType, debugstr_sqllen(irow), + pcrow, rgfRowStatus); + +- ret = ODBC_CALL( SQLExtendedFetch, ¶ms ); +- 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) + { +- struct SQLForeignKeys_params params = { hstmt, szPkCatalogName, cbPkCatalogName, szPkSchemaName, +- cbPkSchemaName, szPkTableName, cbPkTableName, szFkCatalogName, +- cbFkCatalogName, szFkSchemaName, cbFkSchemaName, +- szFkTableName, cbFkTableName }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, szPkCatalogName %s, cbPkCatalogName %d, szPkSchemaName %s, cbPkSchemaName %d," ++ 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); + +- ret = ODBC_CALL( SQLForeignKeys, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1556,13 +1004,10 @@ SQLRETURN WINAPI SQLForeignKeys(SQLHSTMT hstmt, SQLCHAR *szPkCatalogName, SQLSMA + */ + SQLRETURN WINAPI SQLMoreResults(SQLHSTMT StatementHandle) + { +- struct SQLMoreResults_params params = { StatementHandle }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(%p)\n", StatementHandle); ++ FIXME("(%p)\n", StatementHandle); + +- 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) + { +- struct SQLNativeSql_params params = { hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc, ++ 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); + +- 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 + */ + SQLRETURN WINAPI SQLNumParams(SQLHSTMT hstmt, SQLSMALLINT *pcpar) + { +- struct SQLNumParams_params params = { hstmt, pcpar }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, pcpar %p)\n", hstmt, pcpar); ++ FIXME("(hstmt %p, pcpar %p)\n", hstmt, pcpar); + +- ret = ODBC_CALL( SQLNumParams, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1603,13 +1042,10 @@ SQLRETURN WINAPI SQLNumParams(SQLHSTMT hstmt, SQLSMALLINT *pcpar) + */ + SQLRETURN WINAPI SQLParamOptions(SQLHSTMT hstmt, SQLULEN crow, SQLULEN *pirow) + { +- struct SQLParamOptions_params params = { hstmt, crow, pirow }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, crow %s, pirow %p)\n", hstmt, debugstr_sqlulen(crow), pirow); ++ FIXME("(hstmt %p, crow %s, pirow %p)\n", hstmt, debugstr_sqlulen(crow), pirow); + +- ret = ODBC_CALL( SQLParamOptions, ¶ms ); +- 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) + { +- struct SQLPrimaryKeys_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName, +- cbSchemaName, szTableName, cbTableName }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," ++ 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); + +- 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) + { +- struct SQLProcedureColumns_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName, +- cbSchemaName, szProcName, cbProcName, +- szColumnName, cbColumnName }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," ++ 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); + +- 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) + { +- struct SQLProcedures_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName, +- cbSchemaName, szProcName, cbProcName }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," ++ 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); + +- ret = ODBC_CALL( SQLProcedures, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1686,13 +1109,10 @@ SQLRETURN WINAPI SQLProcedures(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLI + */ + SQLRETURN WINAPI SQLSetPos(SQLHSTMT hstmt, SQLSETPOSIROW irow, SQLUSMALLINT fOption, SQLUSMALLINT fLock) + { +- struct SQLSetPos_params params = { hstmt, irow, fOption, fLock }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, irow %s, fOption %d, fLock %d)\n", hstmt, debugstr_sqlulen(irow), fOption, fLock); ++ FIXME("(hstmt %p, irow %s, fOption %d, fLock %d)\n", hstmt, debugstr_sqlulen(irow), fOption, fLock); + +- ret = ODBC_CALL( SQLSetPos, ¶ms ); +- 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) + { +- struct SQLTablePrivileges_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName, +- cbSchemaName, szTableName, cbTableName }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," ++ 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); + +- 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) + { +- struct SQLDrivers_params params = { EnvironmentHandle, fDirection, szDriverDesc, cbDriverDescMax, +- pcbDriverDesc, szDriverAttributes, cbDriverAttrMax, pcbDriverAttr }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- 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( SQLDrivers, ¶ms ); +- +- if (ret == SQL_NO_DATA && fDirection == 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) + { +- struct SQLBindParameter_params params = { hstmt, ipar, fParamType, fCType, fSqlType, cbColDef, +- ibScale, rgbValue, cbValueMax, pcbValue }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, ipar %d, fParamType %d, fCType %d, fSqlType %d, cbColDef %s, ibScale %d, rgbValue %p," ++ 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); + +- ret = ODBC_CALL( SQLBindParameter, ¶ms ); +- 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) + { +- struct SQLDriverConnect_params params = { hdbc, hwnd, ConnectionString, Length, conn_str_out, +- conn_str_out_max, ptr_conn_str_out, driver_completion }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hdbc %p, hwnd %p, ConnectionString %s, Length %d, conn_str_out %p, conn_str_out_max %d," ++ 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); + +- 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) + { +- struct SQLSetScrollOptions_params params = { statement_handle, f_concurrency, crow_keyset, crow_rowset }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(statement_handle %p, f_concurrency %d, crow_keyset %s, crow_rowset %d)\n", statement_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); + +- ret = ODBC_CALL( SQLSetScrollOptions, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +-static BOOL SQLColAttributes_KnownStringAttribute(SQLUSMALLINT fDescType) +-{ +- static const SQLUSMALLINT attrList[] = +- { +- SQL_COLUMN_OWNER_NAME, +- SQL_COLUMN_QUALIFIER_NAME, +- SQL_COLUMN_LABEL, +- SQL_COLUMN_NAME, +- SQL_COLUMN_TABLE_NAME, +- SQL_COLUMN_TYPE_NAME, +- SQL_DESC_BASE_COLUMN_NAME, +- SQL_DESC_BASE_TABLE_NAME, +- SQL_DESC_CATALOG_NAME, +- SQL_DESC_LABEL, +- SQL_DESC_LITERAL_PREFIX, +- SQL_DESC_LITERAL_SUFFIX, +- SQL_DESC_LOCAL_TYPE_NAME, +- SQL_DESC_NAME, +- SQL_DESC_SCHEMA_NAME, +- SQL_DESC_TABLE_NAME, +- SQL_DESC_TYPE_NAME, +- }; +- unsigned int i; +- +- for (i = 0; i < ARRAY_SIZE(attrList); i++) { +- if (attrList[i] == fDescType) return TRUE; +- } +- return FALSE; +-} +- + /************************************************************************* + * SQLColAttributesW [ODBC32.106] + */ +@@ -1839,22 +1206,11 @@ SQLRETURN WINAPI SQLColAttributesW(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLI + SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, + SQLLEN *pfDesc) + { +- struct SQLColAttributesW_params params = { hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol, ++ FIXME("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol, + fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); + +- ret = ODBC_CALL( SQLColAttributesW, ¶ms ); +- +- if (ret == SQL_SUCCESS && SQLColAttributes_KnownStringAttribute(fDescType) && rgbDesc && pcbDesc && +- *pcbDesc != lstrlenW(rgbDesc) * 2) +- { +- TRACE("CHEAT: resetting name length for ADO\n"); +- *pcbDesc = lstrlenW(rgbDesc) * 2; +- } +- +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1865,16 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, ServerName %s, NameLength1 %d, UserName %s, NameLength2 %d, Authentication %s," ++ FIXME("(ConnectionHandle %p, ServerName %s, NameLength1 %d, UserName %s, NameLength2 %d, Authentication %s," + " NameLength3 %d)\n", ConnectionHandle, debugstr_wn(ServerName, NameLength1), NameLength1, + debugstr_wn(UserName, NameLength2), NameLength2, debugstr_wn(Authentication, NameLength3), NameLength3); + +- ret = ODBC_CALL( SQLConnectW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1885,28 +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 }; + SQLSMALLINT dummy; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," ++ FIXME("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," + " ColumnSize %p, DecimalDigits %p, Nullable %p)\n", StatementHandle, ColumnNumber, ColumnName, + BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); + + if (!NameLength) NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ + +- ret = ODBC_CALL( SQLDescribeColW, ¶ms ); +- if (ret >= 0) +- { +- 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 (DecimalDigits) TRACE("DecimalDigits %d\n", *DecimalDigits); +- if (Nullable) TRACE("Nullable %d\n", *Nullable); +- } +- +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1917,24 +1256,12 @@ SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, + WCHAR *Sqlstate, SQLINTEGER *NativeError, WCHAR *MessageText, + SQLSMALLINT BufferLength, SQLSMALLINT *TextLength) + { +- struct SQLErrorW_params params = { EnvironmentHandle, ConnectionHandle, StatementHandle, Sqlstate, +- NativeError, MessageText, BufferLength, TextLength }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, Sqlstate %p, NativeError %p," ++ FIXME("(EnvironmentHandle %p, ConnectionHandle %p, StatementHandle %p, Sqlstate %p, NativeError %p," + " MessageText %p, BufferLength %d, TextLength %p)\n", EnvironmentHandle, ConnectionHandle, + StatementHandle, Sqlstate, NativeError, MessageText, BufferLength, TextLength); + +- ret = ODBC_CALL( SQLErrorW, ¶ms ); +- +- if (ret == SQL_SUCCESS) +- { +- TRACE(" SQLState %s\n", debugstr_wn(Sqlstate, 5)); +- TRACE(" Error %d\n", *NativeError); +- TRACE(" MessageText %s\n", debugstr_wn(MessageText, *TextLength)); +- } +- +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1943,14 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, ++ FIXME("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, + debugstr_wn(StatementText, TextLength), TextLength); + +- ret = ODBC_CALL( SQLExecDirectW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1960,14 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle, CursorName, ++ FIXME("(StatementHandle %p, CursorName %p, BufferLength %d, NameLength %p)\n", StatementHandle, CursorName, + BufferLength, NameLength); + +- ret = ODBC_CALL( SQLGetCursorNameW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1976,14 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, ++ FIXME("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, + debugstr_wn(StatementText, TextLength), TextLength); + +- ret = ODBC_CALL( SQLPrepareW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -1992,14 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle, ++ FIXME("(StatementHandle %p, CursorName %s, NameLength %d)\n", StatementHandle, + debugstr_wn(CursorName, NameLength), NameLength); + +- ret = ODBC_CALL( SQLSetCursorNameW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2011,25 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("StatementHandle %p ColumnNumber %d FieldIdentifier %d CharacterAttribute %p BufferLength %d" ++ FIXME("StatementHandle %p ColumnNumber %d FieldIdentifier %d CharacterAttribute %p BufferLength %d" + " StringLength %p NumericAttribute %p\n", StatementHandle, ColumnNumber, FieldIdentifier, + CharacterAttribute, BufferLength, StringLength, NumericAttribute); + +- ret = ODBC_CALL( SQLColAttributeW, ¶ms ); +- +- if (ret == SQL_SUCCESS && CharacterAttribute != NULL && SQLColAttributes_KnownStringAttribute(FieldIdentifier) && +- StringLength && *StringLength != lstrlenW(CharacterAttribute) * 2) +- { +- TRACE("CHEAT: resetting name length for ADO\n"); +- *StringLength = lstrlenW(CharacterAttribute) * 2; +- } +- +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2039,15 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, ++ FIXME("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, + Attribute, Value, BufferLength, StringLength); + +- ret = ODBC_CALL( SQLGetConnectAttrW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2057,15 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n", ++ FIXME("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d, StringLength %p)\n", + DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength, StringLength); + +- ret = ODBC_CALL( SQLGetDescFieldW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2077,16 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p," ++ FIXME("(DescriptorHandle %p, RecNumber %d, Name %p, BufferLength %d, StringLength %p, Type %p, SubType %p," + " Length %p, Precision %p, Scale %p, Nullable %p)\n", DescriptorHandle, RecNumber, Name, BufferLength, + StringLength, Type, SubType, Length, Precision, Scale, Nullable); + +- ret = ODBC_CALL( SQLGetDescRecW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2097,15 +1387,11 @@ 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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," ++ FIXME("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," + " StringLength %p)\n", HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength); + +- 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) + { +- struct SQLGetDiagRecW_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( SQLGetDiagRecW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2135,10 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, ++ FIXME("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, + Attribute, Value, BufferLength, StringLength); + + if (!Value) +@@ -2147,8 +1428,6 @@ SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, + return SQL_ERROR; + } + +- ret = ODBC_CALL( SQLGetStmtAttrW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2158,14 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value, ++ FIXME("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value, + StringLength); + +- ret = ODBC_CALL( SQLSetConnectAttrW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2176,17 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," ++ FIXME("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," + " NameLength3 %d, ColumnName %s, NameLength4 %d)\n", StatementHandle, + debugstr_wn(CatalogName, NameLength1), NameLength1, debugstr_wn(SchemaName, NameLength2), NameLength2, + debugstr_wn(TableName, NameLength3), NameLength3, debugstr_wn(ColumnName, NameLength4), NameLength4); + +- 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 + SQLSMALLINT Length, WCHAR *OutConnectionString, SQLSMALLINT BufferLength, + SQLSMALLINT *Length2, SQLUSMALLINT DriverCompletion) + { +- struct SQLDriverConnectW_params params = { ConnectionHandle, WindowHandle, InConnectionString, Length, +- OutConnectionString, BufferLength, Length2, DriverCompletion }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle %p, WindowHandle %p, InConnectionString %s, Length %d, OutConnectionString %p," ++ FIXME("(ConnectionHandle %p, WindowHandle %p, InConnectionString %s, Length %d, OutConnectionString %p," + " BufferLength %d, Length2 %p, DriverCompletion %d)\n", ConnectionHandle, WindowHandle, + debugstr_wn(InConnectionString, Length), Length, OutConnectionString, BufferLength, Length2, + DriverCompletion); + +- ret = ODBC_CALL( SQLDriverConnectW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2216,13 +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 }; +- 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); + +- ret = ODBC_CALL( SQLGetConnectOptionW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2232,14 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, ++ FIXME("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, + InfoType, InfoValue, BufferLength, StringLength); + +- ret = ODBC_CALL( SQLGetInfoW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2248,13 +1511,10 @@ SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQ + */ + SQLRETURN WINAPI SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType) + { +- struct SQLGetTypeInfoW_params params = { StatementHandle, DataType }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); ++ FIXME("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); + +- ret = ODBC_CALL( SQLGetTypeInfoW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2263,13 +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 }; +- 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)); + +- ret = ODBC_CALL( SQLSetConnectOptionW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2281,17 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, IdentifierType %d, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d," ++ FIXME("(StatementHandle %p, IdentifierType %d, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d," + " TableName %s, NameLength3 %d, Scope %d, Nullable %d)\n", StatementHandle, IdentifierType, + debugstr_wn(CatalogName, NameLength1), NameLength1, debugstr_wn(SchemaName, NameLength2), NameLength2, + debugstr_wn(TableName, NameLength3), NameLength3, Scope, Nullable); + +- ret = ODBC_CALL( SQLSpecialColumnsW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2302,17 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d SchemaName %s, NameLength2 %d, TableName %s" ++ FIXME("(StatementHandle %p, CatalogName %s, NameLength1 %d SchemaName %s, NameLength2 %d, TableName %s" + " NameLength3 %d, Unique %d, Reserved %d)\n", StatementHandle, + debugstr_wn(CatalogName, NameLength1), NameLength1, debugstr_wn(SchemaName, NameLength2), NameLength2, + debugstr_wn(TableName, NameLength3), NameLength3, Unique, Reserved); + +- ret = ODBC_CALL( SQLStatisticsW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2323,17 +1572,13 @@ 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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," ++ FIXME("(StatementHandle %p, CatalogName %s, NameLength1 %d, SchemaName %s, NameLength2 %d, TableName %s," + " NameLength3 %d, TableType %s, NameLength4 %d)\n", StatementHandle, + debugstr_wn(CatalogName, NameLength1), NameLength1, debugstr_wn(SchemaName, NameLength2), NameLength2, + debugstr_wn(TableName, NameLength3), NameLength3, debugstr_wn(TableType, NameLength4), NameLength4); + +- 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) + { +- struct SQLBrowseConnectW_params params = { hdbc, szConnStrIn, cbConnStrIn, szConnStrOut, +- cbConnStrOutMax, pcbConnStrOut }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hdbc %p, szConnStrIn %s, cbConnStrIn %d, szConnStrOut %p, cbConnStrOutMax %d, pcbConnStrOut %p)\n", ++ FIXME("(hdbc %p, szConnStrIn %s, cbConnStrIn %d, szConnStrOut %p, cbConnStrOutMax %d, pcbConnStrOut %p)\n", + hdbc, debugstr_wn(szConnStrIn, cbConnStrIn), cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut); + +- 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) + { +- struct SQLColumnPrivilegesW_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName, +- cbSchemaName, szTableName, cbTableName, szColumnName, +- cbColumnName }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," ++ 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); + +- ret = ODBC_CALL( SQLColumnPrivilegesW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2387,26 +1623,12 @@ 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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- 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( SQLDataSourcesW, ¶ms ); +- +- if (ret >= 0 && TRACE_ON(odbc)) +- { +- if (ServerName && NameLength1 && *NameLength1 > 0) +- TRACE(" DataSource %s", debugstr_wn(ServerName, *NameLength1)); +- if (Description && NameLength2 && *NameLength2 > 0) +- TRACE(" Description %s", debugstr_wn(Description, *NameLength2)); +- TRACE("\n"); +- } +- +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2419,13 +1641,9 @@ SQLRETURN WINAPI SQLForeignKeysW(SQLHSTMT hstmt, SQLWCHAR *szPkCatalogName, SQLS + 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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, szPkCatalogName %s, cbPkCatalogName %d, szPkSchemaName %s, cbPkSchemaName %d," ++ 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); + +- 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) + { +- struct SQLNativeSqlW_params params = { hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc, ++ FIXME("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc, + debugstr_wn(szSqlStrIn, cbSqlStrIn), cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr); + +- 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) + { +- struct SQLPrimaryKeysW_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName, +- cbSchemaName, szTableName, cbTableName }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," ++ 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); + +- 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) + { +- struct SQLProcedureColumnsW_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName, +- cbSchemaName, szProcName, cbProcName, +- szColumnName, cbColumnName }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," ++ 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); + +- 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) + { +- struct SQLProceduresW_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName, +- cbSchemaName, szProcName, cbProcName }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szProcName %s," ++ 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); + +- 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) + { +- struct SQLTablePrivilegesW_params params = { hstmt, szCatalogName, cbCatalogName, szSchemaName, +- cbSchemaName, szTableName, cbTableName }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(hstmt %p, szCatalogName %s, cbCatalogName %d, szSchemaName %s, cbSchemaName %d, szTableName %s," ++ 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); + +- 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) + { +- struct SQLDriversW_params params = { EnvironmentHandle, fDirection, szDriverDesc, cbDriverDescMax, +- pcbDriverDesc, szDriverAttributes, cbDriverAttrMax, pcbDriverAttr }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- 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) +- ERR_(winediag)("No ODBC drivers could be found. Check the settings for your libodbc provider.\n"); +- +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2574,14 +1762,11 @@ SQLRETURN WINAPI SQLDriversW(SQLHENV EnvironmentHandle, SQLUSMALLINT fDirection, + SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, + SQLPOINTER Value, SQLINTEGER BufferLength) + { +- struct SQLSetDescFieldW_params params = { DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle, ++ FIXME("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle, + RecNumber, FieldIdentifier, Value, BufferLength); + +- ret = ODBC_CALL( SQLSetDescFieldW, ¶ms ); +- TRACE("Returning %d\n", ret); + return ret; + } + +@@ -2591,20 +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 }; +- SQLRETURN ret; ++ SQLRETURN ret = SQL_ERROR; + +- TRACE("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value, ++ FIXME("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value, + StringLength); + +- 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; +- } +- +- 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, + 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; + } +- +- +-/*********************************************************************** +- * DllMain [Internal] Initializes the internal 'ODBC32.DLL'. +- */ +-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved) +-{ +- TRACE("proxy ODBC: %p,%lx,%p\n", hinstDLL, reason, reserved); +- +- switch (reason) +- { +- case DLL_PROCESS_ATTACH: +- DisableThreadLibraryCalls(hinstDLL); +- if (!__wine_init_unix_call() && !WINE_UNIX_CALL( process_attach, NULL )) +- { +- ODBC_ReplicateToRegistry(); +- } +- break; +- +- case DLL_PROCESS_DETACH: +- if (reserved) break; +- WINE_UNIX_CALL( process_detach, NULL ); +- } +- +- return TRUE; +-} +diff --git a/dlls/odbc32/unixlib.c b/dlls/odbc32/unixlib.c +deleted file mode 100644 +index 8458406d8c0..00000000000 +--- a/dlls/odbc32/unixlib.c ++++ /dev/null +@@ -1,1272 +0,0 @@ +-/* +- * Win32 ODBC functions +- * +- * Copyright 1999 Xiang Li, Corel Corporation +- * +- * This library is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Lesser General Public +- * License as published by the Free Software Foundation; either +- * version 2.1 of the License, or (at your option) any later version. +- * +- * This library is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * Lesser General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser General Public +- * License along with this library; if not, write to the Free Software +- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +- * +- * 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 +-#pragma makedep unix +-#endif +- +-#include "config.h" +- +-#include +-#include +-#include +-#include +- +-#include "ntstatus.h" +-#define WIN32_NO_STATUS +-#include "windef.h" +-#include "winbase.h" +-#include "winternl.h" +-#include "wine/debug.h" +-#include "sql.h" +-#include "sqltypes.h" +-#include "sqlext.h" +- +-#include "unixlib.h" +-#include "wine/debug.h" +- +-WINE_DECLARE_DEBUG_CHANNEL(winediag); +- +-static void *libodbc; +- +-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 NTSTATUS load_odbc(void); +- +-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; +- return STATUS_SUCCESS; +-} +- +-static NTSTATUS wrap_SQLAllocConnect( void *args ) +-{ +- struct SQLAllocConnect_params *params = args; +- +- return pSQLAllocConnect(params->EnvironmentHandle, params->ConnectionHandle); +-} +- +-static NTSTATUS wrap_SQLAllocEnv( void *args ) +-{ +- struct SQLAllocEnv_params *params = args; +- +- return pSQLAllocEnv(params->EnvironmentHandle); +-} +- +-static NTSTATUS wrap_SQLAllocHandle( void *args ) +-{ +- struct SQLAllocHandle_params *params = args; +- +- return pSQLAllocHandle(params->HandleType, params->InputHandle, params->OutputHandle); +-} +- +-static NTSTATUS wrap_SQLAllocHandleStd( void *args ) +-{ +- struct SQLAllocHandleStd_params *params = args; +- +- return pSQLAllocHandleStd(params->HandleType, params->InputHandle, params->OutputHandle); +-} +- +-static NTSTATUS wrap_SQLAllocStmt( void *args ) +-{ +- struct SQLAllocStmt_params *params = args; +- +- return pSQLAllocStmt(params->ConnectionHandle, params->StatementHandle); +-} +- +-static NTSTATUS wrap_SQLBindCol( void *args ) +-{ +- struct SQLBindCol_params *params = args; +- +- return pSQLBindCol(params->StatementHandle, params->ColumnNumber, params->TargetType, +- params->TargetValue, params->BufferLength, params->StrLen_or_Ind); +-} +- +-static NTSTATUS wrap_SQLBindParam( void *args ) +-{ +- struct SQLBindParam_params *params = args; +- +- return pSQLBindParam(params->StatementHandle, params->ParameterNumber, params->ValueType, +- params->ParameterType, params->LengthPrecision, params->ParameterScale, +- params->ParameterValue, params->StrLen_or_Ind); +-} +- +-static NTSTATUS wrap_SQLBindParameter( void *args ) +-{ +- struct SQLBindParameter_params *params = args; +- +- return pSQLBindParameter(params->hstmt, params->ipar, params->fParamType, params->fCType, +- params->fSqlType, params->cbColDef, params->ibScale, params->rgbValue, +- params->cbValueMax, params->pcbValue); +-} +- +-static NTSTATUS wrap_SQLBrowseConnect( void *args ) +-{ +- struct SQLBrowseConnect_params *params = args; +- +- return pSQLBrowseConnect(params->hdbc, params->szConnStrIn, params->cbConnStrIn, params->szConnStrOut, +- params->cbConnStrOutMax, params->pcbConnStrOut); +-} +- +-static NTSTATUS wrap_SQLBrowseConnectW( void *args ) +-{ +- struct SQLBrowseConnectW_params *params = args; +- +- return pSQLBrowseConnectW(params->hdbc, params->szConnStrIn, params->cbConnStrIn, params->szConnStrOut, +- params->cbConnStrOutMax, params->pcbConnStrOut); +-} +- +-static NTSTATUS wrap_SQLBulkOperations( void *args ) +-{ +- struct SQLBulkOperations_params *params = args; +- +- return pSQLBulkOperations(params->StatementHandle, params->Operation); +-} +- +-static NTSTATUS wrap_SQLCancel( void *args ) +-{ +- struct SQLCancel_params *params = args; +- +- return pSQLCancel(params->StatementHandle); +-} +- +-static NTSTATUS wrap_SQLCloseCursor( void *args ) +-{ +- struct SQLCloseCursor_params *params = args; +- +- return pSQLCloseCursor(params->StatementHandle); +-} +- +-static NTSTATUS wrap_SQLColAttribute( void *args ) +-{ +- struct SQLColAttribute_params *params = args; +- +- return pSQLColAttribute(params->StatementHandle, params->ColumnNumber, params->FieldIdentifier, +- params->CharacterAttribute, params->BufferLength, params->StringLength, +- params->NumericAttribute); +-} +- +-static NTSTATUS wrap_SQLColAttributeW( void *args ) +-{ +- struct SQLColAttributeW_params *params = args; +- +- return pSQLColAttributeW(params->StatementHandle, params->ColumnNumber, params->FieldIdentifier, +- params->CharacterAttribute, params->BufferLength, params->StringLength, +- params->NumericAttribute); +-} +- +-static NTSTATUS wrap_SQLColAttributes( void *args ) +-{ +- struct SQLColAttributes_params *params = args; +- +- return pSQLColAttributes(params->hstmt, params->icol, params->fDescType, params->rgbDesc, +- params->cbDescMax, params->pcbDesc, params->pfDesc); +-} +- +-static NTSTATUS wrap_SQLColAttributesW( void *args ) +-{ +- struct SQLColAttributesW_params *params = args; +- +- return pSQLColAttributesW(params->hstmt, params->icol, params->fDescType, params->rgbDesc, +- params->cbDescMax, params->pcbDesc, params->pfDesc); +-} +- +-static NTSTATUS wrap_SQLColumnPrivileges( void *args ) +-{ +- struct SQLColumnPrivileges_params *params = args; +- +- return pSQLColumnPrivileges(params->hstmt, params->szCatalogName, params->cbCatalogName, +- params->szSchemaName, params->cbSchemaName, params->szTableName, +- params->cbTableName, params->szColumnName, params->cbColumnName); +-} +- +-static NTSTATUS wrap_SQLColumnPrivilegesW( void *args ) +-{ +- struct SQLColumnPrivilegesW_params *params = args; +- +- return pSQLColumnPrivilegesW(params->hstmt, params->szCatalogName, params->cbCatalogName, +- params->szSchemaName, params->cbSchemaName, params->szTableName, +- params->cbTableName, params->szColumnName, params->cbColumnName); +-} +- +-static NTSTATUS wrap_SQLColumns( void *args ) +-{ +- struct SQLColumns_params *params = args; +- +- return pSQLColumns(params->StatementHandle, params->CatalogName, params->NameLength1, +- params->SchemaName, params->NameLength2, params->TableName, params->NameLength3, +- params->ColumnName, params->NameLength4); +-} +- +-static NTSTATUS wrap_SQLColumnsW( void *args ) +-{ +- struct SQLColumnsW_params *params = args; +- +- return pSQLColumnsW(params->StatementHandle, params->CatalogName, params->NameLength1, +- params->SchemaName, params->NameLength2, params->TableName, params->NameLength3, +- params->ColumnName, params->NameLength4); +-} +- +-static NTSTATUS wrap_SQLConnect( void *args ) +-{ +- struct SQLConnect_params *params = args; +- +- return pSQLConnect(params->ConnectionHandle, params->ServerName, params->NameLength1, params->UserName, +- params->NameLength2, params->Authentication, params->NameLength3); +-} +- +-static NTSTATUS wrap_SQLConnectW( void *args ) +-{ +- struct SQLConnectW_params *params = args; +- +- return pSQLConnectW(params->ConnectionHandle, params->ServerName, params->NameLength1, +- params->UserName, params->NameLength2, params->Authentication, params->NameLength3); +-} +- +-static NTSTATUS wrap_SQLCopyDesc( void *args ) +-{ +- struct SQLCopyDesc_params *params = args; +- +- return pSQLCopyDesc(params->SourceDescHandle, params->TargetDescHandle); +-} +- +-static NTSTATUS wrap_SQLDataSources( void *args ) +-{ +- struct SQLDataSources_params *params = args; +- +- return pSQLDataSources(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; +- +- return pSQLDataSourcesA(params->EnvironmentHandle, params->Direction, params->ServerName, +- params->BufferLength1, params->NameLength1, params->Description, +- params->BufferLength2, params->NameLength2); +-} +- +-static NTSTATUS wrap_SQLDataSourcesW( void *args ) +-{ +- struct SQLDataSourcesW_params *params = args; +- +- return pSQLDataSourcesW(params->EnvironmentHandle, params->Direction, params->ServerName, +- params->BufferLength1, params->NameLength1, params->Description, +- params->BufferLength2, params->NameLength2); +-} +- +-static NTSTATUS wrap_SQLDescribeCol( void *args ) +-{ +- struct SQLDescribeCol_params *params = args; +- +- return pSQLDescribeCol(params->StatementHandle, params->ColumnNumber, params->ColumnName, +- params->BufferLength, params->NameLength, params->DataType, +- params->ColumnSize, params->DecimalDigits, params->Nullable); +-} +- +-static NTSTATUS wrap_SQLDescribeColW( void *args ) +-{ +- struct SQLDescribeColW_params *params = args; +- +- return pSQLDescribeColW(params->StatementHandle, params->ColumnNumber, params->ColumnName, +- params->BufferLength, params->NameLength, params->DataType, +- params->ColumnSize, params->DecimalDigits, params->Nullable); +-} +- +-static NTSTATUS wrap_SQLDescribeParam( void *args ) +-{ +- struct SQLDescribeParam_params *params = args; +- +- return pSQLDescribeParam(params->hstmt, params->ipar, params->pfSqlType, params->pcbParamDef, +- params->pibScale, params->pfNullable); +-} +- +-static NTSTATUS wrap_SQLDisconnect( void *args ) +-{ +- struct SQLDisconnect_params *params = args; +- +- return pSQLDisconnect(params->ConnectionHandle); +-} +- +-static NTSTATUS wrap_SQLDriverConnect( void *args ) +-{ +- struct SQLDriverConnect_params *params = args; +- +- 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); +-} +- +-static NTSTATUS wrap_SQLDriverConnectW( void *args ) +-{ +- struct SQLDriverConnectW_params *params = args; +- +- return pSQLDriverConnectW(params->ConnectionHandle, params->WindowHandle, params->InConnectionString, +- params->Length, params->OutConnectionString, params->BufferLength, +- params->Length2, params->DriverCompletion); +-} +- +-static NTSTATUS wrap_SQLDrivers( void *args ) +-{ +- struct SQLDrivers_params *params = args; +- +- return pSQLDrivers(params->EnvironmentHandle, params->fDirection, params->szDriverDesc, +- params->cbDriverDescMax, params->pcbDriverDesc, params->szDriverAttributes, +- params->cbDriverAttrMax, params->pcbDriverAttr); +-} +- +-static NTSTATUS wrap_SQLDriversW( void *args ) +-{ +- struct SQLDriversW_params *params = args; +- +- return pSQLDriversW(params->EnvironmentHandle, params->fDirection, params->szDriverDesc, +- params->cbDriverDescMax, params->pcbDriverDesc, params->szDriverAttributes, +- params->cbDriverAttrMax, params->pcbDriverAttr); +-} +- +-static NTSTATUS wrap_SQLEndTran( void *args ) +-{ +- struct SQLEndTran_params *params = args; +- +- return pSQLEndTran(params->HandleType, params->Handle, params->CompletionType); +-} +- +-static NTSTATUS wrap_SQLError( void *args ) +-{ +- struct SQLError_params *params = args; +- +- return pSQLError(params->EnvironmentHandle, params->ConnectionHandle, params->StatementHandle, +- params->Sqlstate, params->NativeError, params->MessageText, +- params->BufferLength, params->TextLength); +-} +- +-static NTSTATUS wrap_SQLErrorW( void *args ) +-{ +- struct SQLErrorW_params *params = args; +- +- return pSQLErrorW(params->EnvironmentHandle, params->ConnectionHandle, params->StatementHandle, +- params->Sqlstate, params->NativeError, params->MessageText, +- params->BufferLength, params->TextLength); +-} +- +-static NTSTATUS wrap_SQLExecDirect( void *args ) +-{ +- struct SQLExecDirect_params *params = args; +- +- return pSQLExecDirect(params->StatementHandle, params->StatementText, params->TextLength); +-} +- +-static NTSTATUS wrap_SQLExecDirectW( void *args ) +-{ +- struct SQLExecDirectW_params *params = args; +- +- return pSQLExecDirectW(params->StatementHandle, params->StatementText, params->TextLength); +-} +- +-static NTSTATUS wrap_SQLExecute( void *args ) +-{ +- struct SQLExecute_params *params = args; +- +- return pSQLExecute(params->StatementHandle); +-} +- +-static NTSTATUS wrap_SQLExtendedFetch( void *args ) +-{ +- struct SQLExtendedFetch_params *params = args; +- +- return pSQLExtendedFetch(params->hstmt, params->fFetchType, params->irow, +- params->pcrow, params->rgfRowStatus); +-} +- +-static NTSTATUS wrap_SQLFetch( void *args ) +-{ +- struct SQLFetch_params *params = args; +- +- return pSQLFetch(params->StatementHandle); +-} +- +-static NTSTATUS wrap_SQLFetchScroll( void *args ) +-{ +- struct SQLFetchScroll_params *params = args; +- +- return pSQLFetchScroll(params->StatementHandle, params->FetchOrientation, params->FetchOffset); +-} +- +-static NTSTATUS wrap_SQLForeignKeys( void *args ) +-{ +- struct SQLForeignKeys_params *params = args; +- +- 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); +-} +- +-static NTSTATUS wrap_SQLForeignKeysW( void *args ) +-{ +- struct SQLForeignKeysW_params *params = args; +- +- 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); +-} +- +-static NTSTATUS wrap_SQLFreeConnect( void *args ) +-{ +- struct SQLFreeConnect_params *params = args; +- +- return pSQLFreeConnect(params->ConnectionHandle); +-} +- +-static NTSTATUS wrap_SQLFreeEnv( void *args ) +-{ +- struct SQLFreeEnv_params *params = args; +- +- return pSQLFreeEnv(params->EnvironmentHandle); +-} +- +-static NTSTATUS wrap_SQLFreeHandle( void *args ) +-{ +- struct SQLFreeHandle_params *params = args; +- +- return pSQLFreeHandle(params->HandleType, params->Handle); +-} +- +-static NTSTATUS wrap_SQLFreeStmt( void *args ) +-{ +- struct SQLFreeStmt_params *params = args; +- +- return pSQLFreeStmt(params->StatementHandle, params->Option); +-} +- +-static NTSTATUS wrap_SQLGetConnectAttr( void *args ) +-{ +- struct SQLGetConnectAttr_params *params = args; +- +- return pSQLGetConnectAttr(params->ConnectionHandle, params->Attribute, params->Value, +- params->BufferLength, params->StringLength); +-} +- +-static NTSTATUS wrap_SQLGetConnectAttrW( void *args ) +-{ +- struct SQLGetConnectAttrW_params *params = args; +- +- return pSQLGetConnectAttrW(params->ConnectionHandle, params->Attribute, params->Value, +- params->BufferLength, params->StringLength); +-} +- +-static NTSTATUS wrap_SQLGetConnectOption( void *args ) +-{ +- struct SQLGetConnectOption_params *params = args; +- +- return pSQLGetConnectOption(params->ConnectionHandle, params->Option, params->Value); +-} +- +-static NTSTATUS wrap_SQLGetConnectOptionW( void *args ) +-{ +- struct SQLGetConnectOptionW_params *params = args; +- +- return pSQLGetConnectOptionW(params->ConnectionHandle, params->Option, params->Value); +-} +- +-static NTSTATUS wrap_SQLGetCursorName( void *args ) +-{ +- struct SQLGetCursorName_params *params = args; +- +- return pSQLGetCursorName(params->StatementHandle, params->CursorName, params->BufferLength, +- params->NameLength); +-} +- +-static NTSTATUS wrap_SQLGetCursorNameW( void *args ) +-{ +- struct SQLGetCursorNameW_params *params = args; +- +- return pSQLGetCursorNameW(params->StatementHandle, params->CursorName, params->BufferLength, +- params->NameLength); +-} +- +-static NTSTATUS wrap_SQLGetData( void *args ) +-{ +- struct SQLGetData_params *params = args; +- +- return pSQLGetData(params->StatementHandle, params->ColumnNumber, params->TargetType, +- params->TargetValue, params->BufferLength, params->StrLen_or_Ind); +-} +- +-static NTSTATUS wrap_SQLGetDescField( void *args ) +-{ +- struct SQLGetDescField_params *params = args; +- +- return pSQLGetDescField(params->DescriptorHandle, params->RecNumber, params->FieldIdentifier, +- params->Value, params->BufferLength, params->StringLength); +-} +- +-static NTSTATUS wrap_SQLGetDescFieldW( void *args ) +-{ +- struct SQLGetDescFieldW_params *params = args; +- +- return pSQLGetDescFieldW(params->DescriptorHandle, params->RecNumber, params->FieldIdentifier, +- params->Value, params->BufferLength, params->StringLength); +-} +- +-static NTSTATUS wrap_SQLGetDescRec( void *args ) +-{ +- struct SQLGetDescRec_params *params = args; +- +- return pSQLGetDescRec(params->DescriptorHandle, params->RecNumber, params->Name, params->BufferLength, +- params->StringLength, params->Type, params->SubType, params->Length, +- params->Precision, params->Scale, params->Nullable); +-} +- +-static NTSTATUS wrap_SQLGetDescRecW( void *args ) +-{ +- struct SQLGetDescRecW_params *params = args; +- +- return pSQLGetDescRecW(params->DescriptorHandle, params->RecNumber, params->Name, params->BufferLength, +- params->StringLength, params->Type, params->SubType, params->Length, +- params->Precision, params->Scale, params->Nullable); +-} +- +-static NTSTATUS wrap_SQLGetDiagField( void *args ) +-{ +- struct SQLGetDiagField_params *params = args; +- +- return pSQLGetDiagField(params->HandleType, params->Handle, params->RecNumber, params->DiagIdentifier, +- params->DiagInfo, params->BufferLength, params->StringLength); +-} +- +-static NTSTATUS wrap_SQLGetDiagFieldW( void *args ) +-{ +- struct SQLGetDiagFieldW_params *params = args; +- +- return pSQLGetDiagFieldW(params->HandleType, params->Handle, params->RecNumber, params->DiagIdentifier, +- params->DiagInfo, params->BufferLength, params->StringLength); +-} +- +-static NTSTATUS wrap_SQLGetDiagRec( void *args ) +-{ +- struct SQLGetDiagRec_params *params = args; +- +- 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; +- +- return pSQLGetDiagRecA(params->HandleType, params->Handle, params->RecNumber, params->Sqlstate, +- params->NativeError, params->MessageText, params->BufferLength, +- params->TextLength); +-} +- +-static NTSTATUS wrap_SQLGetDiagRecW( void *args ) +-{ +- struct SQLGetDiagRecW_params *params = args; +- +- return pSQLGetDiagRecW(params->HandleType, params->Handle, params->RecNumber, params->Sqlstate, +- params->NativeError, params->MessageText, params->BufferLength, +- params->TextLength); +-} +- +-static NTSTATUS wrap_SQLGetEnvAttr( void *args ) +-{ +- struct SQLGetEnvAttr_params *params = args; +- +- return pSQLGetEnvAttr(params->EnvironmentHandle, params->Attribute, params->Value, +- params->BufferLength, params->StringLength); +-} +- +-static NTSTATUS wrap_SQLGetFunctions( void *args ) +-{ +- struct SQLGetFunctions_params *params = args; +- +- return pSQLGetFunctions(params->ConnectionHandle, params->FunctionId, params->Supported); +-} +- +-static NTSTATUS wrap_SQLGetInfo( void *args ) +-{ +- struct SQLGetInfo_params *params = args; +- +- return pSQLGetInfo(params->ConnectionHandle, params->InfoType, params->InfoValue, +- params->BufferLength, params->StringLength); +-} +- +-static NTSTATUS wrap_SQLGetInfoW( void *args ) +-{ +- struct SQLGetInfoW_params *params = args; +- +- return pSQLGetInfoW(params->ConnectionHandle, params->InfoType, params->InfoValue, +- params->BufferLength, params->StringLength); +-} +- +-static NTSTATUS wrap_SQLGetStmtAttr( void *args ) +-{ +- struct SQLGetStmtAttr_params *params = args; +- +- return pSQLGetStmtAttr(params->StatementHandle, params->Attribute, params->Value, +- params->BufferLength, params->StringLength); +-} +- +-static NTSTATUS wrap_SQLGetStmtAttrW( void *args ) +-{ +- struct SQLGetStmtAttrW_params *params = args; +- +- return pSQLGetStmtAttrW(params->StatementHandle, params->Attribute, params->Value, +- params->BufferLength, params->StringLength); +-} +- +-static NTSTATUS wrap_SQLGetStmtOption( void *args ) +-{ +- struct SQLGetStmtOption_params *params = args; +- +- return pSQLGetStmtOption(params->StatementHandle, params->Option, params->Value); +-} +- +-static NTSTATUS wrap_SQLGetTypeInfo( void *args ) +-{ +- struct SQLGetTypeInfo_params *params = args; +- +- return pSQLGetTypeInfo(params->StatementHandle, params->DataType); +-} +- +-static NTSTATUS wrap_SQLGetTypeInfoW( void *args ) +-{ +- struct SQLGetTypeInfoW_params *params = args; +- +- return pSQLGetTypeInfoW(params->StatementHandle, params->DataType); +-} +- +-static NTSTATUS wrap_SQLMoreResults( void *args ) +-{ +- struct SQLMoreResults_params *params = args; +- +- return pSQLMoreResults(params->StatementHandle); +-} +- +-static NTSTATUS wrap_SQLNativeSql( void *args ) +-{ +- struct SQLNativeSql_params *params = args; +- +- return pSQLNativeSql(params->hdbc, params->szSqlStrIn, params->cbSqlStrIn, params->szSqlStr, +- params->cbSqlStrMax, params->pcbSqlStr); +-} +- +-static NTSTATUS wrap_SQLNativeSqlW( void *args ) +-{ +- struct SQLNativeSqlW_params *params = args; +- +- return pSQLNativeSqlW(params->hdbc, params->szSqlStrIn, params->cbSqlStrIn, params->szSqlStr, +- params->cbSqlStrMax, params->pcbSqlStr); +-} +- +-static NTSTATUS wrap_SQLNumParams( void *args ) +-{ +- struct SQLNumParams_params *params = args; +- +- return pSQLNumParams(params->hstmt, params->pcpar); +-} +- +-static NTSTATUS wrap_SQLNumResultCols( void *args ) +-{ +- struct SQLNumResultCols_params *params = args; +- +- return pSQLNumResultCols(params->StatementHandle, params->ColumnCount); +-} +- +-static NTSTATUS wrap_SQLParamData( void *args ) +-{ +- struct SQLParamData_params *params = args; +- +- return pSQLParamData(params->StatementHandle, params->Value); +-} +- +-static NTSTATUS wrap_SQLParamOptions( void *args ) +-{ +- struct SQLParamOptions_params *params = args; +- +- return pSQLParamOptions(params->hstmt, params->crow, params->pirow); +-} +- +-static NTSTATUS wrap_SQLPrepare( void *args ) +-{ +- struct SQLPrepare_params *params = args; +- +- return pSQLPrepare(params->StatementHandle, params->StatementText, params->TextLength); +-} +- +-static NTSTATUS wrap_SQLPrepareW( void *args ) +-{ +- struct SQLPrepareW_params *params = args; +- +- return pSQLPrepareW(params->StatementHandle, params->StatementText, params->TextLength); +-} +- +-static NTSTATUS wrap_SQLPrimaryKeys( void *args ) +-{ +- struct SQLPrimaryKeys_params *params = args; +- +- return pSQLPrimaryKeys(params->hstmt, params->szCatalogName, params->cbCatalogName, +- params->szSchemaName, params->cbSchemaName, +- params->szTableName, params->cbTableName); +-} +- +-static NTSTATUS wrap_SQLPrimaryKeysW( void *args ) +-{ +- struct SQLPrimaryKeysW_params *params = args; +- +- return pSQLPrimaryKeysW(params->hstmt, params->szCatalogName, params->cbCatalogName, +- params->szSchemaName, params->cbSchemaName, +- params->szTableName, params->cbTableName); +-} +- +-static NTSTATUS wrap_SQLProcedureColumns( void *args ) +-{ +- struct SQLProcedureColumns_params *params = args; +- +- return pSQLProcedureColumns(params->hstmt, params->szCatalogName, params->cbCatalogName, +- params->szSchemaName, params->cbSchemaName, params->szProcName, +- params->cbProcName, params->szColumnName, params->cbColumnName); +-} +- +-static NTSTATUS wrap_SQLProcedureColumnsW( void *args ) +-{ +- struct SQLProcedureColumnsW_params *params = args; +- +- return pSQLProcedureColumnsW(params->hstmt, params->szCatalogName, params->cbCatalogName, +- params->szSchemaName, params->cbSchemaName, params->szProcName, +- params->cbProcName, params->szColumnName, params->cbColumnName); +-} +- +-static NTSTATUS wrap_SQLProcedures( void *args ) +-{ +- struct SQLProcedures_params *params = args; +- +- return pSQLProcedures(params->hstmt, params->szCatalogName, params->cbCatalogName, +- params->szSchemaName, params->cbSchemaName, params->szProcName, +- params->cbProcName); +-} +- +-static NTSTATUS wrap_SQLProceduresW( void *args ) +-{ +- struct SQLProceduresW_params *params = args; +- +- return pSQLProceduresW(params->hstmt, params->szCatalogName, params->cbCatalogName, +- params->szSchemaName, params->cbSchemaName, params->szProcName, +- params->cbProcName); +-} +- +-static NTSTATUS wrap_SQLPutData( void *args ) +-{ +- struct SQLPutData_params *params = args; +- +- return pSQLPutData(params->StatementHandle, params->Data, params->StrLen_or_Ind); +-} +- +-static NTSTATUS wrap_SQLRowCount( void *args ) +-{ +- struct SQLRowCount_params *params = args; +- +- return pSQLRowCount(params->StatementHandle, params->RowCount); +-} +- +-static NTSTATUS wrap_SQLSetConnectAttr( void *args ) +-{ +- struct SQLSetConnectAttr_params *params = args; +- +- return pSQLSetConnectAttr(params->ConnectionHandle, params->Attribute, params->Value, +- params->StringLength); +-} +- +-static NTSTATUS wrap_SQLSetConnectAttrW( void *args ) +-{ +- struct SQLSetConnectAttrW_params *params = args; +- +- return pSQLSetConnectAttrW(params->ConnectionHandle, params->Attribute, params->Value, +- params->StringLength); +-} +- +-static NTSTATUS wrap_SQLSetConnectOption( void *args ) +-{ +- struct SQLSetConnectOption_params *params = args; +- +- return pSQLSetConnectOption(params->ConnectionHandle, params->Option, params->Value); +-} +- +-static NTSTATUS wrap_SQLSetConnectOptionW( void *args ) +-{ +- struct SQLSetConnectOptionW_params *params = args; +- +- return pSQLSetConnectOptionW(params->ConnectionHandle, params->Option, params->Value); +-} +- +-static NTSTATUS wrap_SQLSetCursorName( void *args ) +-{ +- struct SQLSetCursorName_params *params = args; +- +- return pSQLSetCursorName(params->StatementHandle, params->CursorName, params->NameLength); +-} +- +-static NTSTATUS wrap_SQLSetCursorNameW( void *args ) +-{ +- struct SQLSetCursorNameW_params *params = args; +- +- return pSQLSetCursorNameW(params->StatementHandle, params->CursorName, params->NameLength); +-} +- +-static NTSTATUS wrap_SQLSetDescField( void *args ) +-{ +- struct SQLSetDescField_params *params = args; +- +- return pSQLSetDescField(params->DescriptorHandle, params->RecNumber, params->FieldIdentifier, +- params->Value, params->BufferLength); +-} +- +-static NTSTATUS wrap_SQLSetDescFieldW( void *args ) +-{ +- struct SQLSetDescFieldW_params *params = args; +- +- return pSQLSetDescFieldW(params->DescriptorHandle, params->RecNumber, params->FieldIdentifier, +- params->Value, params->BufferLength); +-} +- +-static NTSTATUS wrap_SQLSetDescRec( void *args ) +-{ +- struct SQLSetDescRec_params *params = args; +- +- return pSQLSetDescRec(params->DescriptorHandle, params->RecNumber, params->Type, params->SubType, +- params->Length, params->Precision, params->Scale, params->Data, +- params->StringLength, params->Indicator); +-} +- +-static NTSTATUS wrap_SQLSetEnvAttr( void *args ) +-{ +- struct SQLSetEnvAttr_params *params = args; +- +- return pSQLSetEnvAttr(params->EnvironmentHandle, params->Attribute, params->Value, params->StringLength); +-} +- +-static NTSTATUS wrap_SQLSetParam( void *args ) +-{ +- struct SQLSetParam_params *params = args; +- +- return pSQLSetParam(params->StatementHandle, params->ParameterNumber, params->ValueType, +- params->ParameterType, params->LengthPrecision, params->ParameterScale, +- params->ParameterValue, params->StrLen_or_Ind); +-} +- +-static NTSTATUS wrap_SQLSetPos( void *args ) +-{ +- struct SQLSetPos_params *params = args; +- +- return pSQLSetPos(params->hstmt, params->irow, params->fOption, params->fLock); +-} +- +-static NTSTATUS wrap_SQLSetScrollOptions( void *args ) +-{ +- struct SQLSetScrollOptions_params *params = args; +- +- return pSQLSetScrollOptions(params->statement_handle, params->f_concurrency, +- params->crow_keyset, params->crow_rowset); +-} +- +-static NTSTATUS wrap_SQLSetStmtAttr( void *args ) +-{ +- struct SQLSetStmtAttr_params *params = args; +- +- return pSQLSetStmtAttr(params->StatementHandle, params->Attribute, params->Value, params->StringLength); +-} +- +-static NTSTATUS wrap_SQLSetStmtAttrW( void *args ) +-{ +- struct SQLSetStmtAttrW_params *params = args; +- +- return pSQLSetStmtAttrW(params->StatementHandle, params->Attribute, params->Value, params->StringLength); +-} +- +-static NTSTATUS wrap_SQLSetStmtOption( void *args ) +-{ +- struct SQLSetStmtOption_params *params = args; +- +- return pSQLSetStmtOption(params->StatementHandle, params->Option, params->Value); +-} +- +-static NTSTATUS wrap_SQLSpecialColumns( void *args ) +-{ +- struct SQLSpecialColumns_params *params = args; +- +- return pSQLSpecialColumns(params->StatementHandle, params->IdentifierType, params->CatalogName, +- params->NameLength1, params->SchemaName, params->NameLength2, +- params->TableName, params->NameLength3, params->Scope, params->Nullable); +-} +- +-static NTSTATUS wrap_SQLSpecialColumnsW( void *args ) +-{ +- struct SQLSpecialColumnsW_params *params = args; +- +- return pSQLSpecialColumnsW(params->StatementHandle, params->IdentifierType, params->CatalogName, +- params->NameLength1, params->SchemaName, params->NameLength2, +- params->TableName, params->NameLength3, params->Scope, params->Nullable); +-} +- +-static NTSTATUS wrap_SQLStatistics( void *args ) +-{ +- struct SQLStatistics_params *params = args; +- +- return pSQLStatistics(params->StatementHandle, params->CatalogName, params->NameLength1, +- params->SchemaName, params->NameLength2, params->TableName, +- params->NameLength3, params->Unique, params->Reserved); +-} +- +-static NTSTATUS wrap_SQLStatisticsW( void *args ) +-{ +- struct SQLStatisticsW_params *params = args; +- +- return pSQLStatisticsW(params->StatementHandle, params->CatalogName, params->NameLength1, +- params->SchemaName, params->NameLength2, params->TableName, +- params->NameLength3, params->Unique, params->Reserved); +-} +- +-static NTSTATUS wrap_SQLTablePrivileges( void *args ) +-{ +- struct SQLTablePrivileges_params *params = args; +- +- return pSQLTablePrivileges(params->hstmt, params->szCatalogName, params->cbCatalogName, +- params->szSchemaName, params->cbSchemaName, params->szTableName, +- params->cbTableName); +-} +- +-static NTSTATUS wrap_SQLTablePrivilegesW( void *args ) +-{ +- struct SQLTablePrivilegesW_params *params = args; +- +- return pSQLTablePrivilegesW(params->hstmt, params->szCatalogName, params->cbCatalogName, +- params->szSchemaName, params->cbSchemaName, params->szTableName, +- params->cbTableName); +-} +- +-static NTSTATUS wrap_SQLTables( void *args ) +-{ +- struct SQLTables_params *params = args; +- +- return pSQLTables(params->StatementHandle, params->CatalogName, params->NameLength1, +- params->SchemaName, params->NameLength2, params->TableName, +- params->NameLength3, params->TableType, params->NameLength4); +-} +- +-static NTSTATUS wrap_SQLTablesW( void *args ) +-{ +- struct SQLTablesW_params *params = args; +- +- return pSQLTablesW(params->StatementHandle, params->CatalogName, params->NameLength1, +- params->SchemaName, params->NameLength2, params->TableName, +- params->NameLength3, params->TableType, params->NameLength4); +-} +- +-static NTSTATUS wrap_SQLTransact( void *args ) +-{ +- struct SQLTransact_params *params = args; +- +- return pSQLTransact(params->EnvironmentHandle, params->ConnectionHandle, params->CompletionType); +-} +- +-unixlib_entry_t __wine_unix_call_funcs[NB_ODBC_FUNCS] = +-{ +- odbc_process_attach, +- odbc_process_detach, +-}; +- +-static NTSTATUS error_func( void *args ) +-{ +- return SQL_ERROR; +-} +- +-static NTSTATUS load_odbc(void) +-{ +- const char *s = getenv("LIB_ODBC_DRIVER_MANAGER"); +- +-#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; +- } +- +-#define LOAD_FUNC(name) \ +- __wine_unix_call_funcs[unix_##name] = (p##name = dlsym( libodbc, #name )) ? wrap_##name : error_func +- +- 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; +-} +diff --git a/dlls/odbc32/unixlib.h b/dlls/odbc32/unixlib.h +deleted file mode 100644 +index 13ce8d0883b..00000000000 +--- a/dlls/odbc32/unixlib.h ++++ /dev/null +@@ -1,278 +0,0 @@ +-/* +- * Win32 ODBC functions +- * +- * Copyright 1999 Xiang Li, Corel Corporation +- * +- * This library is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Lesser General Public +- * License as published by the Free Software Foundation; either +- * version 2.1 of the License, or (at your option) any later version. +- * +- * This library is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * Lesser General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser General Public +- * License along with this library; if not, write to the Free Software +- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +- * +- * NOTES: +- * Proxy ODBC driver manager. This manager delegates all ODBC +- * calls to a real ODBC driver manager named by the environment +- * variable LIB_ODBC_DRIVER_MANAGER, or to libodbc.so if the +- * variable is not set. +- */ +- +-#include +- +-#include "windef.h" +-#include "winbase.h" +- +-#include "sql.h" +-#include "sqltypes.h" +-#include "sqlext.h" +- +-#include "wine/unixlib.h" +- +-enum sql_funcs +-{ +- process_attach, +- process_detach, +- unix_SQLAllocConnect, +- unix_SQLAllocEnv, +- unix_SQLAllocHandle, +- unix_SQLAllocHandleStd, +- unix_SQLAllocStmt, +- unix_SQLBindCol, +- unix_SQLBindParam, +- unix_SQLBindParameter, +- unix_SQLBrowseConnect, +- unix_SQLBrowseConnectW, +- unix_SQLBulkOperations, +- unix_SQLCancel, +- unix_SQLCloseCursor, +- unix_SQLColAttribute, +- unix_SQLColAttributeW, +- unix_SQLColAttributes, +- unix_SQLColAttributesW, +- unix_SQLColumnPrivileges, +- unix_SQLColumnPrivilegesW, +- unix_SQLColumns, +- unix_SQLColumnsW, +- unix_SQLConnect, +- unix_SQLConnectW, +- unix_SQLCopyDesc, +- unix_SQLDataSources, +- unix_SQLDataSourcesA, +- unix_SQLDataSourcesW, +- unix_SQLDescribeCol, +- unix_SQLDescribeColW, +- unix_SQLDescribeParam, +- unix_SQLDisconnect, +- unix_SQLDriverConnect, +- unix_SQLDriverConnectW, +- unix_SQLDrivers, +- unix_SQLDriversW, +- unix_SQLEndTran, +- unix_SQLError, +- unix_SQLErrorW, +- unix_SQLExecDirect, +- unix_SQLExecDirectW, +- unix_SQLExecute, +- unix_SQLExtendedFetch, +- unix_SQLFetch, +- unix_SQLFetchScroll, +- unix_SQLForeignKeys, +- unix_SQLForeignKeysW, +- unix_SQLFreeConnect, +- unix_SQLFreeEnv, +- unix_SQLFreeHandle, +- unix_SQLFreeStmt, +- unix_SQLGetConnectAttr, +- unix_SQLGetConnectAttrW, +- unix_SQLGetConnectOption, +- unix_SQLGetConnectOptionW, +- unix_SQLGetCursorName, +- unix_SQLGetCursorNameW, +- unix_SQLGetData, +- unix_SQLGetDescField, +- unix_SQLGetDescFieldW, +- unix_SQLGetDescRec, +- unix_SQLGetDescRecW, +- unix_SQLGetDiagField, +- unix_SQLGetDiagFieldW, +- unix_SQLGetDiagRec, +- unix_SQLGetDiagRecA, +- unix_SQLGetDiagRecW, +- unix_SQLGetEnvAttr, +- unix_SQLGetFunctions, +- unix_SQLGetInfo, +- unix_SQLGetInfoW, +- unix_SQLGetStmtAttr, +- unix_SQLGetStmtAttrW, +- unix_SQLGetStmtOption, +- unix_SQLGetTypeInfo, +- unix_SQLGetTypeInfoW, +- unix_SQLMoreResults, +- unix_SQLNativeSql, +- unix_SQLNativeSqlW, +- unix_SQLNumParams, +- unix_SQLNumResultCols, +- unix_SQLParamData, +- unix_SQLParamOptions, +- unix_SQLPrepare, +- unix_SQLPrepareW, +- unix_SQLPrimaryKeys, +- unix_SQLPrimaryKeysW, +- unix_SQLProcedureColumns, +- unix_SQLProcedureColumnsW, +- unix_SQLProcedures, +- unix_SQLProceduresW, +- unix_SQLPutData, +- unix_SQLRowCount, +- unix_SQLSetConnectAttr, +- unix_SQLSetConnectAttrW, +- unix_SQLSetConnectOption, +- unix_SQLSetConnectOptionW, +- unix_SQLSetCursorName, +- unix_SQLSetCursorNameW, +- unix_SQLSetDescField, +- unix_SQLSetDescFieldW, +- unix_SQLSetDescRec, +- unix_SQLSetEnvAttr, +- unix_SQLSetParam, +- unix_SQLSetPos, +- unix_SQLSetScrollOptions, +- unix_SQLSetStmtAttr, +- unix_SQLSetStmtAttrW, +- unix_SQLSetStmtOption, +- unix_SQLSpecialColumns, +- unix_SQLSpecialColumnsW, +- unix_SQLStatistics, +- unix_SQLStatisticsW, +- unix_SQLTablePrivileges, +- unix_SQLTablePrivilegesW, +- unix_SQLTables, +- unix_SQLTablesW, +- unix_SQLTransact, +- NB_ODBC_FUNCS +-}; +- +-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 933197b6f7d..617e2856255 100644 +--- a/include/config.h.in ++++ b/include/config.h.in +@@ -795,9 +795,6 @@ + /* Define to the soname of the libnetapi library. */ + #undef SONAME_LIBNETAPI + +-/* Define to the soname of the libodbc library. */ +-#undef SONAME_LIBODBC +- + /* Define to the soname of the libOSMesa library. */ + #undef SONAME_LIBOSMESA + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0002-odbc32-Implement-SQLAllocEnv-SQLFreeEnv.patch b/patches/odbc-remove-unixodbc/0002-odbc32-Implement-SQLAllocEnv-SQLFreeEnv.patch new file mode 100644 index 00000000..0127a81a --- /dev/null +++ b/patches/odbc-remove-unixodbc/0002-odbc32-Implement-SQLAllocEnv-SQLFreeEnv.patch @@ -0,0 +1,74 @@ +From b866665b60bc2c29105d45a0e071db8e259ac229 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Fri, 3 Feb 2023 11:44:19 +1100 +Subject: [PATCH 02/42] odbc32: Implement SQLAllocEnv/SQLFreeEnv + +--- + dlls/odbc32/proxyodbc.c | 31 +++++++++++++++++++++++++------ + 1 file changed, 25 insertions(+), 6 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index e8574430e74..24e84883aa5 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -43,6 +43,11 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(odbc); + ++struct SQLHENV_data ++{ ++ int type; ++}; ++ + + /************************************************************************* + * SQLAllocConnect [ODBC32.001] +@@ -61,13 +66,23 @@ SQLRETURN WINAPI SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionH + */ + SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle) + { +- SQLRETURN ret = SQL_ERROR; ++ struct SQLHENV_data *henv; + +- FIXME("(EnvironmentHandle %p)\n", EnvironmentHandle); ++ TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle); ++ ++ if (!EnvironmentHandle) ++ return SQL_ERROR; + + *EnvironmentHandle = SQL_NULL_HENV; ++ henv = calloc(1, sizeof(*henv)); ++ if (!henv) ++ return SQL_ERROR; + +- return ret; ++ henv->type = SQL_HANDLE_ENV; ++ ++ *EnvironmentHandle = henv; ++ ++ return SQL_SUCCESS; + } + + /************************************************************************* +@@ -399,11 +414,15 @@ SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle) + */ + SQLRETURN WINAPI SQLFreeEnv(SQLHENV EnvironmentHandle) + { +- SQLRETURN ret = SQL_ERROR; ++ struct SQLHENV_data *data = EnvironmentHandle; ++ TRACE("(EnvironmentHandle %p)\n", EnvironmentHandle); + +- FIXME("(EnvironmentHandle %p)\n", EnvironmentHandle); ++ if (data && data->type != SQL_HANDLE_ENV) ++ WARN("EnvironmentHandle isn't of type SQL_HANDLE_ENV\n"); ++ else ++ free(data); + +- return ret; ++ return SQL_SUCCESS; + } + + /************************************************************************* +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0003-odbc32-Support-SQL_ATTR_CONNECTION_POOLING-in-SQLGet.patch b/patches/odbc-remove-unixodbc/0003-odbc32-Support-SQL_ATTR_CONNECTION_POOLING-in-SQLGet.patch new file mode 100644 index 00000000..792c2c0b --- /dev/null +++ b/patches/odbc-remove-unixodbc/0003-odbc32-Support-SQL_ATTR_CONNECTION_POOLING-in-SQLGet.patch @@ -0,0 +1,114 @@ +From cd4b544dc92159ca8c80e790c25a36e93b848145 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Fri, 3 Feb 2023 13:41:20 +1100 +Subject: [PATCH 03/42] odbc32: Support SQL_ATTR_CONNECTION_POOLING in + SQLGetEnvAttr/SQLSetEnvAttr + +--- + dlls/odbc32/proxyodbc.c | 63 +++++++++++++++++++++++++++++++++++++---- + 1 file changed, 57 insertions(+), 6 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 24e84883aa5..1330c4c33fe 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -46,6 +46,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(odbc); + struct SQLHENV_data + { + int type; ++ SQLUINTEGER pooling; + }; + + +@@ -79,6 +80,7 @@ SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle) + return SQL_ERROR; + + henv->type = SQL_HANDLE_ENV; ++ henv->pooling = SQL_CP_OFF; + + *EnvironmentHandle = henv; + +@@ -571,12 +573,42 @@ SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMAL + SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength) + { +- SQLRETURN ret = SQL_ERROR; ++ struct SQLHENV_data *data = EnvironmentHandle; + +- FIXME("(EnvironmentHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ++ TRACE("(EnvironmentHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", + EnvironmentHandle, Attribute, Value, BufferLength, StringLength); + +- return ret; ++ if (EnvironmentHandle == SQL_NULL_HENV) ++ { ++ if (StringLength) ++ *StringLength = 0; ++ if (Value) ++ *(SQLINTEGER*)Value = 0; ++ return SQL_SUCCESS; ++ } ++ ++ if (data->type != SQL_HANDLE_ENV) ++ { ++ WARN("Wrong handle type %d\n", data->type); ++ return SQL_ERROR; ++ } ++ ++ switch (Attribute) ++ { ++ case SQL_ATTR_CONNECTION_POOLING: ++ if (BufferLength != sizeof(data->pooling)) ++ { ++ WARN("Invalid buffer size\n"); ++ return SQL_ERROR; ++ } ++ *(SQLUINTEGER*)Value = data->pooling; ++ break; ++ default: ++ FIXME("Unhandle attribute %d\n", Attribute); ++ return SQL_ERROR; ++ } ++ ++ return SQL_SUCCESS; + } + + /************************************************************************* +@@ -785,12 +817,31 @@ SQLRETURN WINAPI SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, + SQLRETURN WINAPI SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength) + { +- SQLRETURN ret = SQL_ERROR; ++ struct SQLHENV_data *data = EnvironmentHandle; + +- FIXME("(EnvironmentHandle %p, Attribute %d, Value %p, StringLength %d)\n", EnvironmentHandle, Attribute, Value, ++ TRACE("(EnvironmentHandle %p, Attribute %d, Value %p, StringLength %d)\n", EnvironmentHandle, Attribute, Value, + StringLength); + +- return ret; ++ if(!data || data->type != SQL_HANDLE_ENV) ++ { ++ WARN("Wrong handle type %d\n", data->type); ++ return SQL_ERROR; ++ } ++ ++ switch(Attribute) ++ { ++ case SQL_ATTR_CONNECTION_POOLING: ++ if (Value) ++ data->pooling = (uintptr_t)Value; ++ else ++ data->pooling = SQL_CP_OFF; ++ break; ++ default: ++ FIXME("Unhandle attribute %d\n", Attribute); ++ return SQL_ERROR; ++ } ++ ++ return SQL_SUCCESS; + } + + /************************************************************************* +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0004-odbc32-Add-initial-tests.patch b/patches/odbc-remove-unixodbc/0004-odbc32-Add-initial-tests.patch new file mode 100644 index 00000000..4cfc477f --- /dev/null +++ b/patches/odbc-remove-unixodbc/0004-odbc32-Add-initial-tests.patch @@ -0,0 +1,222 @@ +From 648d4f13e26a076feca219b76111c03262504d95 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Fri, 3 Feb 2023 14:16:21 +1100 +Subject: [PATCH 04/42] odbc32: Add initial tests + +--- + configure | 1 + + configure.ac | 1 + + dlls/odbc32/tests/Makefile.in | 4 + + dlls/odbc32/tests/connection.c | 165 +++++++++++++++++++++++++++++++++ + 4 files changed, 171 insertions(+) + create mode 100644 dlls/odbc32/tests/Makefile.in + create mode 100644 dlls/odbc32/tests/connection.c + +diff --git a/configure b/configure +index 66e607337db..40b93ce0490 100755 +--- a/configure ++++ b/configure +@@ -21634,6 +21634,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 1033af2e613..249ea8b3f05 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2898,6 +2898,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..4d8716ed2ed +--- /dev/null ++++ b/dlls/odbc32/tests/Makefile.in +@@ -0,0 +1,4 @@ ++TESTDLL = odbc32.dll ++IMPORTS = odbc32 ++ ++C_SRCS = 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); ++} ++ ++void test_SQLGetEnvAttr(void) ++{ ++ SQLRETURN ret; ++ SQLHENV sqlenv; ++ SQLINTEGER value, length; ++ ++ ret = SQLAllocEnv(&sqlenv); ++ ok(ret == SQL_SUCCESS, "got %d\n", ret); ++ ++ value = 5; ++ length = 12; ++ ret = SQLGetEnvAttr(SQL_NULL_HENV, SQL_ATTR_CONNECTION_POOLING, &value, sizeof(SQLINTEGER), &length); ++ ok(ret == SQL_SUCCESS, "got %d\n", ret); ++ ok(value == 0, "got %d\n", value); ++ todo_wine ok(length == 12, "got %d\n", length); ++ ++ value = 5; ++ length = 13; ++ ret = SQLGetEnvAttr(SQL_NULL_HENV, SQL_ATTR_CONNECTION_POOLING, &value, 0, &length); ++ ok(ret == SQL_SUCCESS, "got %d\n", ret); ++ ok(value == 0, "got %d\n", value); ++ todo_wine ok(length == 13, "got %d\n", length); ++ ++ value = 5; ++ length = 12; ++ ret = SQLGetEnvAttr(sqlenv, SQL_ATTR_CONNECTION_POOLING, &value, sizeof(SQLINTEGER), &length); ++ ok(ret == SQL_SUCCESS, "got %d\n", ret); ++ ok(value == 0, "got %d\n", value); ++ ok(length == 12, "got %d\n", length); ++ ++ value = 5; ++ length = 12; ++ ret = SQLGetEnvAttr(sqlenv, SQL_ATTR_CONNECTION_POOLING, &value, 2, &length); ++ todo_wine ok(ret == SQL_SUCCESS, "got %d\n", ret); ++ todo_wine ok(value == 0, "got %d\n", value); ++ ok(length == 12, "got %d\n", length); ++ ++ ret = SQLFreeEnv(sqlenv); ++ 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(); ++ test_SQLGetEnvAttr(); ++ test_SQLDriver(); ++ test_SQLGetDiagRec(); ++} +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0005-odbc32-Implement-SQLAllocConnect.patch b/patches/odbc-remove-unixodbc/0005-odbc32-Implement-SQLAllocConnect.patch new file mode 100644 index 00000000..4c122440 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0005-odbc32-Implement-SQLAllocConnect.patch @@ -0,0 +1,81 @@ +From 8d5b34c895f776ed4944fa5aeed0df3ddc847015 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Fri, 3 Feb 2023 14:40:03 +1100 +Subject: [PATCH 05/42] odbc32: Implement SQLAllocConnect + +--- + dlls/odbc32/proxyodbc.c | 41 +++++++++++++++++++++++++++++++++++------ + 1 file changed, 35 insertions(+), 6 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 1330c4c33fe..b3680b7759d 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -49,17 +49,35 @@ struct SQLHENV_data + SQLUINTEGER pooling; + }; + ++struct SQLHDBC_data ++{ ++ int type; ++ struct SQLHENV_data *environment; ++}; + + /************************************************************************* + * SQLAllocConnect [ODBC32.001] + */ + SQLRETURN WINAPI SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionHandle) + { +- SQLRETURN ret = SQL_ERROR; ++ struct SQLHDBC_data *hdbc; ++ ++ TRACE("(EnvironmentHandle %p, ConnectionHandle %p)\n", EnvironmentHandle, ConnectionHandle); + +- FIXME("(EnvironmentHandle %p, ConnectionHandle %p)\n", EnvironmentHandle, ConnectionHandle); ++ if(!ConnectionHandle) ++ return SQL_ERROR; + *ConnectionHandle = SQL_NULL_HDBC; +- return ret; ++ ++ hdbc = calloc(1, sizeof(*hdbc)); ++ if (!hdbc) ++ return SQL_ERROR; ++ ++ hdbc->type = SQL_HANDLE_DBC; ++ hdbc->environment = EnvironmentHandle; ++ ++ *ConnectionHandle = hdbc; ++ ++ return SQL_SUCCESS; + } + + /************************************************************************* +@@ -404,11 +422,22 @@ SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrien + */ + SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle) + { +- SQLRETURN ret = SQL_ERROR; ++ struct SQLHDBC_data *hdbc = ConnectionHandle; + +- FIXME("(ConnectionHandle %p)\n", ConnectionHandle); ++ TRACE("(ConnectionHandle %p)\n", ConnectionHandle); + +- return ret; ++ if (!hdbc) ++ return SQL_ERROR; ++ ++ if (hdbc->type != SQL_HANDLE_DBC) ++ { ++ WARN("Wrong handle type %d\n", hdbc->type); ++ return SQL_ERROR; ++ } ++ ++ free(hdbc); ++ ++ return SQL_SUCCESS; + } + + /************************************************************************* +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0006-odbc32-SQLGetInfo-W-support-InfoType-SQL_ODBC_VER.patch b/patches/odbc-remove-unixodbc/0006-odbc32-SQLGetInfo-W-support-InfoType-SQL_ODBC_VER.patch new file mode 100644 index 00000000..22288418 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0006-odbc32-SQLGetInfo-W-support-InfoType-SQL_ODBC_VER.patch @@ -0,0 +1,72 @@ +From c4739858fb4397522f5e09e88400c5433a7cecf2 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Fri, 3 Feb 2023 14:46:44 +1100 +Subject: [PATCH 06/42] odbc32: SQLGetInfo/W support InfoType SQL_ODBC_VER + +--- + dlls/odbc32/proxyodbc.c | 36 ++++++++++++++++++++++++++++++------ + 1 file changed, 30 insertions(+), 6 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index b3680b7759d..c19f0248ef8 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -658,12 +658,24 @@ SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT Function + SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) + { +- SQLRETURN ret = SQL_ERROR; ++ char *ptr = InfoValue; + +- FIXME("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, ++ TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, + InfoType, InfoValue, BufferLength, StringLength); + +- return ret; ++ switch(InfoType) ++ { ++ case SQL_ODBC_VER: ++ lstrcpynA(ptr, "03.80.0000", BufferLength); ++ if (StringLength) ++ *StringLength = strlen(ptr); ++ break; ++ default: ++ FIXME("Unsupported type %d\n", InfoType); ++ return SQL_ERROR; ++ } ++ ++ return SQL_SUCCESS; + } + + /************************************************************************* +@@ -1597,12 +1609,24 @@ SQLRETURN WINAPI SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Opt + SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) + { +- SQLRETURN ret = SQL_ERROR; ++ WCHAR *ptr = InfoValue; + +- FIXME("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, ++ TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, + InfoType, InfoValue, BufferLength, StringLength); + +- return ret; ++ switch(InfoType) ++ { ++ case SQL_ODBC_VER: ++ lstrcpynW(ptr, L"03.80.0000", BufferLength); ++ if (StringLength) ++ *StringLength = wcslen(ptr); ++ break; ++ default: ++ FIXME("Unsupported type %d\n", InfoType); ++ return SQL_ERROR; ++ } ++ ++ return SQL_SUCCESS; + } + + /************************************************************************* +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0007-odbc32-Support-SQL_ATTR_LOGIN_TIMEOUT-in-SQLSetConne.patch b/patches/odbc-remove-unixodbc/0007-odbc32-Support-SQL_ATTR_LOGIN_TIMEOUT-in-SQLSetConne.patch new file mode 100644 index 00000000..275d421a --- /dev/null +++ b/patches/odbc-remove-unixodbc/0007-odbc32-Support-SQL_ATTR_LOGIN_TIMEOUT-in-SQLSetConne.patch @@ -0,0 +1,69 @@ +From a6061eab04f7b9432acf1eb86eb47d3286d97f0e Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Fri, 3 Feb 2023 15:18:21 +1100 +Subject: [PATCH 07/42] odbc32: Support SQL_ATTR_LOGIN_TIMEOUT in + SQLSetConnectAttrW + +--- + dlls/odbc32/proxyodbc.c | 28 +++++++++++++++++++++++++--- + 1 file changed, 25 insertions(+), 3 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index c19f0248ef8..b4ec548b09c 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -53,6 +53,8 @@ struct SQLHDBC_data + { + int type; + struct SQLHENV_data *environment; ++ ++ SQLUINTEGER login_timeout; + }; + + /************************************************************************* +@@ -74,6 +76,7 @@ SQLRETURN WINAPI SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionH + + hdbc->type = SQL_HANDLE_DBC; + hdbc->environment = EnvironmentHandle; ++ hdbc->login_timeout = 0; + + *ConnectionHandle = hdbc; + +@@ -1548,12 +1551,31 @@ SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, + SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength) + { +- SQLRETURN ret = SQL_ERROR; ++ struct SQLHDBC_data *hdbc = ConnectionHandle; + +- FIXME("(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); + +- return ret; ++ if (hdbc->type != SQL_HANDLE_DBC) ++ { ++ WARN("Wrong handle type %d\n", hdbc->type); ++ return SQL_ERROR; ++ } ++ ++ switch(Attribute) ++ { ++ case SQL_ATTR_LOGIN_TIMEOUT: ++ if (Value) ++ hdbc->login_timeout = (intptr_t)Value; ++ else ++ hdbc->login_timeout = 0; ++ break; ++ default: ++ FIXME("Unhandle attribute %d\n", Attribute); ++ return SQL_ERROR; ++ } ++ ++ return SQL_SUCCESS; + } + + /************************************************************************* +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0008-odbc32-Implement-SQLDriverConnectW.patch b/patches/odbc-remove-unixodbc/0008-odbc32-Implement-SQLDriverConnectW.patch new file mode 100644 index 00000000..e3dd2eb1 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0008-odbc32-Implement-SQLDriverConnectW.patch @@ -0,0 +1,405 @@ +From 258bc40f574604e6d27cf3fb75e682f463dcde99 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Sat, 4 Feb 2023 09:16:29 +1100 +Subject: [PATCH 08/42] odbc32: Implement SQLDriverConnectW + +--- + dlls/odbc32/proxyodbc.c | 344 +++++++++++++++++++++++++++++++++++++++- + 1 file changed, 343 insertions(+), 1 deletion(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index b4ec548b09c..ebb6b53d62d 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -53,10 +53,257 @@ struct SQLHDBC_data + { + int type; + struct SQLHENV_data *environment; ++ HMODULE module; ++ SQLHENV driver_env; ++ SQLHDBC driver_hdbc; ++ ++ SQLRETURN (WINAPI *pSQLAllocConnect)(SQLHENV,SQLHDBC*); ++ SQLRETURN (WINAPI *pSQLAllocEnv)(SQLHENV*); ++ SQLRETURN (WINAPI *pSQLAllocHandle)(SQLSMALLINT,SQLHANDLE,SQLHANDLE*); ++ SQLRETURN (WINAPI *pSQLAllocHandleStd)(SQLSMALLINT,SQLHANDLE,SQLHANDLE*); ++ SQLRETURN (WINAPI *pSQLAllocStmt)(SQLHDBC,SQLHSTMT*); ++ SQLRETURN (WINAPI *pSQLBindCol)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*); ++ SQLRETURN (WINAPI *pSQLBindParam)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN*); ++ SQLRETURN (WINAPI *pSQLBindParameter)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*); ++ SQLRETURN (WINAPI *pSQLBrowseConnect)(SQLHDBC,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLBrowseConnectW)(SQLHDBC,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLBulkOperations)(SQLHSTMT,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLCancel)(SQLHSTMT); ++ SQLRETURN (WINAPI *pSQLCloseCursor)(SQLHSTMT); ++ SQLRETURN (WINAPI *pSQLColAttribute)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*); ++ SQLRETURN (WINAPI *pSQLColAttributeW)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*); ++ SQLRETURN (WINAPI *pSQLColAttributes)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*); ++ SQLRETURN (WINAPI *pSQLColAttributesW)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*); ++ SQLRETURN (WINAPI *pSQLColumnPrivileges)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLColumnPrivilegesW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLColumns)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLColumnsW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLConnect)(SQLHDBC,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLConnectW)(SQLHDBC,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLCopyDesc)(SQLHDESC,SQLHDESC); ++ SQLRETURN (WINAPI *pSQLDataSources)(SQLHENV,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLDataSourcesA)(SQLHENV,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLDataSourcesW)(SQLHENV,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLDescribeCol)(SQLHSTMT,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLDescribeColW)(SQLHSTMT,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLDescribeParam)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLDisconnect)(SQLHDBC); ++ SQLRETURN (WINAPI *pSQLDriverConnect)(SQLHDBC,SQLHWND,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLUSMALLINT); ++ SQLRETURN (WINAPI *pSQLDriverConnectW)(SQLHDBC,SQLHWND,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLUSMALLINT); ++ SQLRETURN (WINAPI *pSQLDrivers)(SQLHENV,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLDriversW)(SQLHENV,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLEndTran)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLError)(SQLHENV,SQLHDBC,SQLHSTMT,SQLCHAR*,SQLINTEGER*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLErrorW)(SQLHENV,SQLHDBC,SQLHSTMT,SQLWCHAR*,SQLINTEGER*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLExecDirect)(SQLHSTMT,SQLCHAR*,SQLINTEGER); ++ SQLRETURN (WINAPI *pSQLExecDirectW)(SQLHSTMT,SQLWCHAR*,SQLINTEGER); ++ SQLRETURN (WINAPI *pSQLExecute)(SQLHSTMT); ++ SQLRETURN (WINAPI *pSQLExtendedFetch)(SQLHSTMT,SQLUSMALLINT,SQLLEN,SQLULEN*,SQLUSMALLINT*); ++ SQLRETURN (WINAPI *pSQLFetch)(SQLHSTMT); ++ SQLRETURN (WINAPI *pSQLFetchScroll)(SQLHSTMT,SQLSMALLINT,SQLLEN); ++ SQLRETURN (WINAPI *pSQLForeignKeys)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLForeignKeysW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLFreeConnect)(SQLHDBC); ++ SQLRETURN (WINAPI *pSQLFreeEnv)(SQLHENV); ++ SQLRETURN (WINAPI *pSQLFreeHandle)(SQLSMALLINT,SQLHANDLE); ++ SQLRETURN (WINAPI *pSQLFreeStmt)(SQLHSTMT,SQLUSMALLINT); ++ SQLRETURN (WINAPI *pSQLGetConnectAttr)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*); ++ SQLRETURN (WINAPI *pSQLGetConnectAttrW)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*); ++ SQLRETURN (WINAPI *pSQLGetConnectOption)(SQLHDBC,SQLUSMALLINT,SQLPOINTER); ++ SQLRETURN (WINAPI *pSQLGetConnectOptionW)(SQLHDBC,SQLUSMALLINT,SQLPOINTER); ++ SQLRETURN (WINAPI *pSQLGetCursorName)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLGetCursorNameW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLGetData)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*); ++ SQLRETURN (WINAPI *pSQLGetDescField)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLINTEGER*); ++ SQLRETURN (WINAPI *pSQLGetDescFieldW)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLINTEGER*); ++ SQLRETURN (WINAPI *pSQLGetDescRec)(SQLHDESC,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*,SQLLEN*,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLGetDescRecW)(SQLHDESC,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*,SQLLEN*,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLGetDiagField)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLGetDiagFieldW)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLGetDiagRec)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLCHAR*,SQLINTEGER*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLGetDiagRecA)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLCHAR*,SQLINTEGER*, SQLCHAR*,SQLSMALLINT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLGetDiagRecW)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLWCHAR*,SQLINTEGER*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLGetEnvAttr)(SQLHENV,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*); ++ SQLRETURN (WINAPI *pSQLGetFunctions)(SQLHDBC,SQLUSMALLINT,SQLUSMALLINT*); ++ SQLRETURN (WINAPI *pSQLGetInfo)(SQLHDBC,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLGetInfoW)(SQLHDBC,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLGetStmtAttr)(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*); ++ SQLRETURN (WINAPI *pSQLGetStmtAttrW)(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*); ++ SQLRETURN (WINAPI *pSQLGetStmtOption)(SQLHSTMT,SQLUSMALLINT,SQLPOINTER); ++ SQLRETURN (WINAPI *pSQLGetTypeInfo)(SQLHSTMT,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLGetTypeInfoW)(SQLHSTMT,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLMoreResults)(SQLHSTMT); ++ SQLRETURN (WINAPI *pSQLNativeSql)(SQLHDBC,SQLCHAR*,SQLINTEGER,SQLCHAR*,SQLINTEGER,SQLINTEGER*); ++ SQLRETURN (WINAPI *pSQLNativeSqlW)(SQLHDBC,SQLWCHAR*,SQLINTEGER,SQLWCHAR*,SQLINTEGER,SQLINTEGER*); ++ SQLRETURN (WINAPI *pSQLNumParams)(SQLHSTMT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLNumResultCols)(SQLHSTMT,SQLSMALLINT*); ++ SQLRETURN (WINAPI *pSQLParamData)(SQLHSTMT,SQLPOINTER*); ++ SQLRETURN (WINAPI *pSQLParamOptions)(SQLHSTMT,SQLULEN,SQLULEN*); ++ SQLRETURN (WINAPI *pSQLPrepare)(SQLHSTMT,SQLCHAR*,SQLINTEGER); ++ SQLRETURN (WINAPI *pSQLPrepareW)(SQLHSTMT,SQLWCHAR*,SQLINTEGER); ++ SQLRETURN (WINAPI *pSQLPrimaryKeys)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLPrimaryKeysW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLProcedureColumns)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLProcedureColumnsW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLProcedures)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLProceduresW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLPutData)(SQLHSTMT,SQLPOINTER,SQLLEN); ++ SQLRETURN (WINAPI *pSQLRowCount)(SQLHSTMT,SQLLEN*); ++ SQLRETURN (WINAPI *pSQLSetConnectAttr)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER); ++ SQLRETURN (WINAPI *pSQLSetConnectAttrW)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER); ++ SQLRETURN (WINAPI *pSQLSetConnectOption)(SQLHDBC,SQLUSMALLINT,SQLULEN); ++ SQLRETURN (WINAPI *pSQLSetConnectOptionW)(SQLHDBC,SQLUSMALLINT,SQLULEN); ++ SQLRETURN (WINAPI *pSQLSetCursorName)(SQLHSTMT,SQLCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLSetCursorNameW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLSetDescField)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER); ++ SQLRETURN (WINAPI *pSQLSetDescFieldW)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER); ++ SQLRETURN (WINAPI *pSQLSetDescRec)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLLEN,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN*,SQLLEN*); ++ SQLRETURN (WINAPI *pSQLSetEnvAttr)(SQLHENV,SQLINTEGER,SQLPOINTER,SQLINTEGER); ++ SQLRETURN (WINAPI *pSQLSetParam)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN*); ++ SQLRETURN (WINAPI *pSQLSetPos)(SQLHSTMT,SQLSETPOSIROW,SQLUSMALLINT,SQLUSMALLINT); ++ SQLRETURN (WINAPI *pSQLSetScrollOptions)(SQLHSTMT,SQLUSMALLINT,SQLLEN,SQLUSMALLINT); ++ SQLRETURN (WINAPI *pSQLSetStmtAttr)(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER); ++ SQLRETURN (WINAPI *pSQLSetStmtAttrW)(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER); ++ SQLRETURN (WINAPI *pSQLSetStmtOption)(SQLHSTMT,SQLUSMALLINT,SQLULEN); ++ SQLRETURN (WINAPI *pSQLSpecialColumns)(SQLHSTMT,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT); ++ SQLRETURN (WINAPI *pSQLSpecialColumnsW)(SQLHSTMT,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT); ++ SQLRETURN (WINAPI *pSQLStatistics)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT); ++ SQLRETURN (WINAPI *pSQLStatisticsW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT); ++ SQLRETURN (WINAPI *pSQLTablePrivileges)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLTablePrivilegesW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLTables)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLTablesW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT); ++ SQLRETURN (WINAPI *pSQLTransact)(SQLHENV,SQLHDBC,SQLUSMALLINT); + + SQLUINTEGER login_timeout; + }; + ++static void connection_bind_sql_funcs(struct SQLHDBC_data *connection) ++{ ++#define LOAD_FUNCPTR(f) if((connection->p##f = (void*)GetProcAddress(connection->module, #f)) == NULL) \ ++ { \ ++ WARN( "function '%s' not found in driver.\n", #f ); \ ++ } ++ ++ LOAD_FUNCPTR(SQLAllocConnect); ++ LOAD_FUNCPTR(SQLAllocEnv); ++ LOAD_FUNCPTR(SQLAllocHandle); ++ LOAD_FUNCPTR(SQLAllocHandleStd) ++ LOAD_FUNCPTR(SQLAllocStmt); ++ LOAD_FUNCPTR(SQLBindCol); ++ LOAD_FUNCPTR(SQLBindParam); ++ LOAD_FUNCPTR(SQLBindParameter); ++ LOAD_FUNCPTR(SQLBrowseConnect); ++ LOAD_FUNCPTR(SQLBrowseConnectW); ++ LOAD_FUNCPTR(SQLBulkOperations); ++ LOAD_FUNCPTR(SQLCancel); ++ LOAD_FUNCPTR(SQLCloseCursor); ++ LOAD_FUNCPTR(SQLColAttribute); ++ LOAD_FUNCPTR(SQLColAttributeW); ++ LOAD_FUNCPTR(SQLColAttributes); ++ LOAD_FUNCPTR(SQLColAttributesW); ++ LOAD_FUNCPTR(SQLColumnPrivileges); ++ LOAD_FUNCPTR(SQLColumnPrivilegesW) ++ LOAD_FUNCPTR(SQLColumns); ++ LOAD_FUNCPTR(SQLColumnsW); ++ LOAD_FUNCPTR(SQLConnect); ++ LOAD_FUNCPTR(SQLConnectW); ++ LOAD_FUNCPTR(SQLCopyDesc); ++ LOAD_FUNCPTR(SQLDataSources); ++ LOAD_FUNCPTR(SQLDataSourcesA); ++ LOAD_FUNCPTR(SQLDataSourcesW); ++ LOAD_FUNCPTR(SQLDescribeCol); ++ LOAD_FUNCPTR(SQLDescribeColW); ++ LOAD_FUNCPTR(SQLDescribeParam); ++ LOAD_FUNCPTR(SQLDisconnect); ++ LOAD_FUNCPTR(SQLDriverConnect); ++ LOAD_FUNCPTR(SQLDriverConnectW); ++ LOAD_FUNCPTR(SQLDrivers); ++ LOAD_FUNCPTR(SQLDriversW); ++ LOAD_FUNCPTR(SQLEndTran); ++ LOAD_FUNCPTR(SQLError); ++ LOAD_FUNCPTR(SQLErrorW); ++ LOAD_FUNCPTR(SQLExecDirect); ++ LOAD_FUNCPTR(SQLExecDirectW); ++ LOAD_FUNCPTR(SQLExecute); ++ LOAD_FUNCPTR(SQLExtendedFetch); ++ LOAD_FUNCPTR(SQLFetch); ++ LOAD_FUNCPTR(SQLFetchScroll); ++ LOAD_FUNCPTR(SQLForeignKeys); ++ LOAD_FUNCPTR(SQLForeignKeysW); ++ LOAD_FUNCPTR(SQLFreeConnect); ++ LOAD_FUNCPTR(SQLFreeEnv); ++ LOAD_FUNCPTR(SQLFreeHandle); ++ LOAD_FUNCPTR(SQLFreeStmt); ++ LOAD_FUNCPTR(SQLGetConnectAttr); ++ LOAD_FUNCPTR(SQLGetConnectAttrW); ++ LOAD_FUNCPTR(SQLGetConnectOption); ++ LOAD_FUNCPTR(SQLGetConnectOptionW); ++ LOAD_FUNCPTR(SQLGetCursorName); ++ LOAD_FUNCPTR(SQLGetCursorNameW); ++ LOAD_FUNCPTR(SQLGetData); ++ LOAD_FUNCPTR(SQLGetDescField); ++ LOAD_FUNCPTR(SQLGetDescFieldW); ++ LOAD_FUNCPTR(SQLGetDescRec); ++ LOAD_FUNCPTR(SQLGetDescRecW); ++ LOAD_FUNCPTR(SQLGetDiagField); ++ LOAD_FUNCPTR(SQLGetDiagFieldW); ++ LOAD_FUNCPTR(SQLGetDiagRec); ++ LOAD_FUNCPTR(SQLGetDiagRecA); ++ LOAD_FUNCPTR(SQLGetDiagRecW); ++ LOAD_FUNCPTR(SQLGetEnvAttr); ++ LOAD_FUNCPTR(SQLGetFunctions); ++ LOAD_FUNCPTR(SQLGetInfo); ++ LOAD_FUNCPTR(SQLGetInfoW); ++ LOAD_FUNCPTR(SQLGetStmtAttr); ++ LOAD_FUNCPTR(SQLGetStmtAttrW); ++ LOAD_FUNCPTR(SQLGetStmtOption); ++ LOAD_FUNCPTR(SQLGetTypeInfo); ++ LOAD_FUNCPTR(SQLGetTypeInfoW); ++ LOAD_FUNCPTR(SQLMoreResults); ++ LOAD_FUNCPTR(SQLNativeSql); ++ LOAD_FUNCPTR(SQLNativeSqlW); ++ LOAD_FUNCPTR(SQLNumParams); ++ LOAD_FUNCPTR(SQLNumResultCols); ++ LOAD_FUNCPTR(SQLParamData); ++ LOAD_FUNCPTR(SQLParamOptions); ++ LOAD_FUNCPTR(SQLPrepare); ++ LOAD_FUNCPTR(SQLPrepareW); ++ LOAD_FUNCPTR(SQLPrimaryKeys); ++ LOAD_FUNCPTR(SQLPrimaryKeysW); ++ LOAD_FUNCPTR(SQLProcedureColumns); ++ LOAD_FUNCPTR(SQLProcedureColumnsW); ++ LOAD_FUNCPTR(SQLProcedures); ++ LOAD_FUNCPTR(SQLProceduresW); ++ LOAD_FUNCPTR(SQLPutData); ++ LOAD_FUNCPTR(SQLRowCount); ++ LOAD_FUNCPTR(SQLSetConnectAttr); ++ LOAD_FUNCPTR(SQLSetConnectAttrW); ++ LOAD_FUNCPTR(SQLSetConnectOption); ++ LOAD_FUNCPTR(SQLSetConnectOptionW); ++ LOAD_FUNCPTR(SQLSetCursorName); ++ LOAD_FUNCPTR(SQLSetCursorNameW); ++ LOAD_FUNCPTR(SQLSetDescField); ++ LOAD_FUNCPTR(SQLSetDescFieldW); ++ LOAD_FUNCPTR(SQLSetDescRec); ++ LOAD_FUNCPTR(SQLSetEnvAttr); ++ LOAD_FUNCPTR(SQLSetParam); ++ LOAD_FUNCPTR(SQLSetPos); ++ LOAD_FUNCPTR(SQLSetScrollOptions); ++ LOAD_FUNCPTR(SQLSetStmtAttr); ++ LOAD_FUNCPTR(SQLSetStmtAttrW); ++ LOAD_FUNCPTR(SQLSetStmtOption); ++ LOAD_FUNCPTR(SQLSpecialColumns); ++ LOAD_FUNCPTR(SQLSpecialColumnsW); ++ LOAD_FUNCPTR(SQLStatistics); ++ LOAD_FUNCPTR(SQLStatisticsW); ++ LOAD_FUNCPTR(SQLTablePrivileges); ++ LOAD_FUNCPTR(SQLTablePrivilegesW); ++ LOAD_FUNCPTR(SQLTables); ++ LOAD_FUNCPTR(SQLTablesW); ++ LOAD_FUNCPTR(SQLTransact); ++} ++ + /************************************************************************* + * SQLAllocConnect [ODBC32.001] + */ +@@ -77,6 +324,7 @@ SQLRETURN WINAPI SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionH + hdbc->type = SQL_HANDLE_DBC; + hdbc->environment = EnvironmentHandle; + hdbc->login_timeout = 0; ++ hdbc->module = NULL; + + *ConnectionHandle = hdbc; + +@@ -438,6 +686,8 @@ SQLRETURN WINAPI SQLFreeConnect(SQLHDBC ConnectionHandle) + return SQL_ERROR; + } + ++ FreeLibrary(hdbc->module); ++ + free(hdbc); + + return SQL_SUCCESS; +@@ -1596,6 +1846,62 @@ SQLRETURN WINAPI SQLColumnsW(SQLHSTMT StatementHandle, WCHAR *CatalogName, SQLSM + return ret; + } + ++static HMODULE load_odbc_driver(const WCHAR *driver) ++{ ++ long ret; ++ HMODULE hmod; ++ WCHAR *filename = NULL; ++ HKEY hkey; ++ WCHAR regpath[256]; ++ ++ wcscpy(regpath, L"Software\\ODBC\\ODBC.INI\\"); ++ wcscat(regpath, driver); ++ ++ if ((ret = RegOpenKeyW(HKEY_CURRENT_USER, regpath, &hkey)) != ERROR_SUCCESS) ++ { ++ ret = RegOpenKeyW(HKEY_LOCAL_MACHINE, regpath, &hkey); ++ } ++ ++ if (ret == ERROR_SUCCESS) ++ { ++ DWORD size = 0, type; ++ ret = RegGetValueW(hkey, NULL, L"Driver", RRF_RT_REG_SZ, &type, NULL, &size); ++ if(ret != ERROR_SUCCESS || type != REG_SZ) ++ { ++ RegCloseKey(hkey); ++ WARN("Invalid DSN %s\n", debugstr_w(driver)); ++ ++ return NULL; ++ } ++ ++ filename = malloc(size); ++ if(!filename) ++ { ++ RegCloseKey(hkey); ++ ERR("Out of memory\n"); ++ ++ return NULL; ++ } ++ ret = RegGetValueW(hkey, NULL, L"Driver", RRF_RT_REG_SZ, &type, filename, &size); ++ ++ RegCloseKey(hkey); ++ } ++ ++ if(ret != ERROR_SUCCESS) ++ { ++ free(filename); ++ ERR("Failed to open Registry Key\n"); ++ return NULL; ++ } ++ ++ hmod = LoadLibraryExW(filename, NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); ++ free(filename); ++ ++ if(!hmod) ++ ERR("Failed to load driver\n"); ++ ++ return hmod; ++} + /************************************************************************* + * SQLDriverConnectW [ODBC32.141] + */ +@@ -1603,13 +1909,49 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl + SQLSMALLINT Length, WCHAR *OutConnectionString, SQLSMALLINT BufferLength, + SQLSMALLINT *Length2, SQLUSMALLINT DriverCompletion) + { ++ struct SQLHDBC_data *connection = ConnectionHandle; ++ HMODULE driver; + SQLRETURN ret = SQL_ERROR; ++ WCHAR dsn[128]; ++ WCHAR *p; + +- FIXME("(ConnectionHandle %p, WindowHandle %p, InConnectionString %s, Length %d, OutConnectionString %p," ++ TRACE("(ConnectionHandle %p, WindowHandle %p, InConnectionString %s, Length %d, OutConnectionString %p," + " BufferLength %d, Length2 %p, DriverCompletion %d)\n", ConnectionHandle, WindowHandle, + debugstr_wn(InConnectionString, Length), Length, OutConnectionString, BufferLength, Length2, + DriverCompletion); + ++ p = wcsstr(InConnectionString, L"DSN="); ++ if (p) ++ { ++ WCHAR *end = wcsstr(p, L";"); ++ ++ lstrcpynW(dsn, p+4, end - (p + 3)); ++ } ++ ++ driver = load_odbc_driver(dsn); ++ if (!driver) ++ return SQL_ERROR; ++ ++ connection->module = driver; ++ connection_bind_sql_funcs(connection); ++ ++ if (connection->pSQLAllocHandle) ++ { ++ connection->pSQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &connection->driver_env); ++ connection->pSQLAllocHandle(SQL_HANDLE_DBC, connection->driver_env, &connection->driver_hdbc); ++ } ++ ++ if(!connection->pSQLDriverConnectW) ++ { ++ ERR("Failed to find pSQLDriverConnectW\n"); ++ return SQL_ERROR; ++ } ++ ++ ret = connection->pSQLDriverConnectW(connection->driver_hdbc, WindowHandle, InConnectionString, Length, ++ OutConnectionString, BufferLength, Length2, DriverCompletion); ++ ++ TRACE("Driver returned %d\n", ret); ++ + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0009-odbc32-Foward-SQLGetInfo-W-requests-onto-the-driver.patch b/patches/odbc-remove-unixodbc/0009-odbc32-Foward-SQLGetInfo-W-requests-onto-the-driver.patch new file mode 100644 index 00000000..61d7af7b --- /dev/null +++ b/patches/odbc-remove-unixodbc/0009-odbc32-Foward-SQLGetInfo-W-requests-onto-the-driver.patch @@ -0,0 +1,82 @@ +From 721fddbb419b2bdaf710c023b9d33851b77e1684 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 08:47:46 +1100 +Subject: [PATCH 09/42] odbc32: Foward SQLGetInfo/W requests onto the driver + +--- + dlls/odbc32/proxyodbc.c | 32 ++++++++++++++++++++++++++------ + 1 file changed, 26 insertions(+), 6 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index ebb6b53d62d..6e4e1a68011 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -911,7 +911,9 @@ SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT Function + SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) + { ++ struct SQLHDBC_data *connection = ConnectionHandle; + char *ptr = InfoValue; ++ SQLRETURN ret = SQL_SUCCESS; + + TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, + InfoType, InfoValue, BufferLength, StringLength); +@@ -924,11 +926,19 @@ SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQL + *StringLength = strlen(ptr); + break; + default: +- FIXME("Unsupported type %d\n", InfoType); +- return SQL_ERROR; ++ if (connection->pSQLGetInfo) ++ ret = connection->pSQLGetInfo(connection->driver_hdbc, InfoType, InfoValue, ++ BufferLength, StringLength); ++ else ++ { ++ FIXME("Unsupported type %d\n", InfoType); ++ ret = SQL_ERROR; ++ } + } + +- return SQL_SUCCESS; ++ TRACE("ret %d\n", ret); ++ ++ return ret; + } + + /************************************************************************* +@@ -1973,7 +1983,9 @@ SQLRETURN WINAPI SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Opt + SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength) + { ++ struct SQLHDBC_data *connection = ConnectionHandle; + WCHAR *ptr = InfoValue; ++ SQLRETURN ret = SQL_SUCCESS; + + TRACE("(ConnectionHandle, %p, InfoType %d, InfoValue %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, + InfoType, InfoValue, BufferLength, StringLength); +@@ -1986,11 +1998,19 @@ SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQ + *StringLength = wcslen(ptr); + break; + default: +- FIXME("Unsupported type %d\n", InfoType); +- return SQL_ERROR; ++ if (connection->pSQLGetInfoW) ++ ret = connection->pSQLGetInfoW(connection->driver_hdbc, InfoType, InfoValue, ++ BufferLength, StringLength); ++ else ++ { ++ FIXME("Unsupported type %d\n", InfoType); ++ ret = SQL_ERROR; ++ } + } + +- return SQL_SUCCESS; ++ TRACE("ret %d\n", ret); ++ ++ return ret; + } + + /************************************************************************* +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0010-odbc32-Foward-SQLSetConnectAttr-requets-onto-the-dri.patch b/patches/odbc-remove-unixodbc/0010-odbc32-Foward-SQLSetConnectAttr-requets-onto-the-dri.patch new file mode 100644 index 00000000..3fce0064 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0010-odbc32-Foward-SQLSetConnectAttr-requets-onto-the-dri.patch @@ -0,0 +1,47 @@ +From 54744cb90ebf7ebe9ae60e6f4de12586c6d2083f Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 08:55:12 +1100 +Subject: [PATCH 10/42] odbc32: Foward SQLSetConnectAttr requets onto the + driver + +--- + dlls/odbc32/proxyodbc.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 6e4e1a68011..89062e9cadf 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -1812,6 +1812,7 @@ SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribu + SQLINTEGER StringLength) + { + struct SQLHDBC_data *hdbc = ConnectionHandle; ++ SQLRETURN ret = SQL_SUCCESS; + + TRACE("(ConnectionHandle %p, Attribute %d, Value %p, StringLength %d)\n", ConnectionHandle, Attribute, Value, + StringLength); +@@ -1831,11 +1832,18 @@ SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribu + hdbc->login_timeout = 0; + break; + default: +- FIXME("Unhandle attribute %d\n", Attribute); +- return SQL_ERROR; ++ if (hdbc->pSQLSetConnectAttrW) ++ ret = hdbc->pSQLSetConnectAttrW(hdbc->driver_hdbc, Attribute, Value, StringLength); ++ else ++ { ++ FIXME("Unsupported Attribute %d\n", Attribute); ++ ret = SQL_ERROR; ++ } + } + +- return SQL_SUCCESS; ++ TRACE("ret %d\n", ret); ++ ++ return ret; + } + + /************************************************************************* +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0011-odbc32-Forward-SQLGetFunctions-requets-onto-the-driv.patch b/patches/odbc-remove-unixodbc/0011-odbc32-Forward-SQLGetFunctions-requets-onto-the-driv.patch new file mode 100644 index 00000000..e581dc73 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0011-odbc32-Forward-SQLGetFunctions-requets-onto-the-driv.patch @@ -0,0 +1,33 @@ +From 8b3bcc595990b84b8632397707a3ba756f1b2892 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 09:02:34 +1100 +Subject: [PATCH 11/42] odbc32: Forward SQLGetFunctions requets onto the driver + +--- + dlls/odbc32/proxyodbc.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 89062e9cadf..7e92b90b10c 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -898,9 +898,15 @@ SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, + */ + SQLRETURN WINAPI SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported) + { ++ struct SQLHDBC_data *connection = ConnectionHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(ConnectionHandle %p, FunctionId %d, Supported %p)\n", ConnectionHandle, FunctionId, Supported); ++ TRACE("(ConnectionHandle %p, FunctionId %d, Supported %p)\n", ConnectionHandle, FunctionId, Supported); ++ ++ if (connection->pSQLGetFunctions) ++ { ++ ret = connection->pSQLGetFunctions(connection->driver_hdbc, FunctionId, Supported); ++ } + + return ret; + } +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0012-odbc32-Forward-SQLGetConnectAttr-W-requets-onto-the-.patch b/patches/odbc-remove-unixodbc/0012-odbc32-Forward-SQLGetConnectAttr-W-requets-onto-the-.patch new file mode 100644 index 00000000..ca05c4ed --- /dev/null +++ b/patches/odbc-remove-unixodbc/0012-odbc32-Forward-SQLGetConnectAttr-W-requets-onto-the-.patch @@ -0,0 +1,73 @@ +From f5914eea19b16f6312de43ff72b289c82c08f846 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 09:08:27 +1100 +Subject: [PATCH 12/42] odbc32: Forward SQLGetConnectAttr/W requets onto the + driver + +--- + dlls/odbc32/proxyodbc.c | 34 ++++++++++++++++++++++++++++++++-- + 1 file changed, 32 insertions(+), 2 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 7e92b90b10c..96357cd3f1d 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -739,11 +739,26 @@ SQLRETURN WINAPI SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option) + SQLRETURN WINAPI SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength) + { ++ struct SQLHDBC_data *connection = ConnectionHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, ++ TRACE("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, + Attribute, Value, BufferLength, StringLength); + ++ if (connection->type != SQL_HANDLE_DBC) ++ { ++ WARN("Wrong handle type %d\n", connection->type); ++ return SQL_ERROR; ++ } ++ ++ if (connection->pSQLGetConnectAttr) ++ { ++ ret = connection->pSQLGetConnectAttr(connection->driver_hdbc, Attribute, Value, ++ BufferLength, StringLength); ++ } ++ ++ TRACE("ret %d\n", ret); ++ + return ret; + } + +@@ -1721,11 +1736,26 @@ SQLRETURN WINAPI SQLColAttributeW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnN + SQLRETURN WINAPI SQLGetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength) + { ++ struct SQLHDBC_data *connection = ConnectionHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, ++ TRACE("(ConnectionHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", ConnectionHandle, + Attribute, Value, BufferLength, StringLength); + ++ if (connection->type != SQL_HANDLE_DBC) ++ { ++ WARN("Wrong handle type %d\n", connection->type); ++ return SQL_ERROR; ++ } ++ ++ if (connection->pSQLGetConnectAttrW) ++ { ++ ret = connection->pSQLGetConnectAttrW(connection->driver_hdbc, Attribute, Value, ++ BufferLength, StringLength); ++ } ++ ++ TRACE("ret %d\n", ret); ++ + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0013-odbc32-Foward-SQLDisconnect-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0013-odbc32-Foward-SQLDisconnect-request-onto-driver.patch new file mode 100644 index 00000000..eed7952e --- /dev/null +++ b/patches/odbc-remove-unixodbc/0013-odbc32-Foward-SQLDisconnect-request-onto-driver.patch @@ -0,0 +1,41 @@ +From 3a815fdc2731ffe21a617668e7cd4570196e02c5 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 09:26:57 +1100 +Subject: [PATCH 13/42] odbc32: Foward SQLDisconnect request onto driver + +--- + dlls/odbc32/proxyodbc.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 96357cd3f1d..65f882968c6 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -583,9 +583,23 @@ SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNum + */ + SQLRETURN WINAPI SQLDisconnect(SQLHDBC ConnectionHandle) + { ++ struct SQLHDBC_data *connection = ConnectionHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(ConnectionHandle %p)\n", ConnectionHandle); ++ TRACE("(ConnectionHandle %p)\n", ConnectionHandle); ++ ++ if (connection->type != SQL_HANDLE_DBC) ++ { ++ WARN("Wrong handle type %d\n", connection->type); ++ return SQL_ERROR; ++ } ++ ++ if (connection->pSQLDisconnect) ++ { ++ ret = connection->pSQLDisconnect(connection->driver_hdbc); ++ } ++ ++ TRACE("ret %d\n", ret); + + return ret; + } +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0014-odbc32-Implement-SQLAllocStmt.patch b/patches/odbc-remove-unixodbc/0014-odbc32-Implement-SQLAllocStmt.patch new file mode 100644 index 00000000..71c6ca16 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0014-odbc32-Implement-SQLAllocStmt.patch @@ -0,0 +1,73 @@ +From 2bda5feb6297ec6c01a022a3c13338c2c6f6ff27 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 09:53:34 +1100 +Subject: [PATCH 14/42] odbc32: Implement SQLAllocStmt + +--- + dlls/odbc32/proxyodbc.c | 39 ++++++++++++++++++++++++++++++++++++++- + 1 file changed, 38 insertions(+), 1 deletion(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 65f882968c6..4ec5ecfcb83 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -178,6 +178,13 @@ struct SQLHDBC_data + SQLUINTEGER login_timeout; + }; + ++struct SQLHSTMT_data ++{ ++ int type; ++ struct SQLHDBC_data *connection; ++ SQLHSTMT driver_stmt; ++}; ++ + static void connection_bind_sql_funcs(struct SQLHDBC_data *connection) + { + #define LOAD_FUNCPTR(f) if((connection->p##f = (void*)GetProcAddress(connection->module, #f)) == NULL) \ +@@ -374,11 +381,41 @@ SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, S + */ + SQLRETURN WINAPI SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandle) + { ++ struct SQLHDBC_data *connection = ConnectionHandle; ++ struct SQLHSTMT_data *stmt; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(ConnectionHandle %p, StatementHandle %p)\n", ConnectionHandle, StatementHandle); ++ TRACE("(ConnectionHandle %p, StatementHandle %p)\n", ConnectionHandle, StatementHandle); + + *StatementHandle = SQL_NULL_HSTMT; ++ if (connection->type != SQL_HANDLE_DBC) ++ { ++ WARN("Wrong handle type %d\n", connection->type); ++ return SQL_ERROR; ++ } ++ ++ stmt = malloc(sizeof(*stmt)); ++ if (!stmt) ++ { ++ return SQL_ERROR; ++ } ++ ++ stmt->type = SQL_HANDLE_STMT; ++ stmt->connection = connection; ++ ++ /* Default to ODBC v3 function */ ++ if(connection->pSQLAllocHandle) ++ { ++ ret = connection->pSQLAllocHandle(SQL_HANDLE_STMT, connection->driver_hdbc, &stmt->driver_stmt); ++ } ++ else if (connection->pSQLAllocStmt) ++ { ++ ret = connection->pSQLAllocStmt(connection->driver_hdbc, &stmt->driver_stmt); ++ } ++ ++ *StatementHandle = stmt; ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0015-odbc32-Forward-SQLSetStmtAttr-W-request-to-driver.patch b/patches/odbc-remove-unixodbc/0015-odbc32-Forward-SQLSetStmtAttr-W-request-to-driver.patch new file mode 100644 index 00000000..858d06e1 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0015-odbc32-Forward-SQLSetStmtAttr-W-request-to-driver.patch @@ -0,0 +1,68 @@ +From eeab9933053871380bac92db0a9e7444be7f9374 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 09:59:14 +1100 +Subject: [PATCH 15/42] odbc32: Forward SQLSetStmtAttr/W request to driver + +--- + dlls/odbc32/proxyodbc.c | 30 ++++++++++++++++++++++++++++-- + 1 file changed, 28 insertions(+), 2 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 4ec5ecfcb83..d0be7b600bf 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -1242,11 +1242,24 @@ SQLRETURN WINAPI SQLSetParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNum + SQLRETURN WINAPI SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value, ++ TRACE("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value, + StringLength); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLSetStmtAttr) ++ { ++ ret = statement->connection->pSQLSetStmtAttr(statement->driver_stmt, Attribute, Value, StringLength); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +@@ -2378,11 +2391,24 @@ SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumb + SQLRETURN WINAPI SQLSetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value, ++ TRACE("(StatementHandle %p, Attribute %d, Value %p, StringLength %d)\n", StatementHandle, Attribute, Value, + StringLength); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLSetStmtAttrW) ++ { ++ ret = statement->connection->pSQLSetStmtAttrW(statement->driver_stmt, Attribute, Value, StringLength); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0016-odbc32-Forward-SQLParamOptions-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0016-odbc32-Forward-SQLParamOptions-request-onto-driver.patch new file mode 100644 index 00000000..0592a453 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0016-odbc32-Forward-SQLParamOptions-request-onto-driver.patch @@ -0,0 +1,41 @@ +From e93822d6974d17a4f649228222fb6cd2f513d2a4 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 10:50:26 +1100 +Subject: [PATCH 16/42] odbc32: Forward SQLParamOptions request onto driver + +--- + dlls/odbc32/proxyodbc.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index d0be7b600bf..10de992e83e 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -1501,10 +1501,23 @@ SQLRETURN WINAPI SQLNumParams(SQLHSTMT hstmt, SQLSMALLINT *pcpar) + */ + SQLRETURN WINAPI SQLParamOptions(SQLHSTMT hstmt, SQLULEN crow, SQLULEN *pirow) + { ++ struct SQLHSTMT_data *statement = hstmt; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(hstmt %p, crow %s, pirow %p)\n", hstmt, debugstr_sqlulen(crow), pirow); ++ TRACE("(hstmt %p, crow %s, pirow %p)\n", hstmt, debugstr_sqlulen(crow), pirow); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLParamOptions) ++ { ++ ret = statement->connection->pSQLParamOptions(statement->driver_stmt, crow, pirow); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0017-odbc32-Forward-SQLExecDirect-W-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0017-odbc32-Forward-SQLExecDirect-W-request-onto-driver.patch new file mode 100644 index 00000000..186b86ab --- /dev/null +++ b/patches/odbc-remove-unixodbc/0017-odbc32-Forward-SQLExecDirect-W-request-onto-driver.patch @@ -0,0 +1,66 @@ +From 7b0b4f665836d2008dd679d27c9995c25895f1bb Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 10:53:29 +1100 +Subject: odbc32: Forward SQLExecDirect/W request onto driver + + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 10de992e83e..bbcaa2487db 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -674,11 +674,25 @@ SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, S + */ + SQLRETURN WINAPI SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, +- debugstr_an((const char *)StatementText, TextLength), TextLength); ++ TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, ++ TextLength > 0 ? debugstr_wn(StatementText, TextLength) : debugstr_w(StatementText), ++ TextLength); ++ ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } + ++ if (statement->connection->pSQLExecDirect) ++ { ++ ret = statement->connection->pSQLExecDirect(statement->driver_stmt, StatementText, TextLength); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +@@ -1742,11 +1756,25 @@ SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, + */ + SQLRETURN WINAPI SQLExecDirectW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, +- debugstr_wn(StatementText, TextLength), TextLength); ++ TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, ++ TextLength > 0 ? debugstr_wn(StatementText, TextLength) : debugstr_w(StatementText), ++ TextLength); ++ ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } + ++ if (statement->connection->pSQLExecDirectW) ++ { ++ ret = statement->connection->pSQLExecDirectW(statement->driver_stmt, StatementText, TextLength); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + diff --git a/patches/odbc-remove-unixodbc/0018-odbc32-Forward-SQLGetStmtAttr-W-onto-driver.patch b/patches/odbc-remove-unixodbc/0018-odbc32-Forward-SQLGetStmtAttr-W-onto-driver.patch new file mode 100644 index 00000000..e8fcdbe2 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0018-odbc32-Forward-SQLGetStmtAttr-W-onto-driver.patch @@ -0,0 +1,82 @@ +From e1399a4847627be9772aa411c24f3c9a7269c18d Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 11:04:32 +1100 +Subject: [PATCH 18/42] odbc32: Forward SQLGetStmtAttr/W onto driver + +--- + dlls/odbc32/proxyodbc.c | 32 ++++++++++++++++++++++++++++++-- + 1 file changed, 30 insertions(+), 2 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index b43f2a0f876..ae790cd3651 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -1032,17 +1032,31 @@ SQLRETURN WINAPI SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQL + SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, ++ TRACE("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, + Attribute, Value, BufferLength, StringLength); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ + if (!Value) + { + WARN("Unexpected NULL Value return address\n"); + return SQL_ERROR; + } + ++ if (statement->connection->pSQLGetStmtAttr) ++ { ++ ret = statement->connection->pSQLGetStmtAttr(statement->driver_stmt, Attribute, Value, ++ BufferLength, StringLength); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +@@ -1930,17 +1944,31 @@ SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMA + SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, ++ TRACE("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle, + Attribute, Value, BufferLength, StringLength); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ + if (!Value) + { + WARN("Unexpected NULL Value return address\n"); + return SQL_ERROR; + } + ++ if (statement->connection->pSQLGetStmtAttrW) ++ { ++ ret = statement->connection->pSQLGetStmtAttrW(statement->driver_stmt, Attribute, Value, ++ BufferLength, StringLength); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0019-odbc32-Forward-SQLRowCount-onto-driver.patch b/patches/odbc-remove-unixodbc/0019-odbc32-Forward-SQLRowCount-onto-driver.patch new file mode 100644 index 00000000..cc33f6aa --- /dev/null +++ b/patches/odbc-remove-unixodbc/0019-odbc32-Forward-SQLRowCount-onto-driver.patch @@ -0,0 +1,41 @@ +From 31d7dbc51491735cfadd4732d1a8cc64be18de14 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 11:08:41 +1100 +Subject: [PATCH 19/42] odbc32: Forward SQLRowCount onto driver + +--- + dlls/odbc32/proxyodbc.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index ae790cd3651..32c61eea427 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -1138,10 +1138,23 @@ SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN St + */ + SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(StatementHandle %p, RowCount %p)\n", StatementHandle, RowCount); ++ TRACE("(StatementHandle %p, RowCount %p)\n", StatementHandle, RowCount); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLRowCount) ++ { ++ ret = statement->connection->pSQLRowCount(statement->driver_stmt, RowCount); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0020-odbc32-Forward-SQLNumResultCols-onto-driver.patch b/patches/odbc-remove-unixodbc/0020-odbc32-Forward-SQLNumResultCols-onto-driver.patch new file mode 100644 index 00000000..e7ef6eb3 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0020-odbc32-Forward-SQLNumResultCols-onto-driver.patch @@ -0,0 +1,41 @@ +From 7359117d8a80ac80ca0602ca81a3b2b3ce2d26c1 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 11:10:54 +1100 +Subject: [PATCH 20/42] odbc32: Forward SQLNumResultCols onto driver + +--- + dlls/odbc32/proxyodbc.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 32c61eea427..1d1c575ca11 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -1089,10 +1089,23 @@ SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) + */ + SQLRETURN WINAPI SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnCount) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(StatementHandle %p, ColumnCount %p)\n", StatementHandle, ColumnCount); ++ TRACE("(StatementHandle %p, ColumnCount %p)\n", StatementHandle, ColumnCount); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLNumResultCols) ++ { ++ ret = statement->connection->pSQLNumResultCols(statement->driver_stmt, ColumnCount); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0021-odbc32-Forward-SQLMoreResults-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0021-odbc32-Forward-SQLMoreResults-request-onto-driver.patch new file mode 100644 index 00000000..76d71ded --- /dev/null +++ b/patches/odbc-remove-unixodbc/0021-odbc32-Forward-SQLMoreResults-request-onto-driver.patch @@ -0,0 +1,41 @@ +From 7c1897a48423d319430c3bea7252d2335a1148d5 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 11:12:20 +1100 +Subject: [PATCH 21/42] odbc32: Forward SQLMoreResults request onto driver + +--- + dlls/odbc32/proxyodbc.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 1d1c575ca11..e5b0ae63afb 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -1516,10 +1516,23 @@ SQLRETURN WINAPI SQLForeignKeys(SQLHSTMT hstmt, SQLCHAR *szPkCatalogName, SQLSMA + */ + SQLRETURN WINAPI SQLMoreResults(SQLHSTMT StatementHandle) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(%p)\n", StatementHandle); ++ TRACE("(%p)\n", StatementHandle); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLMoreResults) ++ { ++ ret = statement->connection->pSQLMoreResults(statement->driver_stmt); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0022-odbc32-Forward-SQLDescribeCol-w-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0022-odbc32-Forward-SQLDescribeCol-w-request-onto-driver.patch new file mode 100644 index 00000000..d3099c25 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0022-odbc32-Forward-SQLDescribeCol-w-request-onto-driver.patch @@ -0,0 +1,78 @@ +From 4f1d0d9509469e410e151671da2a8baf53df09b3 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 11:17:59 +1100 +Subject: [PATCH 22/42] odbc32: Forward SQLDescribeCol/w request onto driver + +--- + dlls/odbc32/proxyodbc.c | 35 +++++++++++++++++++++++++++++++++-- + 1 file changed, 33 insertions(+), 2 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index e5b0ae63afb..318aba1cc48 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -606,12 +606,29 @@ SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNum + SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType, + SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) + { ++ struct SQLHSTMT_data *statement = StatementHandle; ++ SQLSMALLINT dummy; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," ++ TRACE("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," + " ColumnSize %p, DecimalDigits %p, Nullable %p)\n", StatementHandle, ColumnNumber, ColumnName, + BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); + ++ if (!NameLength) NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ ++ ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLDescribeCol) ++ { ++ ret = statement->connection->pSQLDescribeCol(statement->driver_stmt, ColumnNumber, ColumnName, ++ BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +@@ -1775,15 +1792,29 @@ SQLRETURN WINAPI SQLDescribeColW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNu + SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType, + SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLSMALLINT dummy; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," ++ TRACE("(StatementHandle %p, ColumnNumber %d, ColumnName %p, BufferLength %d, NameLength %p, DataType %p," + " ColumnSize %p, DecimalDigits %p, Nullable %p)\n", StatementHandle, ColumnNumber, ColumnName, + BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); + + if (!NameLength) NameLength = &dummy; /* workaround for drivers that don't accept NULL NameLength */ + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLDescribeColW) ++ { ++ ret = statement->connection->pSQLDescribeColW(statement->driver_stmt, ColumnNumber, ColumnName, ++ BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0023-odbc32-Forward-SQLColAttributes-W-request-onto-drive.patch b/patches/odbc-remove-unixodbc/0023-odbc32-Forward-SQLColAttributes-W-request-onto-drive.patch new file mode 100644 index 00000000..d50f58c0 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0023-odbc32-Forward-SQLColAttributes-W-request-onto-drive.patch @@ -0,0 +1,100 @@ +From 85be83ac84dea5b5e5aa43770d1c7e78ad07dbd5 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 11:30:58 +1100 +Subject: [PATCH 23/42] odbc32: Forward SQLColAttributes/W request onto driver + +--- + dlls/odbc32/proxyodbc.c | 55 +++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 53 insertions(+), 2 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 318aba1cc48..8360cd0684f 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -1449,11 +1449,26 @@ SQLRETURN WINAPI SQLColAttributes(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLIN + SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, + SQLLEN *pfDesc) + { ++ struct SQLHSTMT_data *statement = hstmt; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol, ++ TRACE("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol, + fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLColAttributes) ++ { ++ ret = statement->connection->pSQLColAttributes(statement->driver_stmt, icol, fDescType, ++ rgbDesc, cbDescMax, pcbDesc, pfDesc); ++ } ++ ++ TRACE("ret %d\n", ret); ++ + return ret; + } + +@@ -1754,6 +1769,21 @@ SQLRETURN WINAPI SQLSetScrollOptions(SQLHSTMT statement_handle, SQLUSMALLINT f_c + return ret; + } + ++static SQLINTEGER map_odbc2_to_3(SQLINTEGER fieldid) ++{ ++ switch( fieldid ) ++ { ++ case SQL_COLUMN_COUNT: ++ return SQL_DESC_COUNT; ++ case SQL_COLUMN_NULLABLE: ++ return SQL_DESC_NULLABLE; ++ case SQL_COLUMN_NAME: ++ return SQL_DESC_NAME; ++ default: ++ return fieldid; ++ } ++} ++ + /************************************************************************* + * SQLColAttributesW [ODBC32.106] + */ +@@ -1761,11 +1791,32 @@ SQLRETURN WINAPI SQLColAttributesW(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLI + SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, + SQLLEN *pfDesc) + { ++ struct SQLHSTMT_data *statement = hstmt; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol, ++ TRACE("(hstmt %p, icol %d, fDescType %d, rgbDesc %p, cbDescMax %d, pcbDesc %p, pfDesc %p)\n", hstmt, icol, + fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ /* Default to ODBC 3.x */ ++ if (statement->connection->pSQLColAttributeW) ++ { ++ fDescType = map_odbc2_to_3(fDescType); ++ ret = statement->connection->pSQLColAttributeW(statement->driver_stmt, icol, fDescType, ++ rgbDesc, cbDescMax, pcbDesc, pfDesc); ++ } ++ else if (statement->connection->pSQLColAttributesW) ++ { ++ ret = statement->connection->pSQLColAttributesW(statement->driver_stmt, icol, fDescType, ++ rgbDesc, cbDescMax, pcbDesc, pfDesc); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0024-odbc32-Forward-SQLNativeSql-W-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0024-odbc32-Forward-SQLNativeSql-W-request-onto-driver.patch new file mode 100644 index 00000000..58d219e8 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0024-odbc32-Forward-SQLNativeSql-W-request-onto-driver.patch @@ -0,0 +1,70 @@ +From 04b5940c19de8c92269f9da73e6d98d9777a3020 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 11:36:33 +1100 +Subject: [PATCH 24/42] odbc32: Forward SQLNativeSql/W request onto driver + +--- + dlls/odbc32/proxyodbc.c | 32 ++++++++++++++++++++++++++++++-- + 1 file changed, 30 insertions(+), 2 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 8360cd0684f..5b63fded654 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -1574,11 +1574,25 @@ SQLRETURN WINAPI SQLMoreResults(SQLHSTMT StatementHandle) + SQLRETURN WINAPI SQLNativeSql(SQLHDBC hdbc, SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLCHAR *szSqlStr, + SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr) + { ++ struct SQLHDBC_data *connection = hdbc; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc, ++ TRACE("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc, + debugstr_an((const char *)szSqlStrIn, cbSqlStrIn), cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr); + ++ if (connection->type != SQL_HANDLE_DBC) ++ { ++ WARN("Wrong handle type %d\n", connection->type); ++ return SQL_ERROR; ++ } ++ ++ if (connection->pSQLNativeSql) ++ { ++ ret = connection->pSQLNativeSql(connection->driver_hdbc, szSqlStrIn, cbSqlStrIn, ++ szSqlStr, cbSqlStrMax, pcbSqlStr); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +@@ -2465,11 +2479,25 @@ SQLRETURN WINAPI SQLForeignKeysW(SQLHSTMT hstmt, SQLWCHAR *szPkCatalogName, SQLS + SQLRETURN WINAPI SQLNativeSqlW(SQLHDBC hdbc, SQLWCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLWCHAR *szSqlStr, + SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr) + { ++ struct SQLHDBC_data *connection = hdbc; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc, ++ TRACE("(hdbc %p, szSqlStrIn %s, cbSqlStrIn %d, szSqlStr %p, cbSqlStrMax %d, pcbSqlStr %p)\n", hdbc, + debugstr_wn(szSqlStrIn, cbSqlStrIn), cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr); + ++ if (connection->type != SQL_HANDLE_DBC) ++ { ++ WARN("Wrong handle type %d\n", connection->type); ++ return SQL_ERROR; ++ } ++ ++ if (connection->pSQLNativeSqlW) ++ { ++ ret = connection->pSQLNativeSqlW(connection->driver_hdbc, szSqlStrIn, cbSqlStrIn, ++ szSqlStr, cbSqlStrMax, pcbSqlStr); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0025-odbc32-Forward-SQLPrepare-W-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0025-odbc32-Forward-SQLPrepare-W-request-onto-driver.patch new file mode 100644 index 00000000..ee2949e3 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0025-odbc32-Forward-SQLPrepare-W-request-onto-driver.patch @@ -0,0 +1,65 @@ +From 95d92cec6ceebb2f3fc7624180f89e7764e2430f Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 11:44:00 +1100 +Subject: odbc32: Forward SQLPrepare/W request onto driver + + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 5b63fded654..fae384ca411 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -1143,11 +1143,25 @@ SQLRETURN WINAPI SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value) + */ + SQLRETURN WINAPI SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + + FIXME("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, +- debugstr_an((const char *)StatementText, TextLength), TextLength); ++ TextLength > 0 ? debugstr_an((const char *)StatementText, TextLength) : debugstr_a((const char *)StatementText), ++ TextLength); ++ ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } + ++ if (statement->connection->pSQLPrepare) ++ { ++ ret = statement->connection->pSQLPrepare(statement->driver_stmt, StatementText, TextLength); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +@@ -1944,11 +1958,25 @@ SQLRETURN WINAPI SQLGetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, + */ + SQLRETURN WINAPI SQLPrepareW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, +- debugstr_wn(StatementText, TextLength), TextLength); ++ TRACE("(StatementHandle %p, StatementText %s, TextLength %d)\n", StatementHandle, ++ TextLength > 0 ? debugstr_wn(StatementText, TextLength) : debugstr_w(StatementText), ++ TextLength); ++ ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } + ++ if (statement->connection->pSQLPrepareW) ++ { ++ ret = statement->connection->pSQLPrepareW(statement->driver_stmt, StatementText, TextLength); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + diff --git a/patches/odbc-remove-unixodbc/0026-odbc32-Implement-SQLFreeStmt.patch b/patches/odbc-remove-unixodbc/0026-odbc32-Implement-SQLFreeStmt.patch new file mode 100644 index 00000000..fe6d4ddd --- /dev/null +++ b/patches/odbc-remove-unixodbc/0026-odbc32-Implement-SQLFreeStmt.patch @@ -0,0 +1,41 @@ +From 20e5843387fd2daf28414b529dddd83dafa23cae Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 11:47:40 +1100 +Subject: [PATCH 26/42] odbc32: Implement SQLFreeStmt + +--- + dlls/odbc32/proxyodbc.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 821c769c865..18efa222945 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -807,10 +807,23 @@ SQLRETURN WINAPI SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle) + */ + SQLRETURN WINAPI SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(StatementHandle %p, Option %d)\n", StatementHandle, Option); ++ TRACE("(StatementHandle %p, Option %d)\n", StatementHandle, Option); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLFreeStmt) ++ { ++ ret = statement->connection->pSQLFreeStmt(statement->driver_stmt, Option); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0027-odbc32-Forward-SQLBindCol-requets-onto-driver.patch b/patches/odbc-remove-unixodbc/0027-odbc32-Forward-SQLBindCol-requets-onto-driver.patch new file mode 100644 index 00000000..07cb1e46 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0027-odbc32-Forward-SQLBindCol-requets-onto-driver.patch @@ -0,0 +1,43 @@ +From 2eed70f4cf636fc2f3e6549d480e8be80b8fcaca Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 11:57:00 +1100 +Subject: [PATCH 27/42] odbc32: Forward SQLBindCol requets onto driver + +--- + dlls/odbc32/proxyodbc.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 18efa222945..48b89731ed0 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -447,11 +447,25 @@ static const char *debugstr_sqllen( SQLLEN len ) + SQLRETURN WINAPI SQLBindCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, + SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", ++ TRACE("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", + StatementHandle, ColumnNumber, TargetType, TargetValue, debugstr_sqllen(BufferLength), StrLen_or_Ind); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLBindCol) ++ { ++ ret = statement->connection->pSQLBindCol(statement->driver_stmt, ColumnNumber, TargetType, ++ TargetValue, BufferLength, StrLen_or_Ind); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0028-odbc32-Forward-SQLExtendedFetch-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0028-odbc32-Forward-SQLExtendedFetch-request-onto-driver.patch new file mode 100644 index 00000000..6967eb07 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0028-odbc32-Forward-SQLExtendedFetch-request-onto-driver.patch @@ -0,0 +1,43 @@ +From 2ad199088b8f666c3d7418eac6ec35e639f8260b Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 12:35:26 +1100 +Subject: [PATCH 28/42] odbc32: Forward SQLExtendedFetch request onto driver + +--- + dlls/odbc32/proxyodbc.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 48b89731ed0..5a03ea3d757 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -1551,11 +1551,25 @@ SQLRETURN WINAPI SQLDescribeParam(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT + SQLRETURN WINAPI SQLExtendedFetch(SQLHSTMT hstmt, SQLUSMALLINT fFetchType, SQLLEN irow, SQLULEN *pcrow, + SQLUSMALLINT *rgfRowStatus) + { ++ struct SQLHSTMT_data *statement = hstmt; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(hstmt %p, fFetchType %d, irow %s, pcrow %p, rgfRowStatus %p)\n", hstmt, fFetchType, debugstr_sqllen(irow), ++ TRACE("(hstmt %p, fFetchType %d, irow %s, pcrow %p, rgfRowStatus %p)\n", hstmt, fFetchType, debugstr_sqllen(irow), + pcrow, rgfRowStatus); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLExtendedFetch) ++ { ++ ret = statement->connection->pSQLExtendedFetch(statement->driver_stmt, fFetchType, irow, ++ pcrow, rgfRowStatus); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0029-odbc32-Forward-SQLExecute-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0029-odbc32-Forward-SQLExecute-request-onto-driver.patch new file mode 100644 index 00000000..362a5dea --- /dev/null +++ b/patches/odbc-remove-unixodbc/0029-odbc32-Forward-SQLExecute-request-onto-driver.patch @@ -0,0 +1,41 @@ +From 04ef2a6e51678a60daac117cec90ed48d5fb3fa6 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 13:14:19 +1100 +Subject: [PATCH 29/42] odbc32: Forward SQLExecute request onto driver + +--- + dlls/odbc32/proxyodbc.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 5a03ea3d757..846b788b76b 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -743,10 +743,23 @@ SQLRETURN WINAPI SQLExecute(SQLHSTMT StatementHandle) + */ + SQLRETURN WINAPI SQLFetch(SQLHSTMT StatementHandle) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(StatementHandle %p)\n", StatementHandle); ++ TRACE("(StatementHandle %p)\n", StatementHandle); ++ ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLFetch) ++ { ++ ret = statement->connection->pSQLFetch(statement->driver_stmt); ++ } + ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0030-odbc32-Forward-SQLGetDiagField-W-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0030-odbc32-Forward-SQLGetDiagField-W-request-onto-driver.patch new file mode 100644 index 00000000..02757360 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0030-odbc32-Forward-SQLGetDiagField-W-request-onto-driver.patch @@ -0,0 +1,80 @@ +From 89c345e13d530c284be111076b5b17abb7d3487b Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 13:15:48 +1100 +Subject: [PATCH 30/42] odbc32: Forward SQLGetDiagField/W request onto driver + +--- + dlls/odbc32/proxyodbc.c | 46 +++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 44 insertions(+), 2 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 846b788b76b..74e5d70cfef 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -963,9 +963,30 @@ SQLRETURN WINAPI SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSM + { + SQLRETURN ret = SQL_ERROR; + +- FIXME("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," ++ TRACE("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," + " StringLength %p)\n", HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength); + ++ if (HandleType == SQL_HANDLE_ENV) ++ { ++ FIXME("Unhandled SQL_HANDLE_ENV records\n"); ++ } ++ else if (HandleType == SQL_HANDLE_DBC) ++ { ++ struct SQLHDBC_data *hdbc = Handle; ++ ++ if (hdbc->pSQLGetDiagField) ++ ret = hdbc->pSQLGetDiagField(HandleType, hdbc->driver_hdbc, RecNumber, DiagIdentifier, ++ DiagInfo, BufferLength, StringLength); ++ } ++ else if (HandleType == SQL_HANDLE_STMT) ++ { ++ struct SQLHSTMT_data *statement = Handle; ++ ++ if (statement->connection->pSQLGetDiagField) ++ ret = statement->connection->pSQLGetDiagField(HandleType, statement->driver_stmt, RecNumber, ++ DiagIdentifier, DiagInfo, BufferLength, StringLength); ++ } ++ + return ret; + } + +@@ -2131,9 +2152,30 @@ SQLRETURN WINAPI SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLS + { + SQLRETURN ret = SQL_ERROR; + +- FIXME("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," ++ TRACE("(HandleType %d, Handle %p, RecNumber %d, DiagIdentifier %d, DiagInfo %p, BufferLength %d," + " StringLength %p)\n", HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength); + ++ if (HandleType == SQL_HANDLE_ENV) ++ { ++ FIXME("Unhandled SQL_HANDLE_ENV records\n"); ++ } ++ else if (HandleType == SQL_HANDLE_DBC) ++ { ++ struct SQLHDBC_data *hdbc = Handle; ++ ++ if (hdbc->pSQLGetDiagFieldW) ++ ret = hdbc->pSQLGetDiagFieldW(HandleType, hdbc->driver_hdbc, RecNumber, DiagIdentifier, ++ DiagInfo, BufferLength, StringLength); ++ } ++ else if (HandleType == SQL_HANDLE_STMT) ++ { ++ struct SQLHSTMT_data *statement = Handle; ++ ++ if (statement->connection->pSQLGetDiagFieldW) ++ ret = statement->connection->pSQLGetDiagFieldW(HandleType, statement->driver_stmt, RecNumber, ++ DiagIdentifier, DiagInfo, BufferLength, StringLength); ++ } ++ + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0031-odbc32-SQLGetStmtAttr-store-some-driver-HDESC-values.patch b/patches/odbc-remove-unixodbc/0031-odbc32-SQLGetStmtAttr-store-some-driver-HDESC-values.patch new file mode 100644 index 00000000..9232c947 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0031-odbc32-SQLGetStmtAttr-store-some-driver-HDESC-values.patch @@ -0,0 +1,124 @@ +From a3e0c12cbbdc7a8a81b5d7278659104d6b4d325a Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 14:00:41 +1100 +Subject: [PATCH 31/42] odbc32: SQLGetStmtAttr store some driver HDESC values + +--- + dlls/odbc32/proxyodbc.c | 81 +++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 78 insertions(+), 3 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 74e5d70cfef..27e4f1a4baa 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -178,11 +178,22 @@ struct SQLHDBC_data + SQLUINTEGER login_timeout; + }; + ++struct SQLHDESC_data ++{ ++ struct SQLHSTMT_data *parent; ++ SQLHDESC driver_hdesc; ++}; ++ + struct SQLHSTMT_data + { + int type; + struct SQLHDBC_data *connection; + SQLHSTMT driver_stmt; ++ ++ struct SQLHDESC_data app_row_desc; ++ struct SQLHDESC_data imp_row_desc; ++ struct SQLHDESC_data app_param_desc; ++ struct SQLHDESC_data imp_param_desc; + }; + + static void connection_bind_sql_funcs(struct SQLHDBC_data *connection) +@@ -1130,8 +1141,40 @@ SQLRETURN WINAPI SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, + + if (statement->connection->pSQLGetStmtAttr) + { +- ret = statement->connection->pSQLGetStmtAttr(statement->driver_stmt, Attribute, Value, ++ switch(Attribute) ++ { ++ case SQL_ATTR_APP_ROW_DESC: ++ statement->app_row_desc.parent = statement; ++ ret = statement->connection->pSQLGetStmtAttr(statement->driver_stmt, Attribute, ++ &statement->app_row_desc.driver_hdesc, ++ BufferLength, StringLength); ++ *((SQLHDESC*)Value) = &statement->app_row_desc; ++ break; ++ case SQL_ATTR_IMP_ROW_DESC: ++ statement->imp_row_desc.parent = statement; ++ ret = statement->connection->pSQLGetStmtAttr(statement->driver_stmt, Attribute, ++ &statement->imp_row_desc.driver_hdesc, ++ BufferLength, StringLength); ++ *((SQLHDESC*)Value) = &statement->imp_row_desc; ++ break; ++ case SQL_ATTR_APP_PARAM_DESC: ++ statement->app_param_desc.parent = statement; ++ ret = statement->connection->pSQLGetStmtAttr(statement->driver_stmt, Attribute, ++ &statement->app_param_desc.driver_hdesc, ++ BufferLength, StringLength); ++ *((SQLHDESC*)Value) = &statement->app_param_desc; ++ break; ++ case SQL_ATTR_IMP_PARAM_DESC: ++ statement->imp_param_desc.parent = statement; ++ ret = statement->connection->pSQLGetStmtAttr(statement->driver_stmt, Attribute, ++ &statement->imp_param_desc.driver_hdesc, ++ BufferLength, StringLength); ++ *((SQLHDESC*)Value) = &statement->imp_param_desc; ++ break; ++ default: ++ ret = statement->connection->pSQLGetStmtAttr(statement->driver_stmt, Attribute, Value, + BufferLength, StringLength); ++ } + } + + TRACE("ret %d\n", ret); +@@ -2221,8 +2264,40 @@ SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, + + if (statement->connection->pSQLGetStmtAttrW) + { +- ret = statement->connection->pSQLGetStmtAttrW(statement->driver_stmt, Attribute, Value, +- BufferLength, StringLength); ++ switch(Attribute) ++ { ++ case SQL_ATTR_APP_ROW_DESC: ++ statement->app_row_desc.parent = statement; ++ ret = statement->connection->pSQLGetStmtAttrW(statement->driver_stmt, Attribute, ++ &statement->app_row_desc.driver_hdesc, ++ BufferLength, StringLength); ++ *((SQLHDESC*)Value) = &statement->app_row_desc; ++ break; ++ case SQL_ATTR_IMP_ROW_DESC: ++ statement->imp_row_desc.parent = statement; ++ ret = statement->connection->pSQLGetStmtAttrW(statement->driver_stmt, Attribute, ++ &statement->imp_row_desc.driver_hdesc, ++ BufferLength, StringLength); ++ *((SQLHDESC*)Value) = &statement->imp_row_desc; ++ break; ++ case SQL_ATTR_APP_PARAM_DESC: ++ statement->app_param_desc.parent = statement; ++ ret = statement->connection->pSQLGetStmtAttrW(statement->driver_stmt, Attribute, ++ &statement->app_param_desc.driver_hdesc, ++ BufferLength, StringLength); ++ *((SQLHDESC*)Value) = &statement->app_param_desc; ++ break; ++ case SQL_ATTR_IMP_PARAM_DESC: ++ statement->imp_param_desc.parent = statement; ++ ret = statement->connection->pSQLGetStmtAttrW(statement->driver_stmt, Attribute, ++ &statement->imp_param_desc.driver_hdesc, ++ BufferLength, StringLength); ++ *((SQLHDESC*)Value) = &statement->imp_param_desc; ++ break; ++ default: ++ ret = statement->connection->pSQLGetStmtAttrW(statement->driver_stmt, Attribute, Value, ++ BufferLength, StringLength); ++ } + } + + TRACE("ret %d\n", ret); +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0032-odbc32-Forward-SQLSetDescFieldW-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0032-odbc32-Forward-SQLSetDescFieldW-request-onto-driver.patch new file mode 100644 index 00000000..82a3fda4 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0032-odbc32-Forward-SQLSetDescFieldW-request-onto-driver.patch @@ -0,0 +1,43 @@ +From d2d566575b786ccaa223e582260a0b33038a8153 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 14:11:44 +1100 +Subject: [PATCH 32/42] odbc32: Forward SQLSetDescFieldW request onto driver + +--- + dlls/odbc32/proxyodbc.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 27e4f1a4baa..7589ba7d9d4 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -2218,6 +2218,7 @@ SQLRETURN WINAPI SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLS + ret = statement->connection->pSQLGetDiagFieldW(HandleType, statement->driver_stmt, RecNumber, + DiagIdentifier, DiagInfo, BufferLength, StringLength); + } ++ TRACE("ret %d\n", ret); + + return ret; + } +@@ -2790,11 +2791,17 @@ SQLRETURN WINAPI SQLDriversW(SQLHENV EnvironmentHandle, SQLUSMALLINT fDirection, + SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, + SQLPOINTER Value, SQLINTEGER BufferLength) + { ++ struct SQLHDESC_data *hdesc = DescriptorHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle, ++ TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle, + RecNumber, FieldIdentifier, Value, BufferLength); + ++ if (hdesc->parent->connection->pSQLSetDescFieldW) ++ ret = hdesc->parent->connection->pSQLSetDescFieldW(hdesc->driver_hdesc, RecNumber, FieldIdentifier, ++ Value, BufferLength); ++ TRACE("ret %d\n", ret); ++ + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0033-odbc32-Forward-SQLGetData-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0033-odbc32-Forward-SQLGetData-request-onto-driver.patch new file mode 100644 index 00000000..9c9e40ae --- /dev/null +++ b/patches/odbc-remove-unixodbc/0033-odbc32-Forward-SQLGetData-request-onto-driver.patch @@ -0,0 +1,43 @@ +From 8d90ba32bbd212d36cbdd47c595c76b4f324d4f8 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 15:13:09 +1100 +Subject: [PATCH 33/42] odbc32: Forward SQLGetData request onto driver + +--- + dlls/odbc32/proxyodbc.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 7589ba7d9d4..4e98c8c7caa 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -926,11 +926,25 @@ 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 SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", ++ TRACE("(StatementHandle %p, ColumnNumber %d, TargetType %d, TargetValue %p, BufferLength %s, StrLen_or_Ind %p)\n", + StatementHandle, ColumnNumber, TargetType, TargetValue, debugstr_sqllen(BufferLength), StrLen_or_Ind); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLGetData) ++ { ++ ret = statement->connection->pSQLGetData(statement->driver_stmt, ColumnNumber, TargetType, ++ TargetValue, BufferLength, StrLen_or_Ind); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0034-odbc32-Forward-SQLGetTypeInfo-W-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0034-odbc32-Forward-SQLGetTypeInfo-W-request-onto-driver.patch new file mode 100644 index 00000000..c7709c0d --- /dev/null +++ b/patches/odbc-remove-unixodbc/0034-odbc32-Forward-SQLGetTypeInfo-W-request-onto-driver.patch @@ -0,0 +1,66 @@ +From edf0a873027a3b95e1bf84750efbb29939aee60e Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 15:23:30 +1100 +Subject: [PATCH 34/42] odbc32: Forward SQLGetTypeInfo/W request onto driver + +--- + dlls/odbc32/proxyodbc.c | 30 ++++++++++++++++++++++++++++-- + 1 file changed, 28 insertions(+), 2 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 4e98c8c7caa..7f8cc57e968 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -1212,10 +1212,23 @@ SQLRETURN WINAPI SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, + */ + SQLRETURN WINAPI SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); ++ TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLGetTypeInfo) ++ { ++ ret = statement->connection->pSQLGetTypeInfo(statement->driver_stmt, DataType); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +@@ -2540,10 +2553,23 @@ SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQ + */ + SQLRETURN WINAPI SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); ++ TRACE("(StatementHandle %p, DataType %d)\n", StatementHandle, DataType); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLGetTypeInfoW) ++ { ++ ret = statement->connection->pSQLGetTypeInfoW(statement->driver_stmt, DataType); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0035-odbc32-Forward-SQLBindParameter-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0035-odbc32-Forward-SQLBindParameter-request-onto-driver.patch new file mode 100644 index 00000000..39676852 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0035-odbc32-Forward-SQLBindParameter-request-onto-driver.patch @@ -0,0 +1,44 @@ +From 4fe0ad96bddd96ff4eb2b3786765ff7a547974d8 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 15:40:24 +1100 +Subject: [PATCH 35/42] odbc32: Forward SQLBindParameter request onto driver + +--- + dlls/odbc32/proxyodbc.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 7f8cc57e968..f73daad254f 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -1901,12 +1901,26 @@ SQLRETURN WINAPI SQLBindParameter(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT + SQLSMALLINT ibScale, SQLPOINTER rgbValue, SQLLEN cbValueMax, + SQLLEN *pcbValue) + { ++ struct SQLHSTMT_data *statement = hstmt; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(hstmt %p, ipar %d, fParamType %d, fCType %d, fSqlType %d, cbColDef %s, ibScale %d, rgbValue %p," ++ TRACE("(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); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLBindParameter) ++ { ++ ret = statement->connection->pSQLBindParameter(statement->driver_stmt, ipar, fParamType, ++ fCType, fSqlType, cbColDef, ibScale, rgbValue, cbValueMax, pcbValue); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0036-odbc32-Forward-SQLTransact-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0036-odbc32-Forward-SQLTransact-request-onto-driver.patch new file mode 100644 index 00000000..e6c79a3b --- /dev/null +++ b/patches/odbc-remove-unixodbc/0036-odbc32-Forward-SQLTransact-request-onto-driver.patch @@ -0,0 +1,42 @@ +From 0930c5f0fe4e4608957cc5c16c2d8e63d805d5e4 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Mon, 6 Feb 2023 16:03:58 +1100 +Subject: [PATCH 36/42] odbc32: Forward SQLTransact request onto driver + +--- + dlls/odbc32/proxyodbc.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index f73daad254f..c73912b38cf 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -1550,11 +1550,24 @@ SQLRETURN WINAPI SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSM + */ + SQLRETURN WINAPI SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType) + { ++ struct SQLHDBC_data *connection = ConnectionHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(EnvironmentHandle %p, ConnectionHandle %p, CompletionType %d)\n", EnvironmentHandle, ConnectionHandle, ++ TRACE("(EnvironmentHandle %p, ConnectionHandle %p, CompletionType %d)\n", EnvironmentHandle, ConnectionHandle, + CompletionType); + ++ if (connection->type != SQL_HANDLE_DBC) ++ { ++ WARN("Wrong connection handle type %d\n", connection->type); ++ return SQL_ERROR; ++ } ++ ++ if (connection->pSQLTransact) ++ { ++ ret = connection->pSQLTransact(connection->driver_env, connection->driver_hdbc, CompletionType); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0037-odbc32-Forward-SQLGetDiagRecW-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0037-odbc32-Forward-SQLGetDiagRecW-request-onto-driver.patch new file mode 100644 index 00000000..46fade58 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0037-odbc32-Forward-SQLGetDiagRecW-request-onto-driver.patch @@ -0,0 +1,54 @@ +From 5fa88dabafbfb905553310a211a2701ad17f6df6 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Tue, 7 Feb 2023 14:18:20 +1100 +Subject: [PATCH 37/42] odbc32: Forward SQLGetDiagRecW request onto driver + +--- + dlls/odbc32/proxyodbc.c | 28 +++++++++++++++++++++++++++- + 1 file changed, 27 insertions(+), 1 deletion(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index c73912b38cf..bdd8361d221 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -2286,10 +2286,36 @@ SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMA + { + SQLRETURN ret = SQL_ERROR; + +- FIXME("(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, + TextLength); + ++ if (HandleType == SQL_HANDLE_ENV) ++ { ++ FIXME("Unhandled SQL_HANDLE_ENV records\n"); ++ } ++ else if (HandleType == SQL_HANDLE_DBC) ++ { ++ struct SQLHDBC_data *hdbc = Handle; ++ ++ if (hdbc->pSQLGetDiagRecW) ++ ret = hdbc->pSQLGetDiagRecW(HandleType, hdbc->driver_hdbc, RecNumber, Sqlstate, ++ NativeError, MessageText, BufferLength, TextLength); ++ } ++ else if (HandleType == SQL_HANDLE_STMT) ++ { ++ struct SQLHSTMT_data *statement = Handle; ++ ++ if (statement->connection->pSQLGetDiagRecW) ++ ret = statement->connection->pSQLGetDiagRecW(HandleType, statement->driver_stmt, RecNumber, ++ Sqlstate, NativeError, MessageText, BufferLength, TextLength); ++ } ++ ++ if (ret != SQL_ERROR) ++ { ++ TRACE("%d: %s %s\n", RecNumber, debugstr_w(Sqlstate), debugstr_w(MessageText)); ++ } ++ + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0038-odbc32-SQLGetEnvAttr-Support-SQL_ATTR_ODBC_VERSION-a.patch b/patches/odbc-remove-unixodbc/0038-odbc32-SQLGetEnvAttr-Support-SQL_ATTR_ODBC_VERSION-a.patch new file mode 100644 index 00000000..085d2407 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0038-odbc32-SQLGetEnvAttr-Support-SQL_ATTR_ODBC_VERSION-a.patch @@ -0,0 +1,61 @@ +From 99696a933b6393903df0aa314190a220cea635ac Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Wed, 8 Feb 2023 08:39:26 +1100 +Subject: [PATCH 38/42] odbc32: SQLGetEnvAttr: Support SQL_ATTR_ODBC_VERSION + attribute + +--- + dlls/odbc32/proxyodbc.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index bdd8361d221..46872add8b0 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -47,6 +47,7 @@ struct SQLHENV_data + { + int type; + SQLUINTEGER pooling; ++ SQLUINTEGER version; + }; + + struct SQLHDBC_data +@@ -368,6 +369,7 @@ SQLRETURN WINAPI SQLAllocEnv(SQLHENV *EnvironmentHandle) + + henv->type = SQL_HANDLE_ENV; + henv->pooling = SQL_CP_OFF; ++ henv->version = SQL_OV_ODBC2; + + *EnvironmentHandle = henv; + +@@ -1067,6 +1069,14 @@ SQLRETURN WINAPI SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, + } + *(SQLUINTEGER*)Value = data->pooling; + break; ++ case SQL_ATTR_ODBC_VERSION: ++ if (BufferLength != sizeof(data->version)) ++ { ++ WARN("Invalid buffer size\n"); ++ return SQL_ERROR; ++ } ++ *(SQLUINTEGER*)Value = data->version; ++ break; + default: + FIXME("Unhandle attribute %d\n", Attribute); + return SQL_ERROR; +@@ -1426,6 +1436,12 @@ SQLRETURN WINAPI SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, + else + data->pooling = SQL_CP_OFF; + break; ++ case SQL_ATTR_ODBC_VERSION: ++ if (Value) ++ data->version = (uintptr_t)Value; ++ else ++ data->version = SQL_OV_ODBC2; ++ break; + default: + FIXME("Unhandle attribute %d\n", Attribute); + return SQL_ERROR; +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0039-odbc32-Pass-ODBC-version-when-creating-driver-enviro.patch b/patches/odbc-remove-unixodbc/0039-odbc32-Pass-ODBC-version-when-creating-driver-enviro.patch new file mode 100644 index 00000000..cadc7996 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0039-odbc32-Pass-ODBC-version-when-creating-driver-enviro.patch @@ -0,0 +1,29 @@ +From 51a3447adf38839ab44b8b7e91baf5de66055125 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Wed, 8 Feb 2023 09:03:40 +1100 +Subject: [PATCH 39/42] odbc32: Pass ODBC version when creating driver + environment + +--- + dlls/odbc32/proxyodbc.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 46872add8b0..851d2535ca1 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -2552,6 +2552,11 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl + if (connection->pSQLAllocHandle) + { + connection->pSQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &connection->driver_env); ++ ++ if (connection->pSQLSetEnvAttr) ++ connection->pSQLSetEnvAttr(connection->driver_env, SQL_ATTR_ODBC_VERSION, ++ (SQLPOINTER)connection->environment->version, 0); ++ + connection->pSQLAllocHandle(SQL_HANDLE_DBC, connection->driver_env, &connection->driver_hdbc); + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0040-odbc32-SQLBindCol-convert-to-ODBC2-types-if-required.patch b/patches/odbc-remove-unixodbc/0040-odbc32-SQLBindCol-convert-to-ODBC2-types-if-required.patch new file mode 100644 index 00000000..496fbe19 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0040-odbc32-SQLBindCol-convert-to-ODBC2-types-if-required.patch @@ -0,0 +1,37 @@ +From e73aae5f26b1af29ce14f3edaa84569bd3c86bc4 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Wed, 8 Feb 2023 14:16:24 +1100 +Subject: [PATCH 40/42] odbc32: SQLBindCol convert to ODBC2 types if required + +--- + dlls/odbc32/proxyodbc.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 851d2535ca1..c6d19b58e1c 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -474,6 +474,20 @@ SQLRETURN WINAPI SQLBindCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, + + if (statement->connection->pSQLBindCol) + { ++ /* ++ * Map ODBC3 Datatype back to ODBC2 types when the application has asked for SQL_OV_ODBC2. ++ * Some drivers rely on this (PostgreSQL odbc driver). ++ */ ++ if (statement->connection->environment->version == SQL_OV_ODBC2) ++ { ++ if(TargetType == SQL_C_TYPE_TIME) ++ TargetType = SQL_C_TIME; ++ else if(TargetType == SQL_C_TYPE_DATE) ++ TargetType = SQL_C_DATE; ++ else if(TargetType == SQL_C_TYPE_TIMESTAMP) ++ TargetType = SQL_C_TIMESTAMP; ++ } ++ + ret = statement->connection->pSQLBindCol(statement->driver_stmt, ColumnNumber, TargetType, + TargetValue, BufferLength, StrLen_or_Ind); + } +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0041-odbc32-Implement-SQLAllocHandle.patch b/patches/odbc-remove-unixodbc/0041-odbc32-Implement-SQLAllocHandle.patch new file mode 100644 index 00000000..11e48a74 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0041-odbc32-Implement-SQLAllocHandle.patch @@ -0,0 +1,40 @@ +From dca052a02225fb151237d0ba36dbf35d3fdab4fe Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Wed, 8 Feb 2023 15:22:00 +1100 +Subject: [PATCH 41/42] odbc32: Implement SQLAllocHandle + +--- + dlls/odbc32/proxyodbc.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index c6d19b58e1c..15171a0d028 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -383,9 +383,22 @@ SQLRETURN WINAPI SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, S + { + SQLRETURN ret = SQL_ERROR; + +- FIXME("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); ++ TRACE("(HandleType %d, InputHandle %p, OutputHandle %p)\n", HandleType, InputHandle, OutputHandle); + + *OutputHandle = 0; ++ if (HandleType == SQL_HANDLE_ENV) ++ { ++ ret = SQLAllocEnv(OutputHandle); ++ } ++ else if (HandleType == SQL_HANDLE_DBC) ++ { ++ ret = SQLAllocConnect(InputHandle, OutputHandle); ++ } ++ else if (HandleType == SQL_HANDLE_STMT) ++ { ++ ret = SQLAllocStmt(InputHandle, OutputHandle); ++ } ++ + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0042-odbc32-Forward-SQLConnectW-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0042-odbc32-Forward-SQLConnectW-request-onto-driver.patch new file mode 100644 index 00000000..72de211c --- /dev/null +++ b/patches/odbc-remove-unixodbc/0042-odbc32-Forward-SQLConnectW-request-onto-driver.patch @@ -0,0 +1,48 @@ +From ec35258befb2b050e2cd2087dc6ea9ea66155403 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Wed, 8 Feb 2023 15:34:18 +1100 +Subject: [PATCH 42/42] odbc32: Forward SQLConnectW request onto driver + +--- + dlls/odbc32/proxyodbc.c | 22 +++++++++++++++++++--- + 1 file changed, 19 insertions(+), 3 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 15171a0d028..6f6d502e772 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -2069,12 +2069,28 @@ SQLRETURN WINAPI SQLConnectW(SQLHDBC ConnectionHandle, WCHAR *ServerName, SQLSMA + WCHAR *UserName, SQLSMALLINT NameLength2, WCHAR *Authentication, + SQLSMALLINT NameLength3) + { ++ struct SQLHDBC_data *connection = ConnectionHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(ConnectionHandle %p, ServerName %s, NameLength1 %d, UserName %s, NameLength2 %d, Authentication %s," +- " NameLength3 %d)\n", ConnectionHandle, debugstr_wn(ServerName, NameLength1), NameLength1, +- debugstr_wn(UserName, NameLength2), NameLength2, debugstr_wn(Authentication, NameLength3), NameLength3); ++ TRACE("(ConnectionHandle %p, ServerName %s, NameLength1 %d, UserName %s, NameLength2 %d, Authentication %s," ++ " NameLength3 %d)\n", ConnectionHandle, ++ NameLength1 > 0 ? debugstr_wn(ServerName, NameLength1) : debugstr_w(ServerName), NameLength1, ++ NameLength2 > 0 ? debugstr_wn(UserName, NameLength2) : debugstr_w(UserName), NameLength2, ++ NameLength3 > 0 ? debugstr_wn(Authentication, NameLength3) : debugstr_w(Authentication), NameLength3); + ++ if (!connection || connection->type != SQL_HANDLE_DBC) ++ { ++ WARN("Wrong handle type %d\n", connection ? connection->type : 0); ++ return SQL_ERROR; ++ } ++ ++ if (connection->pSQLConnectW) ++ { ++ ret = connection->pSQLConnectW(connection->driver_hdbc, ServerName, NameLength1, ++ UserName, NameLength2, Authentication, NameLength3); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/0043-odbc32-Forward-SQLColAttribute-W-request-onto-driver.patch b/patches/odbc-remove-unixodbc/0043-odbc32-Forward-SQLColAttribute-W-request-onto-driver.patch new file mode 100644 index 00000000..1c6dafb3 --- /dev/null +++ b/patches/odbc-remove-unixodbc/0043-odbc32-Forward-SQLColAttribute-W-request-onto-driver.patch @@ -0,0 +1,72 @@ +From 5e0d8ba8d698d404b1b16076a76cbb3e17b616c0 Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Wed, 8 Feb 2023 20:19:44 +1100 +Subject: [PATCH] odbc32: Forward SQLColAttribute/W request onto driver + +--- + dlls/odbc32/proxyodbc.c | 32 ++++++++++++++++++++++++++++++-- + 1 file changed, 30 insertions(+), 2 deletions(-) + +diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c +index 6f6d502e772..d33dbac8b2b 100644 +--- a/dlls/odbc32/proxyodbc.c ++++ b/dlls/odbc32/proxyodbc.c +@@ -566,12 +566,26 @@ SQLRETURN WINAPI SQLColAttribute(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNu + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, + SQLLEN *NumericAttribute) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttribute %p, BufferLength %d," ++ TRACE("(StatementHandle %p, ColumnNumber %d, FieldIdentifier %d, CharacterAttribute %p, BufferLength %d," + " StringLength %p, NumericAttribute %p)\n", StatementHandle, ColumnNumber, FieldIdentifier, + CharacterAttribute, BufferLength, StringLength, NumericAttribute); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLColAttribute) ++ { ++ ret = statement->connection->pSQLColAttribute(statement->driver_stmt, ColumnNumber, FieldIdentifier, ++ CharacterAttribute, BufferLength, StringLength, NumericAttribute); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +@@ -2230,12 +2244,26 @@ SQLRETURN WINAPI SQLColAttributeW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnN + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, + SQLLEN *NumericAttribute) + { ++ struct SQLHSTMT_data *statement = StatementHandle; + SQLRETURN ret = SQL_ERROR; + +- FIXME("StatementHandle %p ColumnNumber %d FieldIdentifier %d CharacterAttribute %p BufferLength %d" ++ TRACE("StatementHandle %p ColumnNumber %d FieldIdentifier %d CharacterAttribute %p BufferLength %d" + " StringLength %p NumericAttribute %p\n", StatementHandle, ColumnNumber, FieldIdentifier, + CharacterAttribute, BufferLength, StringLength, NumericAttribute); + ++ if (statement->type != SQL_HANDLE_STMT) ++ { ++ WARN("Wrong handle type %d\n", statement->type); ++ return SQL_ERROR; ++ } ++ ++ if (statement->connection->pSQLColAttributeW) ++ { ++ ret = statement->connection->pSQLColAttributeW(statement->driver_stmt, ColumnNumber, FieldIdentifier, ++ CharacterAttribute, BufferLength, StringLength, NumericAttribute); ++ } ++ ++ TRACE("ret %d\n", ret); + return ret; + } + +-- +2.39.1 + diff --git a/patches/odbc-remove-unixodbc/definition b/patches/odbc-remove-unixodbc/definition new file mode 100644 index 00000000..78401d59 --- /dev/null +++ b/patches/odbc-remove-unixodbc/definition @@ -0,0 +1 @@ +Fixes: [54499] Support native ODBC drivers.