From 1109d563840fc70801a7cc040e68003b1e7be8ef Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Fri, 21 Oct 2005 02:16:11 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=8733 --- checkin_notes | 10 ++++++++++ clientgui/MainFrame.cpp | 42 +++++++++++++++++++++++++---------------- clientgui/MainFrame.h | 1 + 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/checkin_notes b/checkin_notes index 3c4534d542..fa51feb619 100755 --- a/checkin_notes +++ b/checkin_notes @@ -13279,3 +13279,13 @@ Charlie 20 Oct 2005 mac_installer/ release_boinc.sh + +Rom 20 Oct 2005 + Bug Fix: Some versions of Windows do not support RAS by default and so + wxWidgets complains when it can't find it. What is worse is we end up + dereferencing a null pointer when somebody tries to bring up the + options dialog. If we detect the null pointer disable all the + controls on the networking/communications tab. + + clientgui/ + MainFrame.cpp, .h diff --git a/clientgui/MainFrame.cpp b/clientgui/MainFrame.cpp index 54b32ee487..dbb4faa724 100644 --- a/clientgui/MainFrame.cpp +++ b/clientgui/MainFrame.cpp @@ -222,8 +222,12 @@ CMainFrame::CMainFrame(wxString strTitle) : // Prefetch and Load Wininet.dll so that any calls to // wxDialUpManager->IsAlwaysOnline happen quicker. m_WININET.Load(wxT("WININET")); - m_pDialupManager = wxDialUpManager::Create(); - wxASSERT(m_pDialupManager->IsOk()); + if (m_RASAPI32.Load(wxT("RASAPI32"))) { + m_pDialupManager = wxDialUpManager::Create(); + wxASSERT(m_pDialupManager->IsOk()); + } else { + m_pDialupManager = NULL; + } #endif m_pRefreshStateTimer = new wxTimer(this, ID_REFRESHSTATETIMER); @@ -269,9 +273,6 @@ CMainFrame::~CMainFrame() { wxASSERT(m_pMenubar); wxASSERT(m_pNotebook); wxASSERT(m_pStatusbar); -#ifdef __WXMSW__ - wxASSERT(m_pDialupManager); -#endif SaveState(); @@ -309,7 +310,6 @@ CMainFrame::~CMainFrame() { delete m_pDialupManager; #endif - wxLogTrace(wxT("Function Start/End"), wxT("CMainFrame::~CMainFrame - Function End")); } @@ -1080,10 +1080,6 @@ void CMainFrame::OnOptionsOptions(wxCommandEvent& WXUNUSED(event)) { wxASSERT(wxDynamicCast(pDoc, CMainDocument)); wxASSERT(pDlg); -#ifdef __WXMSW__ - wxASSERT(m_pDialupManager); -#endif - // General Tab pDlg->m_LanguageSelectionCtrl->Append(wxGetApp().GetSupportedLanguages()); @@ -1093,12 +1089,27 @@ void CMainFrame::OnOptionsOptions(wxCommandEvent& WXUNUSED(event)) { #ifdef __WXMSW__ // Connection Tab - m_pDialupManager->GetISPNames(astrDialupConnections); + if (m_pDialupManager) { + m_pDialupManager->GetISPNames(astrDialupConnections); - pDlg->m_DialupConnectionsCtrl->Append(astrDialupConnections); - pDlg->SetDefaultConnectionType(m_iNetworkConnectionType); - pDlg->SetDefaultDialupConnection(m_strNetworkDialupConnectionName); - pDlg->SetDefaultDialupPromptCredentials(m_bNetworkDialupPromptCredentials); + pDlg->m_DialupConnectionsCtrl->Append(astrDialupConnections); + pDlg->SetDefaultConnectionType(m_iNetworkConnectionType); + pDlg->SetDefaultDialupConnection(m_strNetworkDialupConnectionName); + pDlg->SetDefaultDialupPromptCredentials(m_bNetworkDialupPromptCredentials); + } else { + pDlg->m_DialupConnectionsCtrl->Append(astrDialupConnections); + pDlg->SetDefaultConnectionType(m_iNetworkConnectionType); + pDlg->SetDefaultDialupConnection(m_strNetworkDialupConnectionName); + pDlg->SetDefaultDialupPromptCredentials(m_bNetworkDialupPromptCredentials); + + pDlg->m_NetworkAutomaticDetectionCtrl->Disable(); + pDlg->m_NetworkUseLANCtrl->Disable(); + pDlg->m_NetworkUseDialupCtrl->Disable(); + pDlg->m_DialupConnectionsCtrl->Disable(); + pDlg->m_DialupSetDefaultCtrl->Disable(); + pDlg->m_DialupClearDefaultCtrl->Disable(); + pDlg->m_DialupPromptCredentials->Disable(); + } #endif // Proxy Tabs @@ -1465,7 +1476,6 @@ void CMainFrame::OnFrameRender(wxTimerEvent &event) { wxTimeSpan tsLastDialupRequest; wxTimeSpan tsFirstDialupDisconnectEvent; - wxASSERT(m_pDialupManager->IsOk()); if (m_pDialupManager && pDoc) { // Update the always online flag every 60 seconds. This call is expensive // on slow machines. diff --git a/clientgui/MainFrame.h b/clientgui/MainFrame.h index d7f480d71b..8f06147554 100644 --- a/clientgui/MainFrame.h +++ b/clientgui/MainFrame.h @@ -117,6 +117,7 @@ private: CStatusBar* m_pStatusbar; #ifdef __WXMSW__ wxDynamicLibrary m_WININET; + wxDynamicLibrary m_RASAPI32; wxDialUpManager* m_pDialupManager; #endif wxString m_strBaseTitle;