mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Rebase against d98f067294918aa5cfeadb576652dd8fd1757c38.
This commit is contained in:
parent
cd2cce28cc
commit
4af1f11315
@ -1,42 +0,0 @@
|
||||
From 49adfd79f730714b11c4d5f983ced05b26ffa52a Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 12 Jul 2024 13:42:26 +1000
|
||||
Subject: [PATCH] odbc32: Support freeing SQL handles for ODBC v2 drivers.
|
||||
|
||||
---
|
||||
dlls/odbc32/proxyodbc.c | 19 +++++++++++++++++++
|
||||
1 file changed, 19 insertions(+)
|
||||
|
||||
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
||||
index 4799ca0a11e..678d9260fbb 100644
|
||||
--- a/dlls/odbc32/proxyodbc.c
|
||||
+++ b/dlls/odbc32/proxyodbc.c
|
||||
@@ -1867,6 +1867,25 @@ static SQLRETURN free_handle_win32( SQLSMALLINT type, struct handle *handle )
|
||||
{
|
||||
if (handle->win32_funcs->SQLFreeHandle)
|
||||
return handle->win32_funcs->SQLFreeHandle( type, handle->win32_handle );
|
||||
+ else
|
||||
+ {
|
||||
+ /* ODBC v2 */
|
||||
+ if (type == SQL_HANDLE_ENV)
|
||||
+ {
|
||||
+ if (handle->win32_funcs->SQLFreeEnv)
|
||||
+ return handle->win32_funcs->SQLFreeEnv( handle->win32_handle );
|
||||
+ }
|
||||
+ else if (type == SQL_HANDLE_DBC)
|
||||
+ {
|
||||
+ if (handle->win32_funcs->SQLFreeConnect)
|
||||
+ return handle->win32_funcs->SQLFreeConnect( handle->win32_handle );
|
||||
+ }
|
||||
+ else if (type == SQL_HANDLE_STMT)
|
||||
+ {
|
||||
+ if (handle->win32_funcs->SQLFreeStmt)
|
||||
+ return handle->win32_funcs->SQLFreeStmt( handle->win32_handle, SQL_CLOSE );
|
||||
+ }
|
||||
+ }
|
||||
return SQL_ERROR;
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 1966db0e2fe8ee752a7a59b970749235b3fa0e20 Mon Sep 17 00:00:00 2001
|
||||
From 8256bfe5ed31fd521b0baa9085819557653be5e3 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Thu, 18 Jul 2024 14:17:44 +1000
|
||||
Subject: [PATCH] odbc32: SQLSetEnvAttr isnt supported in ODBC v2.0
|
||||
@ -8,28 +8,28 @@ Subject: [PATCH] odbc32: SQLSetEnvAttr isnt supported in ODBC v2.0
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
||||
index 6e51693e33c..0703e2f580d 100644
|
||||
index 2a62fd88d64..4f23c761f5a 100644
|
||||
--- a/dlls/odbc32/proxyodbc.c
|
||||
+++ b/dlls/odbc32/proxyodbc.c
|
||||
@@ -1010,7 +1010,7 @@ static int has_suffix( const WCHAR *str, const WCHAR *suffix )
|
||||
@@ -1162,7 +1162,7 @@ static int has_suffix( const WCHAR *str, const WCHAR *suffix )
|
||||
|
||||
static SQLRETURN set_env_attr( struct handle *handle, SQLINTEGER attr, SQLPOINTER value, SQLINTEGER len )
|
||||
static SQLRETURN set_env_attr( struct environment *env, SQLINTEGER attr, SQLPOINTER value, SQLINTEGER len )
|
||||
{
|
||||
- SQLRETURN ret = SQL_ERROR;
|
||||
+ SQLRETURN ret = SQL_SUCCESS;
|
||||
|
||||
if (handle->unix_handle)
|
||||
if (env->hdr.unix_handle)
|
||||
{
|
||||
@@ -1019,7 +1019,8 @@ static SQLRETURN set_env_attr( struct handle *handle, SQLINTEGER attr, SQLPOINTE
|
||||
@@ -1171,7 +1171,8 @@ static SQLRETURN set_env_attr( struct environment *env, SQLINTEGER attr, SQLPOIN
|
||||
}
|
||||
else if (handle->win32_handle)
|
||||
else if (env->hdr.win32_handle)
|
||||
{
|
||||
- ret = handle->win32_funcs->SQLSetEnvAttr( handle->win32_handle, attr, value, len );
|
||||
+ if (handle->win32_funcs->SQLSetEnvAttr)
|
||||
+ ret = handle->win32_funcs->SQLSetEnvAttr( handle->win32_handle, attr, value, len );
|
||||
- ret = env->hdr.win32_funcs->SQLSetEnvAttr( env->hdr.win32_handle, attr, value, len );
|
||||
+ if (env->hdr.win32_funcs->SQLSetEnvAttr)
|
||||
+ ret = env->hdr.win32_funcs->SQLSetEnvAttr( env->hdr.win32_handle, attr, value, len );
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
@ -1,71 +0,0 @@
|
||||
From c6edaf28df9e495ff173910c6e0124d244784f41 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Thu, 18 Jul 2024 14:34:49 +1000
|
||||
Subject: [PATCH] odbc32: Support Allocating SQL handles for ODBC v2 drivers.
|
||||
|
||||
---
|
||||
dlls/odbc32/proxyodbc.c | 31 +++++++++++++++++++++++++------
|
||||
1 file changed, 25 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
||||
index 6fe38e7a863..6168786084d 100644
|
||||
--- a/dlls/odbc32/proxyodbc.c
|
||||
+++ b/dlls/odbc32/proxyodbc.c
|
||||
@@ -439,13 +439,32 @@ static SQLRETURN alloc_handle_unix( SQLSMALLINT type, struct handle *input, stru
|
||||
|
||||
static SQLRETURN alloc_handle_win32( SQLSMALLINT type, struct handle *input, struct handle *output )
|
||||
{
|
||||
+ SQLRETURN ret = SQL_ERROR;
|
||||
if (input->win32_funcs->SQLAllocHandle)
|
||||
{
|
||||
- SQLRETURN ret = input->win32_funcs->SQLAllocHandle( type, input->win32_handle, &output->win32_handle );
|
||||
- if (SUCCESS( ret )) output->win32_funcs = input->win32_funcs;
|
||||
- return ret;
|
||||
+ ret = input->win32_funcs->SQLAllocHandle( type, input->win32_handle, &output->win32_handle );
|
||||
}
|
||||
- return SQL_ERROR;
|
||||
+ else
|
||||
+ {
|
||||
+ /* ODBC v2 */
|
||||
+ if (type == SQL_HANDLE_ENV)
|
||||
+ {
|
||||
+ if (input->win32_funcs->SQLAllocEnv)
|
||||
+ ret = input->win32_funcs->SQLAllocEnv( &output->win32_handle );
|
||||
+ }
|
||||
+ else if (type == SQL_HANDLE_DBC)
|
||||
+ {
|
||||
+ if (input->win32_funcs->SQLAllocConnect)
|
||||
+ ret = input->win32_funcs->SQLAllocConnect( input, &output->win32_handle );
|
||||
+ }
|
||||
+ else if (type == SQL_HANDLE_STMT)
|
||||
+ {
|
||||
+ if (input->win32_funcs->SQLAllocStmt)
|
||||
+ ret = input->win32_funcs->SQLAllocStmt( input, &output->win32_handle );
|
||||
+ }
|
||||
+ }
|
||||
+ if (SUCCESS( ret )) output->win32_funcs = input->win32_funcs;
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
@@ -1045,7 +1064,7 @@ static SQLRETURN create_env( struct handle *handle, BOOL is_unix )
|
||||
}
|
||||
else
|
||||
{
|
||||
- if ((ret = handle->win32_funcs->SQLAllocHandle( SQL_HANDLE_ENV, NULL, &handle->win32_handle ))) return ret;
|
||||
+ if ((ret = alloc_handle_win32(SQL_HANDLE_ENV, handle, handle ))) return ret;
|
||||
}
|
||||
|
||||
return prepare_env( handle );
|
||||
@@ -1101,7 +1120,7 @@ static SQLRETURN create_con( struct handle *handle )
|
||||
}
|
||||
else
|
||||
{
|
||||
- if ((ret = handle->win32_funcs->SQLAllocHandle( SQL_HANDLE_DBC, parent->win32_handle, &handle->win32_handle )))
|
||||
+ if ((ret = alloc_handle_win32(SQL_HANDLE_DBC, parent, handle )))
|
||||
return ret;
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
@ -1,222 +0,0 @@
|
||||
From 652327cf649f9d10794f18d6c3a2c3452f42f947 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 12 Jul 2024 14:13:33 +1000
|
||||
Subject: [PATCH] odbc32: Support Driver in connection string
|
||||
|
||||
---
|
||||
dlls/odbc32/proxyodbc.c | 100 ++++++++++++++++++++++++++++++----------
|
||||
1 file changed, 75 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
||||
index 94504a8cc26..df8fa06dc57 100644
|
||||
--- a/dlls/odbc32/proxyodbc.c
|
||||
+++ b/dlls/odbc32/proxyodbc.c
|
||||
@@ -989,23 +989,28 @@ static HKEY open_odbcinst_key( void )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
-static WCHAR *get_driver_filename( const SQLWCHAR *source )
|
||||
+static WCHAR *get_driver_filename( const SQLWCHAR *source, BOOL is_dsn )
|
||||
{
|
||||
HKEY key_sources, key_odbcinst, key_driver;
|
||||
WCHAR *driver_name, *ret;
|
||||
|
||||
- if (!(key_sources = open_sources_key( HKEY_CURRENT_USER ))) return NULL;
|
||||
- if (!(driver_name = get_reg_value( key_sources, source )))
|
||||
+ if (is_dsn)
|
||||
{
|
||||
- RegCloseKey( key_sources );
|
||||
- if (!(key_sources = open_sources_key( HKEY_LOCAL_MACHINE ))) return NULL;
|
||||
+ if (!(key_sources = open_sources_key( HKEY_CURRENT_USER ))) return NULL;
|
||||
if (!(driver_name = get_reg_value( key_sources, source )))
|
||||
{
|
||||
RegCloseKey( key_sources );
|
||||
- return NULL;
|
||||
+ if (!(key_sources = open_sources_key( HKEY_LOCAL_MACHINE ))) return NULL;
|
||||
+ if (!(driver_name = get_reg_value( key_sources, source )))
|
||||
+ {
|
||||
+ RegCloseKey( key_sources );
|
||||
+ return NULL;
|
||||
+ }
|
||||
}
|
||||
+ RegCloseKey( key_sources );
|
||||
}
|
||||
- RegCloseKey( key_sources );
|
||||
+ else
|
||||
+ driver_name = wcsdup(source);
|
||||
|
||||
if (!(key_odbcinst = open_odbcinst_key()) || RegOpenKeyExW( key_odbcinst, driver_name, 0, KEY_READ, &key_driver ))
|
||||
{
|
||||
@@ -1175,7 +1180,7 @@ SQLRETURN WINAPI SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSM
|
||||
|
||||
if (!handle) return SQL_INVALID_HANDLE;
|
||||
|
||||
- if (!servername || !(filename = get_driver_filename( servername )))
|
||||
+ if (!servername || !(filename = get_driver_filename( servername, TRUE )))
|
||||
{
|
||||
WARN( "can't find driver filename\n" );
|
||||
goto done;
|
||||
@@ -3983,6 +3988,35 @@ static SQLRETURN browse_connect_unix_a( struct handle *handle, SQLCHAR *in_conn_
|
||||
return ODBC_CALL( SQLBrowseConnect, ¶ms );
|
||||
}
|
||||
|
||||
+static WCHAR *get_driver( const WCHAR *connection_string )
|
||||
+{
|
||||
+ const WCHAR *p = connection_string, *q;
|
||||
+ WCHAR *ret = NULL;
|
||||
+ unsigned int len;
|
||||
+
|
||||
+ if (!p) return NULL;
|
||||
+ while (*p)
|
||||
+ {
|
||||
+ if (!wcsnicmp( p, L"DRIVER=", 7 ))
|
||||
+ {
|
||||
+ p += 7;
|
||||
+ if (*p == '{')
|
||||
+ q = wcschr( ++p, '}' );
|
||||
+ else
|
||||
+ q = wcschr( p, ';' );
|
||||
+ len = q ? (q - p) : wcslen( p );
|
||||
+ if ((ret = malloc( (len + 1) * sizeof(WCHAR) )))
|
||||
+ {
|
||||
+ memcpy( ret, p, len * sizeof(WCHAR) );
|
||||
+ ret[len] = 0;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ p++;
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
/*************************************************************************
|
||||
* SQLBrowseConnect [ODBC32.055]
|
||||
*/
|
||||
@@ -3992,6 +4026,7 @@ SQLRETURN WINAPI SQLBrowseConnect(SQLHDBC ConnectionHandle, SQLCHAR *InConnectio
|
||||
struct handle *handle = ConnectionHandle;
|
||||
WCHAR *datasource = NULL, *filename = NULL, *connection_string = strdupAW( (const char *)InConnectionString );
|
||||
SQLRETURN ret = SQL_ERROR;
|
||||
+ BOOL is_dsn = TRUE;
|
||||
|
||||
TRACE("(ConnectionHandle %p, InConnectionString %s, StringLength1 %d, OutConnectionString %p, BufferLength, %d, "
|
||||
"StringLength2 %p)\n", ConnectionHandle, debugstr_sqlstr(InConnectionString, StringLength1),
|
||||
@@ -3999,13 +4034,16 @@ SQLRETURN WINAPI SQLBrowseConnect(SQLHDBC ConnectionHandle, SQLCHAR *InConnectio
|
||||
|
||||
if (!handle) return SQL_INVALID_HANDLE;
|
||||
|
||||
- /* FIXME: try DRIVER attribute if DSN is absent */
|
||||
if (!connection_string || !(datasource = get_datasource( connection_string )))
|
||||
{
|
||||
- WARN( "can't find data source\n" );
|
||||
- goto done;
|
||||
+ is_dsn = FALSE;
|
||||
+ if (!(datasource = get_driver( connection_string )))
|
||||
+ {
|
||||
+ WARN( "can't find data source\n" );
|
||||
+ goto done;
|
||||
+ }
|
||||
}
|
||||
- if (!(filename = get_driver_filename( datasource )))
|
||||
+ if (!(filename = get_driver_filename( datasource, is_dsn )))
|
||||
{
|
||||
WARN( "can't find driver filename\n" );
|
||||
goto done;
|
||||
@@ -5083,6 +5121,7 @@ SQLRETURN WINAPI SQLDriverConnect(SQLHDBC ConnectionHandle, SQLHWND WindowHandle
|
||||
struct handle *handle = ConnectionHandle;
|
||||
WCHAR *datasource = NULL, *filename = NULL, *connection_string = strdupAW( (const char *)InConnectionString );
|
||||
SQLRETURN ret = SQL_ERROR;
|
||||
+ BOOL is_dsn = TRUE;
|
||||
|
||||
TRACE("(ConnectionHandle %p, WindowHandle %p, InConnectionString %s, Length %d, OutConnectionString %p,"
|
||||
" BufferLength %d, Length2 %p, DriverCompletion %d)\n", ConnectionHandle, WindowHandle,
|
||||
@@ -5091,13 +5130,16 @@ SQLRETURN WINAPI SQLDriverConnect(SQLHDBC ConnectionHandle, SQLHWND WindowHandle
|
||||
|
||||
if (!handle) return SQL_INVALID_HANDLE;
|
||||
|
||||
- /* FIXME: try DRIVER attribute if DSN is absent */
|
||||
if (!connection_string || !(datasource = get_datasource( connection_string )))
|
||||
{
|
||||
- WARN( "can't find data source\n" );
|
||||
- goto done;
|
||||
+ is_dsn = FALSE;
|
||||
+ if (!(datasource = get_driver( connection_string )))
|
||||
+ {
|
||||
+ WARN( "can't find data source\n" );
|
||||
+ goto done;
|
||||
+ }
|
||||
}
|
||||
- if (!(filename = get_driver_filename( datasource )))
|
||||
+ if (!(filename = get_driver_filename( datasource, is_dsn )))
|
||||
{
|
||||
WARN( "can't find driver filename\n" );
|
||||
goto done;
|
||||
@@ -5310,7 +5352,7 @@ SQLRETURN WINAPI SQLConnectW(SQLHDBC ConnectionHandle, SQLWCHAR *ServerName, SQL
|
||||
|
||||
if (!handle) return SQL_INVALID_HANDLE;
|
||||
|
||||
- if (!(filename = get_driver_filename( ServerName )))
|
||||
+ if (!(filename = get_driver_filename( ServerName, TRUE )))
|
||||
{
|
||||
WARN( "can't find driver filename\n" );
|
||||
goto done;
|
||||
@@ -6137,6 +6179,7 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl
|
||||
struct handle *handle = ConnectionHandle;
|
||||
WCHAR *datasource, *filename = NULL;
|
||||
SQLRETURN ret = SQL_ERROR;
|
||||
+ BOOL is_dsn = TRUE;
|
||||
|
||||
TRACE("(ConnectionHandle %p, WindowHandle %p, InConnectionString %s, Length %d, OutConnectionString %p,"
|
||||
" BufferLength %d, Length2 %p, DriverCompletion %d)\n", ConnectionHandle, WindowHandle,
|
||||
@@ -6145,13 +6188,16 @@ SQLRETURN WINAPI SQLDriverConnectW(SQLHDBC ConnectionHandle, SQLHWND WindowHandl
|
||||
|
||||
if (!handle) return SQL_INVALID_HANDLE;
|
||||
|
||||
- /* FIXME: try DRIVER attribute if DSN is absent */
|
||||
if (!(datasource = get_datasource( InConnectionString )))
|
||||
{
|
||||
- WARN( "can't find data source\n" );
|
||||
- goto done;
|
||||
+ is_dsn = FALSE;
|
||||
+ if (!(datasource = get_driver( InConnectionString )))
|
||||
+ {
|
||||
+ WARN( "can't find data source\n" );
|
||||
+ goto done;
|
||||
+ }
|
||||
}
|
||||
- if (!(filename = get_driver_filename( datasource )))
|
||||
+ if (!(filename = get_driver_filename( datasource, is_dsn )))
|
||||
{
|
||||
WARN( "can't find driver filename\n" );
|
||||
goto done;
|
||||
@@ -6553,6 +6599,7 @@ SQLRETURN WINAPI SQLBrowseConnectW(SQLHDBC ConnectionHandle, SQLWCHAR *InConnect
|
||||
struct handle *handle = ConnectionHandle;
|
||||
WCHAR *datasource, *filename = NULL;
|
||||
SQLRETURN ret = SQL_ERROR;
|
||||
+ BOOL is_dsn = TRUE;
|
||||
|
||||
TRACE("(ConnectionHandle %p, InConnectionString %s, StringLength1 %d, OutConnectionString %p, BufferLength %d, "
|
||||
"StringLength2 %p)\n", ConnectionHandle, debugstr_sqlwstr(InConnectionString, StringLength1), StringLength1,
|
||||
@@ -6560,13 +6607,16 @@ SQLRETURN WINAPI SQLBrowseConnectW(SQLHDBC ConnectionHandle, SQLWCHAR *InConnect
|
||||
|
||||
if (!handle) return SQL_INVALID_HANDLE;
|
||||
|
||||
- /* FIXME: try DRIVER attribute if DSN is absent */
|
||||
if (!(datasource = get_datasource( InConnectionString )))
|
||||
{
|
||||
- WARN( "can't find data source\n" );
|
||||
- goto done;
|
||||
+ is_dsn = FALSE;
|
||||
+ if (!(datasource = get_driver( InConnectionString )))
|
||||
+ {
|
||||
+ WARN( "can't find data source\n" );
|
||||
+ goto done;
|
||||
+ }
|
||||
}
|
||||
- if (!(filename = get_driver_filename( datasource )))
|
||||
+ if (!(filename = get_driver_filename( datasource, is_dsn )))
|
||||
{
|
||||
WARN( "can't find driver filename\n" );
|
||||
goto done;
|
||||
--
|
||||
2.43.0
|
||||
|
@ -1,17 +1,17 @@
|
||||
From 6316f79675f38230ee43da7d8a993ff9cb1379f3 Mon Sep 17 00:00:00 2001
|
||||
From 8002ebd60de0c6d9eb718eb58599a41823b3d930 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 12 Jul 2024 14:19:22 +1000
|
||||
Subject: [PATCH] odbc32: SQLColAttributeW support fallback function
|
||||
|
||||
---
|
||||
dlls/odbc32/proxyodbc.c | 23 +++++++++++++++++++++++
|
||||
1 file changed, 23 insertions(+)
|
||||
dlls/odbc32/proxyodbc.c | 24 ++++++++++++++++++++++++
|
||||
1 file changed, 24 insertions(+)
|
||||
|
||||
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
||||
index df8fa06dc57..cbe3e72ef35 100644
|
||||
index 4f23c761f5a..5ead68700df 100644
|
||||
--- a/dlls/odbc32/proxyodbc.c
|
||||
+++ b/dlls/odbc32/proxyodbc.c
|
||||
@@ -5686,6 +5686,21 @@ static SQLRETURN col_attribute_unix_w( struct handle *handle, SQLUSMALLINT col,
|
||||
@@ -5893,6 +5893,21 @@ static SQLRETURN col_attribute_unix_w( struct statement *stmt, SQLUSMALLINT col,
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -30,24 +30,26 @@ index df8fa06dc57..cbe3e72ef35 100644
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static SQLRETURN col_attribute_win32_w( struct handle *handle, SQLUSMALLINT col, SQLUSMALLINT field_id,
|
||||
static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col, SQLUSMALLINT field_id,
|
||||
SQLPOINTER char_attr, SQLSMALLINT buflen, SQLSMALLINT *retlen,
|
||||
SQLLEN *num_attr )
|
||||
@@ -5693,6 +5708,14 @@ static SQLRETURN col_attribute_win32_w( struct handle *handle, SQLUSMALLINT col,
|
||||
if (handle->win32_funcs->SQLColAttributeW)
|
||||
return handle->win32_funcs->SQLColAttributeW( handle->win32_handle, col, field_id, char_attr, buflen,
|
||||
retlen, num_attr );
|
||||
+ else if(handle->win32_funcs->SQLColAttributesW)
|
||||
@@ -5900,7 +5915,16 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col
|
||||
if (stmt->hdr.win32_funcs->SQLColAttributeW)
|
||||
return stmt->hdr.win32_funcs->SQLColAttributeW( stmt->hdr.win32_handle, col, field_id, char_attr, buflen,
|
||||
retlen, num_attr );
|
||||
+ else if(stmt->hdr.win32_funcs->SQLColAttributesW)
|
||||
+ {
|
||||
+ /* ODBC v2 */
|
||||
+ field_id = map_odbc3_to_2(field_id);
|
||||
+ return handle->win32_funcs->SQLColAttributesW( handle->win32_handle, col, field_id,
|
||||
+ return stmt->hdr.win32_funcs->SQLColAttributesW( stmt->hdr.win32_handle, col, field_id,
|
||||
+ char_attr, buflen, retlen,
|
||||
+ num_attr );
|
||||
+ }
|
||||
if (handle->win32_funcs->SQLColAttribute) FIXME( "Unicode to ANSI conversion not handled\n" );
|
||||
if (stmt->hdr.win32_funcs->SQLColAttribute) FIXME( "Unicode to ANSI conversion not handled\n" );
|
||||
+
|
||||
return SQL_ERROR;
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
@ -1,59 +1,65 @@
|
||||
From c72487ac8ae2279f43da906df6ac430fa55e2ae9 Mon Sep 17 00:00:00 2001
|
||||
From 397d95d8e50299f949ac73b0cc245f5fe66cacae Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 12 Jul 2024 14:29:17 +1000
|
||||
Subject: [PATCH 06/15] odbc32: SQLGetDiagRec/W handle fallback function
|
||||
Subject: [PATCH] odbc32: SQLGetDiagRec/W handle fallback function
|
||||
|
||||
---
|
||||
dlls/odbc32/proxyodbc.c | 29 ++++++++++++++++++++++++++++-
|
||||
1 file changed, 28 insertions(+), 1 deletion(-)
|
||||
dlls/odbc32/proxyodbc.c | 34 +++++++++++++++++++++++++++++++---
|
||||
1 file changed, 31 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
||||
index 1f51ac2a27e..c4e1c046edc 100644
|
||||
index 5ead68700df..97c4cac8e31 100644
|
||||
--- a/dlls/odbc32/proxyodbc.c
|
||||
+++ b/dlls/odbc32/proxyodbc.c
|
||||
@@ -1915,7 +1915,21 @@ SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMAL
|
||||
@@ -2672,7 +2672,21 @@ SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMAL
|
||||
}
|
||||
else if (handle->win32_handle)
|
||||
else if (obj->win32_handle)
|
||||
{
|
||||
- ret = get_diag_rec_win32_a( HandleType, handle, RecNumber, SqlState, NativeError, MessageText, BufferLength,
|
||||
- ret = get_diag_rec_win32_a( HandleType, obj, RecNumber, SqlState, NativeError, MessageText, BufferLength,
|
||||
+ /* ODBC v2.0 */
|
||||
+ if (handle->win32_funcs->SQLError)
|
||||
+ if (obj->win32_funcs->SQLError)
|
||||
+ {
|
||||
+ if (HandleType == SQL_HANDLE_ENV)
|
||||
+ ret = handle->win32_funcs->SQLError(handle->win32_handle, SQL_NULL_HDBC, SQL_NULL_HSTMT,
|
||||
+ ret = obj->win32_funcs->SQLError(obj->win32_handle, SQL_NULL_HDBC, SQL_NULL_HSTMT,
|
||||
+ SqlState, NativeError, MessageText, BufferLength, TextLength);
|
||||
+ else if (HandleType == SQL_HANDLE_DBC)
|
||||
+ ret = handle->win32_funcs->SQLError(SQL_NULL_HENV, handle->win32_handle, SQL_NULL_HSTMT,
|
||||
+ ret = obj->win32_funcs->SQLError(SQL_NULL_HENV, obj->win32_handle, SQL_NULL_HSTMT,
|
||||
+ SqlState, NativeError, MessageText, BufferLength, TextLength);
|
||||
+ else if (HandleType == SQL_HANDLE_STMT)
|
||||
+ ret = handle->win32_funcs->SQLError(SQL_NULL_HENV, SQL_NULL_HDBC, handle->win32_handle,
|
||||
+ ret = obj->win32_funcs->SQLError(SQL_NULL_HENV, SQL_NULL_HDBC, obj->win32_handle,
|
||||
+ SqlState, NativeError, MessageText, BufferLength, TextLength);
|
||||
+ }
|
||||
+ else
|
||||
+ ret = get_diag_rec_win32_a( HandleType, handle, RecNumber, SqlState, NativeError, MessageText, BufferLength,
|
||||
+ ret = get_diag_rec_win32_a( HandleType, obj, RecNumber, SqlState, NativeError, MessageText, BufferLength,
|
||||
TextLength );
|
||||
}
|
||||
|
||||
@@ -4285,6 +4299,19 @@ static SQLRETURN get_diag_rec_win32_w( SQLSMALLINT handle_type, struct handle *h
|
||||
if (handle->win32_funcs->SQLGetDiagRecW)
|
||||
return handle->win32_funcs->SQLGetDiagRecW( handle_type, handle->win32_handle, rec_num, state, native_err,
|
||||
msg, buflen, retlen );
|
||||
+ else if (handle->win32_funcs->SQLErrorW)
|
||||
@@ -6187,9 +6201,23 @@ static SQLRETURN get_diag_rec_win32_w( SQLSMALLINT type, struct object *obj, SQL
|
||||
SQLSMALLINT *retlen )
|
||||
{
|
||||
if (obj->win32_funcs->SQLGetDiagRecW)
|
||||
- return obj->win32_funcs->SQLGetDiagRecW( type, obj->win32_handle, rec_num, state, native_err, msg, buflen,
|
||||
- retlen );
|
||||
+ return obj->win32_funcs->SQLGetDiagRecW( type, obj->win32_handle, rec_num, state, native_err,
|
||||
+ msg, buflen, retlen );
|
||||
+ else if (obj->win32_funcs->SQLErrorW)
|
||||
+ {
|
||||
+ /* ODBC v2 */
|
||||
+ if (handle_type == SQL_HANDLE_ENV)
|
||||
+ return handle->win32_funcs->SQLErrorW(handle->win32_handle, SQL_NULL_HDBC, SQL_NULL_HSTMT,
|
||||
+ if (type == SQL_HANDLE_ENV)
|
||||
+ return obj->win32_funcs->SQLErrorW(obj->win32_handle, SQL_NULL_HDBC, SQL_NULL_HSTMT,
|
||||
+ state, native_err, msg, buflen, retlen);
|
||||
+ else if (handle_type == SQL_HANDLE_DBC)
|
||||
+ return handle->win32_funcs->SQLErrorW(SQL_NULL_HENV, handle->win32_handle, SQL_NULL_HSTMT,
|
||||
+ else if (type == SQL_HANDLE_DBC)
|
||||
+ return obj->win32_funcs->SQLErrorW(SQL_NULL_HENV, obj->win32_handle, SQL_NULL_HSTMT,
|
||||
+ state, native_err, msg, buflen, retlen);
|
||||
+ else if (handle_type == SQL_HANDLE_STMT)
|
||||
+ return handle->win32_funcs->SQLErrorW(SQL_NULL_HENV, SQL_NULL_HDBC, handle->win32_handle,
|
||||
+ else if (type == SQL_HANDLE_STMT)
|
||||
+ return obj->win32_funcs->SQLErrorW(SQL_NULL_HENV, SQL_NULL_HDBC, obj->win32_handle,
|
||||
+ state, native_err, msg, buflen, retlen);
|
||||
+ }
|
||||
if (handle->win32_funcs->SQLGetDiagRec) FIXME( "Unicode to ANSI conversion not handled\n" );
|
||||
if (obj->win32_funcs->SQLGetDiagRec) FIXME( "Unicode to ANSI conversion not handled\n" );
|
||||
+
|
||||
return SQL_ERROR;
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
@ -1,21 +1,21 @@
|
||||
From 83238653f67745cd9316b6140fc32a424ffa9b1b Mon Sep 17 00:00:00 2001
|
||||
From 1b2068b8f8adc036d0c2b9cda00c37cd55330b41 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 12 Jul 2024 14:40:32 +1000
|
||||
Subject: [PATCH] odbc32: SQLBindParameter handle fallback function
|
||||
|
||||
---
|
||||
dlls/odbc32/proxyodbc.c | 22 ++++++++++++++++++++++
|
||||
1 file changed, 22 insertions(+)
|
||||
dlls/odbc32/proxyodbc.c | 23 +++++++++++++++++++++++
|
||||
1 file changed, 23 insertions(+)
|
||||
|
||||
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
||||
index 557cd212425..7105f3534ce 100644
|
||||
index 8f53fa71668..7099027c2b4 100644
|
||||
--- a/dlls/odbc32/proxyodbc.c
|
||||
+++ b/dlls/odbc32/proxyodbc.c
|
||||
@@ -5052,6 +5052,28 @@ static SQLRETURN bind_parameter_win32( struct handle *handle, SQLUSMALLINT param
|
||||
if (handle->win32_funcs->SQLBindParameter)
|
||||
return handle->win32_funcs->SQLBindParameter( handle->win32_handle, param, io_type, value_type, param_type,
|
||||
size, digits, value, buflen, len );
|
||||
+ else if(handle->win32_funcs->SQLBindParam)
|
||||
@@ -5242,6 +5242,29 @@ static SQLRETURN bind_parameter_win32( struct statement *stmt, SQLUSMALLINT para
|
||||
if (stmt->hdr.win32_funcs->SQLBindParameter)
|
||||
return stmt->hdr.win32_funcs->SQLBindParameter( stmt->hdr.win32_handle, param, io_type, value_type,
|
||||
param_type, size, digits, value, buflen, len );
|
||||
+ else if(stmt->hdr.win32_funcs->SQLBindParam)
|
||||
+ {
|
||||
+ /* ODBC v2 */
|
||||
+ /* TODO: Make function */
|
||||
@ -34,9 +34,10 @@ index 557cd212425..7105f3534ce 100644
|
||||
+ else if (param_type == SQL_TIMESTAMP)
|
||||
+ param_type = SQL_TYPE_TIMESTAMP;;;
|
||||
+
|
||||
+ return handle->win32_funcs->SQLBindParam(handle->win32_handle, param, value_type, param_type,
|
||||
+ return stmt->hdr.win32_funcs->SQLBindParam( stmt->hdr.win32_handle, param, value_type, param_type,
|
||||
+ size, digits, value, len);
|
||||
+ }
|
||||
+
|
||||
return SQL_ERROR;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 20374d93364244b20dc9c87b53c40c375d4f1235 Mon Sep 17 00:00:00 2001
|
||||
From 1b5f6b996f8a1f314e935657f5e205717ace23b4 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 12 Jul 2024 14:55:47 +1000
|
||||
Subject: [PATCH] odbc32: SQLSetConnectAttr/W handle fallback function
|
||||
@ -8,17 +8,17 @@ Subject: [PATCH] odbc32: SQLSetConnectAttr/W handle fallback function
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
||||
index 7105f3534ce..dd94e070796 100644
|
||||
index 7099027c2b4..632738b9533 100644
|
||||
--- a/dlls/odbc32/proxyodbc.c
|
||||
+++ b/dlls/odbc32/proxyodbc.c
|
||||
@@ -6123,6 +6123,11 @@ static SQLRETURN set_connect_attr_win32_w( struct handle *handle, SQLINTEGER att
|
||||
if (handle->win32_funcs->SQLSetConnectAttrW)
|
||||
return handle->win32_funcs->SQLSetConnectAttrW( handle->win32_handle, attr, value, len );
|
||||
if (handle->win32_funcs->SQLSetConnectAttr) FIXME( "Unicode to ANSI conversion not handled\n" );
|
||||
+ else if(handle->win32_funcs->SQLSetConnectOptionW)
|
||||
@@ -6334,6 +6334,11 @@ static SQLRETURN set_connect_attr_win32_w( struct connection *con, SQLINTEGER at
|
||||
if (con->hdr.win32_funcs->SQLSetConnectAttrW)
|
||||
return con->hdr.win32_funcs->SQLSetConnectAttrW( con->hdr.win32_handle, attr, value, len );
|
||||
if (con->hdr.win32_funcs->SQLSetConnectAttr) FIXME( "Unicode to ANSI conversion not handled\n" );
|
||||
+ else if(con->hdr.win32_funcs->SQLSetConnectOptionW)
|
||||
+ {
|
||||
+ /* ODBC v2 */
|
||||
+ return handle->win32_funcs->SQLSetConnectOptionW( handle->win32_handle, attr, (SQLULEN)value );
|
||||
+ return con->hdr.win32_funcs->SQLSetConnectOptionW( con->hdr.win32_handle, attr, (SQLULEN)value );
|
||||
+ }
|
||||
return SQL_ERROR;
|
||||
}
|
||||
|
@ -1,87 +1,45 @@
|
||||
From d92d2f9dab7aa9552dbed099a3f07182c8bad185 Mon Sep 17 00:00:00 2001
|
||||
From 53c9ccb1d5008cf348268e6a053ff6414bc4773e Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Wed, 10 Jul 2024 15:17:00 +1000
|
||||
Subject: [PATCH] odbc32: Store handles when requesting information of Columns.
|
||||
|
||||
---
|
||||
dlls/odbc32/proxyodbc.c | 34 +++++++++++++++++++++++++++++++++-
|
||||
dlls/odbc32/unixlib.h | 11 +++++++++++
|
||||
2 files changed, 44 insertions(+), 1 deletion(-)
|
||||
dlls/odbc32/proxyodbc.c | 22 +++++++++++++++++++++-
|
||||
1 file changed, 21 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
||||
index dd94e070796..7120f24b76b 100644
|
||||
index 632738b9533..ca598e404b1 100644
|
||||
--- a/dlls/odbc32/proxyodbc.c
|
||||
+++ b/dlls/odbc32/proxyodbc.c
|
||||
@@ -6105,7 +6105,39 @@ SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute,
|
||||
@@ -6315,7 +6315,27 @@ SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute,
|
||||
}
|
||||
else if (handle->win32_handle)
|
||||
else if (stmt->hdr.win32_handle)
|
||||
{
|
||||
- ret = get_stmt_attr_win32_w( handle, Attribute, Value, BufferLength, StringLength );
|
||||
+ switch(Attribute)
|
||||
- ret = get_stmt_attr_win32_w( stmt, Attribute, Value, BufferLength, StringLength );
|
||||
+ switch(Attribute)
|
||||
+ {
|
||||
+ case SQL_ATTR_APP_ROW_DESC:
|
||||
+ handle->app_row_desc.parent = handle;
|
||||
+ ret = handle->win32_funcs->SQLGetStmtAttrW( handle->win32_handle, Attribute,
|
||||
+ &handle->app_row_desc.driver_hdesc,
|
||||
+ BufferLength, StringLength);
|
||||
+ *((SQLHDESC*)Value) = &handle->app_row_desc;
|
||||
+ break;
|
||||
+ case SQL_ATTR_IMP_ROW_DESC:
|
||||
+ handle->imp_row_desc.parent = handle;
|
||||
+ ret = handle->win32_funcs->SQLGetStmtAttrW( handle->win32_handle, Attribute,
|
||||
+ &handle->imp_row_desc.driver_hdesc,
|
||||
+ BufferLength, StringLength);
|
||||
+ *((SQLHDESC*)Value) = &handle->imp_row_desc;
|
||||
+ break;
|
||||
+ case SQL_ATTR_APP_PARAM_DESC:
|
||||
+ handle->app_param_desc.parent = handle;
|
||||
+ ret = handle->win32_funcs->SQLGetStmtAttrW( handle->win32_handle, Attribute,
|
||||
+ &handle->app_param_desc.driver_hdesc,
|
||||
+ BufferLength, StringLength);
|
||||
+ *((SQLHDESC*)Value) = &handle->app_param_desc;
|
||||
+ break;
|
||||
+ case SQL_ATTR_IMP_PARAM_DESC:
|
||||
+ handle->imp_param_desc.parent = handle;
|
||||
+ ret = handle->win32_funcs->SQLGetStmtAttrW( handle->win32_handle, Attribute,
|
||||
+ &handle->imp_param_desc.driver_hdesc,
|
||||
+ {
|
||||
+ struct descriptor *desc;
|
||||
+ if ((desc = create_descriptor( stmt )))
|
||||
+ {
|
||||
+ ret = stmt->hdr.win32_funcs->SQLGetStmtAttrW( stmt->hdr.win32_handle, Attribute,
|
||||
+ &desc->hdr.win32_handle,
|
||||
+ BufferLength, StringLength);
|
||||
+ *((SQLHDESC*)Value) = &handle->imp_param_desc;
|
||||
+ desc->hdr.win32_funcs = stmt->hdr.win32_funcs;
|
||||
+ *((SQLHDESC*)Value) = desc;
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+ default:
|
||||
+ ret = get_stmt_attr_win32_w( handle, Attribute, Value, BufferLength, StringLength );
|
||||
+ ret = get_stmt_attr_win32_w( stmt, Attribute, Value, BufferLength, StringLength );
|
||||
+ }
|
||||
}
|
||||
|
||||
TRACE("Returning %d\n", ret);
|
||||
diff --git a/dlls/odbc32/unixlib.h b/dlls/odbc32/unixlib.h
|
||||
index 4241d06c892..fc69857c8b7 100644
|
||||
--- a/dlls/odbc32/unixlib.h
|
||||
+++ b/dlls/odbc32/unixlib.h
|
||||
@@ -183,6 +183,12 @@ struct param_binding
|
||||
struct param *param;
|
||||
};
|
||||
|
||||
+struct SQLHDESC_data
|
||||
+{
|
||||
+ struct handle *parent;
|
||||
+ SQLHDESC driver_hdesc;
|
||||
+};
|
||||
+
|
||||
struct handle
|
||||
{
|
||||
/* handles */
|
||||
@@ -194,6 +200,11 @@ struct handle
|
||||
UINT32 env_attr_version;
|
||||
UINT32 con_attr_con_timeout;
|
||||
UINT32 con_attr_login_timeout;
|
||||
+ /* statement parameters */
|
||||
+ struct SQLHDESC_data app_row_desc;
|
||||
+ struct SQLHDESC_data imp_row_desc;
|
||||
+ struct SQLHDESC_data app_param_desc;
|
||||
+ struct SQLHDESC_data imp_param_desc;
|
||||
/* drivers and data sources */
|
||||
UINT32 drivers_idx;
|
||||
void *drivers_key;
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
@ -1,48 +0,0 @@
|
||||
From cee76bad632261533d15e6d642367fbb66176564 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Sat, 13 Jul 2024 15:23:10 +1000
|
||||
Subject: [PATCH] odbc32: SQLSetDescFieldW pass correct handle onto driver
|
||||
|
||||
---
|
||||
dlls/odbc32/proxyodbc.c | 11 ++++++++---
|
||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
||||
index 7120f24b76b..ddf6c0ac9f5 100644
|
||||
--- a/dlls/odbc32/proxyodbc.c
|
||||
+++ b/dlls/odbc32/proxyodbc.c
|
||||
@@ -6086,7 +6086,7 @@ SQLRETURN WINAPI SQLGetStmtAttrW(SQLHSTMT StatementHandle, SQLINTEGER Attribute,
|
||||
SQLINTEGER BufferLength, SQLINTEGER *StringLength)
|
||||
{
|
||||
struct handle *handle = StatementHandle;
|
||||
- SQLRETURN ret = SQL_ERROR;
|
||||
+ SQLRETURN ret = SQL_SUCCESS;
|
||||
|
||||
TRACE("(StatementHandle %p, Attribute %d, Value %p, BufferLength %d, StringLength %p)\n", StatementHandle,
|
||||
Attribute, Value, BufferLength, StringLength);
|
||||
@@ -7268,7 +7268,8 @@ static SQLRETURN set_desc_field_win32_w( struct handle *handle, SQLSMALLINT reco
|
||||
SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier,
|
||||
SQLPOINTER Value, SQLINTEGER BufferLength)
|
||||
{
|
||||
- struct handle *handle = DescriptorHandle;
|
||||
+ struct SQLHDESC_data *hdesc = DescriptorHandle;
|
||||
+ struct handle *handle = hdesc->parent;
|
||||
SQLRETURN ret = SQL_ERROR;
|
||||
|
||||
TRACE("(DescriptorHandle %p, RecNumber %d, FieldIdentifier %d, Value %p, BufferLength %d)\n", DescriptorHandle,
|
||||
@@ -7282,7 +7283,11 @@ SQLRETURN WINAPI SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumb
|
||||
}
|
||||
else if (handle->win32_handle)
|
||||
{
|
||||
- ret = set_desc_field_win32_w( handle, RecNumber, FieldIdentifier, Value, BufferLength );
|
||||
+ if (handle->imp_param_desc.driver_hdesc)
|
||||
+ ret = handle->win32_funcs->SQLSetDescFieldW( handle->imp_param_desc.driver_hdesc, RecNumber, FieldIdentifier, Value,
|
||||
+ BufferLength );
|
||||
+ else
|
||||
+ ret = set_desc_field_win32_w( handle, RecNumber, FieldIdentifier, Value, BufferLength );
|
||||
}
|
||||
|
||||
TRACE("Returning %d\n", ret);
|
||||
--
|
||||
2.43.0
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 826649e599a8e8c68b468771aded099c659c0e72 Mon Sep 17 00:00:00 2001
|
||||
From 02836ce54a6a32a72cc696f783f6241da23fa385 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Thu, 18 Jul 2024 07:13:48 +1000
|
||||
Subject: [PATCH 12/15] odbc32: Record loaded driver SQL_ATTR_ODBC_VERSION
|
||||
Subject: [PATCH] odbc32: Record loaded driver SQL_ATTR_ODBC_VERSION
|
||||
|
||||
---
|
||||
dlls/odbc32/proxyodbc.c | 4 ++++
|
||||
@ -9,39 +9,39 @@ Subject: [PATCH 12/15] odbc32: Record loaded driver SQL_ATTR_ODBC_VERSION
|
||||
2 files changed, 5 insertions(+)
|
||||
|
||||
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
||||
index c70b0d80012..bb1cae25051 100644
|
||||
index d48c3d822fa..1977e766950 100644
|
||||
--- a/dlls/odbc32/proxyodbc.c
|
||||
+++ b/dlls/odbc32/proxyodbc.c
|
||||
@@ -376,6 +376,7 @@ static struct handle *create_handle( struct handle *parent )
|
||||
@@ -463,6 +463,7 @@ static struct environment *create_environment( void )
|
||||
if (!(ret = calloc( 1, sizeof(*ret) ))) return NULL;
|
||||
ret->parent = parent;
|
||||
ret->env_attr_version = SQL_OV_ODBC2;
|
||||
init_object( &ret->hdr, SQL_HANDLE_ENV, NULL );
|
||||
ret->attr_version = SQL_OV_ODBC2;
|
||||
+ ret->driver_ver = SQL_OV_ODBC2;
|
||||
ret->row_count = 1;
|
||||
return ret;
|
||||
}
|
||||
@@ -891,6 +892,9 @@ static SQLRETURN set_env_attr( struct handle *handle, SQLINTEGER attr, SQLPOINTE
|
||||
|
||||
@@ -1173,6 +1174,9 @@ static SQLRETURN set_env_attr( struct environment *env, SQLINTEGER attr, SQLPOIN
|
||||
}
|
||||
else if (handle->win32_handle)
|
||||
else if (env->hdr.win32_handle)
|
||||
{
|
||||
+ if (handle->win32_funcs->SQLGetEnvAttr)
|
||||
+ ret = handle->win32_funcs->SQLGetEnvAttr( handle->win32_handle, SQL_ATTR_ODBC_VERSION, &handle->driver_ver, 0, NULL );
|
||||
+ if (env->hdr.win32_funcs->SQLGetEnvAttr)
|
||||
+ ret = env->hdr.win32_funcs->SQLGetEnvAttr( env->hdr.win32_handle, SQL_ATTR_ODBC_VERSION, &env->driver_ver, 0, NULL );
|
||||
+
|
||||
if (handle->win32_funcs->SQLSetEnvAttr)
|
||||
ret = handle->win32_funcs->SQLSetEnvAttr( handle->win32_handle, attr, value, len );
|
||||
if (env->hdr.win32_funcs->SQLSetEnvAttr)
|
||||
ret = env->hdr.win32_funcs->SQLSetEnvAttr( env->hdr.win32_handle, attr, value, len );
|
||||
}
|
||||
diff --git a/dlls/odbc32/unixlib.h b/dlls/odbc32/unixlib.h
|
||||
index fc69857c8b7..61b8429768d 100644
|
||||
index c771e16f9e3..05ee89c57db 100644
|
||||
--- a/dlls/odbc32/unixlib.h
|
||||
+++ b/dlls/odbc32/unixlib.h
|
||||
@@ -211,6 +211,7 @@ struct handle
|
||||
@@ -211,6 +211,7 @@ struct environment
|
||||
UINT32 sources_idx;
|
||||
void *sources_key;
|
||||
BOOL sources_system;
|
||||
+ UINT32 driver_ver;
|
||||
/* parameter bindings */
|
||||
struct param_binding bind_col;
|
||||
struct param_binding bind_parameter;
|
||||
};
|
||||
|
||||
struct connection
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 37a034464df09450fe1d4226bf43ca7588c7894d Mon Sep 17 00:00:00 2001
|
||||
From ad0e5c8a6edd8f483ad3b2cd389b6ec5519b3891 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Wed, 17 Jul 2024 21:55:20 +1000
|
||||
Subject: [PATCH] odbc32: SQLGetData support ODBC v2.0
|
||||
@ -8,15 +8,15 @@ Subject: [PATCH] odbc32: SQLGetData support ODBC v2.0
|
||||
1 file changed, 13 insertions(+)
|
||||
|
||||
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
||||
index be20e967aea..1836164796f 100644
|
||||
index 1977e766950..b2bf2a7d58c 100644
|
||||
--- a/dlls/odbc32/proxyodbc.c
|
||||
+++ b/dlls/odbc32/proxyodbc.c
|
||||
@@ -2223,7 +2223,20 @@ static SQLRETURN get_data_win32( struct handle *handle, SQLUSMALLINT column, SQL
|
||||
@@ -2368,7 +2368,20 @@ static SQLRETURN get_data_win32( struct statement *stmt, SQLUSMALLINT column, SQ
|
||||
SQLLEN buflen, SQLLEN *retlen )
|
||||
{
|
||||
if (handle->win32_funcs->SQLGetData)
|
||||
if (stmt->hdr.win32_funcs->SQLGetData)
|
||||
+ {
|
||||
+ if (handle->env_attr_version == SQL_OV_ODBC2)
|
||||
+ if ( ((struct environment*)(stmt->hdr.parent))->attr_version == SQL_OV_ODBC2)
|
||||
+ {
|
||||
+ if (type == SQL_C_TYPE_TIME)
|
||||
+ type = SQL_C_TIME;
|
||||
@ -26,7 +26,7 @@ index be20e967aea..1836164796f 100644
|
||||
+ type = SQL_C_TIMESTAMP;
|
||||
+ }
|
||||
+
|
||||
return handle->win32_funcs->SQLGetData( handle->win32_handle, column, type, value, buflen, retlen );
|
||||
return stmt->hdr.win32_funcs->SQLGetData( stmt->hdr.win32_handle, column, type, value, buflen, retlen );
|
||||
+ }
|
||||
+
|
||||
return SQL_ERROR;
|
||||
|
@ -1,32 +1,34 @@
|
||||
From c41312e28ac2c500aad9e5cdbbbee4670f4b4a86 Mon Sep 17 00:00:00 2001
|
||||
From 7fd12044418fbd610b920961db964ff0acd098f4 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Wed, 17 Jul 2024 22:03:03 +1000
|
||||
Subject: [PATCH 14/15] odbc32: SQLColAttributesW support ODBC v2.0
|
||||
Subject: [PATCH] odbc32: SQLColAttributesW support ODBC v2.0
|
||||
|
||||
---
|
||||
dlls/odbc32/proxyodbc.c | 18 +++++++++++++++++-
|
||||
1 file changed, 17 insertions(+), 1 deletion(-)
|
||||
dlls/odbc32/proxyodbc.c | 22 +++++++++++++++++++---
|
||||
1 file changed, 19 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
||||
index a66ec99b913..a9d23c94504 100644
|
||||
index b2bf2a7d58c..f7a6535db37 100644
|
||||
--- a/dlls/odbc32/proxyodbc.c
|
||||
+++ b/dlls/odbc32/proxyodbc.c
|
||||
@@ -4144,11 +4144,27 @@ static SQLRETURN col_attribute_win32_w( struct handle *handle, SQLUSMALLINT col,
|
||||
retlen, num_attr );
|
||||
else if(handle->win32_funcs->SQLColAttributesW)
|
||||
@@ -5973,11 +5973,27 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col
|
||||
retlen, num_attr );
|
||||
else if(stmt->hdr.win32_funcs->SQLColAttributesW)
|
||||
{
|
||||
+ SQLRETURN ret;
|
||||
+
|
||||
/* ODBC v2 */
|
||||
field_id = map_odbc3_to_2(field_id);
|
||||
- return handle->win32_funcs->SQLColAttributesW( handle->win32_handle, col, field_id,
|
||||
+ ret = handle->win32_funcs->SQLColAttributesW( handle->win32_handle, col, field_id,
|
||||
char_attr, buflen, retlen,
|
||||
num_attr );
|
||||
- return stmt->hdr.win32_funcs->SQLColAttributesW( stmt->hdr.win32_handle, col, field_id,
|
||||
- char_attr, buflen, retlen,
|
||||
- num_attr );
|
||||
+ ret = stmt->hdr.win32_funcs->SQLColAttributesW( stmt->hdr.win32_handle, col, field_id,
|
||||
+ char_attr, buflen, retlen, num_attr );
|
||||
+
|
||||
+ /* Convert back for ODBC3 drivers */
|
||||
+ if (num_attr && field_id == SQL_COLUMN_TYPE &&
|
||||
+ handle->env_attr_version == SQL_OV_ODBC2 &&
|
||||
+ handle->driver_ver == SQL_OV_ODBC2)
|
||||
+ ((struct environment*)(stmt->hdr.parent))->attr_version == SQL_OV_ODBC2 &&
|
||||
+ ((struct environment*)(stmt->hdr.parent))->driver_ver == SQL_OV_ODBC2)
|
||||
+ {
|
||||
+ if (*num_attr == SQL_TIME)
|
||||
+ *num_attr = SQL_TYPE_TIME;
|
||||
@ -38,8 +40,8 @@ index a66ec99b913..a9d23c94504 100644
|
||||
+
|
||||
+ return ret;
|
||||
}
|
||||
if (handle->win32_funcs->SQLColAttribute) FIXME( "Unicode to ANSI conversion not handled\n" );
|
||||
return SQL_ERROR;
|
||||
if (stmt->hdr.win32_funcs->SQLColAttribute) FIXME( "Unicode to ANSI conversion not handled\n" );
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From b86180b88e1d485bb628a195e2315be2bada2898 Mon Sep 17 00:00:00 2001
|
||||
From 2003987040ac9ac13d899c299b1375024a18a1dc Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Wed, 17 Jul 2024 22:04:39 +1000
|
||||
Subject: [PATCH] odbc32: SQLSetStmtAttrW support fallback for ODBC v2.0
|
||||
@ -8,17 +8,17 @@ Subject: [PATCH] odbc32: SQLSetStmtAttrW support fallback for ODBC v2.0
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
||||
index 3429e8a26ce..2464ddfebee 100644
|
||||
index f7a6535db37..d0661406fae 100644
|
||||
--- a/dlls/odbc32/proxyodbc.c
|
||||
+++ b/dlls/odbc32/proxyodbc.c
|
||||
@@ -7350,6 +7350,11 @@ static SQLRETURN set_stmt_attr_win32_w( struct handle *handle, SQLINTEGER attr,
|
||||
if (handle->win32_funcs->SQLSetStmtAttrW)
|
||||
return handle->win32_funcs->SQLSetStmtAttrW( handle->win32_handle, attr, value, len );
|
||||
if (handle->win32_funcs->SQLSetStmtAttr) FIXME( "Unicode to ANSI conversion not handled\n" );
|
||||
+ else if (handle->win32_funcs->SQLSetStmtOption)
|
||||
@@ -7585,6 +7585,11 @@ static SQLRETURN set_stmt_attr_win32_w( struct statement *stmt, SQLINTEGER attr,
|
||||
if (stmt->hdr.win32_funcs->SQLSetStmtAttrW)
|
||||
return stmt->hdr.win32_funcs->SQLSetStmtAttrW( stmt->hdr.win32_handle, attr, value, len );
|
||||
if (stmt->hdr.win32_funcs->SQLSetStmtAttr) FIXME( "Unicode to ANSI conversion not handled\n" );
|
||||
+ else if (stmt->hdr.win32_funcs->SQLSetStmtOption)
|
||||
+ {
|
||||
+ /* ODBC v2.0 */
|
||||
+ return handle->win32_funcs->SQLSetStmtOption( handle->win32_handle, attr, (SQLULEN)value );
|
||||
+ return stmt->hdr.win32_funcs->SQLSetStmtOption( stmt->hdr.win32_handle, attr, (SQLULEN)value );
|
||||
+ }
|
||||
return SQL_ERROR;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
From a286fe2aca1bd8f7c2a95675394fe554d16ef7fa Mon Sep 17 00:00:00 2001
|
||||
From bf50a23bd4bd098a51b4944f1c22a9d2a71fc454 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Sat, 20 Jul 2024 12:56:26 +1000
|
||||
Subject: [PATCH] odbc32: set_con_attr return success by default
|
||||
@ -8,25 +8,25 @@ Subject: [PATCH] odbc32: set_con_attr return success by default
|
||||
1 file changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
|
||||
index dee73f0618e..d29069cb021 100644
|
||||
index d0661406fae..cf13669d051 100644
|
||||
--- a/dlls/odbc32/proxyodbc.c
|
||||
+++ b/dlls/odbc32/proxyodbc.c
|
||||
@@ -994,7 +994,7 @@ static SQLRETURN create_env( struct handle *handle, BOOL is_unix )
|
||||
@@ -1219,7 +1219,7 @@ static SQLRETURN create_env( struct environment *env, BOOL is_unix )
|
||||
|
||||
static SQLRETURN set_con_attr( struct handle *handle, SQLINTEGER attr, SQLPOINTER value, SQLINTEGER len )
|
||||
static SQLRETURN set_con_attr( struct connection *con, SQLINTEGER attr, SQLPOINTER value, SQLINTEGER len )
|
||||
{
|
||||
- SQLRETURN ret = SQL_ERROR;
|
||||
+ SQLRETURN ret = SQL_SUCCESS;
|
||||
|
||||
if (handle->unix_handle)
|
||||
if (con->hdr.unix_handle)
|
||||
{
|
||||
@@ -1017,6 +1017,17 @@ static SQLRETURN set_con_attr( struct handle *handle, SQLINTEGER attr, SQLPOINTE
|
||||
ret = handle->win32_funcs->SQLSetConnectAttrW( handle->win32_handle, attr, value, len );
|
||||
else if (handle->win32_funcs->SQLSetConnectAttr)
|
||||
ret = handle->win32_funcs->SQLSetConnectAttr( handle->win32_handle, attr, value, len );
|
||||
+ else if (handle->win32_funcs->SQLSetConnectOptionW)
|
||||
@@ -1242,6 +1242,17 @@ static SQLRETURN set_con_attr( struct connection *con, SQLINTEGER attr, SQLPOINT
|
||||
ret = con->hdr.win32_funcs->SQLSetConnectAttrW( con->hdr.win32_handle, attr, value, len );
|
||||
else if (con->hdr.win32_funcs->SQLSetConnectAttr)
|
||||
ret = con->hdr.win32_funcs->SQLSetConnectAttr( con->hdr.win32_handle, attr, value, len );
|
||||
+ else if (con->hdr.win32_funcs->SQLSetConnectOptionW)
|
||||
+ {
|
||||
+ ret = handle->win32_funcs->SQLSetConnectOptionW( handle->win32_handle, attr, (SQLULEN)value );
|
||||
+ ret = con->hdr.win32_funcs->SQLSetConnectOptionW( con->hdr.win32_handle, attr, (SQLULEN)value );
|
||||
+
|
||||
+ /* If an option isn't supported on other driver, then just return success for now. */
|
||||
+ if(ret != SQL_SUCCESS)
|
||||
@ -36,8 +36,8 @@ index dee73f0618e..d29069cb021 100644
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
@ -1,38 +0,0 @@
|
||||
From 1d3f665c4081f2675864b98962b4d8a611564063 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Sat, 10 Aug 2024 14:38:54 +1000
|
||||
Subject: [PATCH] odbc32: Use SQLAllocHandle to allocated a STMT handle
|
||||
|
||||
---
|
||||
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 70837003b69..0fa0102f2bb 100644
|
||||
--- a/dlls/odbc32/proxyodbc.c
|
||||
+++ b/dlls/odbc32/proxyodbc.c
|
||||
@@ -515,12 +515,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;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
--
|
||||
2.43.0
|
||||
|
@ -1,25 +0,0 @@
|
||||
From 14b0cc45d3d19baf6c1f2534f8f31b7b5299c54f Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Sat, 10 Aug 2024 14:43:02 +1000
|
||||
Subject: [PATCH] odbc32: Call drivers SQLBindCol function
|
||||
|
||||
---
|
||||
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 0fa0102f2bb..35744622513 100644
|
||||
--- a/dlls/odbc32/proxyodbc.c
|
||||
+++ b/dlls/odbc32/proxyodbc.c
|
||||
@@ -664,7 +664,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;
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
@ -1,33 +0,0 @@
|
||||
From e93b8d3f2fe126cc42c4af3f6784f268de5d94f2 Mon Sep 17 00:00:00 2001
|
||||
From: Fabian Maurer <dark.shadow4@web.de>
|
||||
Date: Fri, 19 Jul 2024 00:06:37 +0200
|
||||
Subject: [PATCH] printdlg: Allow button id psh1 for "Properties" button.
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55841
|
||||
---
|
||||
dlls/comdlg32/printdlg.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c
|
||||
index aed486a9b09..b5c67c3abad 100644
|
||||
--- a/dlls/comdlg32/printdlg.c
|
||||
+++ b/dlls/comdlg32/printdlg.c
|
||||
@@ -1796,6 +1796,7 @@ static LRESULT PRINTDLG_WMCommandA(HWND hDlg, WPARAM wParam,
|
||||
}
|
||||
break;
|
||||
|
||||
+ case psh1: /* Setup button */
|
||||
case psh2: /* Properties button */
|
||||
{
|
||||
HANDLE hPrinter;
|
||||
@@ -1952,6 +1953,7 @@ static LRESULT PRINTDLG_WMCommandW(HWND hDlg, WPARAM wParam,
|
||||
}
|
||||
break;
|
||||
|
||||
+ case psh1: /* Setup button */
|
||||
case psh2: /* Properties button */
|
||||
{
|
||||
HANDLE hPrinter;
|
||||
--
|
||||
2.43.0
|
||||
|
@ -1,3 +0,0 @@
|
||||
Fixes: [55841] Support print "Properties" button.
|
||||
|
||||
# PR 6119
|
@ -1 +1 @@
|
||||
ad8b2870312a373fb0ab0ff2cbf6d42b3f08c15a
|
||||
d98f067294918aa5cfeadb576652dd8fd1757c38
|
||||
|
Loading…
Reference in New Issue
Block a user