mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=9284
This commit is contained in:
parent
1e1d2f2d8e
commit
7286dbdd18
|
@ -768,3 +768,39 @@ Bruce 22 Jan 2006
|
|||
sched/
|
||||
update_stats.C
|
||||
|
||||
Rom 23 Jan 2007
|
||||
- On Windows use the System Event Notification Service to determine
|
||||
network connectivity instead of using InternetGetConnectedState
|
||||
since it was proving to be unreliable.
|
||||
|
||||
NOTE: This is a big change on Windows. SENS uses COM as it's
|
||||
communication infrastructure and so therefore boinc.dll now has
|
||||
to be regsvr32'ed before network notification messages will be
|
||||
sent to the client. If, for whatever reason SENS isn't working
|
||||
we'll fall back to InternetGetConnectedState.
|
||||
|
||||
client/
|
||||
main.C
|
||||
client/win/
|
||||
hostinfo_win.cpp
|
||||
clientgui/
|
||||
AccountManagerPropertiesPage.cpp
|
||||
BOINCGUIApp.cpp, .h
|
||||
MainFrame.cpp
|
||||
ProjectPropertiesPage.cpp
|
||||
clientlib/win/
|
||||
boinc_dll.cpp, .h (Added)
|
||||
BOINCSENSSink.cpp, .h (Added)
|
||||
Identification.cpp, .h (Added)
|
||||
IdleTracker.cpp, .h (Added)
|
||||
NetworkTracker.cpp, .h (Added)
|
||||
resource.h (Added)
|
||||
SENSLogonSubscriptions.h (Added)
|
||||
SENSNetworkSubscriptions.h (Added)
|
||||
SENSOnNowSubscriptions.h (Added)
|
||||
SENSSubscriptions.h (Added)
|
||||
stdafx.cpp, .h (Added)
|
||||
lib/
|
||||
network.C, .h
|
||||
win_build/
|
||||
boinc_dll.vcproj
|
||||
|
|
|
@ -28,13 +28,13 @@
|
|||
#include "win_service.h"
|
||||
#include "win_util.h"
|
||||
|
||||
extern HINSTANCE g_hIdleDetectionDll;
|
||||
extern HINSTANCE g_hClientLibraryDll;
|
||||
static HANDLE g_hWin9xMonitorSystemThread = NULL;
|
||||
static DWORD g_Win9xMonitorSystemThreadID = NULL;
|
||||
static BOOL g_bIsWin9x = FALSE;
|
||||
|
||||
typedef BOOL (CALLBACK* IdleTrackerInit)();
|
||||
typedef void (CALLBACK* IdleTrackerTerm)();
|
||||
typedef BOOL (CALLBACK* ClientLibraryStartup)();
|
||||
typedef void (CALLBACK* ClientLibraryShutdown)();
|
||||
#ifndef _T
|
||||
#define _T(X) X
|
||||
#endif
|
||||
|
@ -558,8 +558,8 @@ int main(int argc, char** argv) {
|
|||
}
|
||||
#endif
|
||||
|
||||
g_hIdleDetectionDll = LoadLibrary("boinc.dll");
|
||||
if(!g_hIdleDetectionDll) {
|
||||
g_hClientLibraryDll = LoadLibrary("boinc.dll");
|
||||
if(!g_hClientLibraryDll) {
|
||||
printf(
|
||||
"BOINC Core Client Error Message\n"
|
||||
"Failed to initialize the BOINC Idle Detection Interface\n"
|
||||
|
@ -567,16 +567,16 @@ int main(int argc, char** argv) {
|
|||
);
|
||||
}
|
||||
|
||||
if(g_hIdleDetectionDll) {
|
||||
IdleTrackerInit fnIdleTrackerInit;
|
||||
fnIdleTrackerInit = (IdleTrackerInit)GetProcAddress(g_hIdleDetectionDll, _T("IdleTrackerInit"));
|
||||
if(!fnIdleTrackerInit) {
|
||||
FreeLibrary(g_hIdleDetectionDll);
|
||||
g_hIdleDetectionDll = NULL;
|
||||
if(g_hClientLibraryDll) {
|
||||
ClientLibraryStartup fnClientLibraryStartup;
|
||||
fnClientLibraryStartup = (ClientLibraryStartup)GetProcAddress(g_hClientLibraryDll, _T("ClientLibraryStartup"));
|
||||
if(!fnClientLibraryStartup) {
|
||||
FreeLibrary(g_hClientLibraryDll);
|
||||
g_hClientLibraryDll = NULL;
|
||||
} else {
|
||||
if(!fnIdleTrackerInit()) {
|
||||
FreeLibrary(g_hIdleDetectionDll);
|
||||
g_hIdleDetectionDll = NULL;
|
||||
if(!fnClientLibraryStartup()) {
|
||||
FreeLibrary(g_hClientLibraryDll);
|
||||
g_hClientLibraryDll = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -617,19 +617,19 @@ int main(int argc, char** argv) {
|
|||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
if(g_hIdleDetectionDll) {
|
||||
IdleTrackerTerm fnIdleTrackerTerm;
|
||||
fnIdleTrackerTerm = (IdleTrackerTerm)GetProcAddress(g_hIdleDetectionDll, _T("IdleTrackerTerm"));
|
||||
if(fnIdleTrackerTerm) {
|
||||
fnIdleTrackerTerm();
|
||||
if(g_hClientLibraryDll) {
|
||||
ClientLibraryShutdown fnClientLibraryShutdown;
|
||||
fnClientLibraryShutdown = (ClientLibraryShutdown)GetProcAddress(g_hClientLibraryDll, _T("ClientLibraryShutdown"));
|
||||
if(fnClientLibraryShutdown) {
|
||||
fnClientLibraryShutdown();
|
||||
}
|
||||
if(!FreeLibrary(g_hIdleDetectionDll)) {
|
||||
if(!FreeLibrary(g_hClientLibraryDll)) {
|
||||
printf(
|
||||
"BOINC Core Client Error Message\n"
|
||||
"Failed to cleanup the BOINC Idle Detection Interface\n"
|
||||
);
|
||||
}
|
||||
g_hIdleDetectionDll = NULL;
|
||||
g_hClientLibraryDll = NULL;
|
||||
}
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "hostinfo_network.h"
|
||||
#include "hostinfo.h"
|
||||
|
||||
HINSTANCE g_hIdleDetectionDll;
|
||||
HINSTANCE g_hClientLibraryDll;
|
||||
|
||||
// Memory Status Structure for Win2K and WinXP based systems.
|
||||
typedef struct _MYMEMORYSTATUSEX {
|
||||
|
@ -426,9 +426,9 @@ bool HOST_INFO::host_is_running_on_batteries() {
|
|||
|
||||
bool HOST_INFO::users_idle(bool check_all_logins, double idle_time_to_run) {
|
||||
typedef DWORD (CALLBACK* GetFn)();
|
||||
static GetFn fn = (GetFn)GetProcAddress(g_hIdleDetectionDll, "IdleTrackerGetIdleTickCount");
|
||||
static GetFn fn = (GetFn)GetProcAddress(g_hClientLibraryDll, "BOINCGetIdleTickCount");
|
||||
|
||||
if (g_hIdleDetectionDll) {
|
||||
if (g_hClientLibraryDll) {
|
||||
if (fn) {
|
||||
double seconds_idle = fn() / 1000;
|
||||
double seconds_time_to_run = 60 * idle_time_to_run;
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
#include "stdwx.h"
|
||||
#include "wizardex.h"
|
||||
#include "error_numbers.h"
|
||||
#include "BOINCGUIApp.h"
|
||||
#include "network.h"
|
||||
#include "BOINCGUIApp.h"
|
||||
#include "BOINCWizards.h"
|
||||
#include "BOINCBaseWizard.h"
|
||||
#include "WizardAccountManager.h"
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "stdwx.h"
|
||||
#include "BOINCGUIApp.h"
|
||||
#include "diagnostics.h"
|
||||
#include "network.h"
|
||||
#include "MainFrame.h"
|
||||
#include "Events.h"
|
||||
#include "MainDocument.h"
|
||||
|
@ -49,9 +50,11 @@
|
|||
|
||||
|
||||
#ifdef __WXMSW__
|
||||
typedef BOOL (CALLBACK* IdleTrackerInit)();
|
||||
typedef void (CALLBACK* IdleTrackerTerm)();
|
||||
typedef DWORD (CALLBACK* IdleTrackerGetIdleTickCount)();
|
||||
typedef BOOL (*pfnClientLibraryStartup)();
|
||||
typedef void (*pfnClientLibraryShutdown)();
|
||||
typedef int (*pfnBOINCIsNetworkAlive)(LPDWORD lpdwFlags);
|
||||
typedef int (*pfnBOINCIsNetworkAlwaysOnline)();
|
||||
typedef DWORD (*pfnBOINCGetIdleTickCount)();
|
||||
#endif
|
||||
|
||||
IMPLEMENT_APP(CBOINCGUIApp)
|
||||
|
@ -184,6 +187,19 @@ bool CBrandingScheme::OnInit( wxConfigBase *pConfig ) {
|
|||
|
||||
|
||||
bool CBOINCGUIApp::OnInit() {
|
||||
|
||||
// Setup variables with default values
|
||||
m_bBOINCStartedByManager = false;
|
||||
m_bFrameVisible = true;
|
||||
m_lBOINCCoreProcessId = 0;
|
||||
#ifdef __WXMSW__
|
||||
m_hBOINCCoreProcess = NULL;
|
||||
m_hClientLibraryDll = NULL;
|
||||
#endif
|
||||
m_strDefaultWindowStation = wxT("");
|
||||
m_strDefaultDesktop = wxT("");
|
||||
m_strDefaultDisplay = wxT("");
|
||||
|
||||
#ifdef __WXMSW__
|
||||
|
||||
TCHAR szPath[MAX_PATH-1];
|
||||
|
@ -198,13 +214,6 @@ bool CBOINCGUIApp::OnInit() {
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
// Setup the branding scheme
|
||||
m_pBranding = new CBrandingScheme;
|
||||
wxASSERT(m_pBranding);
|
||||
|
||||
m_pBranding->OnInit(m_pConfig);
|
||||
|
||||
#ifdef __WXMAC__
|
||||
|
||||
wxString strDirectory = wxEmptyString;
|
||||
|
@ -236,22 +245,25 @@ bool CBOINCGUIApp::OnInit() {
|
|||
|
||||
#endif // __WXMAC__
|
||||
|
||||
|
||||
// Setup application and company information
|
||||
SetAppName(wxT("BOINC Manager"));
|
||||
SetVendorName(wxT("Space Sciences Laboratory, U.C. Berkeley"));
|
||||
|
||||
|
||||
// Setup variables with default values
|
||||
m_bBOINCStartedByManager = false;
|
||||
m_bFrameVisible = true;
|
||||
m_lBOINCCoreProcessId = 0;
|
||||
#ifdef __WXMSW__
|
||||
m_hBOINCCoreProcess = NULL;
|
||||
m_hIdleDetectionDll = NULL;
|
||||
#endif
|
||||
m_strDefaultWindowStation = wxT("");
|
||||
m_strDefaultDesktop = wxT("");
|
||||
m_strDefaultDisplay = wxT("");
|
||||
// Initialize the configuration storage module
|
||||
m_pConfig = new wxConfig(GetAppName());
|
||||
wxConfigBase::Set(m_pConfig);
|
||||
wxASSERT(m_pConfig);
|
||||
|
||||
m_pConfig->SetPath(wxT("/"));
|
||||
|
||||
|
||||
// Setup the branding scheme
|
||||
m_pBranding = new CBrandingScheme;
|
||||
wxASSERT(m_pBranding);
|
||||
|
||||
m_pBranding->OnInit(m_pConfig);
|
||||
|
||||
|
||||
// Initialize the BOINC Diagnostics Framework
|
||||
|
@ -271,13 +283,6 @@ bool CBOINCGUIApp::OnInit() {
|
|||
"stderrgui"
|
||||
);
|
||||
|
||||
// Initialize the configuration storage module
|
||||
m_pConfig = new wxConfig(GetAppName());
|
||||
wxConfigBase::Set(m_pConfig);
|
||||
wxASSERT(m_pConfig);
|
||||
|
||||
m_pConfig->SetPath(wxT("/"));
|
||||
|
||||
// Enable Logging and Trace Masks
|
||||
m_pLog = new wxLogBOINC();
|
||||
wxLog::SetActiveTarget(m_pLog);
|
||||
|
@ -343,7 +348,7 @@ bool CBOINCGUIApp::OnInit() {
|
|||
DetectDisplayInfo();
|
||||
|
||||
// Startup the System Idle Detection code
|
||||
StartupSystemIdleDetection();
|
||||
ClientLibraryStartup();
|
||||
|
||||
// Detect if we need to start the BOINC Core Client due to configuration
|
||||
StartupBOINCCore();
|
||||
|
@ -396,7 +401,7 @@ int CBOINCGUIApp::OnExit() {
|
|||
ShutdownBOINCCore();
|
||||
|
||||
// Shutdown the System Idle Detection code
|
||||
ShutdownSystemIdleDetection();
|
||||
ClientLibraryShutdown();
|
||||
|
||||
#if defined(__WXMSW__) || defined(__WXMAC__)
|
||||
if (m_pTaskBarIcon) {
|
||||
|
@ -779,21 +784,21 @@ void CBOINCGUIApp::ShutdownBOINCCore() {
|
|||
#endif
|
||||
|
||||
|
||||
wxInt32 CBOINCGUIApp::StartupSystemIdleDetection() {
|
||||
int CBOINCGUIApp::ClientLibraryStartup() {
|
||||
#ifdef __WXMSW__
|
||||
// load dll and start idle detection
|
||||
m_hIdleDetectionDll = LoadLibrary("boinc.dll");
|
||||
if(m_hIdleDetectionDll) {
|
||||
IdleTrackerInit fn;
|
||||
fn = (IdleTrackerInit)GetProcAddress(m_hIdleDetectionDll, wxT("IdleTrackerInit"));
|
||||
m_hClientLibraryDll = LoadLibrary("boinc.dll");
|
||||
if(m_hClientLibraryDll) {
|
||||
pfnClientLibraryStartup fn;
|
||||
fn = (pfnClientLibraryStartup)GetProcAddress(m_hClientLibraryDll, wxT("ClientLibraryStartup"));
|
||||
if(!fn) {
|
||||
FreeLibrary(m_hIdleDetectionDll);
|
||||
m_hIdleDetectionDll = NULL;
|
||||
FreeLibrary(m_hClientLibraryDll);
|
||||
m_hClientLibraryDll = NULL;
|
||||
return -1;
|
||||
} else {
|
||||
if(!fn()) {
|
||||
FreeLibrary(m_hIdleDetectionDll);
|
||||
m_hIdleDetectionDll = NULL;
|
||||
FreeLibrary(m_hClientLibraryDll);
|
||||
m_hClientLibraryDll = NULL;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -803,29 +808,61 @@ wxInt32 CBOINCGUIApp::StartupSystemIdleDetection() {
|
|||
}
|
||||
|
||||
|
||||
wxInt32 CBOINCGUIApp::ShutdownSystemIdleDetection() {
|
||||
int CBOINCGUIApp::ClientLibraryShutdown() {
|
||||
#ifdef __WXMSW__
|
||||
if(m_hIdleDetectionDll) {
|
||||
IdleTrackerTerm fn;
|
||||
fn = (IdleTrackerTerm)GetProcAddress(m_hIdleDetectionDll, wxT("IdleTrackerTerm"));
|
||||
if(m_hClientLibraryDll) {
|
||||
pfnClientLibraryShutdown fn;
|
||||
fn = (pfnClientLibraryShutdown)GetProcAddress(m_hClientLibraryDll, wxT("ClientLibraryShutdown"));
|
||||
if(fn) {
|
||||
fn();
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
FreeLibrary(m_hIdleDetectionDll);
|
||||
m_hIdleDetectionDll = NULL;
|
||||
FreeLibrary(m_hClientLibraryDll);
|
||||
m_hClientLibraryDll = NULL;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
wxInt32 CBOINCGUIApp::UpdateSystemIdleDetection() {
|
||||
int CBOINCGUIApp::IsNetworkAlive(LPDWORD lpdwFlags) {
|
||||
#ifdef __WXMSW__
|
||||
if (m_hIdleDetectionDll) {
|
||||
IdleTrackerGetIdleTickCount fn;
|
||||
fn = (IdleTrackerGetIdleTickCount)GetProcAddress(m_hIdleDetectionDll, wxT("IdleTrackerGetIdleTickCount"));
|
||||
if(m_hClientLibraryDll) {
|
||||
pfnBOINCIsNetworkAlive fn;
|
||||
fn = (pfnBOINCIsNetworkAlive)GetProcAddress(m_hClientLibraryDll, wxT("BOINCIsNetworkAlive"));
|
||||
if(fn) {
|
||||
return fn(lpdwFlags);
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
int CBOINCGUIApp::IsNetworkAlwaysOnline() {
|
||||
#ifdef __WXMSW__
|
||||
if(m_hClientLibraryDll) {
|
||||
pfnBOINCIsNetworkAlwaysOnline fn;
|
||||
fn = (pfnBOINCIsNetworkAlwaysOnline)GetProcAddress(m_hClientLibraryDll, wxT("BOINCIsNetworkAlwaysOnline"));
|
||||
if(fn) {
|
||||
return fn();
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
int CBOINCGUIApp::UpdateSystemIdleDetection() {
|
||||
#ifdef __WXMSW__
|
||||
if (m_hClientLibraryDll) {
|
||||
pfnBOINCGetIdleTickCount fn;
|
||||
fn = (pfnBOINCGetIdleTickCount)GetProcAddress(m_hClientLibraryDll, wxT("BOINCGetIdleTickCount"));
|
||||
if(fn) {
|
||||
fn();
|
||||
} else {
|
||||
|
|
|
@ -100,8 +100,8 @@ protected:
|
|||
bool ProcessExists(pid_t thePID);
|
||||
#endif
|
||||
|
||||
int StartupSystemIdleDetection();
|
||||
int ShutdownSystemIdleDetection();
|
||||
int ClientLibraryStartup();
|
||||
int ClientLibraryShutdown();
|
||||
|
||||
wxConfig* m_pConfig;
|
||||
wxLocale* m_pLocale;
|
||||
|
@ -124,7 +124,7 @@ protected:
|
|||
|
||||
#ifdef __WXMSW__
|
||||
HANDLE m_hBOINCCoreProcess;
|
||||
HINSTANCE m_hIdleDetectionDll;
|
||||
HINSTANCE m_hClientLibraryDll;
|
||||
#endif
|
||||
|
||||
// The last value defined in the wxLanguage enum is wxLANGUAGE_USER_DEFINED.
|
||||
|
@ -139,6 +139,8 @@ public:
|
|||
|
||||
bool OnInit();
|
||||
|
||||
int IsNetworkAlive(LPDWORD lpdwFlags);
|
||||
int IsNetworkAlwaysOnline();
|
||||
int UpdateSystemIdleDetection();
|
||||
|
||||
CBrandingScheme* GetBrand() { return m_pBranding; }
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include "stdwx.h"
|
||||
#include "hyperlink.h"
|
||||
#include "network.h"
|
||||
#include "BOINCGUIApp.h"
|
||||
#include "MainFrame.h"
|
||||
#include "Events.h"
|
||||
|
@ -1548,6 +1549,8 @@ void CMainFrame::OnFrameRender(wxTimerEvent &event) {
|
|||
bool is_online = false;
|
||||
int want_network = 0;
|
||||
int answer = 0;
|
||||
DWORD dwConnectionFlags =
|
||||
NETWORK_ALIVE_LAN | NETWORK_ALIVE_WAN | NETWORK_ALIVE_AOL;
|
||||
wxString strConnectionName = wxEmptyString;
|
||||
wxString strConnectionUsername = wxEmptyString;
|
||||
wxString strConnectionPassword = wxEmptyString;
|
||||
|
@ -1576,7 +1579,7 @@ void CMainFrame::OnFrameRender(wxTimerEvent &event) {
|
|||
tsLastDialupIsAlreadyOnlineCheck = wxDateTime::Now() - dtLastDialupIsAlreadyOnlineCheck;
|
||||
if (tsLastDialupIsAlreadyOnlineCheck.GetSeconds() > 60) {
|
||||
dtLastDialupIsAlreadyOnlineCheck = wxDateTime::Now();
|
||||
is_already_online = m_pDialupManager->IsAlwaysOnline();
|
||||
is_already_online = wxGetApp().IsNetworkAlwaysOnline() ? true : false;
|
||||
}
|
||||
|
||||
// Are we configured to detect a network or told one already exists?
|
||||
|
@ -1596,7 +1599,7 @@ void CMainFrame::OnFrameRender(wxTimerEvent &event) {
|
|||
|
||||
// cache the various states
|
||||
is_dialing = m_pDialupManager->IsDialing();
|
||||
is_online = m_pDialupManager->IsOnline();
|
||||
is_online = wxGetApp().IsNetworkAlive(&dwConnectionFlags) ? true : false;
|
||||
pDoc->rpc.network_query(want_network);
|
||||
|
||||
wxLogTrace(wxT("Function Status"), wxT("CMainFrame::OnFrameRender - Dialup Flags"));
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
#include "stdwx.h"
|
||||
#include "wizardex.h"
|
||||
#include "error_numbers.h"
|
||||
#include "BOINCGUIApp.h"
|
||||
#include "network.h"
|
||||
#include "BOINCGUIApp.h"
|
||||
#include "BOINCWizards.h"
|
||||
#include "BOINCBaseWizard.h"
|
||||
#include "WizardAttachProject.h"
|
||||
|
|
|
@ -0,0 +1,180 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2005 University of California
|
||||
//
|
||||
// This is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// either version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This software is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "BOINCSENSSink.h"
|
||||
#include "SENSSubscriptions.h"
|
||||
|
||||
|
||||
// CBOINCSENSSink
|
||||
|
||||
CBOINCSENSSink::CBOINCSENSSink()
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CBOINCSENSSink::FinalConstruct()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CBOINCSENSSink::FinalRelease()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// ISensNetwork Methods
|
||||
HRESULT CBOINCSENSSink::ConnectionMade(BSTR bstrConnection, unsigned long ulType, SENS_QOCINFO * lpQOCInfo)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
ATLTRACE(TEXT("ConnectionMade: Connection: '%s' Type '%d'\n"), COLE2T(bstrConnection), ulType);
|
||||
ATLTRACE(TEXT("ConnectionMade: dwSize '%d' dwFlags: '%d' dwOutSpeed '%d' dwInSpeed '%d'\n"),
|
||||
lpQOCInfo->dwSize, lpQOCInfo->dwFlags, lpQOCInfo->dwOutSpeed, lpQOCInfo->dwInSpeed);
|
||||
std::vector<PNETWORK_CONNECTION>::iterator iter;
|
||||
BOOL bCachedConnectionFound = FALSE;
|
||||
|
||||
// Check cached connection state
|
||||
for (iter = gpNetworkConnections.begin(); iter != gpNetworkConnections.end(); iter++) {
|
||||
if ((*iter)->bstrConnection == bstrConnection) {
|
||||
ATLTRACE(TEXT("ConnectionMade: Updating existing record.\n"));
|
||||
// Either we missed a disconnect notification or the
|
||||
// ConnectionMadeNoQOCInfo event was fired first.
|
||||
bCachedConnectionFound = TRUE;
|
||||
(*iter)->ulType = ulType;
|
||||
(*iter)->QOCInfo = *lpQOCInfo;
|
||||
}
|
||||
}
|
||||
|
||||
if (!bCachedConnectionFound) {
|
||||
ATLTRACE(TEXT("ConnectionMade: Creating new record.\n"));
|
||||
PNETWORK_CONNECTION pNetworkConnection = new NETWORK_CONNECTION;
|
||||
pNetworkConnection->bstrConnection = bstrConnection;
|
||||
pNetworkConnection->ulType = ulType;
|
||||
pNetworkConnection->QOCInfo = *lpQOCInfo;
|
||||
gpNetworkConnections.push_back(pNetworkConnection);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CBOINCSENSSink::ConnectionMadeNoQOCInfo(BSTR bstrConnection, unsigned long ulType)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
ATLTRACE(TEXT("ConnectionMadeNoQOCInfo: Connection: '%s' Type '%d'\n"), COLE2T(bstrConnection), ulType);
|
||||
std::vector<PNETWORK_CONNECTION>::iterator iter;
|
||||
BOOL bCachedConnectionFound = FALSE;
|
||||
|
||||
// Check cached connection state
|
||||
for (iter = gpNetworkConnections.begin(); iter != gpNetworkConnections.end(); iter++) {
|
||||
if ((*iter)->bstrConnection == bstrConnection) {
|
||||
ATLTRACE(TEXT("ConnectionMadeNoQOCInfo: Updating existing record.\n"));
|
||||
// Either we missed a disconnect notification or the
|
||||
// ConnectionMade event was fired first.
|
||||
bCachedConnectionFound = TRUE;
|
||||
(*iter)->ulType = ulType;
|
||||
}
|
||||
}
|
||||
|
||||
if (!bCachedConnectionFound) {
|
||||
ATLTRACE(TEXT("ConnectionMadeNoQOCInfo: Creating new record.\n"));
|
||||
PNETWORK_CONNECTION pNetworkConnection = new NETWORK_CONNECTION;
|
||||
pNetworkConnection->bstrConnection = bstrConnection;
|
||||
pNetworkConnection->ulType = ulType;
|
||||
gpNetworkConnections.push_back(pNetworkConnection);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CBOINCSENSSink::ConnectionLost(BSTR bstrConnection, unsigned long ulType)
|
||||
{
|
||||
USES_CONVERSION;
|
||||
ATLTRACE(TEXT("ConnectionLost: Connection: '%s' Type '%d'\n"), COLE2T(bstrConnection), ulType);
|
||||
std::vector<PNETWORK_CONNECTION>::iterator iter;
|
||||
for (iter = gpNetworkConnections.begin(); iter != gpNetworkConnections.end(); iter++) {
|
||||
if ((*iter)->bstrConnection == bstrConnection) {
|
||||
gpNetworkConnections.erase(iter);
|
||||
delete *iter;
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CBOINCSENSSink::DestinationReachable(BSTR bstrDestination, BSTR bstrConnection, unsigned long ulType, SENS_QOCINFO * lpQOCInfo)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT CBOINCSENSSink::DestinationReachableNoQOCInfo(BSTR bstrDestination, BSTR bstrConnection, unsigned long ulType)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
// ISensOnNow Methods
|
||||
HRESULT CBOINCSENSSink::OnACPower()
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT CBOINCSENSSink::OnBatteryPower(unsigned long dwBatteryLifePercent)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT CBOINCSENSSink::BatteryLow(unsigned long dwBatteryLifePercent)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
// ISensLogon Methods
|
||||
HRESULT CBOINCSENSSink::Logon(BSTR bstrUserName)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT CBOINCSENSSink::Logoff(BSTR bstrUserName)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT CBOINCSENSSink::StartShell(BSTR bstrUserName)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT CBOINCSENSSink::DisplayLock(BSTR bstrUserName)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT CBOINCSENSSink::DisplayUnlock(BSTR bstrUserName)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT CBOINCSENSSink::StartScreenSaver(BSTR bstrUserName)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT CBOINCSENSSink::StopScreenSaver(BSTR bstrUserName)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2005 University of California
|
||||
//
|
||||
// This is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// either version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This software is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
#pragma once
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
#ifndef MIDL_DEFINE_GUID
|
||||
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
|
||||
const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
|
||||
#endif
|
||||
|
||||
#ifndef IID_IBOINCSENSSink
|
||||
MIDL_DEFINE_GUID(IID, IID_IBOINCSENSSink,0x30DFEB87,0xFDFB,0x48BB,0xA9,0x02,0xDB,0x4F,0x4C,0x13,0xE0,0x87);
|
||||
#endif
|
||||
|
||||
#ifndef CLSID_CBOINCSENSSink
|
||||
MIDL_DEFINE_GUID(CLSID, CLSID_CBOINCSENSSink,0x33955752,0x24F7,0x4DA4,0x81,0xC9,0xE5,0xEA,0x66,0x94,0xA5,0x74);
|
||||
#endif
|
||||
|
||||
// IBOINCSENSSink
|
||||
[
|
||||
object,
|
||||
uuid("30DFEB87-FDFB-48BB-A902-DB4F4C13E087"),
|
||||
dual,
|
||||
helpstring("IBOINCSENSSink Interface"),
|
||||
pointer_default(unique)
|
||||
]
|
||||
__interface IBOINCSENSSink : IDispatch
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
|
||||
// CBOINCSENSSink
|
||||
|
||||
[
|
||||
coclass,
|
||||
threading("free"),
|
||||
vi_progid("BOINCSENS.BOINCSENSSink"),
|
||||
progid("BOINCSENS.BOINCSENSSink.1"),
|
||||
version(1.0),
|
||||
uuid("33955752-24F7-4DA4-81C9-E5EA6694A574"),
|
||||
helpstring("BOINCSENSSink Class")
|
||||
]
|
||||
class ATL_NO_VTABLE CBOINCSENSSink :
|
||||
public IBOINCSENSSink,
|
||||
public IDispatchImpl<ISensNetwork, &__uuidof(ISensNetwork), &LIBID_SensEvents, /* wMajor = */ 2, /* wMinor = */ 0>,
|
||||
public IDispatchImpl<ISensLogon, &__uuidof(ISensLogon), &LIBID_SensEvents, /* wMajor = */ 2, /* wMinor = */ 0>,
|
||||
public IDispatchImpl<ISensOnNow, &__uuidof(ISensOnNow), &LIBID_SensEvents, /* wMajor = */ 2, /* wMinor = */ 0>
|
||||
{
|
||||
public:
|
||||
CBOINCSENSSink();
|
||||
HRESULT FinalConstruct();
|
||||
void FinalRelease();
|
||||
|
||||
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
||||
|
||||
public:
|
||||
|
||||
// ISensNetwork Methods
|
||||
public:
|
||||
STDMETHOD(ConnectionMade)(BSTR bstrConnection, unsigned long ulType, SENS_QOCINFO * lpQOCInfo);
|
||||
STDMETHOD(ConnectionMadeNoQOCInfo)(BSTR bstrConnection, unsigned long ulType);
|
||||
STDMETHOD(ConnectionLost)(BSTR bstrConnection, unsigned long ulType);
|
||||
STDMETHOD(DestinationReachable)(BSTR bstrDestination, BSTR bstrConnection, unsigned long ulType, SENS_QOCINFO * lpQOCInfo);
|
||||
STDMETHOD(DestinationReachableNoQOCInfo)(BSTR bstrDestination, BSTR bstrConnection, unsigned long ulType);
|
||||
|
||||
// ISensOnNow Methods
|
||||
public:
|
||||
STDMETHOD(OnACPower)();
|
||||
STDMETHOD(OnBatteryPower)(unsigned long dwBatteryLifePercent);
|
||||
STDMETHOD(BatteryLow)(unsigned long dwBatteryLifePercent);
|
||||
|
||||
// ISensLogon Methods
|
||||
public:
|
||||
STDMETHOD(Logon)(BSTR bstrUserName);
|
||||
STDMETHOD(Logoff)(BSTR bstrUserName);
|
||||
STDMETHOD(StartShell)(BSTR bstrUserName);
|
||||
STDMETHOD(DisplayLock)(BSTR bstrUserName);
|
||||
STDMETHOD(DisplayUnlock)(BSTR bstrUserName);
|
||||
STDMETHOD(StartScreenSaver)(BSTR bstrUserName);
|
||||
STDMETHOD(StopScreenSaver)(BSTR bstrUserName);
|
||||
};
|
||||
|
|
@ -0,0 +1,163 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2005 University of California
|
||||
//
|
||||
// This is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// either version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This software is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Identification.h"
|
||||
|
||||
|
||||
/**
|
||||
* Find out if we are on a Windows 2000 compatible system
|
||||
**/
|
||||
BOOL IsWindows2000Compatible()
|
||||
{
|
||||
OSVERSIONINFO osvi;
|
||||
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
|
||||
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
|
||||
if (! GetVersionEx ( (OSVERSIONINFO *) &osvi) )
|
||||
return FALSE;
|
||||
|
||||
return (osvi.dwMajorVersion >= 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function performs the basic check to see if
|
||||
* the platform on which it is running is Terminal
|
||||
* services enabled. Note, this code is compatible on
|
||||
* all Win32 platforms. For the Windows 2000 platform
|
||||
* we perform a "lazy" bind to the new product suite
|
||||
* APIs that were first introduced on that platform.
|
||||
**/
|
||||
BOOL IsTerminalServicesEnabled()
|
||||
{
|
||||
BOOL bResult = FALSE; // assume Terminal Services is not enabled
|
||||
|
||||
DWORD dwVersion;
|
||||
OSVERSIONINFOEXA osVersionInfo;
|
||||
DWORDLONG dwlConditionMask = 0;
|
||||
HMODULE hmodK32 = NULL;
|
||||
HMODULE hmodNtDll = NULL;
|
||||
typedef ULONGLONG (WINAPI *PFnVerSetConditionMask)(ULONGLONG,ULONG,UCHAR);
|
||||
typedef BOOL (WINAPI *PFnVerifyVersionInfoA)(POSVERSIONINFOEXA, DWORD, DWORDLONG);
|
||||
PFnVerSetConditionMask pfnVerSetConditionMask;
|
||||
PFnVerifyVersionInfoA pfnVerifyVersionInfoA;
|
||||
|
||||
dwVersion = GetVersion();
|
||||
|
||||
// are we running NT ?
|
||||
if (!(dwVersion & 0x80000000))
|
||||
{
|
||||
// Is it Windows 2000 (NT 5.0) or greater ?
|
||||
if (LOBYTE(LOWORD(dwVersion)) > 4)
|
||||
{
|
||||
// In Windows 2000 we need to use the Product Suite APIs
|
||||
// Don't static link because it won't load on non-Win2000 systems
|
||||
hmodNtDll = GetModuleHandle( "NTDLL.DLL" );
|
||||
if (hmodNtDll != NULL)
|
||||
{
|
||||
pfnVerSetConditionMask = (PFnVerSetConditionMask )GetProcAddress( hmodNtDll, "VerSetConditionMask");
|
||||
if (pfnVerSetConditionMask != NULL)
|
||||
{
|
||||
dwlConditionMask = (*pfnVerSetConditionMask)( dwlConditionMask, VER_SUITENAME, VER_AND );
|
||||
hmodK32 = GetModuleHandle( "KERNEL32.DLL" );
|
||||
if (hmodK32 != NULL)
|
||||
{
|
||||
pfnVerifyVersionInfoA = (PFnVerifyVersionInfoA)GetProcAddress( hmodK32, "VerifyVersionInfoA") ;
|
||||
if (pfnVerifyVersionInfoA != NULL)
|
||||
{
|
||||
ZeroMemory(&osVersionInfo, sizeof(osVersionInfo));
|
||||
osVersionInfo.dwOSVersionInfoSize = sizeof(osVersionInfo);
|
||||
osVersionInfo.wSuiteMask = VER_SUITE_TERMINAL | VER_SUITE_SINGLEUSERTS;
|
||||
bResult = (*pfnVerifyVersionInfoA)(
|
||||
&osVersionInfo,
|
||||
VER_SUITENAME,
|
||||
dwlConditionMask);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is NT 4.0 or older
|
||||
bResult = ValidateProductSuite( "Terminal Server" );
|
||||
}
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function compares the passed in "suite name" string
|
||||
* to the product suite information stored in the registry.
|
||||
* This only works on the Terminal Server 4.0 platform.
|
||||
**/
|
||||
BOOL ValidateProductSuite (LPSTR SuiteName)
|
||||
{
|
||||
BOOL rVal = FALSE;
|
||||
LONG Rslt;
|
||||
HKEY hKey = NULL;
|
||||
DWORD Type = 0;
|
||||
DWORD Size = 0;
|
||||
LPSTR ProductSuite = NULL;
|
||||
LPSTR p;
|
||||
|
||||
Rslt = RegOpenKeyA(
|
||||
HKEY_LOCAL_MACHINE,
|
||||
"System\\CurrentControlSet\\Control\\ProductOptions",
|
||||
&hKey
|
||||
);
|
||||
|
||||
if (Rslt != ERROR_SUCCESS)
|
||||
goto exit;
|
||||
|
||||
Rslt = RegQueryValueExA( hKey, "ProductSuite", NULL, &Type, NULL, &Size );
|
||||
if (Rslt != ERROR_SUCCESS || !Size)
|
||||
goto exit;
|
||||
|
||||
ProductSuite = (LPSTR) LocalAlloc( LPTR, Size );
|
||||
if (!ProductSuite)
|
||||
goto exit;
|
||||
|
||||
Rslt = RegQueryValueExA( hKey, "ProductSuite", NULL, &Type,
|
||||
(LPBYTE) ProductSuite, &Size );
|
||||
if (Rslt != ERROR_SUCCESS || Type != REG_MULTI_SZ)
|
||||
goto exit;
|
||||
|
||||
p = ProductSuite;
|
||||
while (*p)
|
||||
{
|
||||
if (lstrcmpA( p, SuiteName ) == 0)
|
||||
{
|
||||
rVal = TRUE;
|
||||
break;
|
||||
}
|
||||
p += (lstrlenA( p ) + 1);
|
||||
}
|
||||
|
||||
exit:
|
||||
if (ProductSuite)
|
||||
LocalFree( ProductSuite );
|
||||
|
||||
if (hKey)
|
||||
RegCloseKey( hKey );
|
||||
|
||||
return rVal;
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2005 University of California
|
||||
//
|
||||
// This is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// either version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This software is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
#pragma once
|
||||
|
||||
extern BOOL IsWindows2000Compatible();
|
||||
extern BOOL IsTerminalServicesEnabled();
|
||||
extern BOOL ValidateProductSuite (LPSTR SuiteName);
|
|
@ -0,0 +1,298 @@
|
|||
/**
|
||||
* IdleTracker - a DLL that tracks the user's idle input time
|
||||
* system-wide.
|
||||
*
|
||||
* Usage
|
||||
* =====
|
||||
* - call IdleTrackerInit() when you want to start monitoring.
|
||||
* - call IdleTrackerTerm() when you want to stop monitoring.
|
||||
* - to get the time past since last user input, do the following:
|
||||
* GetTickCount() - IdleTrackerGetLastTickCount()
|
||||
*
|
||||
* Author: Sidney Chong
|
||||
* Date: 25/5/2000
|
||||
* Version: 1.0
|
||||
**/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Identification.h"
|
||||
|
||||
|
||||
/**
|
||||
* The following global data is only shared in this instance of the DLL
|
||||
**/
|
||||
HMODULE g_hUser32 = NULL;
|
||||
HANDLE g_hMemoryMappedData = NULL;
|
||||
BOOL g_bIsWindows2000Compatible = FALSE;
|
||||
BOOL g_bIsTerminalServicesEnabled = FALSE;
|
||||
|
||||
/**
|
||||
* The following global data is SHARED among all instances of the DLL
|
||||
* (processes) within a terminal services session.
|
||||
**/
|
||||
#pragma data_seg(".IdleTrac") // you must define as SHARED in .def
|
||||
HHOOK g_hHkKeyboard = NULL; // handle to the keyboard hook
|
||||
HHOOK g_hHkMouse = NULL; // handle to the mouse hook
|
||||
LONG g_mouseLocX = -1; // x-location of mouse position
|
||||
LONG g_mouseLocY = -1; // y-location of mouse position
|
||||
DWORD g_dwLastTick = 0; // tick time of last input event
|
||||
#pragma data_seg()
|
||||
#pragma comment(linker, "/section:.IdleTrac,rws")
|
||||
|
||||
/**
|
||||
* The following global data is SHARED among all instances of the DLL
|
||||
* (processes); i.e., these are system-wide globals.
|
||||
**/
|
||||
struct SystemWideIdleData
|
||||
{
|
||||
DWORD dwLastTick; // tick time of last input event
|
||||
};
|
||||
|
||||
struct SystemWideIdleData* g_pSystemWideIdleData = NULL;
|
||||
|
||||
/**
|
||||
* Define stuff that only exists on Windows 2000 compatible machines
|
||||
**/
|
||||
typedef struct tagLASTINPUTINFO {
|
||||
UINT cbSize;
|
||||
DWORD dwTime;
|
||||
} LASTINPUTINFO, *PLASTINPUTINFO;
|
||||
|
||||
typedef BOOL (WINAPI *GETLASTINPUTINFO)(PLASTINPUTINFO);
|
||||
|
||||
GETLASTINPUTINFO g_fnGetLastInputInfo = NULL;
|
||||
|
||||
/**
|
||||
* Keyboard hook: record tick count
|
||||
**/
|
||||
LRESULT CALLBACK KeyboardTracker(int code, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (code==HC_ACTION)
|
||||
{
|
||||
g_dwLastTick = GetTickCount();
|
||||
}
|
||||
return ::CallNextHookEx(g_hHkKeyboard, code, wParam, lParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mouse hook: record tick count
|
||||
**/
|
||||
LRESULT CALLBACK MouseTracker(int code, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (code==HC_ACTION)
|
||||
{
|
||||
MOUSEHOOKSTRUCT* pStruct = (MOUSEHOOKSTRUCT*)lParam;
|
||||
//we will assume that any mouse msg with the same locations as spurious
|
||||
if (pStruct->pt.x != g_mouseLocX || pStruct->pt.y != g_mouseLocY)
|
||||
{
|
||||
g_mouseLocX = pStruct->pt.x;
|
||||
g_mouseLocY = pStruct->pt.y;
|
||||
g_dwLastTick = GetTickCount();
|
||||
}
|
||||
}
|
||||
return ::CallNextHookEx(g_hHkMouse, code, wParam, lParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tick count of last keyboard or mouse event
|
||||
**/
|
||||
EXTERN_C __declspec(dllexport) DWORD BOINCGetIdleTickCount()
|
||||
{
|
||||
DWORD dwCurrentTickCount = GetTickCount();
|
||||
DWORD dwLastTickCount = 0;
|
||||
|
||||
if ( g_bIsWindows2000Compatible )
|
||||
{
|
||||
LASTINPUTINFO lii;
|
||||
ZeroMemory( &lii, sizeof(lii) );
|
||||
lii.cbSize = sizeof(lii);
|
||||
g_fnGetLastInputInfo( &lii );
|
||||
|
||||
/**
|
||||
* If both values are greater than the system tick count then
|
||||
* the system must have looped back to the begining.
|
||||
**/
|
||||
if ( ( dwCurrentTickCount < lii.dwTime ) &&
|
||||
( dwCurrentTickCount < g_pSystemWideIdleData->dwLastTick ) )
|
||||
{
|
||||
lii.dwTime = dwCurrentTickCount;
|
||||
g_pSystemWideIdleData->dwLastTick = dwCurrentTickCount;
|
||||
}
|
||||
|
||||
if ( lii.dwTime > g_pSystemWideIdleData->dwLastTick )
|
||||
g_pSystemWideIdleData->dwLastTick = lii.dwTime;
|
||||
|
||||
dwLastTickCount = g_pSystemWideIdleData->dwLastTick;
|
||||
}
|
||||
else
|
||||
{
|
||||
dwLastTickCount = g_dwLastTick;
|
||||
}
|
||||
|
||||
return (dwCurrentTickCount - dwLastTickCount);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize DLL: install kbd/mouse hooks.
|
||||
**/
|
||||
BOOL IdleTrackerStartup()
|
||||
{
|
||||
BOOL bExists = FALSE;
|
||||
BOOL bResult = FALSE;
|
||||
SECURITY_ATTRIBUTES sec_attr;
|
||||
SECURITY_DESCRIPTOR sd;
|
||||
|
||||
|
||||
g_bIsWindows2000Compatible = IsWindows2000Compatible();
|
||||
g_bIsTerminalServicesEnabled = IsTerminalServicesEnabled();
|
||||
|
||||
|
||||
if ( !g_bIsWindows2000Compatible )
|
||||
{
|
||||
if ( NULL == g_hHkKeyboard )
|
||||
{
|
||||
g_hHkKeyboard = SetWindowsHookEx(
|
||||
WH_KEYBOARD,
|
||||
KeyboardTracker,
|
||||
_AtlBaseModule.GetModuleInstance(),
|
||||
0
|
||||
);
|
||||
}
|
||||
if ( NULL == g_hHkMouse )
|
||||
{
|
||||
g_hHkMouse = SetWindowsHookEx(
|
||||
WH_MOUSE,
|
||||
MouseTracker,
|
||||
_AtlBaseModule.GetModuleInstance(),
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
_ASSERT( g_hHkKeyboard );
|
||||
_ASSERT( g_hHkMouse );
|
||||
}
|
||||
else
|
||||
{
|
||||
g_hUser32 = LoadLibrary("user32.dll");
|
||||
if (g_hUser32)
|
||||
g_fnGetLastInputInfo = (GETLASTINPUTINFO)GetProcAddress(g_hUser32, "GetLastInputInfo");
|
||||
|
||||
|
||||
/*
|
||||
* Create a security descriptor that will allow
|
||||
* everyone full access.
|
||||
*/
|
||||
InitializeSecurityDescriptor( &sd, SECURITY_DESCRIPTOR_REVISION );
|
||||
SetSecurityDescriptorDacl( &sd, TRUE, NULL, FALSE );
|
||||
|
||||
sec_attr.nLength = sizeof(sec_attr);
|
||||
sec_attr.bInheritHandle = TRUE;
|
||||
sec_attr.lpSecurityDescriptor = &sd;
|
||||
|
||||
/*
|
||||
* Create a filemap object that is global for everyone,
|
||||
* including users logged in via terminal services.
|
||||
*/
|
||||
if( g_bIsTerminalServicesEnabled )
|
||||
{
|
||||
g_hMemoryMappedData =
|
||||
CreateFileMapping(
|
||||
INVALID_HANDLE_VALUE,
|
||||
&sec_attr,
|
||||
PAGE_READWRITE,
|
||||
0,
|
||||
4096,
|
||||
"Global\\BoincIdleTracker"
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_hMemoryMappedData =
|
||||
CreateFileMapping(
|
||||
INVALID_HANDLE_VALUE,
|
||||
&sec_attr,
|
||||
PAGE_READWRITE,
|
||||
0,
|
||||
4096,
|
||||
"BoincIdleTracker"
|
||||
);
|
||||
}
|
||||
_ASSERT( g_hMemoryMappedData );
|
||||
|
||||
if( NULL != g_hMemoryMappedData )
|
||||
{
|
||||
if( ERROR_ALREADY_EXISTS == GetLastError() )
|
||||
bExists = TRUE;
|
||||
|
||||
g_pSystemWideIdleData = (struct SystemWideIdleData*)
|
||||
MapViewOfFile(
|
||||
g_hMemoryMappedData,
|
||||
FILE_MAP_ALL_ACCESS,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
);
|
||||
|
||||
_ASSERT( g_pSystemWideIdleData );
|
||||
}
|
||||
|
||||
if( !bExists )
|
||||
{
|
||||
g_pSystemWideIdleData->dwLastTick = GetTickCount();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( !g_bIsWindows2000Compatible )
|
||||
{
|
||||
if ( !g_hHkKeyboard || !g_hHkMouse )
|
||||
bResult = FALSE;
|
||||
else
|
||||
bResult = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !g_hUser32 || !g_fnGetLastInputInfo || !g_hMemoryMappedData || !g_pSystemWideIdleData )
|
||||
bResult = FALSE;
|
||||
else
|
||||
bResult = TRUE;
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Terminate DLL: remove hooks.
|
||||
**/
|
||||
void IdleTrackerShutdown()
|
||||
{
|
||||
if ( !g_bIsWindows2000Compatible )
|
||||
{
|
||||
BOOL bResult;
|
||||
if ( g_hHkKeyboard )
|
||||
{
|
||||
bResult = UnhookWindowsHookEx( g_hHkKeyboard );
|
||||
_ASSERT( bResult );
|
||||
g_hHkKeyboard = NULL;
|
||||
}
|
||||
if ( g_hHkMouse )
|
||||
{
|
||||
bResult = UnhookWindowsHookEx(g_hHkMouse);
|
||||
_ASSERT( bResult );
|
||||
g_hHkMouse = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( NULL != g_pSystemWideIdleData )
|
||||
{
|
||||
UnmapViewOfFile(g_pSystemWideIdleData);
|
||||
CloseHandle(g_hMemoryMappedData);
|
||||
}
|
||||
|
||||
if ( NULL != g_hUser32 )
|
||||
FreeLibrary(g_hUser32);
|
||||
}
|
||||
}
|
||||
|
||||
const char *BOINC_RCSID_14d432d5b3 = "$Id$";
|
|
@ -0,0 +1,23 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2005 University of California
|
||||
//
|
||||
// This is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// either version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This software is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
#pragma once
|
||||
|
||||
extern BOOL IdleTrackerStartup();
|
||||
extern void IdleTrackerShutdown();
|
|
@ -0,0 +1,327 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2005 University of California
|
||||
//
|
||||
// This is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// either version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This software is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "BOINCSENSSink.h"
|
||||
#include "SENSSubscriptions.h"
|
||||
#include "SENSNetworkSubscriptions.h"
|
||||
#include "SENSOnNowSubscriptions.h"
|
||||
#include "SENSLogonSubscriptions.h"
|
||||
|
||||
|
||||
IEventSystem* gpIEventSystem = NULL;
|
||||
|
||||
SENS_SUBSCRIPTION_GROUP gSubscriptionGroups[3];
|
||||
unsigned int giSubscriptionGroupCount = 0;
|
||||
|
||||
std::vector<PNETWORK_CONNECTION> gpNetworkConnections;
|
||||
|
||||
|
||||
EXTERN_C __declspec(dllexport) BOOL BOINCIsNetworkAlive( LPDWORD lpdwFlags )
|
||||
{
|
||||
USES_CONVERSION;
|
||||
unsigned int i = 0;
|
||||
BOOL bReturnValue = FALSE;
|
||||
BOOL bCachePopulated = FALSE;
|
||||
PNETWORK_CONNECTION pNetworkConnection = NULL;
|
||||
|
||||
ATLTRACE(TEXT("BOINCIsNetworkAlive - Function Begin\n"));
|
||||
|
||||
// Check cached connection state
|
||||
if (!gpNetworkConnections.empty()) {
|
||||
ATLTRACE(TEXT("BOINCIsNetworkAlive - Using cached connection list\n"));
|
||||
bCachePopulated = TRUE;
|
||||
for (i=0; i<gpNetworkConnections.size(); i++) {
|
||||
pNetworkConnection = gpNetworkConnections[i];
|
||||
if (pNetworkConnection->ulType & *lpdwFlags) {
|
||||
ATLTRACE(TEXT("BOINCIsNetworkAlive - Cached connection type found\n"));
|
||||
bReturnValue = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we do not have any cached information, then fall back to other
|
||||
// methods
|
||||
if (!bCachePopulated) {
|
||||
ATLTRACE(TEXT("BOINCIsNetworkAlive - Calling SENS IsNetworkAlive()\n"));
|
||||
bReturnValue = IsNetworkAlive( lpdwFlags );
|
||||
if (!bReturnValue) {
|
||||
DWORD current_flags = NULL;
|
||||
DWORD desired_flags = NULL;
|
||||
|
||||
if (NETWORK_ALIVE_LAN & *lpdwFlags)
|
||||
desired_flags |= INTERNET_CONNECTION_LAN;
|
||||
|
||||
if (NETWORK_ALIVE_WAN & *lpdwFlags)
|
||||
desired_flags |= INTERNET_CONNECTION_MODEM;
|
||||
|
||||
// TODO: Find out if AOL is registered as a LAN or WAN connection.
|
||||
// Until then, assume both are okay.
|
||||
if (NETWORK_ALIVE_AOL & *lpdwFlags)
|
||||
desired_flags |= INTERNET_CONNECTION_LAN | INTERNET_CONNECTION_MODEM;
|
||||
|
||||
ATLTRACE(TEXT("BOINCIsNetworkAlive - Calling InternetGetConnectedState()\n"));
|
||||
BOOL retval = InternetGetConnectedState(¤t_flags, 0);
|
||||
if (retval && (current_flags & desired_flags)) {
|
||||
bReturnValue = TRUE;
|
||||
} else {
|
||||
bReturnValue = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ATLTRACE(TEXT("BOINCIsNetworkAlive - Returning '%d'\n"), bReturnValue);
|
||||
ATLTRACE(TEXT("BOINCIsNetworkAlive - Function End\n"));
|
||||
return bReturnValue;
|
||||
}
|
||||
|
||||
|
||||
EXTERN_C __declspec(dllexport) BOOL BOINCIsNetworkAlwaysOnline()
|
||||
{
|
||||
BOOL bReturnValue = FALSE;
|
||||
DWORD dwFlags = NETWORK_ALIVE_LAN;
|
||||
|
||||
ATLTRACE(TEXT("BOINCIsNetworkAlwaysOnline - Function Begin\n"));
|
||||
|
||||
bReturnValue = BOINCIsNetworkAlive(&dwFlags);
|
||||
|
||||
ATLTRACE(TEXT("BOINCIsNetworkAlwaysOnline - Returning '%d'\n"), bReturnValue);
|
||||
ATLTRACE(TEXT("BOINCIsNetworkAlwaysOnline - Function End\n"));
|
||||
return bReturnValue;
|
||||
}
|
||||
|
||||
|
||||
BOOL NetworkTrackerStartup()
|
||||
{
|
||||
USES_CONVERSION;
|
||||
unsigned int i = 0, j = 0;
|
||||
HRESULT hr = 0;
|
||||
IBOINCSENSSink* pIBOINCSENSSink = NULL;
|
||||
|
||||
CComBSTR bstrPROGID_EventSubscription;
|
||||
IEventSubscription* pIEventSubscription = NULL;
|
||||
|
||||
PSENS_SUBSCRIPTION_GROUP pSubscriptionGroup = NULL;
|
||||
PSENS_SUBSCRIPTION pSubscription = NULL;
|
||||
|
||||
CComBSTR bstrSubscriberCLSID;
|
||||
CComBSTR bstrSubscriptionID;
|
||||
CComBSTR bstrSubscriptionName;
|
||||
CComBSTR bstrMethodName;
|
||||
|
||||
|
||||
// Assign the correct program is value to be used by the event
|
||||
// registration store.
|
||||
bstrPROGID_EventSubscription = PROGID_EventSubscription;
|
||||
|
||||
|
||||
// Clear the cache
|
||||
gpNetworkConnections.clear();
|
||||
|
||||
|
||||
// Try and create some important references to COM objects before
|
||||
// doing anything else.
|
||||
//
|
||||
|
||||
// IEventSystem
|
||||
hr = CoCreateInstance(
|
||||
CLSID_CEventSystem,
|
||||
NULL,
|
||||
CLSCTX_SERVER,
|
||||
IID_IEventSystem,
|
||||
(LPVOID*)&gpIEventSystem);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ATLTRACE(TEXT("Error creating event system! (0x%x)"), hr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// IBOINCSENSSink
|
||||
hr = CoCreateInstance(
|
||||
CLSID_CBOINCSENSSink,
|
||||
NULL,
|
||||
CLSCTX_SERVER,
|
||||
IID_IBOINCSENSSink,
|
||||
(LPVOID*)&pIBOINCSENSSink);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ATLTRACE(TEXT("Failed to create pIBOINCSENSSink (0x%x)"), hr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
// Prepare for registration by pre-populating the registration
|
||||
// multidimensional array with the known good stuff.
|
||||
|
||||
// Prepare the SENS Network registration group.
|
||||
gSubscriptionGroups[0].bstrPublisherID = SENSGUID_PUBLISHER;
|
||||
gSubscriptionGroups[0].bstrEventClassID = SENSGUID_EVENTCLASS_NETWORK;
|
||||
gSubscriptionGroups[0].bstrInterfaceID = IID_ISensNetwork;
|
||||
gSubscriptionGroups[0].uiSubscriptionCount = SENS_NETWORK_SUBSCRIPTIONS_COUNT;
|
||||
gSubscriptionGroups[0].pSubscriptions = (PSENS_SUBSCRIPTION)&gSENSNetworkSubscriptions;
|
||||
|
||||
// Prepare the SENS OnNow registration group.
|
||||
gSubscriptionGroups[1].bstrPublisherID = SENSGUID_PUBLISHER;
|
||||
gSubscriptionGroups[1].bstrEventClassID = SENSGUID_EVENTCLASS_ONNOW;
|
||||
gSubscriptionGroups[1].bstrInterfaceID = IID_ISensOnNow;
|
||||
gSubscriptionGroups[1].uiSubscriptionCount = SENS_ONNOW_SUBSCRIPTIONS_COUNT;
|
||||
gSubscriptionGroups[1].pSubscriptions = (PSENS_SUBSCRIPTION)&gSENSOnNowSubscriptions;
|
||||
|
||||
// Prepare the SENS Logon registration group.
|
||||
gSubscriptionGroups[2].bstrPublisherID = SENSGUID_PUBLISHER;
|
||||
gSubscriptionGroups[2].bstrEventClassID = SENSGUID_EVENTCLASS_LOGON;
|
||||
gSubscriptionGroups[2].bstrInterfaceID = IID_ISensLogon;
|
||||
gSubscriptionGroups[2].uiSubscriptionCount = SENS_LOGON_SUBSCRIPTIONS_COUNT;
|
||||
gSubscriptionGroups[2].pSubscriptions = (PSENS_SUBSCRIPTION)&gSENSLogonSubscriptions;
|
||||
|
||||
|
||||
// Start to register the events by walking through the registration groups
|
||||
//
|
||||
giSubscriptionGroupCount =
|
||||
sizeof(gSubscriptionGroups) / sizeof(SENS_SUBSCRIPTION_GROUP);
|
||||
|
||||
for (i = 0; i < giSubscriptionGroupCount; i++)
|
||||
{
|
||||
pSubscriptionGroup = &gSubscriptionGroups[i];
|
||||
for (j = 0; j < pSubscriptionGroup->uiSubscriptionCount; j++)
|
||||
{
|
||||
pSubscription = &pSubscriptionGroup->pSubscriptions[j];
|
||||
|
||||
// Get a new IEventSubscription object.
|
||||
hr = CoCreateInstance(
|
||||
CLSID_CEventSubscription,
|
||||
NULL,
|
||||
CLSCTX_SERVER,
|
||||
IID_IEventSubscription,
|
||||
(LPVOID*) &pIEventSubscription);
|
||||
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ATLTRACE(TEXT("Error getting IEventSubscription object (0x%x)"), hr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bstrSubscriptionID = *pSubscription->pSubscriptionID;
|
||||
hr = pIEventSubscription->put_SubscriptionID(bstrSubscriptionID);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ATLTRACE(TEXT("pIEventSubscription->put_SubscriptionID (0x%x)"), hr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bstrSubscriptionName = pSubscription->strSubscriptionName;
|
||||
hr = pIEventSubscription->put_SubscriptionName(bstrSubscriptionName);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ATLTRACE(TEXT("pIEventSubscription->put_SubscriptionName (0x%x)"), hr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bstrMethodName = pSubscription->strMethodName;
|
||||
hr = pIEventSubscription->put_MethodName(bstrMethodName);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ATLTRACE(TEXT("pIEventSubscription->put_MethodName (0x%x)"), hr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
hr = pIEventSubscription->put_EventClassID(pSubscriptionGroup->bstrEventClassID);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ATLTRACE(TEXT("pIEventSubscription->put_EventClassID (0x%x)"), hr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
hr = pIEventSubscription->put_SubscriberInterface(pIBOINCSENSSink);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ATLTRACE(TEXT("pIEventSubscription->put_SubscriberInterface (0x%x)"), hr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Initialize it.
|
||||
hr = gpIEventSystem->Store(
|
||||
bstrPROGID_EventSubscription,
|
||||
pIEventSubscription);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ATLTRACE(TEXT("gpIEventSystem->Store (0x%x)"), hr);
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
ATLTRACE(TEXT("Subscription Sucess: %s\n"), COLE2T(pSubscription->strMethodName));
|
||||
}
|
||||
|
||||
pIEventSubscription->Release();
|
||||
pIEventSubscription = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (pIEventSubscription != NULL)
|
||||
pIEventSubscription->Release();
|
||||
|
||||
if (pIBOINCSENSSink != NULL)
|
||||
pIBOINCSENSSink->Release();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
void NetworkTrackerShutdown()
|
||||
{
|
||||
USES_CONVERSION;
|
||||
unsigned int i = 0, j = 0;
|
||||
HRESULT hr = 0;
|
||||
int errorIndex = 0;
|
||||
CComBSTR bstrQuery;
|
||||
PSENS_SUBSCRIPTION_GROUP pSubscriptionGroup = NULL;
|
||||
PSENS_SUBSCRIPTION pSubscription = NULL;
|
||||
PNETWORK_CONNECTION pNetworkConnection = NULL;
|
||||
|
||||
for (i = 0; i < giSubscriptionGroupCount; i++)
|
||||
{
|
||||
pSubscriptionGroup = &gSubscriptionGroups[i];
|
||||
for (j = 0; j < pSubscriptionGroup->uiSubscriptionCount; j++)
|
||||
{
|
||||
pSubscription = &pSubscriptionGroup->pSubscriptions[j];
|
||||
|
||||
bstrQuery.Empty();
|
||||
bstrQuery = TEXT("SubscriptionID=");
|
||||
bstrQuery += *pSubscription->pSubscriptionID;
|
||||
|
||||
hr = gpIEventSystem->Remove(
|
||||
PROGID_EventSubscription,
|
||||
bstrQuery,
|
||||
&errorIndex);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ATLTRACE(TEXT("gpIEventSystem->Remove (0x%x)"), hr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Clear the cache
|
||||
for (i=0; i<gpNetworkConnections.size(); i++) {
|
||||
delete gpNetworkConnections[i];
|
||||
}
|
||||
gpNetworkConnections.clear();
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2005 University of California
|
||||
//
|
||||
// This is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// either version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This software is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
#pragma once
|
||||
|
||||
extern BOOL NetworkTrackerStartup();
|
||||
extern void NetworkTrackerShutdown();
|
|
@ -0,0 +1,142 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2005 University of California
|
||||
//
|
||||
// This is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// either version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This software is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
#pragma once
|
||||
|
||||
#define SUBSCIPTION_NAME_DISPLAYLOCK \
|
||||
OLESTR("BOINC Subscription to SENS DisplayLock Event")
|
||||
|
||||
#define SUBSCIPTION_NAME_DISPLAYUNLOCK \
|
||||
OLESTR("BOINC Subscription to SENS DisplayUnLock Event")
|
||||
|
||||
#define SUBSCIPTION_NAME_LOGOFF \
|
||||
OLESTR("BOINC Subscription to SENS Logoff Event")
|
||||
|
||||
#define SUBSCIPTION_NAME_LOGON \
|
||||
OLESTR("BOINC Subscription to SENS Logon Event")
|
||||
|
||||
#define SUBSCIPTION_NAME_STARTSCREENSAVER \
|
||||
OLESTR("BOINC Subscription to SENS StartScreenSaver Event")
|
||||
|
||||
#define SUBSCIPTION_NAME_STARTSHELL \
|
||||
OLESTR("BOINC Subscription to SENS StartShell Event")
|
||||
|
||||
#define SUBSCIPTION_NAME_STOPSCREENSAVER \
|
||||
OLESTR("BOINC Subscription to SENS StopScreenSaver Event")
|
||||
|
||||
//
|
||||
// Subscription Guids
|
||||
//
|
||||
|
||||
// {B6EEAA4F-D713-4cf2-B798-4D03E8B8FE59}
|
||||
EXTERN_C const GUID GUID_SUBSCRIPTION_DISPLAYLOCK =
|
||||
{ 0xb6eeaa4f, 0xd713, 0x4cf2, { 0xb7, 0x98, 0x4d, 0x3, 0xe8, 0xb8, 0xfe, 0x59 } };
|
||||
|
||||
// {C51E3293-2E53-4a97-9D83-0DE49FE33141}
|
||||
EXTERN_C const GUID GUID_SUBSCRIPTION_DISPLAYUNLOCK =
|
||||
{ 0xc51e3293, 0x2e53, 0x4a97, { 0x9d, 0x83, 0xd, 0xe4, 0x9f, 0xe3, 0x31, 0x41 } };
|
||||
|
||||
// {C5EEBA2E-0C7E-41ab-AB58-BA0F049FE99C}
|
||||
EXTERN_C const GUID GUID_SUBSCRIPTION_LOGOFF =
|
||||
{ 0xc5eeba2e, 0xc7e, 0x41ab, { 0xab, 0x58, 0xba, 0xf, 0x4, 0x9f, 0xe9, 0x9c } };
|
||||
|
||||
// {909C5924-A5A3-4506-838D-F8633754C2BC}
|
||||
EXTERN_C const GUID GUID_SUBSCRIPTION_LOGON =
|
||||
{ 0x909c5924, 0xa5a3, 0x4506, { 0x83, 0x8d, 0xf8, 0x63, 0x37, 0x54, 0xc2, 0xbc } };
|
||||
|
||||
// {63616A1E-8811-4b29-B131-99B52002A330}
|
||||
EXTERN_C const GUID GUID_SUBSCRIPTION_STARTSCREENSAVER =
|
||||
{ 0x63616a1e, 0x8811, 0x4b29, { 0xb1, 0x31, 0x99, 0xb5, 0x20, 0x2, 0xa3, 0x30 } };
|
||||
|
||||
// {4E5C1C2E-3C5D-4b8a-9D10-80A7C844E738}
|
||||
EXTERN_C const GUID GUID_SUBSCRIPTION_STARTSHELL =
|
||||
{ 0x4e5c1c2e, 0x3c5d, 0x4b8a, { 0x9d, 0x10, 0x80, 0xa7, 0xc8, 0x44, 0xe7, 0x38 } };
|
||||
|
||||
// {BBCF2081-8E09-4708-B4FF-7DE11C16E85E}
|
||||
EXTERN_C const GUID GUID_SUBSCRIPTION_STOPSCREENSAVER =
|
||||
{ 0xbbcf2081, 0x8e09, 0x4708, { 0xb4, 0xff, 0x7d, 0xe1, 0x1c, 0x16, 0xe8, 0x5e } };
|
||||
|
||||
|
||||
const SENS_SUBSCRIPTION gSENSLogonSubscriptions[] =
|
||||
{
|
||||
{
|
||||
&GUID_SUBSCRIPTION_DISPLAYLOCK,
|
||||
SUBSCIPTION_NAME_DISPLAYLOCK,
|
||||
OLESTR("DisplayLock"),
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
|
||||
{
|
||||
&GUID_SUBSCRIPTION_DISPLAYUNLOCK,
|
||||
SUBSCIPTION_NAME_DISPLAYUNLOCK,
|
||||
OLESTR("DisplayUnLock"),
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
|
||||
{
|
||||
&GUID_SUBSCRIPTION_LOGOFF,
|
||||
SUBSCIPTION_NAME_LOGOFF,
|
||||
OLESTR("Logoff"),
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
|
||||
{
|
||||
&GUID_SUBSCRIPTION_LOGON,
|
||||
SUBSCIPTION_NAME_LOGON,
|
||||
OLESTR("Logon"),
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
|
||||
{
|
||||
&GUID_SUBSCRIPTION_STARTSCREENSAVER,
|
||||
SUBSCIPTION_NAME_STARTSCREENSAVER,
|
||||
OLESTR("StartScreenSaver"),
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
|
||||
{
|
||||
&GUID_SUBSCRIPTION_STARTSHELL,
|
||||
SUBSCIPTION_NAME_STARTSHELL,
|
||||
OLESTR("StartShell"),
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
|
||||
{
|
||||
&GUID_SUBSCRIPTION_STOPSCREENSAVER,
|
||||
SUBSCIPTION_NAME_STOPSCREENSAVER,
|
||||
OLESTR("StopScreenSaver"),
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
#define SENS_LOGON_SUBSCRIPTIONS_COUNT (sizeof(gSENSLogonSubscriptions)/sizeof(SENS_SUBSCRIPTION))
|
|
@ -0,0 +1,110 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2005 University of California
|
||||
//
|
||||
// This is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// either version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This software is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
#pragma once
|
||||
|
||||
#define SUBSCIPTION_NAME_CONNECTIONMADE \
|
||||
OLESTR("BOINC Subscription to SENS ConnectionMade Event")
|
||||
|
||||
#define SUBSCIPTION_NAME_CONNECTIONMADE_NOQOC \
|
||||
OLESTR("BOINC Subscription to SENS ConnectionMadeNoQOCInfo Event")
|
||||
|
||||
#define SUBSCIPTION_NAME_CONNECTIONLOST \
|
||||
OLESTR("BOINC Subscription to SENS ConnectionLost Event")
|
||||
|
||||
#define SUBSCIPTION_NAME_DESTINATIONREACHABLE \
|
||||
OLESTR("BOINC Subscription to SENS DestinationReachable Event")
|
||||
|
||||
#define SUBSCIPTION_NAME_DESTINATIONREACHABLE_NOQOC \
|
||||
OLESTR("BOINC Subscription to SENS DestinationReachableNoQOCInfo Event")
|
||||
|
||||
//
|
||||
// Subscription Guids
|
||||
//
|
||||
|
||||
// {F6F32236-73E5-4914-BF55-8485623657FF}
|
||||
EXTERN_C const GUID GUID_SUBSCRIPTION_CONNECTIONMADE =
|
||||
{ 0xf6f32236, 0x73e5, 0x4914, { 0xbf, 0x55, 0x84, 0x85, 0x62, 0x36, 0x57, 0xff } };
|
||||
|
||||
// {6051A461-00B0-4185-9FC3-20FDE3C333FE}
|
||||
EXTERN_C const GUID GUID_SUBSCRIPTION_CONNECTIONMADE_NOQOC =
|
||||
{ 0x6051a461, 0xb0, 0x4185, { 0x9f, 0xc3, 0x20, 0xfd, 0xe3, 0xc3, 0x33, 0xfe } };
|
||||
|
||||
// {A8EDB33C-55FF-4d5d-965A-27769CC279AD}
|
||||
EXTERN_C const GUID GUID_SUBSCRIPTION_CONNECTIONLOST =
|
||||
{ 0xa8edb33c, 0x55ff, 0x4d5d, { 0x96, 0x5a, 0x27, 0x76, 0x9c, 0xc2, 0x79, 0xad } };
|
||||
|
||||
// {6EE0AF08-A3BE-4be3-B048-8C752D585852}
|
||||
EXTERN_C const GUID GUID_SUBSCRIPTION_DESTINATIONREACHABLE =
|
||||
{ 0x6ee0af08, 0xa3be, 0x4be3, { 0xb0, 0x48, 0x8c, 0x75, 0x2d, 0x58, 0x58, 0x52 } };
|
||||
|
||||
// {C19482AE-4FD5-4e52-BE81-F25DD6E26A0A}
|
||||
EXTERN_C const GUID GUID_SUBSCRIPTION_DESTINATIONREACHABLE_NOQOC =
|
||||
{ 0xc19482ae, 0x4fd5, 0x4e52, { 0xbe, 0x81, 0xf2, 0x5d, 0xd6, 0xe2, 0x6a, 0xa } };
|
||||
|
||||
|
||||
const SENS_SUBSCRIPTION gSENSNetworkSubscriptions[] =
|
||||
{
|
||||
{
|
||||
&GUID_SUBSCRIPTION_CONNECTIONMADE,
|
||||
SUBSCIPTION_NAME_CONNECTIONMADE,
|
||||
OLESTR("ConnectionMade"),
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
|
||||
{
|
||||
&GUID_SUBSCRIPTION_CONNECTIONMADE_NOQOC,
|
||||
SUBSCIPTION_NAME_CONNECTIONMADE_NOQOC,
|
||||
OLESTR("ConnectionMadeNoQOCInfo"),
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
|
||||
{
|
||||
&GUID_SUBSCRIPTION_CONNECTIONLOST,
|
||||
SUBSCIPTION_NAME_CONNECTIONLOST,
|
||||
OLESTR("ConnectionLost"),
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
|
||||
{
|
||||
&GUID_SUBSCRIPTION_DESTINATIONREACHABLE,
|
||||
SUBSCIPTION_NAME_DESTINATIONREACHABLE,
|
||||
OLESTR("DestinationReachable"),
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
|
||||
{
|
||||
&GUID_SUBSCRIPTION_DESTINATIONREACHABLE_NOQOC,
|
||||
SUBSCIPTION_NAME_DESTINATIONREACHABLE_NOQOC,
|
||||
OLESTR("DestinationReachableNoQOCInfo"),
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
};
|
||||
|
||||
#define SENS_NETWORK_SUBSCRIPTIONS_COUNT (sizeof(gSENSNetworkSubscriptions)/sizeof(SENS_SUBSCRIPTION))
|
|
@ -0,0 +1,78 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2005 University of California
|
||||
//
|
||||
// This is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// either version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This software is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
#pragma once
|
||||
|
||||
#define SUBSCIPTION_NAME_ONACPOWER \
|
||||
OLESTR("BOINC Subscription to SENS OnACPower Event")
|
||||
|
||||
#define SUBSCIPTION_NAME_ONBATTERYPOWER \
|
||||
OLESTR("BOINC Subscription to SENS OnBatteryPower Event")
|
||||
|
||||
#define SUBSCIPTION_NAME_BATTERYLOW \
|
||||
OLESTR("BOINC Subscription to SENS BatteryLow Event")
|
||||
|
||||
//
|
||||
// Subscription Guids
|
||||
//
|
||||
|
||||
// {07753E05-C62E-49b7-8043-602022A20D45}
|
||||
EXTERN_C const GUID GUID_SUBSCRIPTION_ONACPOWER =
|
||||
{ 0x7753e05, 0xc62e, 0x49b7, { 0x80, 0x43, 0x60, 0x20, 0x22, 0xa2, 0xd, 0x45 } };
|
||||
|
||||
// {716F2168-9E3D-4623-97EA-6ED717D5D692}
|
||||
EXTERN_C const GUID GUID_SUBSCRIPTION_ONBATTERYPOWER =
|
||||
{ 0x716f2168, 0x9e3d, 0x4623, { 0x97, 0xea, 0x6e, 0xd7, 0x17, 0xd5, 0xd6, 0x92 } };
|
||||
|
||||
// {2307AB30-A367-4e02-940B-AE9ABC1B0587}
|
||||
EXTERN_C const GUID GUID_SUBSCRIPTION_BATTERYLOW =
|
||||
{ 0x2307ab30, 0xa367, 0x4e02, { 0x94, 0xb, 0xae, 0x9a, 0xbc, 0x1b, 0x5, 0x87 } };
|
||||
|
||||
|
||||
const SENS_SUBSCRIPTION gSENSOnNowSubscriptions[] =
|
||||
{
|
||||
{
|
||||
&GUID_SUBSCRIPTION_ONACPOWER,
|
||||
SUBSCIPTION_NAME_ONACPOWER,
|
||||
OLESTR("OnACPower"),
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
|
||||
{
|
||||
&GUID_SUBSCRIPTION_ONBATTERYPOWER,
|
||||
SUBSCIPTION_NAME_ONBATTERYPOWER,
|
||||
OLESTR("OnBatteryPower"),
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
|
||||
{
|
||||
&GUID_SUBSCRIPTION_BATTERYLOW,
|
||||
SUBSCIPTION_NAME_BATTERYLOW,
|
||||
OLESTR("BatteryLow"),
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
};
|
||||
|
||||
#define SENS_ONNOW_SUBSCRIPTIONS_COUNT (sizeof(gSENSOnNowSubscriptions)/sizeof(SENS_SUBSCRIPTION))
|
|
@ -0,0 +1,58 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2005 University of California
|
||||
//
|
||||
// This is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// either version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This software is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
#pragma once
|
||||
|
||||
typedef struct _SENS_SUBSCRIPTION
|
||||
{
|
||||
const GUID *pSubscriptionID;
|
||||
LPOLESTR strSubscriptionName;
|
||||
LPOLESTR strMethodName;
|
||||
BOOL bPublisherPropertyPresent;
|
||||
LPOLESTR strPropertyMethodName;
|
||||
LPOLESTR strPropertyMethodNameValue;
|
||||
|
||||
} SENS_SUBSCRIPTION, *PSENS_SUBSCRIPTION;
|
||||
|
||||
|
||||
typedef struct _SENS_SUBSCRIPTION_GROUP
|
||||
{
|
||||
CComBSTR bstrPublisherID;
|
||||
CComBSTR bstrInterfaceID;
|
||||
CComBSTR bstrEventClassID;
|
||||
unsigned int uiSubscriptionCount;
|
||||
PSENS_SUBSCRIPTION pSubscriptions;
|
||||
|
||||
} SENS_SUBSCRIPTION_GROUP, *PSENS_SUBSCRIPTION_GROUP;
|
||||
|
||||
|
||||
typedef struct _NETWORK_CONNECTION
|
||||
{
|
||||
CComBSTR bstrConnection;
|
||||
unsigned long ulType;
|
||||
SENS_QOCINFO QOCInfo;
|
||||
|
||||
} NETWORK_CONNECTION, *PNETWORK_CONNECTION;
|
||||
|
||||
extern std::vector<PNETWORK_CONNECTION> gpNetworkConnections;
|
||||
|
||||
EXTERN_C __declspec(dllexport) BOOL BOINCRegisterSubscriptions(void);
|
||||
EXTERN_C __declspec(dllexport) BOOL BOINCUnregisterSubscriptions(void);
|
||||
|
||||
EXTERN_C __declspec(dllexport) BOOL BOINCIsNetworkActive();
|
|
@ -0,0 +1,55 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2005 University of California
|
||||
//
|
||||
// This is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// either version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This software is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "resource.h"
|
||||
#include "IdleTracker.h"
|
||||
#include "NetworkTracker.h"
|
||||
|
||||
|
||||
// The module attribute causes DllMain, DllRegisterServer and DllUnregisterServer to be automatically implemented for you
|
||||
[ module(dll,
|
||||
uuid = "{16B09F41-6216-4131-AADD-D66276A88089}",
|
||||
name = "BOINCSENS",
|
||||
helpstring = "BOINCSENS 1.0 Type Library",
|
||||
resource_name = "IDR_BOINCSENS") ]
|
||||
class CBOINCSENSModule
|
||||
{
|
||||
public:
|
||||
// Override CAtlDllModuleT members
|
||||
};
|
||||
|
||||
|
||||
EXTERN_C __declspec(dllexport) BOOL ClientLibraryStartup()
|
||||
{
|
||||
if (!IdleTrackerStartup())
|
||||
return FALSE;
|
||||
if (!NetworkTrackerStartup())
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
EXTERN_C __declspec(dllexport) void ClientLibraryShutdown()
|
||||
{
|
||||
IdleTrackerShutdown();
|
||||
NetworkTrackerShutdown();
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
// Berkeley Open Infrastructure for Network Computing
|
||||
// http://boinc.berkeley.edu
|
||||
// Copyright (C) 2005 University of California
|
||||
//
|
||||
// This is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation;
|
||||
// either version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This software is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Lesser General Public License for more details.
|
||||
//
|
||||
// To view the GNU Lesser General Public License visit
|
||||
// http://www.gnu.org/copyleft/lesser.html
|
||||
// or write to the Free Software Foundation, Inc.,
|
||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MIDL_DEFINE_GUID
|
||||
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
|
||||
const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
|
||||
#endif
|
||||
|
||||
#ifndef LIBID_BOINCSENS
|
||||
MIDL_DEFINE_GUID(IID, LIBID_BOINCSENS,0x16B09F41,0x6216,0x4131,0xAA,0xDD,0xD6,0x62,0x76,0xA8,0x80,0x89);
|
||||
#endif
|
|
@ -0,0 +1,205 @@
|
|||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.h"
|
||||
#include "version.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"#include ""version.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Visual Studio 2005 Compatibility
|
||||
//
|
||||
#ifndef IDC_STATIC
|
||||
#define IDC_STATIC (-1) // all static controls
|
||||
#endif
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
#if defined(_GRIDREPUBLIC)
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION BOINC_MAJOR_VERSION,BOINC_MINOR_VERSION,BOINC_RELEASE,0
|
||||
PRODUCTVERSION BOINC_MAJOR_VERSION,BOINC_MINOR_VERSION,BOINC_RELEASE,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "GridRepublic"
|
||||
VALUE "FileDescription", "GridRepublic Client Platform Library"
|
||||
VALUE "FileVersion", BOINC_VERSION_STRING "\0"
|
||||
VALUE "InternalName", "boinc_dll"
|
||||
VALUE "LegalCopyright", "© 2003-2006 University of California"
|
||||
VALUE "OriginalFilename", "boinc.dll"
|
||||
VALUE "ProductName", "BOINC Core Client"
|
||||
VALUE "ProductVersion", BOINC_VERSION_STRING "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#elif defined(_CPDNBBC)
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION BOINC_MAJOR_VERSION,BOINC_MINOR_VERSION,BOINC_RELEASE,0
|
||||
PRODUCTVERSION BOINC_MAJOR_VERSION,BOINC_MINOR_VERSION,BOINC_RELEASE,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "ClimatePrediction.net"
|
||||
VALUE "FileDescription", "CPDNBBC Client Platform Library"
|
||||
VALUE "FileVersion", BOINC_VERSION_STRING "\0"
|
||||
VALUE "InternalName", "boinc_dll"
|
||||
VALUE "LegalCopyright", "© 2003-2006 University of California"
|
||||
VALUE "OriginalFilename", "boinc.dll"
|
||||
VALUE "ProductName", "CPDNBBC Core Client"
|
||||
VALUE "ProductVersion", BOINC_VERSION_STRING "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#else
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION BOINC_MAJOR_VERSION,BOINC_MINOR_VERSION,BOINC_RELEASE,0
|
||||
PRODUCTVERSION BOINC_MAJOR_VERSION,BOINC_MINOR_VERSION,BOINC_RELEASE,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Space Sciences Laboratory"
|
||||
VALUE "FileDescription", "BOINC Client Platform Library"
|
||||
VALUE "FileVersion", BOINC_VERSION_STRING "\0"
|
||||
VALUE "InternalName", "boinc_dll"
|
||||
VALUE "LegalCopyright", "© 2003-2006 University of California"
|
||||
VALUE "OriginalFilename", "boinc.dll"
|
||||
VALUE "ProductName", "BOINC Core Client"
|
||||
VALUE "ProductVersion", BOINC_VERSION_STRING "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// REGISTRY
|
||||
//
|
||||
|
||||
IDR_BOINCSENS REGISTRY "boincsens.rgs"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_PROJNAME "BOINC Client Platform Library"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
HKCR
|
||||
{
|
||||
NoRemove AppID
|
||||
{
|
||||
'%APPID%' = s 'boincsens'
|
||||
'boincsens.DLL'
|
||||
{
|
||||
val AppID = s '%APPID%'
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by boinc_dll.rc
|
||||
//
|
||||
#define IDS_PROJNAME 100
|
||||
#define IDR_BOINCSENS 101
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 201
|
||||
#define _APS_NEXT_COMMAND_VALUE 32768
|
||||
#define _APS_NEXT_CONTROL_VALUE 201
|
||||
#define _APS_NEXT_SYMED_VALUE 102
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,5 @@
|
|||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// boincsens.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
|
@ -0,0 +1,56 @@
|
|||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently,
|
||||
// but are changed infrequently
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef STRICT
|
||||
#define STRICT
|
||||
#endif
|
||||
|
||||
// Modify the following defines if you have to target a platform prior to the ones specified below.
|
||||
// Refer to MSDN for the latest info on corresponding values for different platforms.
|
||||
#ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later.
|
||||
#define WINVER 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later.
|
||||
#define _WIN32_WINNT 0x0400 // Change this to the appropriate value to target Windows 2000 or later.
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
|
||||
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_IE // Allow use of features specific to IE 5.01 or later.
|
||||
#define _WIN32_IE 0x0501 // Change this to the appropriate value to target IE 6.0 or later.
|
||||
#endif
|
||||
|
||||
#define _ATL_APARTMENT_THREADED
|
||||
#define _ATL_NO_AUTOMATIC_NAMESPACE
|
||||
|
||||
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
|
||||
|
||||
// turns off ATL's hiding of some common and often safely ignored warning messages
|
||||
#define _ATL_ALL_WARNINGS
|
||||
|
||||
#include <windows.h>
|
||||
#include <initguid.h>
|
||||
#include <Sens.h>
|
||||
#include <SensApi.h>
|
||||
#include <EventSys.h>
|
||||
#include <wininet.h>
|
||||
#include <crtdbg.h>
|
||||
|
||||
#include <atlbase.h>
|
||||
#include <atlcom.h>
|
||||
#include <atlwin.h>
|
||||
#include <atltypes.h>
|
||||
#include <atlctl.h>
|
||||
#include <atlhost.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
#import "SENS.DLL" raw_interfaces_only, raw_native_types, no_namespace, named_guids
|
||||
|
||||
using namespace ATL;
|
|
@ -180,23 +180,37 @@ int get_socket_error(int fd) {
|
|||
#if defined(_WIN32) && defined(USE_WINSOCK)
|
||||
|
||||
typedef BOOL (WINAPI *GetStateProc)( OUT LPDWORD lpdwFlags, IN DWORD dwReserved);
|
||||
typedef int (*pfnBOINCIsNetworkAlive)(LPDWORD lpdwFlags);
|
||||
|
||||
int get_connected_state( ) {
|
||||
int online = 0;
|
||||
static bool first=true;
|
||||
static HMODULE libmodule;
|
||||
static HMODULE lib_wininet_module;
|
||||
static GetStateProc GetState;
|
||||
static HMODULE lib_boinc_module;
|
||||
static pfnBOINCIsNetworkAlive BOINCIsNetworkAlive;
|
||||
DWORD connectionFlags;
|
||||
|
||||
if (first) {
|
||||
libmodule = LoadLibrary("wininet.dll");
|
||||
if (libmodule) {
|
||||
GetState = (GetStateProc) GetProcAddress(libmodule, "InternetGetConnectedState");
|
||||
lib_wininet_module = LoadLibrary("wininet.dll");
|
||||
if (lib_wininet_module) {
|
||||
GetState = (GetStateProc) GetProcAddress(lib_wininet_module, "InternetGetConnectedState");
|
||||
}
|
||||
lib_boinc_module = LoadLibrary("boinc.dll");
|
||||
if (lib_boinc_module) {
|
||||
BOINCIsNetworkAlive = (pfnBOINCIsNetworkAlive) GetProcAddress(lib_boinc_module, "BOINCIsNetworkAlive");
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
if (libmodule && GetState) {
|
||||
online = (*GetState)(&connectionFlags, 0);
|
||||
if (lib_boinc_module && BOINCIsNetworkAlive) {
|
||||
connectionFlags = NETWORK_ALIVE_LAN | NETWORK_ALIVE_WAN | NETWORK_ALIVE_AOL;
|
||||
online = BOINCIsNetworkAlive(&connectionFlags);
|
||||
if (online) {
|
||||
return CONNECTED_STATE_CONNECTED;
|
||||
}
|
||||
}
|
||||
if (lib_wininet_module && GetState) {
|
||||
online = GetState(&connectionFlags, 0);
|
||||
if (online) {
|
||||
return CONNECTED_STATE_CONNECTED;
|
||||
} else {
|
||||
|
|
|
@ -56,6 +56,20 @@ typedef int boinc_socklen_t;
|
|||
typedef BOINC_SOCKLEN_T boinc_socklen_t;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef NETWORK_ALIVE_LAN
|
||||
#define NETWORK_ALIVE_LAN 0x00000001
|
||||
#endif
|
||||
|
||||
#ifndef NETWORK_ALIVE_WAN
|
||||
#define NETWORK_ALIVE_WAN 0x00000002
|
||||
#endif
|
||||
|
||||
#ifndef NETWORK_ALIVE_AOL
|
||||
#define NETWORK_ALIVE_AOL 0x00000004
|
||||
#endif
|
||||
|
||||
|
||||
#define CONNECTED_STATE_NOT_CONNECTED 0
|
||||
#define CONNECTED_STATE_CONNECTED 1
|
||||
#define CONNECTED_STATE_UNKNOWN 2
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="boinc_dll"
|
||||
ProjectGUID="{B06280CB-82A4-46DE-8956-602643078BDF}"
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
ProjectGUID="{ADA6451B-CFEA-402A-9681-227CD1FDE08C}"
|
||||
RootNamespace="boinc"
|
||||
Keyword="AtlProj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
|
@ -16,54 +16,48 @@
|
|||
OutputDirectory=".\Build\Debug"
|
||||
IntermediateDirectory=".\Build\Debug\boinc_dll\obj"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
UseOfATL="1"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../;../lib"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;BOINC_DLL_EXPORTS"
|
||||
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
BufferSecurityCheck="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="boinc_win.h"
|
||||
PrecompiledHeaderFile="$(IntDir)/boinc_win.pch"
|
||||
AssemblerListingLocation=".\Build\Debug\boinc_dll\obj/"
|
||||
ObjectFile=".\Build\Debug\boinc_dll\obj/"
|
||||
ProgramDataBaseFileName=".\Build\Debug\boinc_dll\obj/vc70.pdb"
|
||||
BrowseInformation="1"
|
||||
UsePrecompiledHeader="3"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
ForcedIncludeFiles="boinc_win.h"/>
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="kernel32.lib user32.lib MSVCRTD.LIB MSVCPRTD.LIB "
|
||||
OutputFile="Build\Debug/boinc.dll"
|
||||
LinkIncremental="0"
|
||||
SuppressStartupBanner="TRUE"
|
||||
IgnoreAllDefaultLibraries="TRUE"
|
||||
ModuleDefinitionFile="..\client\win\win_idle_tracker.def"
|
||||
IgnoreImportLibrary="TRUE"
|
||||
AdditionalDependencies="sensapi.lib wininet.lib"
|
||||
OutputFile="$(OutDir)/boinc.dll"
|
||||
LinkIncremental="2"
|
||||
MergedIDLBaseFileName="_boinc_dll.idl"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\Build\Debug/boinc_dll.pdb"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="0"
|
||||
ImportLibrary=".\Build\Debug/boinc.lib"
|
||||
ImportLibrary="$(OutDir)/boinc_dll.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
MkTypLibCompatible="FALSE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Build\Debug/boinc_dll.tlb"
|
||||
HeaderFileName=""/>
|
||||
GenerateStublessProxies="TRUE"
|
||||
TypeLibraryName="$(IntDir)/boinc_dll.tlb"
|
||||
HeaderFileName="boinc_dll.h"
|
||||
DLLDataFileName=""
|
||||
InterfaceIdentifierFileName="boinc_dll_i.c"
|
||||
ProxyFileName="boinc_dll_p.c"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Performing registration"
|
||||
CommandLine="regsvr32 /s /c "$(TargetPath)""/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
|
@ -72,7 +66,7 @@
|
|||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="../"/>
|
||||
AdditionalIncludeDirectories=""$(IntDir)";../"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
|
@ -89,58 +83,47 @@
|
|||
OutputDirectory=".\Build\Release"
|
||||
IntermediateDirectory=".\Build\Release\boinc_dll\obj"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
UseOfATL="1"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
GlobalOptimizations="TRUE"
|
||||
InlineFunctionExpansion="1"
|
||||
EnableIntrinsicFunctions="TRUE"
|
||||
ImproveFloatingPointConsistency="FALSE"
|
||||
FavorSizeOrSpeed="1"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories="..;..\lib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;BOINC_DLL_EXPORTS"
|
||||
StringPooling="TRUE"
|
||||
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="boinc_win.h"
|
||||
PrecompiledHeaderFile="$(IntDir)/boinc_win.pch"
|
||||
AssemblerListingLocation=".\Build\Release\boinc_dll\obj/"
|
||||
ObjectFile=".\Build\Release\boinc_dll\obj/"
|
||||
ProgramDataBaseFileName=".\Build\Release\boinc_dll\obj/"
|
||||
UsePrecompiledHeader="3"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
ForcedIncludeFiles="boinc_win.h"/>
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="kernel32.lib user32.lib MSVCRT.LIB MSVCPRT.LIB "
|
||||
OutputFile="Build\Release/boinc.dll"
|
||||
IgnoreImportLibrary="TRUE"
|
||||
AdditionalDependencies="sensapi.lib wininet.lib"
|
||||
OutputFile="$(OutDir)/boinc.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
IgnoreAllDefaultLibraries="TRUE"
|
||||
ModuleDefinitionFile="..\client\win\win_idle_tracker.def"
|
||||
MergedIDLBaseFileName="_boinc_dll.idl"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\Build\Release/boinc_dll.pdb"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
ImportLibrary=".\Build\Release/boinc.lib"
|
||||
EnableCOMDATFolding="2"
|
||||
ImportLibrary="$(OutDir)/boinc_dll.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
MkTypLibCompatible="FALSE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Build\Release/boinc_dll.tlb"
|
||||
HeaderFileName=""/>
|
||||
GenerateStublessProxies="TRUE"
|
||||
TypeLibraryName="$(IntDir)/boinc_dll.tlb"
|
||||
HeaderFileName="boinc_dll.h"
|
||||
DLLDataFileName=""
|
||||
InterfaceIdentifierFileName="boinc_dll_i.c"
|
||||
ProxyFileName="boinc_dll_p.c"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Performing registration"
|
||||
CommandLine="regsvr32 /s /c "$(TargetPath)""/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
|
@ -149,7 +132,7 @@
|
|||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories=".."/>
|
||||
AdditionalIncludeDirectories=""$(IntDir)";../"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
|
@ -167,45 +150,86 @@
|
|||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath="..\client\win\win_idle_tracker.cpp">
|
||||
RelativePath="..\clientlib\win\boinc_dll.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientlib\win\BOINCSENSSink.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientlib\win\Identification.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientlib\win\IdleTracker.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientlib\win\NetworkTracker.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientlib\win\stdafx.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;BOINC_DLL_EXPORTS;$(NoInherit)"
|
||||
BasicRuntimeChecks="3"
|
||||
BrowseInformation="1"/>
|
||||
UsePrecompiledHeader="1"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;BOINC_DLL_EXPORTS;$(NoInherit)"/>
|
||||
UsePrecompiledHeader="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\client\win\win_idle_tracker.def">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath="..\client\win\boinc_dll.h">
|
||||
RelativePath="..\clientlib\win\boinc_dll.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\client\win\win_idle_tracker.h">
|
||||
RelativePath="..\clientlib\win\BOINCSENSSink.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientlib\win\Identification.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientlib\win\IdleTracker.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientlib\win\NetworkTracker.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientlib\win\Resource.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientlib\win\SENSLogonSubscriptions.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientlib\win\SENSNetworkSubscriptions.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientlib\win\SENSOnNowSubscriptions.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientlib\win\SENSSubscriptions.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientlib\win\stdafx.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||
<File
|
||||
RelativePath="..\client\win\boinc_dll.rc">
|
||||
RelativePath="..\clientlib\win\boinc_dll.rc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientlib\win\boincsens.rgs">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue