MGR: Implement CBOINCClientManager::IsBOINCRunning()for Windows

svn path=/trunk/boinc/; revision=18318
This commit is contained in:
Charlie Fenton 2009-06-06 13:35:58 +00:00
parent 8304ad8aea
commit 9b099daea7
2 changed files with 5 additions and 8 deletions

View File

@ -5148,8 +5148,8 @@ Charlie 5 June 2009
BOINCClientManager.cpp, .h
Charlie 5 June 2009
- MGR: Implement CBOINCClientManager::KillClient() for Windows.
NOTE: IsBOINCRunning() is not yet working properly on Windows.
- MGR: Implement CBOINCClientManager::KillClient() and IsBOINCRunning()
for Windows.
NOTE: I have confirmed that the "ps -a -x -c -o command,pid" command
as used in IsBOINCRunning() should works in Ubuntu under VMWare, but
it needs to be tested on other Linux platforms.

View File

@ -118,7 +118,6 @@ bool CBOINCClientManager::IsBOINCCoreRunning() {
#ifdef __WXMSW__
char buf[MAX_PATH] = "";
DWORD err = 0;
// Global mutex on Win2k and later
//
if (IsWindows2000Compatible()) {
@ -126,14 +125,12 @@ bool CBOINCClientManager::IsBOINCCoreRunning() {
}
strcat( buf, RUN_MUTEX);
SetLastError(0);
err = GetLastError();
HANDLE h = CreateMutexA(NULL, true, buf);
err = GetLastError();
DWORD err = GetLastError();
if ((h==0) || (err == ERROR_ALREADY_EXISTS)) {
running = true;
} else {
// ReleaseMutex(h);
}
if (h) {
CloseHandle(h);
}
#else