]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dialup.cpp
add -mno-cygwin detection: we should treat cygwin as Windows, not Unix, when it's...
[wxWidgets.git] / src / msw / dialup.cpp
index b4bb8d55eabf03a048161ff7cee07248935db0cc..76ad747b72e73499433f4adc78378440eda2ed41 100644 (file)
@@ -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:
 
 #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"
+    #include "wx/timer.h"
+    #include "wx/module.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)
 DEFINE_EVENT_TYPE(wxEVT_DIALUP_DISCONNECTED)
@@ -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
-