Changeset 18640 in vbox for trunk/src/VBox/Additions/common/VBoxService
- Timestamp:
- Apr 2, 2009 2:26:00 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 45560
- Location:
- trunk/src/VBox/Additions/common/VBoxService
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp
r18639 r18640 48 48 /** The default service interval (the -i | --interval) option). */ 49 49 uint32_t g_DefaultInterval = 0; 50 /** Shutdown the main thread. (later, for signals) */50 /** Shutdown the main thread. (later, for signals). */ 51 51 bool volatile g_fShutdown; 52 52 … … 242 242 int main(int argc, char **argv) 243 243 { 244 int rc; 244 int rc = 0; 245 246 #if defined(RT_OS_WINDOWS) 247 /* Do not use a global namespace ("Global\\") for mutex name here, will blow up NT4 compatibility! */ 248 HANDLE hMutexAppRunning = CreateMutex (NULL, FALSE, VBOXSERVICE_NAME); 249 if ( (hMutexAppRunning != NULL) 250 && (GetLastError() == ERROR_ALREADY_EXISTS)) 251 { 252 VBoxServiceError("%s is already running! Terminating.", g_pszProgName); 253 254 /* Close the mutex for this application instance. */ 255 CloseHandle(hMutexAppRunning); 256 hMutexAppRunning = NULL; 257 } 258 #endif 245 259 246 260 /* -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceInternal.h
r18639 r18640 22 22 #ifndef ___VBoxServiceInternal_h 23 23 #define ___VBoxServiceInternal_h 24 25 #if defined(RT_OS_WINDOWS) 26 #include <windows.h> 27 #include <tchar.h> 28 #include <process.h> 29 #endif 24 30 25 31 /** Name of this program. */ … … 115 121 extern VBOXSERVICE g_Control; 116 122 123 /** Windows SCM stuff. */ 124 #if defined(RT_OS_WINDOWS) 125 extern DWORD g_vboxServiceStatusCode; 126 extern SERVICE_STATUS_HANDLE g_vboxServiceStatusHandle; 127 #endif 128 117 129 __END_DECLS 118 130
Note:
See TracChangeset
for help on using the changeset viewer.