odbc32: Made ODBC function signatures 64-bit compliant

andreas.damm at gmail.com andreas.damm at gmail.com
Tue Feb 28 11:42:54 CST 2017

From: Andreas Damm <andreas at insightsoftware.com>

When using ODBC in a 64-bit environment I encountered a bug when SQLBindParameter is called where the driver manager (unixODBC) thinks that the 'BufferLength' parameter is less than 0, even though a value of 4 has been passed. The program I am trying to run is only available in a 64-bit version. Not being able to use MDAC (there doesn't appear to be a 64-bit version for download), the builtin odbc32.dll proxy to unixODBC is being used.

It appears that some of the signatures of the ODBC functions are incorrect when used in 64-bit mode chiefly when any length related argument is passed. Only the first 4 bytes are being forwarded to unixODBC with the remaining 4 bytes (length types in 64-bit are 8 bytes long) being padding and not having a defined value (something with the MSB set 1 making the whole number negative in my case). 

Signature changes for 64-bit ODBC are limited to the SQLLEN, SQLULEN and SQLSETPOSIROW argument types. The ODBC header files and proxyodbc.c have been updated accordingly by this patch.

Andreas Damm (1):
  Made ODBC function signatures 64-bit compliant

 dlls/odbc32/proxyodbc.c |  108 +++++++++++++++++++++++-----------------------
 include/sql.h           |   36 ++++++++--------
 include/sqlext.h        |   22 +++++-----
 3 files changed, 83 insertions(+), 83 deletions(-)

More information about the wine-patches mailing list