fixed crash in wxDb::Open() in Unicode build due to wrong interpretation of BufferLength argument of SQLDriverConnect()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40160 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-07-17 10:42:55 +00:00
parent 8dee721efd
commit cd7e925abb
2 changed files with 3 additions and 2 deletions

View File

@@ -85,6 +85,7 @@ All:
- Added wxPowerEvent (currently MSW-only).
- Make wx-config compatible with Bourne shells.
- Fixed wxDb::Open(wxDbConnectInf) when using connection string (Hellwolf Misty)
- Fixed crash in wxDb::Open() in Unicode build (Massimiliano Marretta)
All (GUI):

View File

@@ -858,7 +858,7 @@ bool wxDb::Open(const wxString& inConnectStr, SQLHWND parentWnd, bool failOnData
retcode = SQLDriverConnect(hdbc, parentWnd, (SQLTCHAR FAR *)inConnectionStr.c_str(),
(SWORD)inConnectionStr.length(), (SQLTCHAR FAR *)outConnectBuffer,
sizeof(outConnectBuffer), &outConnectBufferLen, SQL_DRIVER_COMPLETE );
WXSIZEOF(outConnectBuffer), &outConnectBufferLen, SQL_DRIVER_COMPLETE );
if ((retcode != SQL_SUCCESS) &&
(retcode != SQL_SUCCESS_WITH_INFO))
@@ -963,7 +963,7 @@ bool wxDb::Open(wxDb *copyDb)
retcode = SQLDriverConnect(hdbc, NULL, (SQLTCHAR FAR *)inConnectionStr.c_str(),
(SWORD)inConnectionStr.length(), (SQLTCHAR FAR *)outConnectBuffer,
sizeof(outConnectBuffer), &outConnectBufferLen, SQL_DRIVER_COMPLETE);
WXSIZEOF(outConnectBuffer), &outConnectBufferLen, SQL_DRIVER_COMPLETE);
if ((retcode != SQL_SUCCESS) &&
(retcode != SQL_SUCCESS_WITH_INFO))