X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e6d4038a8bf3ae178bc89cceaf60a0652749ea9b..e65a6cc1ec5537dc7f19f89e10cdfaae54adb264:/src/msw/dialup.cpp?ds=sidebyside diff --git a/src/msw/dialup.cpp b/src/msw/dialup.cpp index cce425e056..66a5a034fa 100644 --- a/src/msw/dialup.cpp +++ b/src/msw/dialup.cpp @@ -41,8 +41,8 @@ #include "wx/dynlib.h" -DEFINE_EVENT_TYPE(wxEVT_DIALUP_CONNECTED) -DEFINE_EVENT_TYPE(wxEVT_DIALUP_DISCONNECTED) +wxDEFINE_EVENT( wxEVT_DIALUP_CONNECTED, wxDialUpEvent ); +wxDEFINE_EVENT( wxEVT_DIALUP_DISCONNECTED, wxDialUpEvent ); // Doesn't yet compile under VC++ 4, BC++, Watcom C++, // Wine: no wininet.h @@ -163,7 +163,7 @@ struct WXDLLEXPORT wxRasThreadData HANDLE hEventRas, // automatic event which RAS signals when status changes hEventQuit; // manual event which we signal when we terminate - class WXDLLEXPORT wxDialUpManagerMSW *dialUpManager; // the owner + class WXDLLIMPEXP_FWD_CORE wxDialUpManagerMSW *dialUpManager; // the owner }; // ---------------------------------------------------------------------------- @@ -237,7 +237,7 @@ private: private: wxDialUpManagerMSW *m_dialUpManager; - DECLARE_NO_COPY_CLASS(RasTimer) + wxDECLARE_NO_COPY_CLASS(RasTimer); } m_timerStatusPolling; // thread handle for the thread sitting on connection change event @@ -288,7 +288,7 @@ private: // this flag tells us whether a call to RasDial() is in progress static wxDialUpManagerMSW *ms_dialer; - DECLARE_NO_COPY_CLASS(wxDialUpManagerMSW) + wxDECLARE_NO_COPY_CLASS(wxDialUpManagerMSW); }; // module to destroy helper window created by wxDialUpManagerMSW @@ -709,7 +709,13 @@ size_t wxDialUpManagerMSW::GetISPNames(wxArrayString& names) const if ( dwRet == ERROR_BUFFER_TOO_SMALL ) { // reallocate the buffer - rasEntries = (RASENTRYNAME *)realloc(rasEntries, size); + void *n = realloc(rasEntries, size); + if (n == NULL) + { + free(rasEntries); + return 0; + } + rasEntries = (RASENTRYNAME *)n; } else if ( dwRet != 0 ) { @@ -801,7 +807,7 @@ bool wxDialUpManagerMSW::Dial(const wxString& nameOfISP, RASDIALPARAMS rasDialParams; rasDialParams.dwSize = sizeof(rasDialParams); - wxStrncpy(rasDialParams.szEntryName, entryName, RAS_MaxEntryName); + wxStrlcpy(rasDialParams.szEntryName, entryName.c_str(), RAS_MaxEntryName); // do we have the username and password? if ( !username || !password ) @@ -823,8 +829,8 @@ bool wxDialUpManagerMSW::Dial(const wxString& nameOfISP, } else { - wxStrncpy(rasDialParams.szUserName, username, UNLEN); - wxStrncpy(rasDialParams.szPassword, password, PWLEN); + wxStrlcpy(rasDialParams.szUserName, username.c_str(), UNLEN); + wxStrlcpy(rasDialParams.szPassword, password.c_str(), PWLEN); } // default values for other fields