[PATCH 0/2] MR6247: odbc32 fix regressions
This fixes two regression with the latest ODBC32 updates. - SQLAllocStmt is an ODBC v2 function, so use the SQLAllocHandle (odbc v3) by default. - SQLBindCol call the actual driver function (appears to be a copy paste mistake). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6247
From: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> --- dlls/odbc32/proxyodbc.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 4799ca0a11e..6d4772f7f11 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -493,12 +493,17 @@ static SQLRETURN alloc_stmt_unix( struct handle *con, struct handle *stmt ) static SQLRETURN alloc_stmt_win32( struct handle *con, struct handle *stmt ) { - if (con->win32_funcs->SQLAllocStmt) + SQLRETURN ret = SQL_ERROR; + if (con->win32_funcs->SQLAllocHandle) { - SQLRETURN ret = con->win32_funcs->SQLAllocStmt( con->win32_handle, &stmt->win32_handle ); - if (SUCCESS( ret )) stmt->win32_funcs = con->win32_funcs; + ret = con->win32_funcs->SQLAllocHandle( SQL_HANDLE_STMT, con->win32_handle, &stmt->win32_handle ); } - return SQL_ERROR; + else if (con->win32_funcs->SQLAllocStmt) + { + ret = con->win32_funcs->SQLAllocStmt( con->win32_handle, &stmt->win32_handle ); + } + if (SUCCESS( ret )) stmt->win32_funcs = con->win32_funcs; + return ret; } /************************************************************************* -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6247
From: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> --- dlls/odbc32/proxyodbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 6d4772f7f11..7e3999adff6 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -642,7 +642,7 @@ static SQLRETURN bind_col_win32( struct handle *handle, SQLUSMALLINT column, SQL SQLLEN buflen, SQLLEN *retlen ) { if (handle->win32_funcs->SQLBindCol) - return SQLBindCol( handle->win32_handle, column, type, value, buflen, retlen ); + return handle->win32_funcs->SQLBindCol( handle->win32_handle, column, type, value, buflen, retlen ); return SQL_ERROR; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6247
I have a patch in my tree that merges the various handle allocation helpers which also covers the statement case. Thanks for spotting the SQLBindCol() typo. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6247#note_78279
This merge request was closed by Alistair Leslie-Hughes. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6247
participants (3)
-
Alistair Leslie-Hughes -
Alistair Leslie-Hughes (@alesliehughes) -
Hans Leidekker (@hans)