Author: tkreuzer
Date: Mon Jun 21 23:14:01 2010
New Revision: 47824
URL:
http://svn.reactos.org/svn/reactos?rev=47824&view=rev
Log:
[ODBC32]
Merge 41027, 41028, 44611 from amd64 branch
Update odbc32 to Wine-1.1.21.
Added:
trunk/reactos/dll/win32/odbc32/odbc32_ros.diff (with props)
Modified:
trunk/reactos/dll/win32/odbc32/odbc32.rbuild
trunk/reactos/dll/win32/odbc32/odbc32.spec
trunk/reactos/dll/win32/odbc32/proxyodbc.c
trunk/reactos/dll/win32/odbc32/proxyodbc.h
Modified: trunk/reactos/dll/win32/odbc32/odbc32.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/odbc32/odbc32.rb…
==============================================================================
--- trunk/reactos/dll/win32/odbc32/odbc32.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/odbc32/odbc32.rbuild [iso-8859-1] Mon Jun 21 23:14:01 2010
@@ -7,6 +7,7 @@
<include base="ReactOS">include/reactos/wine</include>
<define name="__WINESRC__" />
<library>wine</library>
+ <library>advapi32</library>
<file>proxyodbc.c</file>
</module>
-</group>
+</group>
Modified: trunk/reactos/dll/win32/odbc32/odbc32.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/odbc32/odbc32.sp…
==============================================================================
--- trunk/reactos/dll/win32/odbc32/odbc32.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/odbc32/odbc32.spec [iso-8859-1] Mon Jun 21 23:14:01 2010
@@ -86,43 +86,43 @@
86 stub ODBSetTryWaitValue
89 stub ODBCSharedPerfMon
90 stub ODBCSharedVSFlag
-106 stub SQLColAttributesW
-107 stub SQLConnectW
-108 stub SQLDescribeColW
-110 stub SQLErrorW
-111 stub SQLExecDirectW
-117 stub SQLGetCursorNameW
-119 stub SQLPrepareW
-121 stub SQLSetCursorNameW
-127 stub SQLColAttributeW
-132 stub SQLGetConnectAttrW
-133 stub SQLGetDescFieldW
-134 stub SQLGetDescRecW
-135 stub SQLGetDiagFieldW
-136 stub SQLGetDiagRecW
-138 stub SQLGetStmtAttrW
-139 stub SQLSetConnectAttrW
-140 stub SQLColumnsW
-141 stub SQLDriverConnectW
-142 stub SQLGetConnectOptionW
-145 stub SQLGetInfoW
-147 stub SQLGetTypeInfoW
-150 stub SQLSetConnectOptionW
-152 stub SQLSpecialColumnsW
-153 stub SQLStatisticsW
-154 stub SQLTablesW
-155 stub SQLBrowseConnectW
-156 stub SQLColumnPrivilegesW
-157 stub SQLDataSourcesW
-160 stub SQLForeignKeysW
-162 stub SQLNativeSqlW
-165 stub SQLPrimaryKeysW
-166 stub SQLProcedureColumnsW
-167 stub SQLProceduresW
-170 stub SQLTablePrivilegesW
-171 stub SQLDriversW
-173 stub SQLSetDescFieldW
-176 stub SQLSetStmtAttrW
+106 stdcall SQLColAttributesW(long long long ptr long ptr ptr)
+107 stdcall SQLConnectW(long wstr long wstr long wstr long)
+108 stdcall SQLDescribeColW(long long wstr long ptr ptr ptr ptr ptr)
+110 stdcall SQLErrorW(long long long wstr ptr wstr long ptr)
+111 stdcall SQLExecDirectW(long wstr long)
+117 stdcall SQLGetCursorNameW(long wstr long ptr)
+119 stdcall SQLPrepareW(long wstr long)
+121 stdcall SQLSetCursorNameW(long wstr long)
+127 stdcall SQLColAttributeW(long long long ptr long ptr ptr)
+132 stdcall SQLGetConnectAttrW(long long ptr long ptr)
+133 stdcall SQLGetDescFieldW(long long long ptr long ptr)
+134 stdcall SQLGetDescRecW(long long wstr long ptr ptr ptr ptr ptr ptr ptr)
+135 stdcall SQLGetDiagFieldW(long long long long ptr long ptr)
+136 stdcall SQLGetDiagRecW(long long long wstr ptr wstr long ptr)
+138 stdcall SQLGetStmtAttrW(long long ptr long ptr)
+139 stdcall SQLSetConnectAttrW(long long ptr long)
+140 stdcall SQLColumnsW(long wstr long wstr long wstr long wstr long)
+141 stdcall SQLDriverConnectW(long long wstr long wstr long wstr long)
+142 stdcall SQLGetConnectOptionW(long long ptr)
+145 stdcall SQLGetInfoW(long long ptr long ptr)
+147 stdcall SQLGetTypeInfoW(long long)
+150 stdcall SQLSetConnectOptionW(long long long)
+152 stdcall SQLSpecialColumnsW(long long wstr long wstr long wstr long long long)
+153 stdcall SQLStatisticsW(long wstr long wstr long wstr long long long)
+154 stdcall SQLTablesW(long wstr long wstr long wstr long wstr long)
+155 stdcall SQLBrowseConnectW(long wstr long wstr long ptr)
+156 stdcall SQLColumnPrivilegesW(long wstr long wstr long wstr long wstr long)
+157 stdcall SQLDataSourcesW(long long wstr long ptr wstr long ptr)
+160 stdcall SQLForeignKeysW(long wstr long wstr long wstr long wstr long wstr long wstr
long)
+162 stdcall SQLNativeSqlW(long wstr long wstr long ptr)
+165 stdcall SQLPrimaryKeysW(long wstr long wstr long wstr long)
+166 stdcall SQLProcedureColumnsW(long wstr long wstr long wstr long wstr long)
+167 stdcall SQLProceduresW(long wstr long wstr long wstr long)
+170 stdcall SQLTablePrivilegesW(long wstr long wstr long wstr long)
+171 stdcall SQLDriversW(long long wstr long ptr wstr long ptr)
+173 stdcall SQLSetDescFieldW(long long long ptr long)
+176 stdcall SQLSetStmtAttrW(long long ptr long)
206 stub SQLColAttributesA
207 stub SQLConnectA
208 stub SQLDescribeColA
Added: trunk/reactos/dll/win32/odbc32/odbc32_ros.diff
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/odbc32/odbc32_ro…
==============================================================================
--- trunk/reactos/dll/win32/odbc32/odbc32_ros.diff (added)
+++ trunk/reactos/dll/win32/odbc32/odbc32_ros.diff [iso-8859-1] Mon Jun 21 23:14:01 2010
@@ -1,0 +1,395 @@
+Index: proxyodbc.c
+===================================================================
+--- proxyodbc.c (Revision 41027)
++++ proxyodbc.c (Arbeitskopie)
+@@ -733,8 +733,8 @@
+ */
+ SQLRETURN WINAPI SQLBindCol(SQLHSTMT StatementHandle,
+ SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
+- SQLPOINTER TargetValue, SQLINTEGER BufferLength,
+- SQLINTEGER *StrLen_or_Ind)
++ SQLPOINTER TargetValue, SQLLEN BufferLength,
++ SQLLEN *StrLen_or_Ind)
+ {
+ TRACE("\n");
+
+@@ -756,9 +756,9 @@
+ */
+ SQLRETURN WINAPI SQLBindParam(SQLHSTMT StatementHandle,
+ SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
+- SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision,
++ SQLSMALLINT ParameterType, SQLULEN LengthPrecision,
+ SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue,
+- SQLINTEGER *StrLen_or_Ind)
++ SQLLEN *StrLen_or_Ind)
+ {
+ TRACE("\n");
+
+@@ -926,7 +926,7 @@
+ SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle,
+ SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName,
+ SQLSMALLINT BufferLength, SQLSMALLINT *NameLength,
+- SQLSMALLINT *DataType, SQLUINTEGER *ColumnSize,
++ SQLSMALLINT *DataType, SQLULEN *ColumnSize,
+ SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable)
+ {
+ TRACE("\n");
+@@ -1040,7 +1040,7 @@
+ /*************************************************************************
+ * SQLFetchScroll [ODBC32.030]
+ */
+-SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation,
SQLINTEGER FetchOffset)
++SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation,
SQLLEN FetchOffset)
+ {
+ TRACE("\n");
+
+@@ -1177,8 +1177,8 @@
+ */
+ SQLRETURN WINAPI SQLGetData(SQLHSTMT StatementHandle,
+ SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
+- SQLPOINTER TargetValue, SQLINTEGER BufferLength,
+- SQLINTEGER *StrLen_or_Ind)
++ SQLPOINTER TargetValue, SQLLEN BufferLength,
++ SQLLEN *StrLen_or_Ind)
+ {
+ TRACE("\n");
+
+@@ -1217,7 +1217,7 @@
+ SQLSMALLINT RecNumber, SQLCHAR *Name,
+ SQLSMALLINT BufferLength, SQLSMALLINT *StringLength,
+ SQLSMALLINT *Type, SQLSMALLINT *SubType,
+- SQLINTEGER *Length, SQLSMALLINT *Precision,
++ SQLLEN *Length, SQLSMALLINT *Precision,
+ SQLSMALLINT *Scale, SQLSMALLINT *Nullable)
+ {
+ TRACE("\n");
+@@ -1413,7 +1413,7 @@
+ /*************************************************************************
+ * SQLPutData [ODBC32.049]
+ */
+-SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLINTEGER
StrLen_or_Ind)
++SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN
StrLen_or_Ind)
+ {
+ TRACE("\n");
+
+@@ -1428,7 +1428,7 @@
+ /*************************************************************************
+ * SQLRowCount [ODBC32.020]
+ */
+-SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLINTEGER *RowCount)
++SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount)
+ {
+ TRACE("\n");
+
+@@ -1459,7 +1459,7 @@
+ /*************************************************************************
+ * SQLSetConnectOption [ODBC32.050]
+ */
+-SQLRETURN WINAPI SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option,
SQLUINTEGER Value)
++SQLRETURN WINAPI SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option,
SQLULEN Value)
+ {
+ TRACE("\n");
+
+@@ -1508,10 +1508,10 @@
+ */
+ SQLRETURN WINAPI SQLSetDescRec(SQLHDESC DescriptorHandle,
+ SQLSMALLINT RecNumber, SQLSMALLINT Type,
+- SQLSMALLINT SubType, SQLINTEGER Length,
++ SQLSMALLINT SubType, SQLLEN Length,
+ SQLSMALLINT Precision, SQLSMALLINT Scale,
+- SQLPOINTER Data, SQLINTEGER *StringLength,
+- SQLINTEGER *Indicator)
++ SQLPOINTER Data, SQLLEN *StringLength,
++ SQLLEN *Indicator)
+ {
+ TRACE("\n");
+
+@@ -1546,9 +1546,9 @@
+ */
+ SQLRETURN WINAPI SQLSetParam(SQLHSTMT StatementHandle,
+ SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
+- SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision,
++ SQLSMALLINT ParameterType, SQLULEN LengthPrecision,
+ SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue,
+- SQLINTEGER *StrLen_or_Ind)
++ SQLLEN *StrLen_or_Ind)
+ {
+ TRACE("\n");
+
+@@ -1581,7 +1581,7 @@
+ /*************************************************************************
+ * SQLSetStmtOption [ODBC32.051]
+ */
+-SQLRETURN WINAPI SQLSetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option,
SQLUINTEGER Value)
++SQLRETURN WINAPI SQLSetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLULEN
Value)
+ {
+ TRACE("\n");
+
+@@ -1717,7 +1717,7 @@
+ SQLPOINTER rgbDesc,
+ SQLSMALLINT cbDescMax,
+ SQLSMALLINT *pcbDesc,
+- SQLINTEGER *pfDesc)
++ SQLLEN *pfDesc)
+ {
+ TRACE("\n");
+
+@@ -1761,7 +1761,7 @@
+ SQLHSTMT hstmt,
+ SQLUSMALLINT ipar,
+ SQLSMALLINT *pfSqlType,
+- SQLUINTEGER *pcbParamDef,
++ SQLULEN *pcbParamDef,
+ SQLSMALLINT *pibScale,
+ SQLSMALLINT *pfNullable)
+ {
+@@ -2039,11 +2039,11 @@
+ SQLSMALLINT fParamType,
+ SQLSMALLINT fCType,
+ SQLSMALLINT fSqlType,
+- SQLUINTEGER cbColDef,
++ SQLULEN cbColDef,
+ SQLSMALLINT ibScale,
+ SQLPOINTER rgbValue,
+- SQLINTEGER cbValueMax,
+- SQLINTEGER *pcbValue)
++ SQLLEN cbValueMax,
++ SQLLEN *pcbValue)
+ {
+ TRACE("\n");
+
+@@ -2086,7 +2086,7 @@
+ SQLRETURN WINAPI SQLSetScrollOptions(
+ SQLHSTMT statement_handle,
+ SQLUSMALLINT f_concurrency,
+- SQLINTEGER crow_keyset,
++ SQLLEN crow_keyset,
+ SQLUSMALLINT crow_rowset )
+ {
+ TRACE("\n");
+@@ -2138,7 +2138,7 @@
+ SQLPOINTER rgbDesc,
+ SQLSMALLINT cbDescMax,
+ SQLSMALLINT *pcbDesc,
+- SQLINTEGER *pfDesc)
++ SQLLEN *pfDesc)
+ {
+ SQLRETURN iResult;
+
+@@ -2200,9 +2200,9 @@
+ * SQLDescribeColW [ODBC32.108]
+ */
+ SQLRETURN WINAPI SQLDescribeColW(SQLHSTMT StatementHandle,
+- SQLUSMALLINT ColumnNumber, WCHAR *ColumnName,
++ SQLUSMALLINT ColumnNumber, SQLWCHAR *ColumnName,
+ SQLSMALLINT BufferLength, SQLSMALLINT *NameLength,
+- SQLSMALLINT *DataType, SQLUINTEGER *ColumnSize,
++ SQLSMALLINT *DataType, SQLULEN *ColumnSize,
+ SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable)
+ {
+ SQLRETURN iResult;
+@@ -2378,10 +2378,10 @@
+ * SQLGetDescRecW [ODBC32.134]
+ */
+ SQLRETURN WINAPI SQLGetDescRecW(SQLHDESC DescriptorHandle,
+- SQLSMALLINT RecNumber, WCHAR *Name,
++ SQLSMALLINT RecNumber, SQLWCHAR *Name,
+ SQLSMALLINT BufferLength, SQLSMALLINT *StringLength,
+ SQLSMALLINT *Type, SQLSMALLINT *SubType,
+- SQLINTEGER *Length, SQLSMALLINT *Precision,
++ SQLLEN *Length, SQLSMALLINT *Precision,
+ SQLSMALLINT *Scale, SQLSMALLINT *Nullable)
+ {
+ TRACE("\n");
+@@ -2573,7 +2573,7 @@
+ /*************************************************************************
+ * SQLSetConnectOptionW [ODBC32.150]
+ */
+-SQLRETURN WINAPI SQLSetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option,
SQLUINTEGER Value)
++SQLRETURN WINAPI SQLSetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option,
SQLULEN Value)
+ {
+ TRACE("\n");
+
+@@ -2588,9 +2588,9 @@
+ * SQLSpecialColumnsW [ODBC32.152]
+ */
+ SQLRETURN WINAPI SQLSpecialColumnsW(SQLHSTMT StatementHandle,
+- SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName,
+- SQLSMALLINT NameLength1, SQLCHAR *SchemaName,
+- SQLSMALLINT NameLength2, SQLCHAR *TableName,
++ SQLUSMALLINT IdentifierType, SQLWCHAR *CatalogName,
++ SQLSMALLINT NameLength1, SQLWCHAR *SchemaName,
++ SQLSMALLINT NameLength2, SQLWCHAR *TableName,
+ SQLSMALLINT NameLength3, SQLUSMALLINT Scope,
+ SQLUSMALLINT Nullable)
+ {
+@@ -2607,9 +2607,9 @@
+ * SQLStatisticsW [ODBC32.153]
+ */
+ SQLRETURN WINAPI SQLStatisticsW(SQLHSTMT StatementHandle,
+- SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
+- SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
+- SQLCHAR *TableName, SQLSMALLINT NameLength3,
++ SQLWCHAR *CatalogName, SQLSMALLINT NameLength1,
++ SQLWCHAR *SchemaName, SQLSMALLINT NameLength2,
++ SQLWCHAR *TableName, SQLSMALLINT NameLength3,
+ SQLUSMALLINT Unique, SQLUSMALLINT Reserved)
+ {
+ TRACE("\n");
+@@ -2626,10 +2626,10 @@
+ * SQLTablesW [ODBC32.154]
+ */
+ SQLRETURN WINAPI SQLTablesW(SQLHSTMT StatementHandle,
+- SQLCHAR *CatalogName, SQLSMALLINT NameLength1,
+- SQLCHAR *SchemaName, SQLSMALLINT NameLength2,
+- SQLCHAR *TableName, SQLSMALLINT NameLength3,
+- SQLCHAR *TableType, SQLSMALLINT NameLength4)
++ SQLWCHAR *CatalogName, SQLSMALLINT NameLength1,
++ SQLWCHAR *SchemaName, SQLSMALLINT NameLength2,
++ SQLWCHAR *TableName, SQLSMALLINT NameLength3,
++ SQLWCHAR *TableType, SQLSMALLINT NameLength4)
+ {
+ TRACE("\n");
+
+@@ -2646,9 +2646,9 @@
+ */
+ SQLRETURN WINAPI SQLBrowseConnectW(
+ SQLHDBC hdbc,
+- SQLCHAR *szConnStrIn,
++ SQLWCHAR *szConnStrIn,
+ SQLSMALLINT cbConnStrIn,
+- SQLCHAR *szConnStrOut,
++ SQLWCHAR *szConnStrOut,
+ SQLSMALLINT cbConnStrOutMax,
+ SQLSMALLINT *pcbConnStrOut)
+ {
+@@ -2666,13 +2666,13 @@
+ */
+ SQLRETURN WINAPI SQLColumnPrivilegesW(
+ SQLHSTMT hstmt,
+- SQLCHAR *szCatalogName,
++ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+- SQLCHAR *szSchemaName,
++ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+- SQLCHAR *szTableName,
++ SQLWCHAR *szTableName,
+ SQLSMALLINT cbTableName,
+- SQLCHAR *szColumnName,
++ SQLWCHAR *szColumnName,
+ SQLSMALLINT cbColumnName)
+ {
+ TRACE("\n");
+@@ -2727,17 +2727,17 @@
+ */
+ SQLRETURN WINAPI SQLForeignKeysW(
+ SQLHSTMT hstmt,
+- SQLCHAR *szPkCatalogName,
++ SQLWCHAR *szPkCatalogName,
+ SQLSMALLINT cbPkCatalogName,
+- SQLCHAR *szPkSchemaName,
++ SQLWCHAR *szPkSchemaName,
+ SQLSMALLINT cbPkSchemaName,
+- SQLCHAR *szPkTableName,
++ SQLWCHAR *szPkTableName,
+ SQLSMALLINT cbPkTableName,
+- SQLCHAR *szFkCatalogName,
++ SQLWCHAR *szFkCatalogName,
+ SQLSMALLINT cbFkCatalogName,
+- SQLCHAR *szFkSchemaName,
++ SQLWCHAR *szFkSchemaName,
+ SQLSMALLINT cbFkSchemaName,
+- SQLCHAR *szFkTableName,
++ SQLWCHAR *szFkTableName,
+ SQLSMALLINT cbFkTableName)
+ {
+ TRACE("\n");
+@@ -2756,9 +2756,9 @@
+ */
+ SQLRETURN WINAPI SQLNativeSqlW(
+ SQLHDBC hdbc,
+- SQLCHAR *szSqlStrIn,
++ SQLWCHAR *szSqlStrIn,
+ SQLINTEGER cbSqlStrIn,
+- SQLCHAR *szSqlStr,
++ SQLWCHAR *szSqlStr,
+ SQLINTEGER cbSqlStrMax,
+ SQLINTEGER *pcbSqlStr)
+ {
+@@ -2776,11 +2776,11 @@
+ */
+ SQLRETURN WINAPI SQLPrimaryKeysW(
+ SQLHSTMT hstmt,
+- SQLCHAR *szCatalogName,
++ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+- SQLCHAR *szSchemaName,
++ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+- SQLCHAR *szTableName,
++ SQLWCHAR *szTableName,
+ SQLSMALLINT cbTableName)
+ {
+ TRACE("\n");
+@@ -2798,13 +2798,13 @@
+ */
+ SQLRETURN WINAPI SQLProcedureColumnsW(
+ SQLHSTMT hstmt,
+- SQLCHAR *szCatalogName,
++ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+- SQLCHAR *szSchemaName,
++ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+- SQLCHAR *szProcName,
++ SQLWCHAR *szProcName,
+ SQLSMALLINT cbProcName,
+- SQLCHAR *szColumnName,
++ SQLWCHAR *szColumnName,
+ SQLSMALLINT cbColumnName)
+ {
+ TRACE("\n");
+@@ -2822,11 +2822,11 @@
+ */
+ SQLRETURN WINAPI SQLProceduresW(
+ SQLHSTMT hstmt,
+- SQLCHAR *szCatalogName,
++ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+- SQLCHAR *szSchemaName,
++ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+- SQLCHAR *szProcName,
++ SQLWCHAR *szProcName,
+ SQLSMALLINT cbProcName)
+ {
+ TRACE("\n");
+@@ -2844,11 +2844,11 @@
+ */
+ SQLRETURN WINAPI SQLTablePrivilegesW(
+ SQLHSTMT hstmt,
+- SQLCHAR *szCatalogName,
++ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+- SQLCHAR *szSchemaName,
++ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+- SQLCHAR *szTableName,
++ SQLWCHAR *szTableName,
+ SQLSMALLINT cbTableName)
+ {
+ TRACE("\n");
+@@ -2867,10 +2867,10 @@
+ SQLRETURN WINAPI SQLDriversW(
+ SQLHENV henv,
+ SQLUSMALLINT fDirection,
+- SQLCHAR *szDriverDesc,
++ SQLWCHAR *szDriverDesc,
+ SQLSMALLINT cbDriverDescMax,
+ SQLSMALLINT *pcbDriverDesc,
+- SQLCHAR *szDriverAttributes,
++ SQLWCHAR *szDriverAttributes,
+ SQLSMALLINT cbDriverAttrMax,
+ SQLSMALLINT *pcbDriverAttr)
+ {
Propchange: trunk/reactos/dll/win32/odbc32/odbc32_ros.diff
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/win32/odbc32/proxyodbc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/odbc32/proxyodbc…
==============================================================================
--- trunk/reactos/dll/win32/odbc32/proxyodbc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/odbc32/proxyodbc.c [iso-8859-1] Mon Jun 21 23:14:01 2010
@@ -18,8 +18,8 @@
* Foundation, Inc., 51 Franklin Street, 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
+ * 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.
*
@@ -36,15 +36,18 @@
#include "windef.h"
#include "winbase.h"
-#include "wine/debug.h"
-//#include "wine/library.h"
-
-#undef TRACE_ON
+#include "winreg.h"
#include "sql.h"
#include "sqltypes.h"
#include "sqlext.h"
+#undef TRACE_ON
+
+#include "wine/debug.h"
+#include "wine/library.h"
+#include "wine/unicode.h"
+
#include "proxyodbc.h"
static BOOL ODBC_LoadDriverManager(void);
@@ -54,84 +57,84 @@
static const DM_FUNC template_func[] =
{
- /* 00 */ { SQL_API_SQLALLOCCONNECT, "SQLAllocConnect",
SQLAllocConnect, NULL },
- /* 01 */ { SQL_API_SQLALLOCENV, "SQLAllocEnv", SQLAllocEnv, NULL
},
- /* 02 */ { SQL_API_SQLALLOCHANDLE, "SQLAllocHandle", SQLAllocHandle,
NULL },
- /* 03 */ { SQL_API_SQLALLOCSTMT, "SQLAllocStmt", SQLAllocStmt, NULL
},
- /* 04 */ { SQL_API_SQLALLOCHANDLESTD, "SQLAllocHandleStd",
SQLAllocHandleStd, NULL },
- /* 05 */ { SQL_API_SQLBINDCOL, "SQLBindCol", SQLBindCol, NULL },
- /* 06 */ { SQL_API_SQLBINDPARAM, "SQLBindParam", SQLBindParam, NULL
},
- /* 07 */ { SQL_API_SQLBINDPARAMETER, "SQLBindParameter",
SQLBindParameter, NULL },
- /* 08 */ { SQL_API_SQLBROWSECONNECT, "SQLBrowseConnect",
SQLBrowseConnect, NULL },
- /* 09 */ { SQL_API_SQLBULKOPERATIONS, "SQLBulkOperations",
SQLBulkOperations, NULL },
- /* 10 */ { SQL_API_SQLCANCEL, "SQLCancel", SQLCancel, NULL },
- /* 11 */ { SQL_API_SQLCLOSECURSOR, "SQLCloseCursor", SQLCloseCursor,
NULL },
- /* 12 */ { SQL_API_SQLCOLATTRIBUTE, "SQLColAttribute",
SQLColAttribute, NULL },
- /* 13 */ { SQL_API_SQLCOLATTRIBUTES, "SQLColAttributes",
SQLColAttributes, NULL },
- /* 14 */ { SQL_API_SQLCOLUMNPRIVILEGES, "SQLColumnPrivileges",
SQLColumnPrivileges, NULL },
- /* 15 */ { SQL_API_SQLCOLUMNS, "SQLColumns", SQLColumns, NULL },
- /* 16 */ { SQL_API_SQLCONNECT, "SQLConnect", SQLConnect, NULL },
- /* 17 */ { SQL_API_SQLCOPYDESC, "SQLCopyDesc", SQLCopyDesc, NULL
},
- /* 18 */ { SQL_API_SQLDATASOURCES, "SQLDataSources", SQLDataSources,
NULL },
- /* 19 */ { SQL_API_SQLDESCRIBECOL, "SQLDescribeCol", SQLDescribeCol,
NULL },
- /* 20 */ { SQL_API_SQLDESCRIBEPARAM, "SQLDescribeParam",
SQLDescribeParam, NULL },
- /* 21 */ { SQL_API_SQLDISCONNECT, "SQLDisconnect", SQLDisconnect,
NULL },
- /* 22 */ { SQL_API_SQLDRIVERCONNECT, "SQLDriverConnect",
SQLDriverConnect, NULL },
- /* 23 */ { SQL_API_SQLDRIVERS, "SQLDrivers", SQLDrivers, NULL },
- /* 24 */ { SQL_API_SQLENDTRAN, "SQLEndTran", SQLEndTran, NULL },
- /* 25 */ { SQL_API_SQLERROR, "SQLError", SQLError, NULL },
- /* 26 */ { SQL_API_SQLEXECDIRECT, "SQLExecDirect", SQLExecDirect,
NULL },
- /* 27 */ { SQL_API_SQLEXECUTE, "SQLExecute", SQLExecute, NULL },
- /* 28 */ { SQL_API_SQLEXTENDEDFETCH, "SQLExtendedFetch",
SQLExtendedFetch, NULL },
- /* 29 */ { SQL_API_SQLFETCH, "SQLFetch", SQLFetch, NULL },
- /* 30 */ { SQL_API_SQLFETCHSCROLL, "SQLFetchScroll", SQLFetchScroll,
NULL },
- /* 31 */ { SQL_API_SQLFOREIGNKEYS, "SQLForeignKeys", SQLForeignKeys,
NULL },
- /* 32 */ { SQL_API_SQLFREEENV, "SQLFreeEnv", SQLFreeEnv, NULL },
- /* 33 */ { SQL_API_SQLFREEHANDLE, "SQLFreeHandle", SQLFreeHandle,
NULL },
- /* 34 */ { SQL_API_SQLFREESTMT, "SQLFreeStmt", SQLFreeStmt, NULL
},
- /* 35 */ { SQL_API_SQLFREECONNECT, "SQLFreeConnect", SQLFreeConnect,
NULL },
- /* 36 */ { SQL_API_SQLGETCONNECTATTR, "SQLGetConnectAttr",
SQLGetConnectAttr, NULL },
- /* 37 */ { SQL_API_SQLGETCONNECTOPTION, "SQLGetConnectOption",
SQLGetConnectOption, NULL },
- /* 38 */ { SQL_API_SQLGETCURSORNAME, "SQLGetCursorName",
SQLGetCursorName, NULL },
- /* 39 */ { SQL_API_SQLGETDATA, "SQLGetData", SQLGetData, NULL },
- /* 40 */ { SQL_API_SQLGETDESCFIELD, "SQLGetDescField",
SQLGetDescField, NULL },
- /* 41 */ { SQL_API_SQLGETDESCREC, "SQLGetDescRec", SQLGetDescRec,
NULL },
- /* 42 */ { SQL_API_SQLGETDIAGFIELD, "SQLGetDiagField",
SQLGetDiagField, NULL },
- /* 43 */ { SQL_API_SQLGETENVATTR, "SQLGetEnvAttr", SQLGetEnvAttr,
NULL },
- /* 44 */ { SQL_API_SQLGETFUNCTIONS, "SQLGetFunctions",
SQLGetFunctions, NULL },
- /* 45 */ { SQL_API_SQLGETINFO, "SQLGetInfo", SQLGetInfo, NULL },
- /* 46 */ { SQL_API_SQLGETSTMTATTR, "SQLGetStmtAttr", SQLGetStmtAttr,
NULL },
- /* 47 */ { SQL_API_SQLGETSTMTOPTION, "SQLGetStmtOption",
SQLGetStmtOption, NULL },
- /* 48 */ { SQL_API_SQLGETTYPEINFO, "SQLGetTypeInfo", SQLGetTypeInfo,
NULL },
- /* 49 */ { SQL_API_SQLMORERESULTS, "SQLMoreResults", SQLMoreResults,
NULL },
- /* 50 */ { SQL_API_SQLNATIVESQL, "SQLNativeSql", SQLNativeSql, NULL
},
- /* 51 */ { SQL_API_SQLNUMPARAMS, "SQLNumParams", SQLNumParams, NULL
},
- /* 52 */ { SQL_API_SQLNUMRESULTCOLS, "SQLNumResultCols",
SQLNumResultCols, NULL },
- /* 53 */ { SQL_API_SQLPARAMDATA, "SQLParamData", SQLParamData, NULL
},
- /* 54 */ { SQL_API_SQLPARAMOPTIONS, "SQLParamOptions",
SQLParamOptions, NULL },
- /* 55 */ { SQL_API_SQLPREPARE, "SQLPrepare", SQLPrepare, NULL },
- /* 56 */ { SQL_API_SQLPRIMARYKEYS, "SQLPrimaryKeys", SQLPrimaryKeys,
NULL },
- /* 57 */ { SQL_API_SQLPROCEDURECOLUMNS, "SQLProcedureColumns",
SQLProcedureColumns, NULL },
- /* 58 */ { SQL_API_SQLPROCEDURES, "SQLProcedures", SQLProcedures,
NULL },
- /* 59 */ { SQL_API_SQLPUTDATA, "SQLPutData", SQLPutData, NULL },
- /* 60 */ { SQL_API_SQLROWCOUNT, "SQLRowCount", SQLRowCount, NULL
},
- /* 61 */ { SQL_API_SQLSETCONNECTATTR, "SQLSetConnectAttr",
SQLSetConnectAttr, NULL },
- /* 62 */ { SQL_API_SQLSETCONNECTOPTION, "SQLSetConnectOption",
SQLSetConnectOption, NULL },
- /* 63 */ { SQL_API_SQLSETCURSORNAME, "SQLSetCursorName",
SQLSetCursorName, NULL },
- /* 64 */ { SQL_API_SQLSETDESCFIELD, "SQLSetDescField",
SQLSetDescField, NULL },
- /* 65 */ { SQL_API_SQLSETDESCREC, "SQLSetDescRec", SQLSetDescRec,
NULL },
- /* 66 */ { SQL_API_SQLSETENVATTR, "SQLSetEnvAttr", SQLSetEnvAttr,
NULL },
- /* 67 */ { SQL_API_SQLSETPARAM, "SQLSetParam", SQLSetParam, NULL
},
- /* 68 */ { SQL_API_SQLSETPOS, "SQLSetPos", SQLSetPos, NULL },
- /* 69 */ { SQL_API_SQLSETSCROLLOPTIONS, "SQLSetScrollOptions",
SQLSetScrollOptions, NULL },
- /* 70 */ { SQL_API_SQLSETSTMTATTR, "SQLSetStmtAttr", SQLSetStmtAttr,
NULL },
- /* 71 */ { SQL_API_SQLSETSTMTOPTION, "SQLSetStmtOption",
SQLSetStmtOption, NULL },
- /* 72 */ { SQL_API_SQLSPECIALCOLUMNS, "SQLSpecialColumns",
SQLSpecialColumns, NULL },
- /* 73 */ { SQL_API_SQLSTATISTICS, "SQLStatistics", SQLStatistics,
NULL },
- /* 74 */ { SQL_API_SQLTABLEPRIVILEGES, "SQLTablePrivileges",
SQLTablePrivileges, NULL },
- /* 75 */ { SQL_API_SQLTABLES, "SQLTables", SQLTables, NULL },
- /* 76 */ { SQL_API_SQLTRANSACT, "SQLTransact", SQLTransact, NULL
},
- /* 77 */ { SQL_API_SQLGETDIAGREC, "SQLGetDiagRec", SQLGetDiagRec,
NULL },
+ /* 00 */ { SQL_API_SQLALLOCCONNECT, "SQLAllocConnect",
SQLAllocConnect, NULL, NULL },
+ /* 01 */ { SQL_API_SQLALLOCENV, "SQLAllocEnv", SQLAllocEnv, NULL,
NULL },
+ /* 02 */ { SQL_API_SQLALLOCHANDLE, "SQLAllocHandle", SQLAllocHandle,
NULL, NULL },
+ /* 03 */ { SQL_API_SQLALLOCSTMT, "SQLAllocStmt", SQLAllocStmt,
NULL, NULL },
+ /* 04 */ { SQL_API_SQLALLOCHANDLESTD, "SQLAllocHandleStd",
SQLAllocHandleStd, NULL, NULL },
+ /* 05 */ { SQL_API_SQLBINDCOL, "SQLBindCol", SQLBindCol, NULL,
NULL },
+ /* 06 */ { SQL_API_SQLBINDPARAM, "SQLBindParam", SQLBindParam,
NULL, NULL },
+ /* 07 */ { SQL_API_SQLBINDPARAMETER, "SQLBindParameter",
SQLBindParameter, NULL, NULL },
+ /* 08 */ { SQL_API_SQLBROWSECONNECT, "SQLBrowseConnect",
SQLBrowseConnect, NULL, NULL },
+ /* 09 */ { SQL_API_SQLBULKOPERATIONS, "SQLBulkOperations",
SQLBulkOperations, NULL, NULL },
+ /* 10 */ { SQL_API_SQLCANCEL, "SQLCancel", SQLCancel, NULL, NULL
},
+ /* 11 */ { SQL_API_SQLCLOSECURSOR, "SQLCloseCursor", SQLCloseCursor,
NULL, NULL },
+ /* 12 */ { SQL_API_SQLCOLATTRIBUTE, "SQLColAttribute",
SQLColAttribute, NULL, NULL },
+ /* 13 */ { SQL_API_SQLCOLATTRIBUTES, "SQLColAttributes",
SQLColAttributes, NULL, NULL },
+ /* 14 */ { SQL_API_SQLCOLUMNPRIVILEGES, "SQLColumnPrivileges",
SQLColumnPrivileges, NULL, NULL },
+ /* 15 */ { SQL_API_SQLCOLUMNS, "SQLColumns", SQLColumns, NULL,
NULL },
+ /* 16 */ { SQL_API_SQLCONNECT, "SQLConnect", SQLConnect, NULL,
NULL },
+ /* 17 */ { SQL_API_SQLCOPYDESC, "SQLCopyDesc", SQLCopyDesc, NULL,
NULL },
+ /* 18 */ { SQL_API_SQLDATASOURCES, "SQLDataSources", SQLDataSources,
NULL, NULL },
+ /* 19 */ { SQL_API_SQLDESCRIBECOL, "SQLDescribeCol", SQLDescribeCol,
NULL, NULL },
+ /* 20 */ { SQL_API_SQLDESCRIBEPARAM, "SQLDescribeParam",
SQLDescribeParam, NULL, NULL },
+ /* 21 */ { SQL_API_SQLDISCONNECT, "SQLDisconnect", SQLDisconnect,
NULL, NULL },
+ /* 22 */ { SQL_API_SQLDRIVERCONNECT, "SQLDriverConnect",
SQLDriverConnect, NULL, NULL },
+ /* 23 */ { SQL_API_SQLDRIVERS, "SQLDrivers", SQLDrivers, NULL,
NULL },
+ /* 24 */ { SQL_API_SQLENDTRAN, "SQLEndTran", SQLEndTran, NULL,
NULL },
+ /* 25 */ { SQL_API_SQLERROR, "SQLError", SQLError, NULL, NULL
},
+ /* 26 */ { SQL_API_SQLEXECDIRECT, "SQLExecDirect", SQLExecDirect,
NULL, NULL },
+ /* 27 */ { SQL_API_SQLEXECUTE, "SQLExecute", SQLExecute, NULL,
NULL },
+ /* 28 */ { SQL_API_SQLEXTENDEDFETCH, "SQLExtendedFetch",
SQLExtendedFetch, NULL, NULL },
+ /* 29 */ { SQL_API_SQLFETCH, "SQLFetch", SQLFetch, NULL, NULL
},
+ /* 30 */ { SQL_API_SQLFETCHSCROLL, "SQLFetchScroll", SQLFetchScroll,
NULL, NULL },
+ /* 31 */ { SQL_API_SQLFOREIGNKEYS, "SQLForeignKeys", SQLForeignKeys,
NULL, NULL },
+ /* 32 */ { SQL_API_SQLFREEENV, "SQLFreeEnv", SQLFreeEnv, NULL,
NULL },
+ /* 33 */ { SQL_API_SQLFREEHANDLE, "SQLFreeHandle", SQLFreeHandle,
NULL, NULL },
+ /* 34 */ { SQL_API_SQLFREESTMT, "SQLFreeStmt", SQLFreeStmt, NULL,
NULL },
+ /* 35 */ { SQL_API_SQLFREECONNECT, "SQLFreeConnect", SQLFreeConnect,
NULL, NULL },
+ /* 36 */ { SQL_API_SQLGETCONNECTATTR, "SQLGetConnectAttr",
SQLGetConnectAttr, NULL, NULL },
+ /* 37 */ { SQL_API_SQLGETCONNECTOPTION, "SQLGetConnectOption",
SQLGetConnectOption, NULL, NULL },
+ /* 38 */ { SQL_API_SQLGETCURSORNAME, "SQLGetCursorName",
SQLGetCursorName, NULL, NULL },
+ /* 39 */ { SQL_API_SQLGETDATA, "SQLGetData", SQLGetData, NULL,
NULL },
+ /* 40 */ { SQL_API_SQLGETDESCFIELD, "SQLGetDescField",
SQLGetDescField, NULL, NULL },
+ /* 41 */ { SQL_API_SQLGETDESCREC, "SQLGetDescRec", SQLGetDescRec,
NULL, NULL },
+ /* 42 */ { SQL_API_SQLGETDIAGFIELD, "SQLGetDiagField",
SQLGetDiagField, NULL, NULL },
+ /* 43 */ { SQL_API_SQLGETENVATTR, "SQLGetEnvAttr", SQLGetEnvAttr,
NULL, NULL },
+ /* 44 */ { SQL_API_SQLGETFUNCTIONS, "SQLGetFunctions",
SQLGetFunctions, NULL, NULL },
+ /* 45 */ { SQL_API_SQLGETINFO, "SQLGetInfo", SQLGetInfo, NULL,
NULL },
+ /* 46 */ { SQL_API_SQLGETSTMTATTR, "SQLGetStmtAttr", SQLGetStmtAttr,
NULL, NULL },
+ /* 47 */ { SQL_API_SQLGETSTMTOPTION, "SQLGetStmtOption",
SQLGetStmtOption, NULL, NULL },
+ /* 48 */ { SQL_API_SQLGETTYPEINFO, "SQLGetTypeInfo", SQLGetTypeInfo,
NULL, NULL },
+ /* 49 */ { SQL_API_SQLMORERESULTS, "SQLMoreResults", SQLMoreResults,
NULL, NULL },
+ /* 50 */ { SQL_API_SQLNATIVESQL, "SQLNativeSql", SQLNativeSql,
NULL, NULL },
+ /* 51 */ { SQL_API_SQLNUMPARAMS, "SQLNumParams", SQLNumParams,
NULL, NULL },
+ /* 52 */ { SQL_API_SQLNUMRESULTCOLS, "SQLNumResultCols",
SQLNumResultCols, NULL, NULL },
+ /* 53 */ { SQL_API_SQLPARAMDATA, "SQLParamData", SQLParamData,
NULL, NULL },
+ /* 54 */ { SQL_API_SQLPARAMOPTIONS, "SQLParamOptions",
SQLParamOptions, NULL, NULL },
+ /* 55 */ { SQL_API_SQLPREPARE, "SQLPrepare", SQLPrepare, NULL,
NULL },
+ /* 56 */ { SQL_API_SQLPRIMARYKEYS, "SQLPrimaryKeys", SQLPrimaryKeys,
NULL, NULL },
+ /* 57 */ { SQL_API_SQLPROCEDURECOLUMNS, "SQLProcedureColumns",
SQLProcedureColumns, NULL, NULL },
+ /* 58 */ { SQL_API_SQLPROCEDURES, "SQLProcedures", SQLProcedures,
NULL, NULL },
+ /* 59 */ { SQL_API_SQLPUTDATA, "SQLPutData", SQLPutData, NULL,
NULL },
+ /* 60 */ { SQL_API_SQLROWCOUNT, "SQLRowCount", SQLRowCount, NULL,
NULL },
+ /* 61 */ { SQL_API_SQLSETCONNECTATTR, "SQLSetConnectAttr",
SQLSetConnectAttr, NULL, NULL },
+ /* 62 */ { SQL_API_SQLSETCONNECTOPTION, "SQLSetConnectOption",
SQLSetConnectOption, NULL, NULL },
+ /* 63 */ { SQL_API_SQLSETCURSORNAME, "SQLSetCursorName",
SQLSetCursorName, NULL, NULL },
+ /* 64 */ { SQL_API_SQLSETDESCFIELD, "SQLSetDescField",
SQLSetDescField, NULL, NULL },
+ /* 65 */ { SQL_API_SQLSETDESCREC, "SQLSetDescRec", SQLSetDescRec,
NULL, NULL },
+ /* 66 */ { SQL_API_SQLSETENVATTR, "SQLSetEnvAttr", SQLSetEnvAttr,
NULL, NULL },
+ /* 67 */ { SQL_API_SQLSETPARAM, "SQLSetParam", SQLSetParam, NULL,
NULL },
+ /* 68 */ { SQL_API_SQLSETPOS, "SQLSetPos", SQLSetPos, NULL, NULL
},
+ /* 69 */ { SQL_API_SQLSETSCROLLOPTIONS, "SQLSetScrollOptions",
SQLSetScrollOptions, NULL, NULL },
+ /* 70 */ { SQL_API_SQLSETSTMTATTR, "SQLSetStmtAttr", SQLSetStmtAttr,
NULL, NULL },
+ /* 71 */ { SQL_API_SQLSETSTMTOPTION, "SQLSetStmtOption",
SQLSetStmtOption, NULL, NULL },
+ /* 72 */ { SQL_API_SQLSPECIALCOLUMNS, "SQLSpecialColumns",
SQLSpecialColumns, NULL, NULL },
+ /* 73 */ { SQL_API_SQLSTATISTICS, "SQLStatistics", SQLStatistics,
NULL, NULL },
+ /* 74 */ { SQL_API_SQLTABLEPRIVILEGES, "SQLTablePrivileges",
SQLTablePrivileges, NULL, NULL },
+ /* 75 */ { SQL_API_SQLTABLES, "SQLTables", SQLTables, NULL, NULL
},
+ /* 76 */ { SQL_API_SQLTRANSACT, "SQLTransact", SQLTransact, NULL,
NULL },
+ /* 77 */ { SQL_API_SQLGETDIAGREC, "SQLGetDiagRec", SQLGetDiagRec,
NULL, NULL },
};
static PROXYHANDLE gProxyHandle;
@@ -156,10 +159,299 @@
} \
}
-SQLRETURN SQLDummyFunc()
-{
- TRACE("SQLDummyFunc: \n");
+static SQLRETURN SQLDummyFunc(void)
+{
+ TRACE("SQLDummyFunc:\n");
return SQL_SUCCESS;
+}
+
+/***********************************************************************
+ * 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;
+ int success;
+
+ success = 0;
+ 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 = 1;
+ 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 %d replicating driver %s\n",
+ reg_ret, desc);
+ success = 0;
+ }
+ }
+ else if (reg_ret != ERROR_SUCCESS)
+ {
+ TRACE ("Error %d checking for %s in drivers\n",
+ reg_ret, desc);
+ success = 0;
+ }
+ 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 %d closing %s key\n", reg_ret,
+ desc);
+ }
+ else
+ {
+ TRACE ("Error %d ensuring driver key %s\n",
+ reg_ret, desc);
+ success = 0;
+ }
+ }
+ else
+ {
+ WARN ("Unusually long driver name %s not replicated\n",
+ desc);
+ success = 0;
+ }
+ }
+ if (sql_ret != SQL_NO_DATA)
+ {
+ TRACE ("Error %d enumerating drivers\n", (int)sql_ret);
+ success = 0;
+ }
+ if ((reg_ret = RegCloseKey (hDrivers)) != ERROR_SUCCESS)
+ {
+ TRACE ("Error %d closing hDrivers\n", reg_ret);
+ }
+ }
+ else
+ {
+ TRACE ("Error %d opening HKLM\\S\\O\\OI\\Drivers\n", reg_ret);
+ }
+ if ((reg_ret = RegCloseKey (hODBCInst)) != ERROR_SUCCESS)
+ {
+ TRACE ("Error %d closing HKLM\\S\\O\\ODBCINST.INI\n", reg_ret);
+ }
+ }
+ else
+ {
+ TRACE ("Error %d 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 (int 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;
+ int success;
+ const char *which = is_user ? "user" : "system";
+
+ success = 0;
+ 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 = 1;
+ 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 %d replicating description of "
+ "%s(%s)\n", reg_ret, dsn, desc);
+ success = 0;
+ }
+ }
+ else if (reg_ret != ERROR_SUCCESS)
+ {
+ TRACE ("Error %d checking for description of %s\n",
+ reg_ret, dsn);
+ success = 0;
+ }
+ if ((reg_ret = RegCloseKey (hDSN)) != ERROR_SUCCESS)
+ {
+ TRACE ("Error %d closing %s DSN key %s\n",
+ reg_ret, which, dsn);
+ }
+ }
+ else
+ {
+ TRACE ("Error %d opening %s DSN key %s\n",
+ reg_ret, which, dsn);
+ success = 0;
+ }
+ }
+ else
+ {
+ WARN ("Unusually long %s data source name %s (%s) not "
+ "replicated\n", which, dsn, desc);
+ success = 0;
+ }
+ }
+ if (sql_ret != SQL_NO_DATA)
+ {
+ TRACE ("Error %d enumerating %s datasources\n",
+ (int)sql_ret, which);
+ success = 0;
+ }
+ if ((reg_ret = RegCloseKey (hODBC)) != ERROR_SUCCESS)
+ {
+ TRACE ("Error %d closing %s ODBC.INI registry key\n", reg_ret,
+ which);
+ }
+ }
+ else
+ {
+ TRACE ("Error %d 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 (0 /* system dsns */, hEnv);
+ ODBC_ReplicateODBCToRegistry (1 /* 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");
+ }
}
/***********************************************************************
@@ -178,14 +470,17 @@
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
int i;
- TRACE("Initializing or Finalizing proxy ODBC: %p,%lx,%p\n", hinstDLL,
fdwReason, lpvReserved);
+ TRACE("Initializing or Finalizing proxy ODBC: %p,%x,%p\n", hinstDLL,
fdwReason, lpvReserved);
if (fdwReason == DLL_PROCESS_ATTACH)
{
TRACE("Loading ODBC...\n");
DisableThreadLibraryCalls(hinstDLL);
if (ODBC_LoadDriverManager())
+ {
ODBC_LoadDMFunctions();
+ ODBC_ReplicateToRegistry();
+ }
}
else if (fdwReason == DLL_PROCESS_DETACH)
{
@@ -197,18 +492,16 @@
gProxyHandle.functions[i].func = SQLDummyFunc;
}
}
-#ifndef __REACTOS__
+
if (gProxyHandle.dmHandle)
{
wine_dlclose(gProxyHandle.dmHandle,NULL,0);
gProxyHandle.dmHandle = NULL;
}
-#endif
}
return TRUE;
}
-
/***********************************************************************
* ODBC_LoadDriverManager [Internal] Load ODBC library.
@@ -223,41 +516,28 @@
static BOOL ODBC_LoadDriverManager(void)
{
const char *s = getenv("LIB_ODBC_DRIVER_MANAGER");
-#ifndef __REACTOS__
char error[256];
+
+ TRACE("\n");
+
+ gProxyHandle.bFunctionReady = FALSE;
+
+#ifdef SONAME_LIBODBC
+ if (!s || !s[0]) s = SONAME_LIBODBC;
#endif
-
- TRACE("\n");
-
- gProxyHandle.bFunctionReady = FALSE;
- gProxyHandle.nErrorType = ERROR_LIBRARY_NOT_FOUND;
-
- if (s!= NULL && strlen (s) >= sizeof(gProxyHandle.dmLibName))
- {
- ERR("Driver name too long (%s)\n",s);
- return FALSE;
- }
- if (s == NULL || strlen(s) == 0)
- s = "libodbc.so";
- strcpy(gProxyHandle.dmLibName, s);
-#ifndef __REACTOS__
- gProxyHandle.dmHandle = wine_dlopen(gProxyHandle.dmLibName, RTLD_LAZY, error,
sizeof(error));
-
- if (gProxyHandle.dmHandle == NULL) /* fail to load unixODBC driver manager
*/
- {
- WARN("failed to open library %s: %s\n", gProxyHandle.dmLibName,
error);
- gProxyHandle.dmLibName[0] = '\0';
- gProxyHandle.nErrorType = ERROR_LIBRARY_NOT_FOUND;
- return FALSE;
- }
- else
+ if (!s || !s[0]) goto failed;
+
+ gProxyHandle.dmHandle = wine_dlopen(s, RTLD_LAZY | RTLD_GLOBAL, error,
sizeof(error));
+
+ if (gProxyHandle.dmHandle != NULL)
{
gProxyHandle.nErrorType = ERROR_FREE;
return TRUE;
}
-#else
+failed:
+ WARN("failed to open library %s: %s\n", debugstr_a(s), error);
+ gProxyHandle.nErrorType = ERROR_LIBRARY_NOT_FOUND;
return FALSE;
-#endif
}
@@ -273,16 +553,16 @@
static BOOL ODBC_LoadDMFunctions(void)
{
-#ifndef __REACTOS__
int i;
char error[256];
-#endif
if (gProxyHandle.dmHandle == NULL)
return FALSE;
-#ifndef __REACTOS__
+
for ( i = 0; i < NUM_SQLFUNC; i ++ )
{
+ char * pFuncNameW;
+
gProxyHandle.functions[i] = template_func[i];
gProxyHandle.functions[i].func = wine_dlsym(gProxyHandle.dmHandle,
gProxyHandle.functions[i].name, error, sizeof(error));
@@ -292,10 +572,27 @@
ERR("Failed to load function
%s\n",gProxyHandle.functions[i].name);
gProxyHandle.functions[i].func = SQLDummyFunc;
}
+ else
+ {
+ /* Build Unicode function name for this function */
+ pFuncNameW = HeapAlloc(GetProcessHeap(), 0,
strlen(gProxyHandle.functions[i].name) + 2);
+ strcpy(pFuncNameW, gProxyHandle.functions[i].name);
+ pFuncNameW[strlen(gProxyHandle.functions[i].name) + 1] = '\0';
+ pFuncNameW[strlen(gProxyHandle.functions[i].name)] = 'W';
+
+ gProxyHandle.functions[i].funcW = wine_dlsym(gProxyHandle.dmHandle,
+ pFuncNameW, error, sizeof(error));
+ if (error[0])
+ {
+/* TRACE("Failed to load function %s, possibly no Unicode version is
required\n", pFuncNameW); */
+ gProxyHandle.functions[i].funcW = NULL;
+ }
+ HeapFree(GetProcessHeap(), 0, pFuncNameW);
+ }
}
gProxyHandle.bFunctionReady = TRUE;
-#endif
+
return TRUE;
}
@@ -356,7 +653,7 @@
if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
{
if (gProxyHandle.nErrorType == ERROR_LIBRARY_NOT_FOUND)
- WARN("ProxyODBC: Can not load ODBC driver manager
library.\n");
+ WARN("ProxyODBC: Cannot load ODBC driver manager library.\n");
if (HandleType == SQL_HANDLE_ENV)
*OutputHandle = SQL_NULL_HENV;
@@ -409,12 +706,12 @@
SQLRETURN WINAPI SQLAllocHandleStd( SQLSMALLINT HandleType,
SQLHANDLE InputHandle, SQLHANDLE
*OutputHandle)
{
- TRACE("ProxyODBC: SQLAllocHandelStd.\n");
+ TRACE("ProxyODBC: SQLAllocHandleStd.\n");
if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
{
if (gProxyHandle.nErrorType == ERROR_LIBRARY_NOT_FOUND)
- WARN("ProxyODBC: Can not load ODBC driver manager
library.\n");
+ WARN("ProxyODBC: Cannot load ODBC driver manager library.\n");
if (HandleType == SQL_HANDLE_ENV)
*OutputHandle = SQL_NULL_HENV;
@@ -439,8 +736,8 @@
*/
SQLRETURN WINAPI SQLBindCol(SQLHSTMT StatementHandle,
SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
- SQLPOINTER TargetValue, SQLINTEGER BufferLength,
- SQLINTEGER *StrLen_or_Ind)
+ SQLPOINTER TargetValue, SQLLEN BufferLength,
+ SQLLEN *StrLen_or_Ind)
{
TRACE("\n");
@@ -462,9 +759,9 @@
*/
SQLRETURN WINAPI SQLBindParam(SQLHSTMT StatementHandle,
SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
- SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision,
+ SQLSMALLINT ParameterType, SQLULEN LengthPrecision,
SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue,
- SQLINTEGER *StrLen_or_Ind)
+ SQLLEN *StrLen_or_Ind)
{
TRACE("\n");
@@ -560,8 +857,8 @@
CHECK_READY_AND_dmHandle();
- strcpy(gProxyHandle.ServerName, (const char*)ServerName);
- strcpy(gProxyHandle.UserName, (const char*)UserName);
+ strcpy( (LPSTR)gProxyHandle.ServerName, (LPSTR)ServerName );
+ strcpy( (LPSTR)gProxyHandle.UserName, (LPSTR)UserName );
assert(gProxyHandle.functions[SQLAPI_INDEX_SQLCONNECT].func);
ret=(gProxyHandle.functions[SQLAPI_INDEX_SQLCONNECT].func)
@@ -612,7 +909,7 @@
(EnvironmentHandle, Direction, ServerName,
BufferLength1, NameLength1, Description, BufferLength2, NameLength2);
- if (WINE_TRACE_ON(odbc))
+ if (TRACE_ON(odbc))
{
TRACE("returns: %d \t", ret);
if (*NameLength1 > 0)
@@ -632,7 +929,7 @@
SQLRETURN WINAPI SQLDescribeCol(SQLHSTMT StatementHandle,
SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName,
SQLSMALLINT BufferLength, SQLSMALLINT *NameLength,
- SQLSMALLINT *DataType, SQLUINTEGER *ColumnSize,
+ SQLSMALLINT *DataType, SQLULEN *ColumnSize,
SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable)
{
TRACE("\n");
@@ -746,7 +1043,7 @@
/*************************************************************************
* SQLFetchScroll [ODBC32.030]
*/
-SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation,
SQLINTEGER FetchOffset)
+SQLRETURN WINAPI SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation,
SQLLEN FetchOffset)
{
TRACE("\n");
@@ -883,8 +1180,8 @@
*/
SQLRETURN WINAPI SQLGetData(SQLHSTMT StatementHandle,
SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType,
- SQLPOINTER TargetValue, SQLINTEGER BufferLength,
- SQLINTEGER *StrLen_or_Ind)
+ SQLPOINTER TargetValue, SQLLEN BufferLength,
+ SQLLEN *StrLen_or_Ind)
{
TRACE("\n");
@@ -923,7 +1220,7 @@
SQLSMALLINT RecNumber, SQLCHAR *Name,
SQLSMALLINT BufferLength, SQLSMALLINT *StringLength,
SQLSMALLINT *Type, SQLSMALLINT *SubType,
- SQLINTEGER *Length, SQLSMALLINT *Precision,
+ SQLLEN *Length, SQLSMALLINT *Precision,
SQLSMALLINT *Scale, SQLSMALLINT *Nullable)
{
TRACE("\n");
@@ -1119,7 +1416,7 @@
/*************************************************************************
* SQLPutData [ODBC32.049]
*/
-SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLINTEGER
StrLen_or_Ind)
+SQLRETURN WINAPI SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN
StrLen_or_Ind)
{
TRACE("\n");
@@ -1134,7 +1431,7 @@
/*************************************************************************
* SQLRowCount [ODBC32.020]
*/
-SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLINTEGER *RowCount)
+SQLRETURN WINAPI SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount)
{
TRACE("\n");
@@ -1165,7 +1462,7 @@
/*************************************************************************
* SQLSetConnectOption [ODBC32.050]
*/
-SQLRETURN WINAPI SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option,
SQLUINTEGER Value)
+SQLRETURN WINAPI SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option,
SQLULEN Value)
{
TRACE("\n");
@@ -1214,10 +1511,10 @@
*/
SQLRETURN WINAPI SQLSetDescRec(SQLHDESC DescriptorHandle,
SQLSMALLINT RecNumber, SQLSMALLINT Type,
- SQLSMALLINT SubType, SQLINTEGER Length,
+ SQLSMALLINT SubType, SQLLEN Length,
SQLSMALLINT Precision, SQLSMALLINT Scale,
- SQLPOINTER Data, SQLINTEGER *StringLength,
- SQLINTEGER *Indicator)
+ SQLPOINTER Data, SQLLEN *StringLength,
+ SQLLEN *Indicator)
{
TRACE("\n");
@@ -1252,9 +1549,9 @@
*/
SQLRETURN WINAPI SQLSetParam(SQLHSTMT StatementHandle,
SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType,
- SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision,
+ SQLSMALLINT ParameterType, SQLULEN LengthPrecision,
SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue,
- SQLINTEGER *StrLen_or_Ind)
+ SQLLEN *StrLen_or_Ind)
{
TRACE("\n");
@@ -1287,7 +1584,7 @@
/*************************************************************************
* SQLSetStmtOption [ODBC32.051]
*/
-SQLRETURN WINAPI SQLSetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option,
SQLUINTEGER Value)
+SQLRETURN WINAPI SQLSetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLULEN
Value)
{
TRACE("\n");
@@ -1423,7 +1720,7 @@
SQLPOINTER rgbDesc,
SQLSMALLINT cbDescMax,
SQLSMALLINT *pcbDesc,
- SQLINTEGER *pfDesc)
+ SQLLEN *pfDesc)
{
TRACE("\n");
@@ -1467,7 +1764,7 @@
SQLHSTMT hstmt,
SQLUSMALLINT ipar,
SQLSMALLINT *pfSqlType,
- SQLUINTEGER *pcbParamDef,
+ SQLULEN *pcbParamDef,
SQLSMALLINT *pibScale,
SQLSMALLINT *pfNullable)
{
@@ -1745,11 +2042,11 @@
SQLSMALLINT fParamType,
SQLSMALLINT fCType,
SQLSMALLINT fSqlType,
- SQLUINTEGER cbColDef,
+ SQLULEN cbColDef,
SQLSMALLINT ibScale,
SQLPOINTER rgbValue,
- SQLINTEGER cbValueMax,
- SQLINTEGER *pcbValue)
+ SQLLEN cbValueMax,
+ SQLLEN *pcbValue)
{
TRACE("\n");
@@ -1792,7 +2089,7 @@
SQLRETURN WINAPI SQLSetScrollOptions(
SQLHSTMT statement_handle,
SQLUSMALLINT f_concurrency,
- SQLINTEGER crow_keyset,
+ SQLLEN crow_keyset,
SQLUSMALLINT crow_rowset )
{
TRACE("\n");
@@ -1804,4 +2101,832 @@
(statement_handle, f_concurrency, crow_keyset, crow_rowset);
}
+static int 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 < sizeof(attrList) / sizeof(SQLUSMALLINT); i++) {
+ if (attrList[i] == fDescType) return 1;
+ }
+ return 0;
+}
+
+/*************************************************************************
+ * SQLColAttributesW [ODBC32.106]
+ */
+SQLRETURN WINAPI SQLColAttributesW(
+ SQLHSTMT hstmt,
+ SQLUSMALLINT icol,
+ SQLUSMALLINT fDescType,
+ SQLPOINTER rgbDesc,
+ SQLSMALLINT cbDescMax,
+ SQLSMALLINT *pcbDesc,
+ SQLLEN *pfDesc)
+{
+ SQLRETURN iResult;
+
+ TRACE("hstmt=0x%08lx icol=%d fDescType=%d rgbDesc=%p cbDescMax=%d pcbDesc=%p
pfDesc=%p\n",
+ hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc);
+
+ CHECK_dmHandle();
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLCOLATTRIBUTES].funcW);
+ iResult = (gProxyHandle.functions[SQLAPI_INDEX_SQLCOLATTRIBUTES].funcW)
+ (hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc);
+ if (iResult == SQL_SUCCESS && rgbDesc != NULL &&
SQLColAttributes_KnownStringAttribute(fDescType)) {
+ /*
+ TRACE("Dumping values fetched via SQLColAttributesW:\n");
+ TRACE(" Attribute name : %s\n", debugstr_w(rgbDesc));
+ TRACE(" Declared length: %d\n", *pcbDesc);
+ */
+ if (*pcbDesc != lstrlenW(rgbDesc) * 2) {
+ TRACE("CHEAT: resetting name length for ADO\n");
+ *pcbDesc = lstrlenW(rgbDesc) * 2;
+ }
+ }
+ return iResult;
+}
+
+/*************************************************************************
+ * SQLConnectW [ODBC32.107]
+ */
+SQLRETURN WINAPI SQLConnectW(SQLHDBC ConnectionHandle,
+ WCHAR *ServerName, SQLSMALLINT NameLength1,
+ WCHAR *UserName, SQLSMALLINT NameLength2,
+ WCHAR *Authentication, SQLSMALLINT NameLength3)
+{
+ SQLRETURN ret;
+ TRACE("(Server=%.*s)\n",NameLength1+3, debugstr_w(ServerName));
+
+ CHECK_READY_AND_dmHandle();
+
+ WideCharToMultiByte(
+ CP_UTF8, 0,
+ ServerName, NameLength1,
+ gProxyHandle.ServerName, sizeof(gProxyHandle.ServerName),
+ NULL, NULL);
+ WideCharToMultiByte(
+ CP_UTF8, 0,
+ UserName, NameLength2,
+ gProxyHandle.UserName, sizeof(gProxyHandle.UserName),
+ NULL, NULL);
+
+ assert(gProxyHandle.functions[SQLAPI_INDEX_SQLCONNECT].funcW);
+ ret=(gProxyHandle.functions[SQLAPI_INDEX_SQLCONNECT].funcW)
+ (ConnectionHandle, ServerName, NameLength1,
+ UserName, NameLength2, Authentication, NameLength3);
+
+ TRACE("returns %d\n",ret);
+ return ret;
+}
+
+/*************************************************************************
+ * SQLDescribeColW [ODBC32.108]
+ */
+SQLRETURN WINAPI SQLDescribeColW(SQLHSTMT StatementHandle,
+ SQLUSMALLINT ColumnNumber, SQLWCHAR *ColumnName,
+ SQLSMALLINT BufferLength, SQLSMALLINT *NameLength,
+ SQLSMALLINT *DataType, SQLULEN *ColumnSize,
+ SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable)
+{
+ SQLRETURN iResult;
+ TRACE("\n");
+
+ CHECK_READY_AND_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLDESCRIBECOL].funcW);
+ iResult = (gProxyHandle.functions[SQLAPI_INDEX_SQLDESCRIBECOL].funcW)
+ (StatementHandle, ColumnNumber, ColumnName,
+ BufferLength, NameLength, DataType, ColumnSize, DecimalDigits, Nullable);
+ if (iResult >= 0) {
+ TRACE("Successfully recovered the following column
information:\n");
+ TRACE("\tRequested column index: %d\n", ColumnNumber);
+ TRACE("\tAvailable length for column name: %d\n", BufferLength);
+ if (NameLength != NULL)
+ TRACE("\tActual length for column name: %d\n", *NameLength);
+ else TRACE("\tActual length for column name: (null)\n");
+ TRACE("\tReturned column name: %s\n", debugstr_w(ColumnName));
+ }
+ return iResult;
+}
+
+/*************************************************************************
+ * SQLErrorW [ODBC32.110]
+ */
+SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle,
+ SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle,
+ WCHAR *Sqlstate, SQLINTEGER *NativeError,
+ WCHAR *MessageText, SQLSMALLINT BufferLength,
+ SQLSMALLINT *TextLength)
+{
+ TRACE("\n");
+
+ CHECK_READY_AND_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLERROR].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLERROR].funcW)
+ (EnvironmentHandle, ConnectionHandle, StatementHandle,
+ Sqlstate, NativeError, MessageText, BufferLength, TextLength);
+}
+
+/*************************************************************************
+ * SQLExecDirectW [ODBC32.111]
+ */
+SQLRETURN WINAPI SQLExecDirectW(SQLHSTMT StatementHandle,
+ WCHAR *StatementText, SQLINTEGER TextLength)
+{
+ TRACE("\n");
+
+ CHECK_READY_AND_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLEXECDIRECT].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLEXECDIRECT].funcW)
+ (StatementHandle, StatementText, TextLength);
+}
+
+/*************************************************************************
+ * SQLGetCursorNameW [ODBC32.117]
+ */
+SQLRETURN WINAPI SQLGetCursorNameW(SQLHSTMT StatementHandle,
+ WCHAR *CursorName, SQLSMALLINT BufferLength,
+ SQLSMALLINT *NameLength)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLGETCURSORNAME].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETCURSORNAME].funcW)
+ (StatementHandle, CursorName, BufferLength, NameLength);
+}
+
+/*************************************************************************
+ * SQLPrepareW [ODBC32.119]
+ */
+SQLRETURN WINAPI SQLPrepareW(SQLHSTMT StatementHandle,
+ WCHAR *StatementText, SQLINTEGER TextLength)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLPREPARE].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLPREPARE].funcW)
+ (StatementHandle, StatementText, TextLength);
+}
+
+/*************************************************************************
+ * SQLSetCursorNameW [ODBC32.121]
+ */
+SQLRETURN WINAPI SQLSetCursorNameW(SQLHSTMT StatementHandle, WCHAR *CursorName,
SQLSMALLINT NameLength)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLSETCURSORNAME].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLSETCURSORNAME].funcW)
+ (StatementHandle, CursorName, NameLength);
+}
+
+/*************************************************************************
+ * SQLColAttributeW [ODBC32.127]
+ */
+SQLRETURN WINAPI SQLColAttributeW (SQLHSTMT StatementHandle,
+ SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier,
+ SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength,
+ SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute)
+{
+ SQLRETURN iResult;
+
+ TRACE("StatementHandle=0x%08lx ColumnNumber=%d FieldIdentifier=%d
CharacterAttribute=%p BufferLength=%d StringLength=%p NumericAttribute=%p\n",
+ StatementHandle, ColumnNumber, FieldIdentifier,
+ CharacterAttribute, BufferLength, StringLength, NumericAttribute);
+
+ CHECK_READY_AND_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLCOLATTRIBUTE].funcW);
+ iResult = (gProxyHandle.functions[SQLAPI_INDEX_SQLCOLATTRIBUTE].funcW)
+ (StatementHandle, ColumnNumber, FieldIdentifier,
+ CharacterAttribute, BufferLength, StringLength, NumericAttribute);
+ if (iResult == SQL_SUCCESS && CharacterAttribute != NULL &&
SQLColAttributes_KnownStringAttribute(FieldIdentifier)) {
+ /*
+ TRACE("Dumping values fetched via SQLColAttributeW:\n");
+ TRACE(" Attribute name : %s\n", debugstr_w(rgbDesc));
+ TRACE(" Declared length: %d\n", *pcbDesc);
+ */
+ if (*StringLength != lstrlenW(CharacterAttribute) * 2) {
+ TRACE("CHEAT: resetting name length for ADO\n");
+ *StringLength = lstrlenW(CharacterAttribute) * 2;
+ }
+ }
+ return iResult;
+}
+
+/*************************************************************************
+ * SQLGetConnectAttrW [ODBC32.132]
+ */
+SQLRETURN WINAPI SQLGetConnectAttrW(SQLHDBC ConnectionHandle,
+ SQLINTEGER Attribute, SQLPOINTER Value,
+ SQLINTEGER BufferLength, SQLINTEGER *StringLength)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLGETCONNECTATTR].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETCONNECTATTR].funcW)
+ (ConnectionHandle, Attribute, Value,
+ BufferLength, StringLength);
+}
+
+/*************************************************************************
+ * SQLGetDescFieldW [ODBC32.133]
+ */
+SQLRETURN WINAPI SQLGetDescFieldW(SQLHDESC DescriptorHandle,
+ SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
+ SQLPOINTER Value, SQLINTEGER BufferLength,
+ SQLINTEGER *StringLength)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLGETDESCFIELD].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETDESCFIELD].funcW)
+ (DescriptorHandle, RecNumber, FieldIdentifier,
+ Value, BufferLength, StringLength);
+}
+
+/*************************************************************************
+ * SQLGetDescRecW [ODBC32.134]
+ */
+SQLRETURN WINAPI SQLGetDescRecW(SQLHDESC DescriptorHandle,
+ SQLSMALLINT RecNumber, SQLWCHAR *Name,
+ SQLSMALLINT BufferLength, SQLSMALLINT *StringLength,
+ SQLSMALLINT *Type, SQLSMALLINT *SubType,
+ SQLLEN *Length, SQLSMALLINT *Precision,
+ SQLSMALLINT *Scale, SQLSMALLINT *Nullable)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLGETDESCREC].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETDESCREC].funcW)
+ (DescriptorHandle, RecNumber, Name, BufferLength,
+ StringLength, Type, SubType, Length, Precision, Scale, Nullable);
+}
+
+/*************************************************************************
+ * SQLGetDiagFieldW [ODBC32.135]
+ */
+SQLRETURN WINAPI SQLGetDiagFieldW(SQLSMALLINT HandleType, SQLHANDLE Handle,
+ SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier,
+ SQLPOINTER DiagInfo, SQLSMALLINT BufferLength,
+ SQLSMALLINT *StringLength)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLGETDIAGFIELD].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETDIAGFIELD].funcW)
+ (HandleType, Handle, RecNumber, DiagIdentifier,
+ DiagInfo, BufferLength, StringLength);
+}
+
+/*************************************************************************
+ * SQLGetDiagRecW [ODBC32.136]
+ */
+SQLRETURN WINAPI SQLGetDiagRecW(SQLSMALLINT HandleType, SQLHANDLE Handle,
+ SQLSMALLINT RecNumber, WCHAR *Sqlstate,
+ SQLINTEGER *NativeError, WCHAR *MessageText,
+ SQLSMALLINT BufferLength, SQLSMALLINT *TextLength)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLGETDIAGREC].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETDIAGREC].funcW)
+ (HandleType, Handle, RecNumber, Sqlstate, NativeError,
+ MessageText, BufferLength, TextLength);
+}
+
+/*************************************************************************
+ * SQLGetStmtAttrW [ODBC32.138]
+ */
+SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle,
+ SQLINTEGER Attribute, SQLPOINTER Value,
+ SQLINTEGER BufferLength, SQLINTEGER *StringLength)
+{
+ SQLRETURN iResult;
+
+ TRACE("Attribute = (%02ld) Value = %p BufferLength = (%ld) StringLength =
%p\n",
+ Attribute, Value, BufferLength, StringLength);
+
+ if (Value == NULL) {
+ WARN("Unexpected NULL in Value return address\n");
+ iResult = SQL_ERROR;
+/*
+ } else if (StringLength == NULL) {
+ WARN("Unexpected NULL in StringLength return address\n");
+ iResult = SQL_ERROR;
+*/
+ } else {
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLGETSTMTATTR].funcW);
+ iResult = (gProxyHandle.functions[SQLAPI_INDEX_SQLGETSTMTATTR].funcW)
+ (StatementHandle, Attribute, Value, BufferLength, StringLength);
+ TRACE("returning %d...\n", iResult);
+ }
+ return iResult;
+}
+
+/*************************************************************************
+ * SQLSetConnectAttrW [ODBC32.139]
+ */
+SQLRETURN WINAPI SQLSetConnectAttrW(SQLHDBC ConnectionHandle, SQLINTEGER Attribute,
+ SQLPOINTER Value, SQLINTEGER StringLength)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLSETCONNECTATTR].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLSETCONNECTATTR].funcW)
+ (ConnectionHandle, Attribute, Value, StringLength);
+}
+
+/*************************************************************************
+ * SQLColumnsW [ODBC32.140]
+ */
+SQLRETURN WINAPI SQLColumnsW(SQLHSTMT StatementHandle,
+ WCHAR *CatalogName, SQLSMALLINT NameLength1,
+ WCHAR *SchemaName, SQLSMALLINT NameLength2,
+ WCHAR *TableName, SQLSMALLINT NameLength3,
+ WCHAR *ColumnName, SQLSMALLINT NameLength4)
+{
+ TRACE("\n");
+
+ CHECK_READY_AND_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLCOLUMNS].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLCOLUMNS].funcW)
+ (StatementHandle, CatalogName, NameLength1,
+ SchemaName, NameLength2, TableName, NameLength3, ColumnName, NameLength4);
+}
+
+/*************************************************************************
+ * SQLDriverConnectW [ODBC32.141]
+ */
+SQLRETURN WINAPI SQLDriverConnectW(
+ SQLHDBC hdbc,
+ SQLHWND hwnd,
+ WCHAR *conn_str_in,
+ SQLSMALLINT len_conn_str_in,
+ WCHAR *conn_str_out,
+ SQLSMALLINT conn_str_out_max,
+ SQLSMALLINT *ptr_conn_str_out,
+ SQLUSMALLINT driver_completion )
+{
+ TRACE("ConnStrIn (%d bytes) --> %s\n", len_conn_str_in,
debugstr_w(conn_str_in));
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLDRIVERCONNECT].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLDRIVERCONNECT].funcW)
+ (hdbc, hwnd, conn_str_in, len_conn_str_in, conn_str_out,
+ conn_str_out_max, ptr_conn_str_out, driver_completion);
+}
+
+/*************************************************************************
+ * SQLGetConnectOptionW [ODBC32.142]
+ */
+SQLRETURN WINAPI SQLGetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option,
SQLPOINTER Value)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLGETCONNECTOPTION].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETCONNECTOPTION].funcW)
+ (ConnectionHandle, Option, Value);
+}
+
+/*************************************************************************
+ * SQLGetInfoW [ODBC32.145]
+ */
+SQLRETURN WINAPI SQLGetInfoW(SQLHDBC ConnectionHandle,
+ SQLUSMALLINT InfoType, SQLPOINTER InfoValue,
+ SQLSMALLINT BufferLength, SQLSMALLINT *StringLength)
+{
+ SQLRETURN iResult;
+
+ TRACE("InfoType = (%02u), InfoValue = %p, BufferLength = %d bytes\n",
InfoType, InfoValue, BufferLength);
+ if (InfoValue == NULL) {
+ WARN("Unexpected NULL in InfoValue address\n");
+ iResult = SQL_ERROR;
+ } else {
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLGETINFO].funcW);
+ iResult = (gProxyHandle.functions[SQLAPI_INDEX_SQLGETINFO].funcW)
+ (ConnectionHandle, InfoType, InfoValue, BufferLength, StringLength);
+ TRACE("returning %d...\n", iResult);
+ }
+ return iResult;
+}
+
+/*************************************************************************
+ * SQLGetTypeInfoW [ODBC32.147]
+ */
+SQLRETURN WINAPI SQLGetTypeInfoW(SQLHSTMT StatementHandle, SQLSMALLINT DataType)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLGETTYPEINFO].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLGETTYPEINFO].funcW)
+ (StatementHandle, DataType);
+}
+
+/*************************************************************************
+ * SQLSetConnectOptionW [ODBC32.150]
+ */
+SQLRETURN WINAPI SQLSetConnectOptionW(SQLHDBC ConnectionHandle, SQLUSMALLINT Option,
SQLULEN Value)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLSETCONNECTOPTION].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLSETCONNECTOPTION].funcW)
+ (ConnectionHandle, Option, Value);
+}
+
+/*************************************************************************
+ * SQLSpecialColumnsW [ODBC32.152]
+ */
+SQLRETURN WINAPI SQLSpecialColumnsW(SQLHSTMT StatementHandle,
+ SQLUSMALLINT IdentifierType, SQLWCHAR *CatalogName,
+ SQLSMALLINT NameLength1, SQLWCHAR *SchemaName,
+ SQLSMALLINT NameLength2, SQLWCHAR *TableName,
+ SQLSMALLINT NameLength3, SQLUSMALLINT Scope,
+ SQLUSMALLINT Nullable)
+{
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLSPECIALCOLUMNS].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLSPECIALCOLUMNS].funcW)
+ (StatementHandle, IdentifierType, CatalogName, NameLength1, SchemaName,
+ NameLength2, TableName, NameLength3, Scope, Nullable);
+}
+
+/*************************************************************************
+ * SQLStatisticsW [ODBC32.153]
+ */
+SQLRETURN WINAPI SQLStatisticsW(SQLHSTMT StatementHandle,
+ SQLWCHAR *CatalogName, SQLSMALLINT NameLength1,
+ SQLWCHAR *SchemaName, SQLSMALLINT NameLength2,
+ SQLWCHAR *TableName, SQLSMALLINT NameLength3,
+ SQLUSMALLINT Unique, SQLUSMALLINT Reserved)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLSTATISTICS].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLSTATISTICS].funcW)
+ (StatementHandle, CatalogName, NameLength1, SchemaName, NameLength2,
+ TableName, NameLength3, Unique, Reserved);
+}
+
+/*************************************************************************
+ * SQLTablesW [ODBC32.154]
+ */
+SQLRETURN WINAPI SQLTablesW(SQLHSTMT StatementHandle,
+ SQLWCHAR *CatalogName, SQLSMALLINT NameLength1,
+ SQLWCHAR *SchemaName, SQLSMALLINT NameLength2,
+ SQLWCHAR *TableName, SQLSMALLINT NameLength3,
+ SQLWCHAR *TableType, SQLSMALLINT NameLength4)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLTABLES].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLTABLES].funcW)
+ (StatementHandle, CatalogName, NameLength1,
+ SchemaName, NameLength2, TableName, NameLength3, TableType,
NameLength4);
+}
+
+/*************************************************************************
+ * SQLBrowseConnectW [ODBC32.155]
+ */
+SQLRETURN WINAPI SQLBrowseConnectW(
+ SQLHDBC hdbc,
+ SQLWCHAR *szConnStrIn,
+ SQLSMALLINT cbConnStrIn,
+ SQLWCHAR *szConnStrOut,
+ SQLSMALLINT cbConnStrOutMax,
+ SQLSMALLINT *pcbConnStrOut)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLBROWSECONNECT].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLBROWSECONNECT].funcW)
+ (hdbc, szConnStrIn, cbConnStrIn, szConnStrOut, cbConnStrOutMax,
pcbConnStrOut);
+}
+
+/*************************************************************************
+ * SQLColumnPrivilegesW [ODBC32.156]
+ */
+SQLRETURN WINAPI SQLColumnPrivilegesW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLWCHAR *szTableName,
+ SQLSMALLINT cbTableName,
+ SQLWCHAR *szColumnName,
+ SQLSMALLINT cbColumnName)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLCOLUMNPRIVILEGES].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLCOLUMNPRIVILEGES].funcW)
+ (hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
+ szTableName, cbTableName, szColumnName, cbColumnName);
+}
+
+/*************************************************************************
+ * SQLDataSourcesW [ODBC32.157]
+ */
+SQLRETURN WINAPI SQLDataSourcesW(SQLHENV EnvironmentHandle,
+ SQLUSMALLINT Direction, WCHAR *ServerName,
+ SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1,
+ WCHAR *Description, SQLSMALLINT BufferLength2,
+ SQLSMALLINT *NameLength2)
+{
+ SQLRETURN ret;
+
+ TRACE("EnvironmentHandle = %p\n", (LPVOID)EnvironmentHandle);
+
+ if (!gProxyHandle.bFunctionReady || gProxyHandle.dmHandle == NULL)
+ {
+ ERR("Error: empty dm handle (gProxyHandle.dmHandle == NULL)\n");
+ return SQL_ERROR;
+ }
+
+ assert(gProxyHandle.functions[SQLAPI_INDEX_SQLDATASOURCES].funcW);
+ ret = (gProxyHandle.functions[SQLAPI_INDEX_SQLDATASOURCES].funcW)
+ (EnvironmentHandle, Direction, ServerName,
+ BufferLength1, NameLength1, Description, BufferLength2, NameLength2);
+
+ if (TRACE_ON(odbc))
+ {
+ TRACE("returns: %d \t", ret);
+ if (*NameLength1 > 0)
+ TRACE("DataSource = %s,", debugstr_w(ServerName));
+ if (*NameLength2 > 0)
+ TRACE(" Description = %s", debugstr_w(Description));
+ TRACE("\n");
+ }
+
+ return ret;
+}
+
+/*************************************************************************
+ * SQLForeignKeysW [ODBC32.160]
+ */
+SQLRETURN WINAPI SQLForeignKeysW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szPkCatalogName,
+ SQLSMALLINT cbPkCatalogName,
+ SQLWCHAR *szPkSchemaName,
+ SQLSMALLINT cbPkSchemaName,
+ SQLWCHAR *szPkTableName,
+ SQLSMALLINT cbPkTableName,
+ SQLWCHAR *szFkCatalogName,
+ SQLSMALLINT cbFkCatalogName,
+ SQLWCHAR *szFkSchemaName,
+ SQLSMALLINT cbFkSchemaName,
+ SQLWCHAR *szFkTableName,
+ SQLSMALLINT cbFkTableName)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLFOREIGNKEYS].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLFOREIGNKEYS].funcW)
+ (hstmt, szPkCatalogName, cbPkCatalogName, szPkSchemaName,
cbPkSchemaName,
+ szPkTableName, cbPkTableName, szFkCatalogName, cbFkCatalogName,
szFkSchemaName,
+ cbFkSchemaName, szFkTableName, cbFkTableName);
+}
+
+/*************************************************************************
+ * SQLNativeSqlW [ODBC32.162]
+ */
+SQLRETURN WINAPI SQLNativeSqlW(
+ SQLHDBC hdbc,
+ SQLWCHAR *szSqlStrIn,
+ SQLINTEGER cbSqlStrIn,
+ SQLWCHAR *szSqlStr,
+ SQLINTEGER cbSqlStrMax,
+ SQLINTEGER *pcbSqlStr)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLNATIVESQL].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLNATIVESQL].funcW)
+ (hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr);
+}
+
+/*************************************************************************
+ * SQLPrimaryKeysW [ODBC32.165]
+ */
+SQLRETURN WINAPI SQLPrimaryKeysW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLWCHAR *szTableName,
+ SQLSMALLINT cbTableName)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLPRIMARYKEYS].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLPRIMARYKEYS].funcW)
+ (hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
+ szTableName, cbTableName);
+}
+
+/*************************************************************************
+ * SQLProcedureColumnsW [ODBC32.166]
+ */
+SQLRETURN WINAPI SQLProcedureColumnsW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLWCHAR *szProcName,
+ SQLSMALLINT cbProcName,
+ SQLWCHAR *szColumnName,
+ SQLSMALLINT cbColumnName)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLPROCEDURECOLUMNS].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLPROCEDURECOLUMNS].funcW)
+ (hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
+ szProcName, cbProcName, szColumnName, cbColumnName);
+}
+
+/*************************************************************************
+ * SQLProceduresW [ODBC32.167]
+ */
+SQLRETURN WINAPI SQLProceduresW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLWCHAR *szProcName,
+ SQLSMALLINT cbProcName)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLPROCEDURES].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLPROCEDURES].funcW)
+ (hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
+ szProcName, cbProcName);
+}
+
+/*************************************************************************
+ * SQLTablePrivilegesW [ODBC32.170]
+ */
+SQLRETURN WINAPI SQLTablePrivilegesW(
+ SQLHSTMT hstmt,
+ SQLWCHAR *szCatalogName,
+ SQLSMALLINT cbCatalogName,
+ SQLWCHAR *szSchemaName,
+ SQLSMALLINT cbSchemaName,
+ SQLWCHAR *szTableName,
+ SQLSMALLINT cbTableName)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLTABLEPRIVILEGES].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLTABLEPRIVILEGES].funcW)
+ (hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName,
+ szTableName, cbTableName);
+}
+
+/*************************************************************************
+ * SQLDriversW [ODBC32.171]
+ */
+SQLRETURN WINAPI SQLDriversW(
+ SQLHENV henv,
+ SQLUSMALLINT fDirection,
+ SQLWCHAR *szDriverDesc,
+ SQLSMALLINT cbDriverDescMax,
+ SQLSMALLINT *pcbDriverDesc,
+ SQLWCHAR *szDriverAttributes,
+ SQLSMALLINT cbDriverAttrMax,
+ SQLSMALLINT *pcbDriverAttr)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLDRIVERS].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLDRIVERS].funcW)
+ (henv, fDirection, szDriverDesc, cbDriverDescMax, pcbDriverDesc,
+ szDriverAttributes, cbDriverAttrMax, pcbDriverAttr);
+}
+
+/*************************************************************************
+ * SQLSetDescFieldW [ODBC32.173]
+ */
+SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle,
+ SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
+ SQLPOINTER Value, SQLINTEGER BufferLength)
+{
+ TRACE("\n");
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLSETDESCFIELD].funcW);
+ return (gProxyHandle.functions[SQLAPI_INDEX_SQLSETDESCFIELD].funcW)
+ (DescriptorHandle, RecNumber, FieldIdentifier, Value, BufferLength);
+}
+
+/*************************************************************************
+ * SQLSetStmtAttrW [ODBC32.176]
+ */
+SQLRETURN WINAPI SQLSetStmtAttrW(SQLHSTMT StatementHandle,
+ SQLINTEGER Attribute, SQLPOINTER Value,
+ SQLINTEGER StringLength)
+{
+ SQLRETURN iResult;
+ TRACE("Attribute = (%02ld) Value = %p StringLength = (%ld)\n",
+ Attribute, Value, StringLength);
+
+ CHECK_dmHandle();
+
+ assert (gProxyHandle.functions[SQLAPI_INDEX_SQLSETSTMTATTR].funcW);
+ iResult = (gProxyHandle.functions[SQLAPI_INDEX_SQLSETSTMTATTR].funcW)
+ (StatementHandle, Attribute, Value, StringLength);
+ if (iResult == SQL_ERROR && (Attribute == SQL_ROWSET_SIZE || Attribute ==
SQL_ATTR_ROW_ARRAY_SIZE)) {
+ TRACE("CHEAT: returning SQL_SUCCESS to ADO...\n");
+ iResult = SQL_SUCCESS;
+ } else {
+ TRACE("returning %d...\n", iResult);
+ }
+ return iResult;
+}
+
+
/* End of file */
Modified: trunk/reactos/dll/win32/odbc32/proxyodbc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/odbc32/proxyodbc…
==============================================================================
--- trunk/reactos/dll/win32/odbc32/proxyodbc.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/odbc32/proxyodbc.h [iso-8859-1] Mon Jun 21 23:14:01 2010
@@ -33,6 +33,7 @@
const char *name;
void *d_func;
SQLRETURN (*func)();
+ SQLRETURN (*funcW)();
} DM_FUNC;
typedef struct proxyhandle
@@ -44,7 +45,6 @@
int nErrorType;
DM_FUNC functions[NUM_SQLFUNC]; /* entry point for driver manager functions */
char driverLibName[200]; /* ODBC driver SO name */
- char dmLibName[200]; /* driver manager library name */
char ServerName[200]; /* keep server name */
char UserName[50]; /* keep username */
} PROXYHANDLE;