1)odbc32: compare strings case-insensitively in get_driver_filename() Driver names should be compared without case-sensetivity. unixODBC has no problems when testDSN got "Driver = SQLite3" instead of "Driver = SQLITE3" https://learn.microsoft.com/en-us/openspecs/sql_server_protocols/ms-odbcstr/... 2)odbc32: skip set_value for NULL filename in replicate_odbc_to_registry() get_driver_filename can return NULL, for example when \~/.odbc.ini contains driver that has been deleted. We want to prevent SIGSEGV because of wcslen(filename) when filename is NULL. 3)odbc32: check if row_number is NULL in param_options_unix() According to documentation, SQLParamOptions can accept NULL row_number. Now when NULL row_nuber is passed, crash happens 4)odbc32: make sure ODBC_CALL returns SQLRETURN Not sure about this one, need opinion. The targeted problem: now ODBC_CALL return SQLRETURN which is truncated from NTSTATUS. If WINE_UNIX_CALL fails at some point, ODBC_CALL returns truncated NTSTATUS error code, STATUS_ACCESS_VIOLATION (0xC0000005) truncated to 5, then function gets invalid SQLRETURN. The following solution checks of NTSTATUS is actually short SQLRETURN casted to NTSTATUS. -- v3: odbc32: Check if row_number is NULL in param_options_unix(). odbc32: Skip set_value for NULL filename in replicate_odbc_to_registry(). odbc32: Compare strings case-insensitively in get_driver_filename(). https://gitlab.winehq.org/wine/wine/-/merge_requests/10743