X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8563c6f18aa1a98a07334f6e413756542ef31412..3cdcf4d444770f7f0ff2ca64807d8699764ed8b3:/src/msw/dialup.cpp?ds=sidebyside diff --git a/src/msw/dialup.cpp b/src/msw/dialup.cpp index b4bb8d55ea..75bd13098d 100644 --- a/src/msw/dialup.cpp +++ b/src/msw/dialup.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: msw/dialup.cpp +// Name: src/msw/dialup.cpp // Purpose: MSW implementation of network/dialup classes and functions // Author: Vadim Zeitlin // Modified by: @@ -26,18 +26,19 @@ #if wxUSE_DIALUP_MANAGER +#include "wx/dialup.h" + #ifndef WX_PRECOMP #include "wx/log.h" #include "wx/intl.h" #include "wx/event.h" + #include "wx/app.h" #endif #include "wx/timer.h" -#include "wx/app.h" #include "wx/generic/choicdgg.h" #include "wx/dynlib.h" -#include "wx/dialup.h" #include "wx/module.h" DEFINE_EVENT_TYPE(wxEVT_DIALUP_CONNECTED) @@ -947,8 +948,10 @@ bool wxDialUpManagerMSW::HangUp() return false; } - DWORD dwRet = ms_pfnRasHangUp(hRasConn); - if ( dwRet != 0 ) + // note that it's not an error if the connection had been already + // terminated + const DWORD dwRet = ms_pfnRasHangUp(hRasConn); + if ( dwRet != 0 && dwRet != ERROR_NO_CONNECTION ) { wxLogError(_("Failed to terminate the dialup connection: %s"), GetErrorString(dwRet).c_str()); @@ -1186,7 +1189,7 @@ void wxDialUpManagerMSW::DisableAutoCheckOnlineStatus() { wxCHECK_RET( IsOk(), wxT("using uninitialized wxDialUpManager") ); - if ( --m_autoCheckLevel ) + if ( --m_autoCheckLevel != 0 ) { // still checking return; @@ -1327,4 +1330,3 @@ static void WINAPI wxRasDialFunc(UINT WXUNUSED(unMsg), #endif // __BORLANDC__ #endif // wxUSE_DIALUP_MANAGER -