From: Hans Leidekker hans@codeweavers.com
This function is not exported by current Windows drivers. --- dlls/odbc32/proxyodbc.c | 66 ++------------------------------------ dlls/odbc32/tests/odbc32.c | 35 -------------------- dlls/odbc32/unixlib.c | 39 ---------------------- dlls/odbc32/unixlib.h | 24 -------------- 4 files changed, 3 insertions(+), 161 deletions(-)
diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 47e0aff0b18..e295f052ee7 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -261,35 +261,10 @@ SQLRETURN WINAPI SQLBindParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNu SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, SQLLEN *StrLen_or_Ind) { - struct SQLBindParam_params params = { 0, ParameterNumber, ValueType, ParameterType, LengthPrecision, - ParameterScale, ParameterValue }; - struct handle *handle = StatementHandle; - UINT i = ParameterNumber - 1; - SQLRETURN ret; - - TRACE("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s," - " ParameterScale %d, ParameterValue %p, StrLen_or_Ind %p)\n", StatementHandle, ParameterNumber, ValueType, + FIXME("(StatementHandle %p, ParameterNumber %d, ValueType %d, ParameterType %d, LengthPrecision %s," + " ParameterScale %d, ParameterValue %p, StrLen_or_Ind %p) stub\n", StatementHandle, ParameterNumber, ValueType, ParameterType, debugstr_sqlulen(LengthPrecision), ParameterScale, ParameterValue, StrLen_or_Ind); - - if (!handle) return SQL_INVALID_HANDLE; - if (!ParameterNumber) - { - FIXME( "parameter 0 not handled\n" ); - return SQL_ERROR; - } - if (!alloc_binding( &handle->bind_param, SQL_PARAM_INPUT, ParameterNumber, handle->row_count )) return SQL_ERROR; - handle->bind_param.param[i].param.value_type = ValueType; - handle->bind_param.param[i].param.parameter_type = ParameterType; - handle->bind_param.param[i].param.length_precision = LengthPrecision; - handle->bind_param.param[i].param.parameter_scale = ParameterScale; - handle->bind_param.param[i].param.parameter_value = ParameterValue; - - params.StatementHandle = handle->unix_handle; - params.StrLen_or_Ind = handle->bind_param.param[i].len; - *(UINT64 *)params.StrLen_or_Ind = *StrLen_or_Ind; - if (SUCCESS(( ret = ODBC_CALL( SQLBindParam, ¶ms )))) handle->bind_param.param[i].ptr = StrLen_or_Ind; - TRACE ("Returning %d\n", ret); - return ret; + return SQL_ERROR; }
/************************************************************************* @@ -624,10 +599,6 @@ static void update_result_lengths( struct handle *handle, USHORT type ) { len_to_user( handle->bind_col.param[i].ptr, handle->bind_col.param[i].len, handle->row_count, width ); } - for (i = 0; i < handle->bind_param.count; i++) - { - len_to_user( handle->bind_param.param[i].ptr, handle->bind_param.param[i].len, handle->row_count, width ); - } for (i = 0; i < handle->bind_parameter.count; i++) { if (handle->bind_parameter.param[i].type != SQL_PARAM_OUTPUT && @@ -642,7 +613,6 @@ static void update_result_lengths( struct handle *handle, USHORT type ) { len_from_user( handle->bind_col.param[i].len, handle->bind_col.param[i].ptr, handle->row_count, width ); } - /* FIXME: handle bind_param */ for (i = 0; i < handle->bind_parameter.count; i++) { if (handle->bind_parameter.param[i].type != SQL_PARAM_INPUT && @@ -761,11 +731,6 @@ static void free_bindings( struct handle *handle ) free( handle->bind_col.param->len ); free( handle->bind_col.param ); } - if (handle->bind_param.param) - { - free( handle->bind_param.param->len ); - free( handle->bind_param.param ); - } if (handle->bind_parameter.param) { free( handle->bind_parameter.param->len ); @@ -1406,31 +1371,6 @@ static BOOL resize_result_lengths( struct handle *handle, UINT size ) } handle->bind_col.param[i].len = tmp; } - for (i = 0; i < handle->bind_param.count; i++) - { - UINT8 *tmp; - if (!handle->bind_param.param[i].ptr) continue; - if (!(tmp = realloc( handle->bind_param.param[i].len, size * sizeof(UINT64) ))) return FALSE; - if (tmp != handle->bind_param.param[i].len) - { - struct SQLBindParam_params params; - - params.StatementHandle = handle->unix_handle; - params.ParameterNumber = i + 1; - params.ValueType = handle->bind_param.param[i].param.value_type; - params.ParameterType = handle->bind_param.param[i].param.parameter_type; - params.LengthPrecision = handle->bind_param.param[i].param.length_precision; - params.ParameterScale = handle->bind_param.param[i].param.parameter_scale; - params.ParameterValue = handle->bind_param.param[i].param.parameter_value; - params.StrLen_or_Ind = tmp; - if (!SUCCESS(ODBC_CALL( SQLBindParam, ¶ms ))) - { - free( tmp ); - return FALSE; - } - } - handle->bind_param.param[i].len = tmp; - } for (i = 0; i < handle->bind_parameter.count; i++) { UINT8 *tmp; diff --git a/dlls/odbc32/tests/odbc32.c b/dlls/odbc32/tests/odbc32.c index 57bb17ef617..fafc63003b7 100644 --- a/dlls/odbc32/tests/odbc32.c +++ b/dlls/odbc32/tests/odbc32.c @@ -313,41 +313,6 @@ static void test_SQLExecDirect( void ) ok( ret == SQL_SUCCESS, "got %d\n", ret ); if (ret == SQL_ERROR) diag( stmt, SQL_HANDLE_STMT );
- id[0] = 1; - len_id[0] = sizeof(id[0]); - ret = SQLBindParam( stmt, 1, SQL_INTEGER, SQL_INTEGER, 0, 0, id, len_id ); - ok( ret == SQL_SUCCESS, "got %d\n", ret ); - if (ret == SQL_ERROR) diag( stmt, SQL_HANDLE_STMT ); - - memcpy( name, "Mary", sizeof("Mary") ); - len_name[0] = sizeof( "Mary" ) - 1; - ret = SQLBindParam( stmt, 2, SQL_CHAR, SQL_VARCHAR, 0, 0, name, len_name ); - ok( ret == SQL_SUCCESS, "got %d\n", ret ); - if (ret == SQL_ERROR) diag( stmt, SQL_HANDLE_STMT ); - - ret = SQLExecute( stmt ); - ok( ret == SQL_SUCCESS, "got %d\n", ret ); - if (ret == SQL_ERROR) diag( stmt, SQL_HANDLE_STMT ); - - ret = SQLFetch( stmt ); - ok( ret == SQL_SUCCESS, "got %d\n", ret ); - if (ret == SQL_ERROR) diag( stmt, SQL_HANDLE_STMT ); - ok( id[0] == 1, "got %d\n", id[0] ); - ok( len_id[0] == sizeof(id[0]), "got %d\n", (int)len_id[0] ); - ok( !strcmp( (const char *)name, "Mary" ), "got %s\n", name ); - ok( len_name[0] == sizeof("Mary") - 1, "got %d\n", (int)len_name[0] ); - - ret = SQLFreeStmt( stmt, 0 ); - ok( ret == SQL_SUCCESS, "got %d\n", ret ); - - ret = SQLAllocStmt( con, &stmt ); - ok( ret == SQL_SUCCESS, "got %d\n", ret ); - - ret = SQLPrepare( stmt, (SQLCHAR *)"SELECT * FROM winetest WHERE Id = ? AND Name = ?", - ARRAYSIZE("SELECT * FROM winetest WHERE Id = ? AND Name = ?") - 1 ); - ok( ret == SQL_SUCCESS, "got %d\n", ret ); - if (ret == SQL_ERROR) diag( stmt, SQL_HANDLE_STMT ); - id[0] = 1; len_id[0] = sizeof(id[0]); ret = SQLBindParameter( stmt, 1, SQL_PARAM_INPUT, SQL_INTEGER, SQL_INTEGER, 0, 0, id, 0, len_id ); diff --git a/dlls/odbc32/unixlib.c b/dlls/odbc32/unixlib.c index cc963c5a893..3f793ef382d 100644 --- a/dlls/odbc32/unixlib.c +++ b/dlls/odbc32/unixlib.c @@ -371,14 +371,6 @@ static NTSTATUS wrap_SQLBindCol( void *args ) params->TargetValue, params->BufferLength, params->StrLen_or_Ind ); }
-static NTSTATUS wrap_SQLBindParam( void *args ) -{ - struct SQLBindParam_params *params = args; - return SQLBindParam( (SQLHSTMT)(ULONG_PTR)params->StatementHandle, params->ParameterNumber, params->ValueType, - params->ParameterType, params->LengthPrecision, params->ParameterScale, - params->ParameterValue, params->StrLen_or_Ind ); -} - static NTSTATUS wrap_SQLBindParameter( void *args ) { struct SQLBindParameter_params *params = args; @@ -1155,7 +1147,6 @@ const unixlib_entry_t __wine_unix_call_funcs[] = wrap_SQLAllocHandleStd, wrap_SQLAllocStmt, wrap_SQLBindCol, - wrap_SQLBindParam, wrap_SQLBindParameter, wrap_SQLBrowseConnect, wrap_SQLBrowseConnectW, @@ -1297,35 +1288,6 @@ static NTSTATUS wow64_SQLBindCol( void *args ) return wrap_SQLBindCol( ¶ms ); }
-static NTSTATUS wow64_SQLBindParam( void *args ) -{ - struct - { - UINT64 StatementHandle; - UINT16 ParameterNumber; - INT16 ValueType; - INT16 ParameterType; - UINT64 LengthPrecision; - INT16 ParameterScale; - PTR32 ParameterValue; - PTR32 StrLen_or_Ind; - } const *params32 = args; - - struct SQLBindParam_params params = - { - params32->StatementHandle, - params32->ParameterNumber, - params32->ValueType, - params32->ParameterType, - params32->LengthPrecision, - params32->ParameterScale, - ULongToPtr(params32->ParameterValue), - ULongToPtr(params32->StrLen_or_Ind) - }; - - return wrap_SQLBindParam( ¶ms ); -} - static NTSTATUS wow64_SQLBindParameter( void *args ) { struct @@ -3557,7 +3519,6 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = wrap_SQLAllocHandleStd, wrap_SQLAllocStmt, wow64_SQLBindCol, - wow64_SQLBindParam, wow64_SQLBindParameter, wow64_SQLBrowseConnect, wow64_SQLBrowseConnectW, diff --git a/dlls/odbc32/unixlib.h b/dlls/odbc32/unixlib.h index b1f42363429..7cb245c52f3 100644 --- a/dlls/odbc32/unixlib.h +++ b/dlls/odbc32/unixlib.h @@ -40,7 +40,6 @@ enum sql_funcs unix_SQLAllocHandleStd, unix_SQLAllocStmt, unix_SQLBindCol, - unix_SQLBindParam, unix_SQLBindParameter, unix_SQLBrowseConnect, unix_SQLBrowseConnectW, @@ -159,15 +158,6 @@ struct bind_col_args INT64 buffer_length; };
-struct bind_param_args -{ - INT16 value_type; - INT16 parameter_type; - UINT64 length_precision; - INT16 parameter_scale; - void *parameter_value; -}; - struct bind_parameter_args { INT16 input_output_type; @@ -185,7 +175,6 @@ struct param union { struct bind_col_args col; - struct bind_param_args param; struct bind_parameter_args parameter; }; UINT8 *len; /* result length array stored in Unix lib */ @@ -202,7 +191,6 @@ struct handle { UINT64 unix_handle; struct param_binding bind_col; - struct param_binding bind_param; struct param_binding bind_parameter; UINT32 row_count; /* number of rows returned by SQLFetch() */ }; @@ -248,18 +236,6 @@ struct SQLBindCol_params void *StrLen_or_Ind; };
-struct SQLBindParam_params -{ - UINT64 StatementHandle; - UINT16 ParameterNumber; - INT16 ValueType; - INT16 ParameterType; - UINT64 LengthPrecision; - INT16 ParameterScale; - void *ParameterValue; - void *StrLen_or_Ind; -}; - struct SQLBindParameter_params { UINT64 StatementHandle;