diff --git a/checkin_notes b/checkin_notes index bde57e2cf2..0ab50e0b53 100755 --- a/checkin_notes +++ b/checkin_notes @@ -4378,5 +4378,17 @@ Rom 1 May 2006 diagnostics.h diagnostics_win.C +Rom 2 May 2006 + - Have the BOINC Manager perform the screensaver test everytime + is successfully makes a connection to the localhost core + client. It executes so fast it doesn't even show up in the + process list and if the user ever switches firewall packages + it'll at least prevent the machine from going into limbo + when the screensaver is spposed to shutdown. + + clientgui/ + BOINCGUIApp.cpp, .h + MainFrame.cpp + \ No newline at end of file diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index a90af787f4..9bed8dd923 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -951,4 +951,47 @@ int CBOINCGUIApp::UpdateSystemIdleDetection() { } +int CBOINCGUIApp::StartBOINCScreensaverTest() { +#ifdef __WXMSW__ + wxString strExecute = wxEmptyString; + wxChar szExecutableDirectory[4096]; + PROCESS_INFORMATION pi; + STARTUPINFO si; + BOOL bProcessStarted; + + memset(szExecutableDirectory, 0, sizeof(szExecutableDirectory)); + memset(&pi, 0, sizeof(pi)); + memset(&si, 0, sizeof(si)); + + si.cb = sizeof(si); + si.dwFlags = STARTF_USESHOWWINDOW; + si.wShowWindow = SW_HIDE; + + + // On Windows the screensaver is located in the Windows directory. + GetWindowsDirectory( + szExecutableDirectory, + (sizeof(szExecutableDirectory) / sizeof(wxChar)) + ); + + // Append boinc.exe to the end of the strExecute string and get ready to rock + strExecute = wxT("\"") + wxString(szExecutableDirectory) + wxT("\\boinc.scr\" /test"); + + bProcessStarted = CreateProcess( + NULL, + (LPTSTR)strExecute.c_str(), + NULL, + NULL, + FALSE, + CREATE_NEW_PROCESS_GROUP|CREATE_NO_WINDOW, + NULL, + szExecutableDirectory, + &si, + &pi + ); +#endif + return 0; +} + + const char *BOINC_RCSID_487cbf3018 = "$Id$"; diff --git a/clientgui/BOINCGUIApp.h b/clientgui/BOINCGUIApp.h index b2dc943205..21f9b4a91f 100644 --- a/clientgui/BOINCGUIApp.h +++ b/clientgui/BOINCGUIApp.h @@ -147,6 +147,8 @@ public: int IsNetworkAlwaysOnline(); int UpdateSystemIdleDetection(); + int StartBOINCScreensaverTest(); + CBrandingScheme* GetBrand() { return m_pBranding; } CMainFrame* GetFrame() { return m_pFrame; } CMainDocument* GetDocument() { return m_pDocument; } diff --git a/clientgui/MainFrame.cpp b/clientgui/MainFrame.cpp index afda1b38df..47015ceb40 100644 --- a/clientgui/MainFrame.cpp +++ b/clientgui/MainFrame.cpp @@ -1669,6 +1669,7 @@ void CMainFrame::OnConnect(CMainFrameEvent&) { CMainDocument* pDoc = wxGetApp().GetDocument(); CWizardAccountManager* pAMWizard = NULL; CWizardAttachProject* pAPWizard = NULL; + wxString strComputer = wxEmptyString; wxString strName = wxEmptyString; wxString strURL = wxEmptyString; bool bCachedCredentials = false; @@ -1690,6 +1691,15 @@ void CMainFrame::OnConnect(CMainFrameEvent&) { m_pFrameListPanelRenderTimer->Stop(); m_pDocumentPollTimer->Stop(); + + // If we are connected to the localhost, run a really quick screensaver + // test to trigger a firewall popup. + pDoc->GetConnectedComputerName(strComputer); + if (pDoc->IsComputerNameLocal(strComputer)) { + wxGetApp().StartBOINCScreensaverTest(); + } + + pDoc->rpc.acct_mgr_info(ami); if (ami.acct_mgr_url.size() && !ami.have_credentials) { pAMWizard = new CWizardAccountManager(this);