- Timestamp:
- Dec 3, 2009 1:35:13 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 55595
- Location:
- trunk/src/VBox/Additions/common/VBoxService
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxService-win.cpp
r25159 r25166 44 44 }; 45 45 46 46 47 /** 47 48 * @todo Format code style. … … 49 50 * @todo Add event log capabilities / check return values. 50 51 */ 51 DWORD VBoxServiceWinAddAceToObjectsSecurityDescriptor 52 53 54 55 56 57 52 DWORD VBoxServiceWinAddAceToObjectsSecurityDescriptor(LPTSTR pszObjName, 53 SE_OBJECT_TYPE ObjectType, 54 LPTSTR pszTrustee, 55 TRUSTEE_FORM TrusteeForm, 56 DWORD dwAccessRights, 57 ACCESS_MODE AccessMode, 58 DWORD dwInheritance) 58 59 { 59 60 DWORD dwRes = 0; … … 115 116 } 116 117 117 BOOL VBoxServiceWinSetStatus (DWORD dwStatus, DWORD dwCheckPoint /*= 0 */) 118 119 BOOL VBoxServiceWinSetStatus(DWORD dwStatus, DWORD dwCheckPoint) 118 120 { 119 121 if (NULL == g_hWinServiceStatus) /* Program could be in testing mode, so no service environment available. */ … … 132 134 ss.dwWaitHint = 3000; 133 135 134 return SetServiceStatus (g_hWinServiceStatus, &ss); 135 } 136 137 int VBoxServiceWinInstall () 136 return SetServiceStatus(g_hWinServiceStatus, &ss); 137 } 138 139 140 int VBoxServiceWinInstall(void) 138 141 { 139 142 SC_HANDLE hService, hSCManager; … … 173 176 } 174 177 175 int VBoxServiceWinUninstall ()178 int VBoxServiceWinUninstall(void) 176 179 { 177 180 SC_HANDLE hService, hSCManager; … … 216 219 } 217 220 218 int VBoxServiceWinStart() 221 222 int VBoxServiceWinStart(void) 219 223 { 220 224 int rc = VINF_SUCCESS; … … 260 264 always starts in main thread (which causes the SCM to wait because of the non-responding 261 265 service). */ 262 VBoxServiceWinSetStatus (SERVICE_RUNNING );266 VBoxServiceWinSetStatus (SERVICE_RUNNING, 0); 263 267 264 268 /* … … 269 273 270 274 if (RT_FAILURE(rc)) 271 VBoxServiceWinSetStatus (SERVICE_STOPPED );275 VBoxServiceWinSetStatus (SERVICE_STOPPED, 0); 272 276 } 273 277 … … 278 282 } 279 283 284 280 285 #ifdef TARGET_NT4 281 VOID WINAPI VBoxServiceWinCtrlHandler 286 VOID WINAPI VBoxServiceWinCtrlHandler(DWORD dwControl) 282 287 #else 283 DWORD WINAPI VBoxServiceWinCtrlHandler 284 285 286 288 DWORD WINAPI VBoxServiceWinCtrlHandler(DWORD dwControl, 289 DWORD dwEventType, 290 LPVOID lpEventData, 291 LPVOID lpContext) 287 292 #endif 288 293 { … … 298 303 299 304 case SERVICE_CONTROL_INTERROGATE: 300 VBoxServiceWinSetStatus(g_rcWinService );305 VBoxServiceWinSetStatus(g_rcWinService, 0); 301 306 break; 302 307 … … 304 309 case SERVICE_CONTROL_SHUTDOWN: 305 310 { 306 VBoxServiceWinSetStatus(SERVICE_STOP_PENDING );311 VBoxServiceWinSetStatus(SERVICE_STOP_PENDING, 0); 307 312 308 313 rc = VBoxServiceStopServices(); 309 314 310 VBoxServiceWinSetStatus(SERVICE_STOPPED );315 VBoxServiceWinSetStatus(SERVICE_STOPPED, 0); 311 316 } 312 317 break; … … 342 347 } 343 348 344 void WINAPI VBoxServiceWinMain (DWORD argc, LPTSTR *argv) 349 350 void WINAPI VBoxServiceWinMain(DWORD argc, LPTSTR *argv) 345 351 { 346 352 int rc = VINF_SUCCESS; … … 377 383 } 378 384 } 379 -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceInternal.h
r25159 r25166 147 147 extern int VBoxServiceWinUninstall(void); 148 148 /** Reports our current status to the SCM. */ 149 extern BOOL VBoxServiceWinSetStatus (DWORD dwStatus, DWORD dwCheckPoint = 0);149 extern BOOL VBoxServiceWinSetStatus(DWORD dwStatus, DWORD dwCheckPoint); 150 150 #ifdef VBOX_WITH_GUEST_PROPS 151 151 /** Detects wheter a user is logged on based on the enumerated processes. */
Note:
See TracChangeset
for help on using the changeset viewer.