mfreadwrite/reader: Add missing allocation check (Coverity).
[wine/zf.git] / dlls / odbc32 / unixlib.c
blobcde104aa29a2b4137714174c36fb9e64689825bc
1 /*
2 * Win32 ODBC functions
4 * Copyright 1999 Xiang Li, Corel Corporation
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 * NOTES:
21 * Proxy ODBC driver manager. This manager delegates all ODBC
22 * calls to a real ODBC driver manager named by the environment
23 * variable LIB_ODBC_DRIVER_MANAGER, or to libodbc.so if the
24 * variable is not set.
27 #if 0
28 #pragma makedep unix
29 #endif
31 #include "config.h"
32 #include "wine/port.h"
34 #include <stdarg.h>
35 #include <stdlib.h>
37 #include "ntstatus.h"
38 #define WIN32_NO_STATUS
39 #include "windef.h"
40 #include "winbase.h"
41 #include "winternl.h"
42 #include "wine/debug.h"
43 #include "sql.h"
44 #include "sqltypes.h"
45 #include "sqlext.h"
47 #include "unixlib.h"
48 #include "wine/debug.h"
50 WINE_DECLARE_DEBUG_CHANNEL(winediag);
52 static SQLRETURN (*pSQLAllocConnect)(SQLHENV,SQLHDBC*);
53 static SQLRETURN (*pSQLAllocEnv)(SQLHENV*);
54 static SQLRETURN (*pSQLAllocHandle)(SQLSMALLINT,SQLHANDLE,SQLHANDLE*);
55 static SQLRETURN (*pSQLAllocHandleStd)(SQLSMALLINT,SQLHANDLE,SQLHANDLE*);
56 static SQLRETURN (*pSQLAllocStmt)(SQLHDBC,SQLHSTMT*);
57 static SQLRETURN (*pSQLBindCol)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*);
58 static SQLRETURN (*pSQLBindParam)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN*);
59 static SQLRETURN (*pSQLBindParameter)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*);
60 static SQLRETURN (*pSQLBrowseConnect)(SQLHDBC,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
61 static SQLRETURN (*pSQLBrowseConnectW)(SQLHDBC,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
62 static SQLRETURN (*pSQLBulkOperations)(SQLHSTMT,SQLSMALLINT);
63 static SQLRETURN (*pSQLCancel)(SQLHSTMT);
64 static SQLRETURN (*pSQLCloseCursor)(SQLHSTMT);
65 static SQLRETURN (*pSQLColAttribute)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*);
66 static SQLRETURN (*pSQLColAttributeW)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*);
67 static SQLRETURN (*pSQLColAttributes)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*);
68 static SQLRETURN (*pSQLColAttributesW)(SQLHSTMT,SQLUSMALLINT,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*,SQLLEN*);
69 static SQLRETURN (*pSQLColumnPrivileges)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
70 static SQLRETURN (*pSQLColumnPrivilegesW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
71 static SQLRETURN (*pSQLColumns)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
72 static SQLRETURN (*pSQLColumnsW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
73 static SQLRETURN (*pSQLConnect)(SQLHDBC,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
74 static SQLRETURN (*pSQLConnectW)(SQLHDBC,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
75 static SQLRETURN (*pSQLCopyDesc)(SQLHDESC,SQLHDESC);
76 static SQLRETURN (*pSQLDataSources)(SQLHENV,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
77 static SQLRETURN (*pSQLDataSourcesA)(SQLHENV,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
78 static SQLRETURN (*pSQLDataSourcesW)(SQLHENV,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
79 static SQLRETURN (*pSQLDescribeCol)(SQLHSTMT,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*);
80 static SQLRETURN (*pSQLDescribeColW)(SQLHSTMT,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*);
81 static SQLRETURN (*pSQLDescribeParam)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT*,SQLULEN*,SQLSMALLINT*,SQLSMALLINT*);
82 static SQLRETURN (*pSQLDisconnect)(SQLHDBC);
83 static SQLRETURN (*pSQLDriverConnect)(SQLHDBC,SQLHWND,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLUSMALLINT);
84 static SQLRETURN (*pSQLDriverConnectW)(SQLHDBC,SQLHWND,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLUSMALLINT);
85 static SQLRETURN (*pSQLDrivers)(SQLHENV,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
86 static SQLRETURN (*pSQLDriversW)(SQLHENV,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
87 static SQLRETURN (*pSQLEndTran)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT);
88 static SQLRETURN (*pSQLError)(SQLHENV,SQLHDBC,SQLHSTMT,SQLCHAR*,SQLINTEGER*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
89 static SQLRETURN (*pSQLErrorW)(SQLHENV,SQLHDBC,SQLHSTMT,SQLWCHAR*,SQLINTEGER*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
90 static SQLRETURN (*pSQLExecDirect)(SQLHSTMT,SQLCHAR*,SQLINTEGER);
91 static SQLRETURN (*pSQLExecDirectW)(SQLHSTMT,SQLWCHAR*,SQLINTEGER);
92 static SQLRETURN (*pSQLExecute)(SQLHSTMT);
93 static SQLRETURN (*pSQLExtendedFetch)(SQLHSTMT,SQLUSMALLINT,SQLLEN,SQLULEN*,SQLUSMALLINT*);
94 static SQLRETURN (*pSQLFetch)(SQLHSTMT);
95 static SQLRETURN (*pSQLFetchScroll)(SQLHSTMT,SQLSMALLINT,SQLLEN);
96 static SQLRETURN (*pSQLForeignKeys)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
97 static SQLRETURN (*pSQLForeignKeysW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
98 static SQLRETURN (*pSQLFreeConnect)(SQLHDBC);
99 static SQLRETURN (*pSQLFreeEnv)(SQLHENV);
100 static SQLRETURN (*pSQLFreeHandle)(SQLSMALLINT,SQLHANDLE);
101 static SQLRETURN (*pSQLFreeStmt)(SQLHSTMT,SQLUSMALLINT);
102 static SQLRETURN (*pSQLGetConnectAttr)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
103 static SQLRETURN (*pSQLGetConnectAttrW)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
104 static SQLRETURN (*pSQLGetConnectOption)(SQLHDBC,SQLUSMALLINT,SQLPOINTER);
105 static SQLRETURN (*pSQLGetConnectOptionW)(SQLHDBC,SQLUSMALLINT,SQLPOINTER);
106 static SQLRETURN (*pSQLGetCursorName)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
107 static SQLRETURN (*pSQLGetCursorNameW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
108 static SQLRETURN (*pSQLGetData)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN,SQLLEN*);
109 static SQLRETURN (*pSQLGetDescField)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
110 static SQLRETURN (*pSQLGetDescFieldW)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
111 static SQLRETURN (*pSQLGetDescRec)(SQLHDESC,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*,SQLLEN*,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*);
112 static SQLRETURN (*pSQLGetDescRecW)(SQLHDESC,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*,SQLLEN*,SQLSMALLINT*,SQLSMALLINT*,SQLSMALLINT*);
113 static SQLRETURN (*pSQLGetDiagField)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*);
114 static SQLRETURN (*pSQLGetDiagFieldW)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*);
115 static SQLRETURN (*pSQLGetDiagRec)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLCHAR*,SQLINTEGER*,SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
116 static SQLRETURN (*pSQLGetDiagRecA)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLCHAR*,SQLINTEGER*, SQLCHAR*,SQLSMALLINT,SQLSMALLINT*);
117 static SQLRETURN (*pSQLGetDiagRecW)(SQLSMALLINT,SQLHANDLE,SQLSMALLINT,SQLWCHAR*,SQLINTEGER*,SQLWCHAR*,SQLSMALLINT,SQLSMALLINT*);
118 static SQLRETURN (*pSQLGetEnvAttr)(SQLHENV,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
119 static SQLRETURN (*pSQLGetFunctions)(SQLHDBC,SQLUSMALLINT,SQLUSMALLINT*);
120 static SQLRETURN (*pSQLGetInfo)(SQLHDBC,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*);
121 static SQLRETURN (*pSQLGetInfoW)(SQLHDBC,SQLUSMALLINT,SQLPOINTER,SQLSMALLINT,SQLSMALLINT*);
122 static SQLRETURN (*pSQLGetStmtAttr)(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
123 static SQLRETURN (*pSQLGetStmtAttrW)(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER,SQLINTEGER*);
124 static SQLRETURN (*pSQLGetStmtOption)(SQLHSTMT,SQLUSMALLINT,SQLPOINTER);
125 static SQLRETURN (*pSQLGetTypeInfo)(SQLHSTMT,SQLSMALLINT);
126 static SQLRETURN (*pSQLGetTypeInfoW)(SQLHSTMT,SQLSMALLINT);
127 static SQLRETURN (*pSQLMoreResults)(SQLHSTMT);
128 static SQLRETURN (*pSQLNativeSql)(SQLHDBC,SQLCHAR*,SQLINTEGER,SQLCHAR*,SQLINTEGER,SQLINTEGER*);
129 static SQLRETURN (*pSQLNativeSqlW)(SQLHDBC,SQLWCHAR*,SQLINTEGER,SQLWCHAR*,SQLINTEGER,SQLINTEGER*);
130 static SQLRETURN (*pSQLNumParams)(SQLHSTMT,SQLSMALLINT*);
131 static SQLRETURN (*pSQLNumResultCols)(SQLHSTMT,SQLSMALLINT*);
132 static SQLRETURN (*pSQLParamData)(SQLHSTMT,SQLPOINTER*);
133 static SQLRETURN (*pSQLParamOptions)(SQLHSTMT,SQLULEN,SQLULEN*);
134 static SQLRETURN (*pSQLPrepare)(SQLHSTMT,SQLCHAR*,SQLINTEGER);
135 static SQLRETURN (*pSQLPrepareW)(SQLHSTMT,SQLWCHAR*,SQLINTEGER);
136 static SQLRETURN (*pSQLPrimaryKeys)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
137 static SQLRETURN (*pSQLPrimaryKeysW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
138 static SQLRETURN (*pSQLProcedureColumns)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
139 static SQLRETURN (*pSQLProcedureColumnsW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
140 static SQLRETURN (*pSQLProcedures)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
141 static SQLRETURN (*pSQLProceduresW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
142 static SQLRETURN (*pSQLPutData)(SQLHSTMT,SQLPOINTER,SQLLEN);
143 static SQLRETURN (*pSQLRowCount)(SQLHSTMT,SQLLEN*);
144 static SQLRETURN (*pSQLSetConnectAttr)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER);
145 static SQLRETURN (*pSQLSetConnectAttrW)(SQLHDBC,SQLINTEGER,SQLPOINTER,SQLINTEGER);
146 static SQLRETURN (*pSQLSetConnectOption)(SQLHDBC,SQLUSMALLINT,SQLULEN);
147 static SQLRETURN (*pSQLSetConnectOptionW)(SQLHDBC,SQLUSMALLINT,SQLULEN);
148 static SQLRETURN (*pSQLSetCursorName)(SQLHSTMT,SQLCHAR*,SQLSMALLINT);
149 static SQLRETURN (*pSQLSetCursorNameW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT);
150 static SQLRETURN (*pSQLSetDescField)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER);
151 static SQLRETURN (*pSQLSetDescFieldW)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLINTEGER);
152 static SQLRETURN (*pSQLSetDescRec)(SQLHDESC,SQLSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLLEN,SQLSMALLINT,SQLSMALLINT,SQLPOINTER,SQLLEN*,SQLLEN*);
153 static SQLRETURN (*pSQLSetEnvAttr)(SQLHENV,SQLINTEGER,SQLPOINTER,SQLINTEGER);
154 static SQLRETURN (*pSQLSetParam)(SQLHSTMT,SQLUSMALLINT,SQLSMALLINT,SQLSMALLINT,SQLULEN,SQLSMALLINT,SQLPOINTER,SQLLEN*);
155 static SQLRETURN (*pSQLSetPos)(SQLHSTMT,SQLSETPOSIROW,SQLUSMALLINT,SQLUSMALLINT);
156 static SQLRETURN (*pSQLSetScrollOptions)(SQLHSTMT,SQLUSMALLINT,SQLLEN,SQLUSMALLINT);
157 static SQLRETURN (*pSQLSetStmtAttr)(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER);
158 static SQLRETURN (*pSQLSetStmtAttrW)(SQLHSTMT,SQLINTEGER,SQLPOINTER,SQLINTEGER);
159 static SQLRETURN (*pSQLSetStmtOption)(SQLHSTMT,SQLUSMALLINT,SQLULEN);
160 static SQLRETURN (*pSQLSpecialColumns)(SQLHSTMT,SQLUSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT);
161 static SQLRETURN (*pSQLSpecialColumnsW)(SQLHSTMT,SQLUSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT);
162 static SQLRETURN (*pSQLStatistics)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT);
163 static SQLRETURN (*pSQLStatisticsW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLUSMALLINT,SQLUSMALLINT);
164 static SQLRETURN (*pSQLTablePrivileges)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
165 static SQLRETURN (*pSQLTablePrivilegesW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
166 static SQLRETURN (*pSQLTables)(SQLHSTMT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT,SQLCHAR*,SQLSMALLINT);
167 static SQLRETURN (*pSQLTablesW)(SQLHSTMT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT,SQLWCHAR*,SQLSMALLINT);
168 static SQLRETURN (*pSQLTransact)(SQLHENV,SQLHDBC,SQLUSMALLINT);
171 static SQLRETURN WINAPI wrap_SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionHandle)
173 return pSQLAllocConnect(EnvironmentHandle, ConnectionHandle);
176 static SQLRETURN WINAPI wrap_SQLAllocEnv(SQLHENV *EnvironmentHandle)
178 return pSQLAllocEnv(EnvironmentHandle);
181 static SQLRETURN WINAPI wrap_SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle)
183 return pSQLAllocHandle(HandleType, InputHandle, OutputHandle);
186 static SQLRETURN WINAPI wrap_SQLAllocHandleStd(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle)
188 return pSQLAllocHandleStd(HandleType, InputHandle, OutputHandle);
191 static SQLRETURN WINAPI wrap_SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandle)
193 return pSQLAllocStmt(ConnectionHandle, StatementHandle);
196 static SQLRETURN WINAPI wrap_SQLBindCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
197 SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind)
199 return pSQLBindCol(StatementHandle, ColumnNumber, TargetType, TargetValue, BufferLength, StrLen_or_Ind);
202 static SQLRETURN WINAPI wrap_SQLBindParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
203 SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale,
204 SQLPOINTER ParameterValue, SQLLEN *StrLen_or_Ind)
206 return pSQLBindParam(StatementHandle, ParameterNumber, ValueType, ParameterType, LengthPrecision, ParameterScale,
207 ParameterValue, StrLen_or_Ind);
210 static SQLRETURN WINAPI wrap_SQLBindParameter(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT fParamType,
211 SQLSMALLINT fCType, SQLSMALLINT fSqlType, SQLULEN cbColDef,
212 SQLSMALLINT ibScale, SQLPOINTER rgbValue, SQLLEN cbValueMax,
213 SQLLEN *pcbValue)
215 return pSQLBindParameter(hstmt, ipar, fParamType, fCType, fSqlType, cbColDef, ibScale, rgbValue, cbValueMax,
216 pcbValue);
219 static SQLRETURN WINAPI wrap_SQLBrowseConnect(SQLHDBC hdbc, SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn,
220 SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax,
221 SQLSMALLINT *pcbConnStrOut)
223 return pSQLBrowseConnect(hdbc, szConnStrIn, cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut);
226 static SQLRETURN WINAPI wrap_SQLBrowseConnectW(SQLHDBC hdbc, SQLWCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn,
227 SQLWCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax,
228 SQLSMALLINT *pcbConnStrOut)
230 return pSQLBrowseConnectW(hdbc, szConnStrIn, cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut);
233 static SQLRETURN WINAPI wrap_SQLBulkOperations(SQLHSTMT StatementHandle, SQLSMALLINT Operation)
235 return pSQLBulkOperations(StatementHandle, Operation);
238 static SQLRETURN WINAPI wrap_SQLCancel(SQLHSTMT StatementHandle)
240 return pSQLCancel(StatementHandle);
243 static SQLRETURN WINAPI wrap_SQLCloseCursor(SQLHSTMT StatementHandle)
245 return pSQLCloseCursor(StatementHandle);
248 static SQLRETURN WINAPI wrap_SQLColAttribute(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber,
249 SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttribute,
250 SQLSMALLINT BufferLength, SQLSMALLINT *StringLength,
251 SQLLEN *NumericAttribute)
253 return pSQLColAttribute(StatementHandle, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength,
254 StringLength, NumericAttribute);
257 static SQLRETURN WINAPI wrap_SQLColAttributeW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber,
258 SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttribute,
259 SQLSMALLINT BufferLength, SQLSMALLINT *StringLength,
260 SQLLEN *NumericAttribute)
262 return pSQLColAttributeW(StatementHandle, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength,
263 StringLength, NumericAttribute);
266 static SQLRETURN WINAPI wrap_SQLColAttributes(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType,
267 SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc,
268 SQLLEN *pfDesc)
270 return pSQLColAttributes(hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc);
273 static SQLRETURN WINAPI wrap_SQLColAttributesW(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType,
274 SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc,
275 SQLLEN *pfDesc)
277 return pSQLColAttributesW(hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc);
280 static SQLRETURN WINAPI wrap_SQLColumnPrivileges(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
281 SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName,
282 SQLSMALLINT cbTableName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName)
284 return pSQLColumnPrivileges(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
285 szTableName, cbTableName, szColumnName, cbColumnName);
288 static SQLRETURN WINAPI wrap_SQLColumnPrivilegesW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
289 SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName,
290 SQLSMALLINT cbTableName, SQLWCHAR *szColumnName, SQLSMALLINT cbColumnName)
292 return pSQLColumnPrivilegesW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName,
293 cbTableName, szColumnName, cbColumnName);
296 static SQLRETURN WINAPI wrap_SQLColumns(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
297 SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName,
298 SQLSMALLINT NameLength3, SQLCHAR *ColumnName, SQLSMALLINT NameLength4)
300 return pSQLColumns(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, TableName,
301 NameLength3, ColumnName, NameLength4);
304 static SQLRETURN WINAPI wrap_SQLColumnsW(SQLHSTMT StatementHandle, WCHAR *CatalogName, SQLSMALLINT NameLength1,
305 WCHAR *SchemaName, SQLSMALLINT NameLength2, WCHAR *TableName,
306 SQLSMALLINT NameLength3, WCHAR *ColumnName, SQLSMALLINT NameLength4)
308 return pSQLColumnsW(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, TableName, NameLength3,
309 ColumnName, NameLength4);
312 static SQLRETURN WINAPI wrap_SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSMALLINT NameLength1,
313 SQLCHAR *UserName, SQLSMALLINT NameLength2, SQLCHAR *Authentication,
314 SQLSMALLINT NameLength3)
316 return pSQLConnect(ConnectionHandle, ServerName, NameLength1, UserName, NameLength2, Authentication, NameLength3);
319 static SQLRETURN WINAPI wrap_SQLConnectW(SQLHDBC ConnectionHandle, WCHAR *ServerName, SQLSMALLINT NameLength1,
320 WCHAR *UserName, SQLSMALLINT NameLength2, WCHAR *Authentication,
321 SQLSMALLINT NameLength3)
323 return pSQLConnectW(ConnectionHandle, ServerName, NameLength1, UserName, NameLength2, Authentication, NameLength3);
326 static SQLRETURN WINAPI wrap_SQLCopyDesc(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle)
328 return pSQLCopyDesc(SourceDescHandle, TargetDescHandle);
331 static SQLRETURN WINAPI wrap_SQLDataSources(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR *ServerName,
332 SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, SQLCHAR *Description,
333 SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2)
335 return pSQLDataSources(EnvironmentHandle, Direction, ServerName, BufferLength1, NameLength1, Description,
336 BufferLength2, NameLength2);
339 static SQLRETURN WINAPI wrap_SQLDataSourcesA(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR *ServerName,
340 SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, SQLCHAR *Description,
341 SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2)
343 return pSQLDataSourcesA(EnvironmentHandle, Direction, ServerName, BufferLength1, NameLength1, Description,
344 BufferLength2, NameLength2);
347 static SQLRETURN WINAPI wrap_SQLDataSourcesW(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, WCHAR *ServerName,
348 SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, WCHAR *Description,
349 SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2)
351 return pSQLDataSourcesW(EnvironmentHandle, Direction, ServerName, BufferLength1, NameLength1, Description,
352 BufferLength2, NameLength2);
355 static SQLRETURN WINAPI wrap_SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName,
356 SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType,
357 SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable)
359 return pSQLDescribeCol(StatementHandle, ColumnNumber, ColumnName, BufferLength, NameLength, DataType, ColumnSize,
360 DecimalDigits, Nullable);
363 static SQLRETURN WINAPI wrap_SQLDescribeColW(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, WCHAR *ColumnName,
364 SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType,
365 SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable)
367 return pSQLDescribeColW(StatementHandle, ColumnNumber, ColumnName, BufferLength, NameLength, DataType, ColumnSize,
368 DecimalDigits, Nullable);
371 static SQLRETURN WINAPI wrap_SQLDescribeParam(SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT *pfSqlType,
372 SQLULEN *pcbParamDef, SQLSMALLINT *pibScale, SQLSMALLINT *pfNullable)
374 return pSQLDescribeParam(hstmt, ipar, pfSqlType, pcbParamDef, pibScale, pfNullable);
377 static SQLRETURN WINAPI wrap_SQLDisconnect(SQLHDBC ConnectionHandle)
379 return pSQLDisconnect(ConnectionHandle);
382 static SQLRETURN WINAPI wrap_SQLDriverConnect(SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR *ConnectionString, SQLSMALLINT Length,
383 SQLCHAR *conn_str_out, SQLSMALLINT conn_str_out_max,
384 SQLSMALLINT *ptr_conn_str_out, SQLUSMALLINT driver_completion)
386 return pSQLDriverConnect(hdbc, hwnd, ConnectionString, Length, conn_str_out, conn_str_out_max,
387 ptr_conn_str_out, driver_completion);
390 static SQLRETURN WINAPI wrap_SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandle, WCHAR *InConnectionString,
391 SQLSMALLINT Length, WCHAR *OutConnectionString, SQLSMALLINT BufferLength,
392 SQLSMALLINT *Length2, SQLUSMALLINT DriverCompletion)
394 return pSQLDriverConnectW(ConnectionHandle, WindowHandle, InConnectionString, Length, OutConnectionString,
395 BufferLength, Length2, DriverCompletion);
398 static SQLRETURN WINAPI wrap_SQLDrivers(SQLHENV EnvironmentHandle, SQLUSMALLINT fDirection, SQLCHAR *szDriverDesc,
399 SQLSMALLINT cbDriverDescMax, SQLSMALLINT *pcbDriverDesc,
400 SQLCHAR *szDriverAttributes, SQLSMALLINT cbDriverAttrMax,
401 SQLSMALLINT *pcbDriverAttr)
403 return pSQLDrivers(EnvironmentHandle, fDirection, szDriverDesc, cbDriverDescMax, pcbDriverDesc,
404 szDriverAttributes, cbDriverAttrMax, pcbDriverAttr);
407 static SQLRETURN WINAPI wrap_SQLDriversW(SQLHENV EnvironmentHandle, SQLUSMALLINT fDirection, SQLWCHAR *szDriverDesc,
408 SQLSMALLINT cbDriverDescMax, SQLSMALLINT *pcbDriverDesc,
409 SQLWCHAR *szDriverAttributes, SQLSMALLINT cbDriverAttrMax,
410 SQLSMALLINT *pcbDriverAttr)
412 return pSQLDriversW(EnvironmentHandle, fDirection, szDriverDesc, cbDriverDescMax, pcbDriverDesc,
413 szDriverAttributes, cbDriverAttrMax, pcbDriverAttr);
416 static SQLRETURN WINAPI wrap_SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType)
418 return pSQLEndTran(HandleType, Handle, CompletionType);
421 static SQLRETURN WINAPI wrap_SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle,
422 SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText,
423 SQLSMALLINT BufferLength, SQLSMALLINT *TextLength)
425 return pSQLError(EnvironmentHandle, ConnectionHandle, StatementHandle, Sqlstate, NativeError, MessageText,
426 BufferLength, TextLength);
429 static SQLRETURN WINAPI wrap_SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle,
430 WCHAR *Sqlstate, SQLINTEGER *NativeError, WCHAR *MessageText,
431 SQLSMALLINT BufferLength, SQLSMALLINT *TextLength)
433 return pSQLErrorW(EnvironmentHandle, ConnectionHandle, StatementHandle, Sqlstate, NativeError, MessageText,
434 BufferLength, TextLength);
437 static SQLRETURN WINAPI wrap_SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength)
439 return pSQLExecDirect(StatementHandle, StatementText, TextLength);
442 static SQLRETURN WINAPI wrap_SQLExecDirectW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength)
444 return pSQLExecDirectW(StatementHandle, StatementText, TextLength);
447 static SQLRETURN WINAPI wrap_SQLExecute(SQLHSTMT StatementHandle)
449 return pSQLExecute(StatementHandle);
452 static SQLRETURN WINAPI wrap_SQLExtendedFetch(SQLHSTMT hstmt, SQLUSMALLINT fFetchType, SQLLEN irow, SQLULEN *pcrow,
453 SQLUSMALLINT *rgfRowStatus)
455 return pSQLExtendedFetch(hstmt, fFetchType, irow, pcrow, rgfRowStatus);
458 static SQLRETURN WINAPI wrap_SQLFetch(SQLHSTMT StatementHandle)
460 return pSQLFetch(StatementHandle);
463 static SQLRETURN WINAPI wrap_SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset)
465 return pSQLFetchScroll(StatementHandle, FetchOrientation, FetchOffset);
468 static SQLRETURN WINAPI wrap_SQLForeignKeys(SQLHSTMT hstmt, SQLCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName,
469 SQLCHAR *szPkSchemaName, SQLSMALLINT cbPkSchemaName, SQLCHAR *szPkTableName,
470 SQLSMALLINT cbPkTableName, SQLCHAR *szFkCatalogName,
471 SQLSMALLINT cbFkCatalogName, SQLCHAR *szFkSchemaName,
472 SQLSMALLINT cbFkSchemaName, SQLCHAR *szFkTableName, SQLSMALLINT cbFkTableName)
474 return pSQLForeignKeys(hstmt, szPkCatalogName, cbPkCatalogName, szPkSchemaName, cbPkSchemaName, szPkTableName,
475 cbPkTableName, szFkCatalogName, cbFkCatalogName, szFkSchemaName, cbFkSchemaName,
476 szFkTableName, cbFkTableName);
479 static SQLRETURN WINAPI wrap_SQLForeignKeysW(SQLHSTMT hstmt, SQLWCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName,
480 SQLWCHAR *szPkSchemaName, SQLSMALLINT cbPkSchemaName, SQLWCHAR *szPkTableName,
481 SQLSMALLINT cbPkTableName, SQLWCHAR *szFkCatalogName,
482 SQLSMALLINT cbFkCatalogName, SQLWCHAR *szFkSchemaName,
483 SQLSMALLINT cbFkSchemaName, SQLWCHAR *szFkTableName, SQLSMALLINT cbFkTableName)
485 return pSQLForeignKeysW(hstmt, szPkCatalogName, cbPkCatalogName, szPkSchemaName, cbPkSchemaName, szPkTableName,
486 cbPkTableName, szFkCatalogName, cbFkCatalogName, szFkSchemaName, cbFkSchemaName,
487 szFkTableName, cbFkTableName);
490 static SQLRETURN WINAPI wrap_SQLFreeConnect(SQLHDBC ConnectionHandle)
492 return pSQLFreeConnect(ConnectionHandle);
495 static SQLRETURN WINAPI wrap_SQLFreeEnv(SQLHENV EnvironmentHandle)
497 return pSQLFreeEnv(EnvironmentHandle);
500 static SQLRETURN WINAPI wrap_SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle)
502 return pSQLFreeHandle(HandleType, Handle);
505 static SQLRETURN WINAPI wrap_SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option)
507 return pSQLFreeStmt(StatementHandle, Option);
510 static SQLRETURN WINAPI wrap_SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value,
511 SQLINTEGER BufferLength, SQLINTEGER *StringLength)
513 return pSQLGetConnectAttr(ConnectionHandle, Attribute, Value, BufferLength, StringLength);
516 static SQLRETURN WINAPI wrap_SQLGetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value,
517 SQLINTEGER BufferLength, SQLINTEGER *StringLength)
519 return pSQLGetConnectAttrW(ConnectionHandle, Attribute, Value, BufferLength, StringLength);
522 static SQLRETURN WINAPI wrap_SQLGetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value)
524 return pSQLGetConnectOption(ConnectionHandle, Option, Value);
527 static SQLRETURN WINAPI wrap_SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value)
529 return pSQLGetConnectOptionW(ConnectionHandle, Option, Value);
532 static SQLRETURN WINAPI wrap_SQLGetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT BufferLength,
533 SQLSMALLINT *NameLength)
535 return pSQLGetCursorName(StatementHandle, CursorName, BufferLength, NameLength);
538 static SQLRETURN WINAPI wrap_SQLGetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, SQLSMALLINT BufferLength,
539 SQLSMALLINT *NameLength)
541 return pSQLGetCursorNameW(StatementHandle, CursorName, BufferLength, NameLength);
544 static SQLRETURN WINAPI wrap_SQLGetData(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
545 SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind)
547 return pSQLGetData(StatementHandle, ColumnNumber, TargetType, TargetValue, BufferLength, StrLen_or_Ind);
550 static SQLRETURN WINAPI wrap_SQLGetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
551 SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength)
553 return pSQLGetDescField(DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength, StringLength);
556 static SQLRETURN WINAPI wrap_SQLGetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
557 SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength)
559 return pSQLGetDescFieldW(DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength, StringLength);
562 static SQLRETURN WINAPI wrap_SQLGetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLCHAR *Name,
563 SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLSMALLINT *Type,
564 SQLSMALLINT *SubType, SQLLEN *Length, SQLSMALLINT *Precision,
565 SQLSMALLINT *Scale, SQLSMALLINT *Nullable)
567 return pSQLGetDescRec(DescriptorHandle, RecNumber, Name, BufferLength, StringLength, Type, SubType, Length,
568 Precision, Scale, Nullable);
571 static SQLRETURN WINAPI wrap_SQLGetDescRecW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, WCHAR *Name,
572 SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLSMALLINT *Type,
573 SQLSMALLINT *SubType, SQLLEN *Length, SQLSMALLINT *Precision,
574 SQLSMALLINT *Scale, SQLSMALLINT *Nullable)
576 return pSQLGetDescRecW(DescriptorHandle, RecNumber, Name, BufferLength, StringLength, Type, SubType, Length,
577 Precision, Scale, Nullable);
580 static SQLRETURN WINAPI wrap_SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber,
581 SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength,
582 SQLSMALLINT *StringLength)
584 return pSQLGetDiagField(HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength);
587 static SQLRETURN WINAPI wrap_SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber,
588 SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength,
589 SQLSMALLINT *StringLength)
591 return pSQLGetDiagFieldW(HandleType, Handle, RecNumber, DiagIdentifier, DiagInfo, BufferLength, StringLength);
594 static SQLRETURN WINAPI wrap_SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber,
595 SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText,
596 SQLSMALLINT BufferLength, SQLSMALLINT *TextLength)
598 return pSQLGetDiagRec(HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength, TextLength);
601 static SQLRETURN WINAPI wrap_SQLGetDiagRecA(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber,
602 SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText,
603 SQLSMALLINT BufferLength, SQLSMALLINT *TextLength)
605 return pSQLGetDiagRecA(HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength, TextLength);
608 static SQLRETURN WINAPI wrap_SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber,
609 WCHAR *Sqlstate, SQLINTEGER *NativeError, WCHAR *MessageText,
610 SQLSMALLINT BufferLength, SQLSMALLINT *TextLength)
612 return pSQLGetDiagRecW(HandleType, Handle, RecNumber, Sqlstate, NativeError, MessageText, BufferLength, TextLength);
615 static SQLRETURN WINAPI wrap_SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value,
616 SQLINTEGER BufferLength, SQLINTEGER *StringLength)
618 return pSQLGetEnvAttr(EnvironmentHandle, Attribute, Value, BufferLength, StringLength);
621 static SQLRETURN WINAPI wrap_SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported)
623 return pSQLGetFunctions(ConnectionHandle, FunctionId, Supported);
626 static SQLRETURN WINAPI wrap_SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue,
627 SQLSMALLINT BufferLength, SQLSMALLINT *StringLength)
629 return pSQLGetInfo(ConnectionHandle, InfoType, InfoValue, BufferLength, StringLength);
632 static SQLRETURN WINAPI wrap_SQLGetInfoW(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue,
633 SQLSMALLINT BufferLength, SQLSMALLINT *StringLength)
635 return pSQLGetInfoW(ConnectionHandle, InfoType, InfoValue, BufferLength, StringLength);
638 static SQLRETURN WINAPI wrap_SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value,
639 SQLINTEGER BufferLength, SQLINTEGER *StringLength)
641 return pSQLGetStmtAttr(StatementHandle, Attribute, Value, BufferLength, StringLength);
644 static SQLRETURN WINAPI wrap_SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value,
645 SQLINTEGER BufferLength, SQLINTEGER *StringLength)
647 return pSQLGetStmtAttrW(StatementHandle, Attribute, Value, BufferLength, StringLength);
650 static SQLRETURN WINAPI wrap_SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLPOINTER Value)
652 return pSQLGetStmtOption(StatementHandle, Option, Value);
655 static SQLRETURN WINAPI wrap_SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType)
657 return pSQLGetTypeInfo(StatementHandle, DataType);
660 static SQLRETURN WINAPI wrap_SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType)
662 return pSQLGetTypeInfoW(StatementHandle, DataType);
665 static SQLRETURN WINAPI wrap_SQLMoreResults(SQLHSTMT StatementHandle)
667 return pSQLMoreResults(StatementHandle);
670 static SQLRETURN WINAPI wrap_SQLNativeSql(SQLHDBC hdbc, SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLCHAR *szSqlStr,
671 SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr)
673 return pSQLNativeSql(hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr);
676 static SQLRETURN WINAPI wrap_SQLNativeSqlW(SQLHDBC hdbc, SQLWCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLWCHAR *szSqlStr,
677 SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr)
679 return pSQLNativeSqlW(hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr);
682 static SQLRETURN WINAPI wrap_SQLNumParams(SQLHSTMT hstmt, SQLSMALLINT *pcpar)
684 return pSQLNumParams(hstmt, pcpar);
687 static SQLRETURN WINAPI wrap_SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnCount)
689 return pSQLNumResultCols(StatementHandle, ColumnCount);
692 static SQLRETURN WINAPI wrap_SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value)
694 return pSQLParamData(StatementHandle, Value);
697 static SQLRETURN WINAPI wrap_SQLParamOptions(SQLHSTMT hstmt, SQLULEN crow, SQLULEN *pirow)
699 return pSQLParamOptions(hstmt, crow, pirow);
702 static SQLRETURN WINAPI wrap_SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength)
704 return pSQLPrepare(StatementHandle, StatementText, TextLength);
707 static SQLRETURN WINAPI wrap_SQLPrepareW(SQLHSTMT StatementHandle, WCHAR *StatementText, SQLINTEGER TextLength)
709 return pSQLPrepareW(StatementHandle, StatementText, TextLength);
712 static SQLRETURN WINAPI wrap_SQLPrimaryKeys(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
713 SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName,
714 SQLSMALLINT cbTableName)
716 return pSQLPrimaryKeys(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName, cbTableName);
719 static SQLRETURN WINAPI wrap_SQLPrimaryKeysW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
720 SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName,
721 SQLSMALLINT cbTableName)
723 return pSQLPrimaryKeysW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName, cbTableName);
726 static SQLRETURN WINAPI wrap_SQLProcedureColumns(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
727 SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName,
728 SQLSMALLINT cbProcName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName)
730 return pSQLProcedureColumns(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szProcName,
731 cbProcName, szColumnName, cbColumnName);
734 static SQLRETURN WINAPI wrap_SQLProcedureColumnsW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
735 SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szProcName,
736 SQLSMALLINT cbProcName, SQLWCHAR *szColumnName, SQLSMALLINT cbColumnName)
738 return pSQLProcedureColumnsW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szProcName,
739 cbProcName, szColumnName, cbColumnName);
742 static SQLRETURN WINAPI wrap_SQLProcedures(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
743 SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName,
744 SQLSMALLINT cbProcName)
746 return pSQLProcedures(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szProcName, cbProcName);
749 static SQLRETURN WINAPI wrap_SQLProceduresW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
750 SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szProcName,
751 SQLSMALLINT cbProcName)
753 return pSQLProceduresW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szProcName, cbProcName);
756 static SQLRETURN WINAPI wrap_SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN StrLen_or_Ind)
758 return pSQLPutData(StatementHandle, Data, StrLen_or_Ind);
761 static SQLRETURN WINAPI wrap_SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount)
763 return pSQLRowCount(StatementHandle, RowCount);
766 static SQLRETURN WINAPI wrap_SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value,
767 SQLINTEGER StringLength)
769 return pSQLSetConnectAttr(ConnectionHandle, Attribute, Value, StringLength);
772 static SQLRETURN WINAPI wrap_SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value,
773 SQLINTEGER StringLength)
775 return pSQLSetConnectAttrW(ConnectionHandle, Attribute, Value, StringLength);
778 static SQLRETURN WINAPI wrap_SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value)
780 return pSQLSetConnectOption(ConnectionHandle, Option, Value);
783 static SQLRETURN WINAPI wrap_SQLSetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value)
785 return pSQLSetConnectOptionW(ConnectionHandle, Option, Value);
788 static SQLRETURN WINAPI wrap_SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT NameLength)
790 return pSQLSetCursorName(StatementHandle, CursorName, NameLength);
793 static SQLRETURN WINAPI wrap_SQLSetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName, SQLSMALLINT NameLength)
795 return pSQLSetCursorNameW(StatementHandle, CursorName, NameLength);
798 static SQLRETURN WINAPI wrap_SQLSetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
799 SQLPOINTER Value, SQLINTEGER BufferLength)
801 return pSQLSetDescField(DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength);
804 static SQLRETURN WINAPI wrap_SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
805 SQLPOINTER Value, SQLINTEGER BufferLength)
807 return pSQLSetDescFieldW(DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength);
810 static SQLRETURN WINAPI wrap_SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT Type,
811 SQLSMALLINT SubType, SQLLEN Length, SQLSMALLINT Precision, SQLSMALLINT Scale,
812 SQLPOINTER Data, SQLLEN *StringLength, SQLLEN *Indicator)
814 return pSQLSetDescRec(DescriptorHandle, RecNumber, Type, SubType, Length, Precision, Scale, Data,
815 StringLength, Indicator);
818 static SQLRETURN WINAPI wrap_SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value,
819 SQLINTEGER StringLength)
821 return pSQLSetEnvAttr(EnvironmentHandle, Attribute, Value, StringLength);
824 static SQLRETURN WINAPI wrap_SQLSetParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
825 SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale,
826 SQLPOINTER ParameterValue, SQLLEN *StrLen_or_Ind)
828 return pSQLSetParam(StatementHandle, ParameterNumber, ValueType, ParameterType, LengthPrecision,
829 ParameterScale, ParameterValue, StrLen_or_Ind);
832 static SQLRETURN WINAPI wrap_SQLSetPos(SQLHSTMT hstmt, SQLSETPOSIROW irow, SQLUSMALLINT fOption, SQLUSMALLINT fLock)
834 return pSQLSetPos(hstmt, irow, fOption, fLock);
837 static SQLRETURN WINAPI wrap_SQLSetScrollOptions(SQLHSTMT statement_handle, SQLUSMALLINT f_concurrency, SQLLEN crow_keyset,
838 SQLUSMALLINT crow_rowset)
840 return pSQLSetScrollOptions(statement_handle, f_concurrency, crow_keyset, crow_rowset);
843 static SQLRETURN WINAPI wrap_SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value,
844 SQLINTEGER StringLength)
846 return pSQLSetStmtAttr(StatementHandle, Attribute, Value, StringLength);
849 static SQLRETURN WINAPI wrap_SQLSetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value,
850 SQLINTEGER StringLength)
852 return pSQLSetStmtAttrW(StatementHandle, Attribute, Value, StringLength);
855 static SQLRETURN WINAPI wrap_SQLSetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLULEN Value)
857 return pSQLSetStmtOption(StatementHandle, Option, Value);
860 static SQLRETURN WINAPI wrap_SQLSpecialColumns(SQLHSTMT StatementHandle, SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName,
861 SQLSMALLINT NameLength1, SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
862 SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Scope,
863 SQLUSMALLINT Nullable)
865 return pSQLSpecialColumns(StatementHandle, IdentifierType, CatalogName, NameLength1, SchemaName,
866 NameLength2, TableName, NameLength3, Scope, Nullable);
869 static SQLRETURN WINAPI wrap_SQLSpecialColumnsW(SQLHSTMT StatementHandle, SQLUSMALLINT IdentifierType,
870 SQLWCHAR *CatalogName, SQLSMALLINT NameLength1, SQLWCHAR *SchemaName,
871 SQLSMALLINT NameLength2, SQLWCHAR *TableName, SQLSMALLINT NameLength3,
872 SQLUSMALLINT Scope, SQLUSMALLINT Nullable)
874 return pSQLSpecialColumnsW(StatementHandle, IdentifierType, CatalogName, NameLength1, SchemaName,
875 NameLength2, TableName, NameLength3, Scope, Nullable);
878 static SQLRETURN WINAPI wrap_SQLStatistics(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
879 SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName,
880 SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved)
882 return pSQLStatistics(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, TableName,
883 NameLength3, Unique, Reserved);
886 static SQLRETURN WINAPI wrap_SQLStatisticsW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1,
887 SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName,
888 SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved)
890 return pSQLStatisticsW(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, TableName,
891 NameLength3, Unique, Reserved);
894 static SQLRETURN WINAPI wrap_SQLTablePrivileges(SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
895 SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName,
896 SQLSMALLINT cbTableName)
898 return pSQLTablePrivileges(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName,
899 cbTableName);
902 static SQLRETURN WINAPI wrap_SQLTablePrivilegesW(SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName,
903 SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName,
904 SQLSMALLINT cbTableName)
906 return pSQLTablePrivilegesW(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName,
907 cbTableName);
910 static SQLRETURN WINAPI wrap_SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
911 SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName,
912 SQLSMALLINT NameLength3, SQLCHAR *TableType, SQLSMALLINT NameLength4)
914 return pSQLTables(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, TableName, NameLength3,
915 TableType, NameLength4);
918 static SQLRETURN WINAPI wrap_SQLTablesW(SQLHSTMT StatementHandle, SQLWCHAR *CatalogName, SQLSMALLINT NameLength1,
919 SQLWCHAR *SchemaName, SQLSMALLINT NameLength2, SQLWCHAR *TableName,
920 SQLSMALLINT NameLength3, SQLWCHAR *TableType, SQLSMALLINT NameLength4)
922 return pSQLTablesW(StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2, TableName, NameLength3,
923 TableType, NameLength4);
926 static SQLRETURN WINAPI wrap_SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType)
928 return pSQLTransact(EnvironmentHandle, ConnectionHandle, CompletionType);
931 static void *libodbc;
933 static NTSTATUS load_odbc( struct sql_funcs *funcs )
935 const char *s = getenv("LIB_ODBC_DRIVER_MANAGER");
937 #ifdef SONAME_LIBODBC
938 if (!s || !s[0]) s = SONAME_LIBODBC;
939 #endif
940 if (!s || !s[0] || !(libodbc = dlopen( s, RTLD_LAZY | RTLD_GLOBAL )))
942 ERR_(winediag)("failed to open library %s: %s\n", debugstr_a(s), dlerror());
943 return STATUS_DLL_NOT_FOUND;
946 #define LOAD_FUNC(name) if ((p##name = dlsym( libodbc, #name ))) funcs->p##name = wrap_##name
948 LOAD_FUNC(SQLAllocConnect);
949 LOAD_FUNC(SQLAllocEnv);
950 LOAD_FUNC(SQLAllocHandle);
951 LOAD_FUNC(SQLAllocHandleStd);
952 LOAD_FUNC(SQLAllocStmt);
953 LOAD_FUNC(SQLBindCol);
954 LOAD_FUNC(SQLBindParam);
955 LOAD_FUNC(SQLBindParameter);
956 LOAD_FUNC(SQLBrowseConnect);
957 LOAD_FUNC(SQLBrowseConnectW);
958 LOAD_FUNC(SQLBulkOperations);
959 LOAD_FUNC(SQLCancel);
960 LOAD_FUNC(SQLCloseCursor);
961 LOAD_FUNC(SQLColAttribute);
962 LOAD_FUNC(SQLColAttributeW);
963 LOAD_FUNC(SQLColAttributes);
964 LOAD_FUNC(SQLColAttributesW);
965 LOAD_FUNC(SQLColumnPrivileges);
966 LOAD_FUNC(SQLColumnPrivilegesW);
967 LOAD_FUNC(SQLColumns);
968 LOAD_FUNC(SQLColumnsW);
969 LOAD_FUNC(SQLConnect);
970 LOAD_FUNC(SQLConnectW);
971 LOAD_FUNC(SQLCopyDesc);
972 LOAD_FUNC(SQLDataSources);
973 LOAD_FUNC(SQLDataSourcesA);
974 LOAD_FUNC(SQLDataSourcesW);
975 LOAD_FUNC(SQLDescribeCol);
976 LOAD_FUNC(SQLDescribeColW);
977 LOAD_FUNC(SQLDescribeParam);
978 LOAD_FUNC(SQLDisconnect);
979 LOAD_FUNC(SQLDriverConnect);
980 LOAD_FUNC(SQLDriverConnectW);
981 LOAD_FUNC(SQLDrivers);
982 LOAD_FUNC(SQLDriversW);
983 LOAD_FUNC(SQLEndTran);
984 LOAD_FUNC(SQLError);
985 LOAD_FUNC(SQLErrorW);
986 LOAD_FUNC(SQLExecDirect);
987 LOAD_FUNC(SQLExecDirectW);
988 LOAD_FUNC(SQLExecute);
989 LOAD_FUNC(SQLExtendedFetch);
990 LOAD_FUNC(SQLFetch);
991 LOAD_FUNC(SQLFetchScroll);
992 LOAD_FUNC(SQLForeignKeys);
993 LOAD_FUNC(SQLForeignKeysW);
994 LOAD_FUNC(SQLFreeConnect);
995 LOAD_FUNC(SQLFreeEnv);
996 LOAD_FUNC(SQLFreeHandle);
997 LOAD_FUNC(SQLFreeStmt);
998 LOAD_FUNC(SQLGetConnectAttr);
999 LOAD_FUNC(SQLGetConnectAttrW);
1000 LOAD_FUNC(SQLGetConnectOption);
1001 LOAD_FUNC(SQLGetConnectOptionW);
1002 LOAD_FUNC(SQLGetCursorName);
1003 LOAD_FUNC(SQLGetCursorNameW);
1004 LOAD_FUNC(SQLGetData);
1005 LOAD_FUNC(SQLGetDescField);
1006 LOAD_FUNC(SQLGetDescFieldW);
1007 LOAD_FUNC(SQLGetDescRec);
1008 LOAD_FUNC(SQLGetDescRecW);
1009 LOAD_FUNC(SQLGetDiagField);
1010 LOAD_FUNC(SQLGetDiagFieldW);
1011 LOAD_FUNC(SQLGetDiagRec);
1012 LOAD_FUNC(SQLGetDiagRecA);
1013 LOAD_FUNC(SQLGetDiagRecW);
1014 LOAD_FUNC(SQLGetEnvAttr);
1015 LOAD_FUNC(SQLGetFunctions);
1016 LOAD_FUNC(SQLGetInfo);
1017 LOAD_FUNC(SQLGetInfoW);
1018 LOAD_FUNC(SQLGetStmtAttr);
1019 LOAD_FUNC(SQLGetStmtAttrW);
1020 LOAD_FUNC(SQLGetStmtOption);
1021 LOAD_FUNC(SQLGetTypeInfo);
1022 LOAD_FUNC(SQLGetTypeInfoW);
1023 LOAD_FUNC(SQLMoreResults);
1024 LOAD_FUNC(SQLNativeSql);
1025 LOAD_FUNC(SQLNativeSqlW);
1026 LOAD_FUNC(SQLNumParams);
1027 LOAD_FUNC(SQLNumResultCols);
1028 LOAD_FUNC(SQLParamData);
1029 LOAD_FUNC(SQLParamOptions);
1030 LOAD_FUNC(SQLPrepare);
1031 LOAD_FUNC(SQLPrepareW);
1032 LOAD_FUNC(SQLPrimaryKeys);
1033 LOAD_FUNC(SQLPrimaryKeysW);
1034 LOAD_FUNC(SQLProcedureColumns);
1035 LOAD_FUNC(SQLProcedureColumnsW);
1036 LOAD_FUNC(SQLProcedures);
1037 LOAD_FUNC(SQLProceduresW);
1038 LOAD_FUNC(SQLPutData);
1039 LOAD_FUNC(SQLRowCount);
1040 LOAD_FUNC(SQLSetConnectAttr);
1041 LOAD_FUNC(SQLSetConnectAttrW);
1042 LOAD_FUNC(SQLSetConnectOption);
1043 LOAD_FUNC(SQLSetConnectOptionW);
1044 LOAD_FUNC(SQLSetCursorName);
1045 LOAD_FUNC(SQLSetCursorNameW);
1046 LOAD_FUNC(SQLSetDescField);
1047 LOAD_FUNC(SQLSetDescFieldW);
1048 LOAD_FUNC(SQLSetDescRec);
1049 LOAD_FUNC(SQLSetEnvAttr);
1050 LOAD_FUNC(SQLSetParam);
1051 LOAD_FUNC(SQLSetPos);
1052 LOAD_FUNC(SQLSetScrollOptions);
1053 LOAD_FUNC(SQLSetStmtAttr);
1054 LOAD_FUNC(SQLSetStmtAttrW);
1055 LOAD_FUNC(SQLSetStmtOption);
1056 LOAD_FUNC(SQLSpecialColumns);
1057 LOAD_FUNC(SQLSpecialColumnsW);
1058 LOAD_FUNC(SQLStatistics);
1059 LOAD_FUNC(SQLStatisticsW);
1060 LOAD_FUNC(SQLTablePrivileges);
1061 LOAD_FUNC(SQLTablePrivilegesW);
1062 LOAD_FUNC(SQLTables);
1063 LOAD_FUNC(SQLTablesW);
1064 LOAD_FUNC(SQLTransact);
1065 #undef LOAD_FUNC
1066 return STATUS_SUCCESS;
1069 NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out )
1071 switch (reason)
1073 case DLL_PROCESS_ATTACH:
1074 if (!load_odbc( ptr_out )) return STATUS_DLL_NOT_FOUND;
1075 break;
1076 case DLL_PROCESS_DETACH:
1077 if (libodbc) dlclose( libodbc );
1078 libodbc = NULL;
1079 break;
1081 return STATUS_SUCCESS;