From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
--- dlls/odbc32/proxyodbc.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 957584af008..fb635b1d9c0 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -1182,8 +1182,16 @@ SQLRETURN WINAPI SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, S } else if ((env && env->win32_handle) || (con && con->win32_handle) || (stmt && stmt->win32_handle)) { - ret = env->win32_funcs->SQLError( env->win32_handle, con->win32_handle, stmt->win32_handle, SqlState, - NativeError, MessageText, BufferLength, TextLength ); + const struct win32_funcs *win32_funcs = NULL; + + if (env) win32_funcs = env->win32_funcs; + else if (con) win32_funcs = con->win32_funcs; + else if (stmt) win32_funcs = stmt->win32_funcs; + + ret = win32_funcs->SQLError( env ? env->win32_handle : NULL, + con ? con->win32_handle : NULL, + stmt ? stmt->win32_handle : NULL, + SqlState, NativeError, MessageText, BufferLength, TextLength ); }
if (SUCCESS( ret )) @@ -3569,10 +3577,16 @@ SQLRETURN WINAPI SQLErrorW(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, } else if ((env && env->win32_handle) || (con && con->win32_handle) || (stmt && stmt->win32_handle)) { - ret = env->win32_funcs->SQLErrorW( env ? env->win32_handle : NULL, - con ? con->win32_handle : NULL, - stmt ? stmt->win32_handle : NULL, - SqlState, NativeError, MessageText, BufferLength, TextLength ); + const struct win32_funcs *win32_funcs = NULL; + + if (env) win32_funcs = env->win32_funcs; + else if (con) win32_funcs = con->win32_funcs; + else if (stmt) win32_funcs = stmt->win32_funcs; + + ret = win32_funcs->SQLErrorW( env ? env->win32_handle : NULL, + con ? con->win32_handle : NULL, + stmt ? stmt->win32_handle : NULL, + SqlState, NativeError, MessageText, BufferLength, TextLength ); }
if (SUCCESS(ret ))