Changeset 40682 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Mar 28, 2012 2:36:01 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 77136
- Location:
- trunk/src/VBox/Additions/common/VBoxService
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp
r40529 r40682 234 234 { 235 235 VBoxServiceVerbose(3, "Waiting for host msg ...\n"); 236 uint32_t uMsg ;237 uint32_t cParms ;236 uint32_t uMsg = 0; 237 uint32_t cParms = 0; 238 238 rc = VbglR3GuestCtrlWaitForHostMsg(g_uControlSvcClientID, &uMsg, &cParms); 239 239 if (rc == VERR_TOO_MUCH_DATA) … … 356 356 VBoxServiceError("Starting process failed with rc=%Rrc\n", rc); 357 357 358 int rc2 = VbglR3GuestCtrlExecReportStatus(uClientID, uContextID, 0 /* PID, invalid. */, 358 /* 359 * Note: The context ID can be 0 because we mabye weren't able to fetch the command 360 * from the host. The host in case has to deal with that! 361 */ 362 int rc2 = VbglR3GuestCtrlExecReportStatus(uClientID, uContextID /* Might be 0 */, 0 /* PID, invalid */, 359 363 PROC_STS_ERROR, rc, 360 364 NULL /* pvData */, 0 /* cbData */); … … 591 595 if (RT_SUCCESS(rc)) 592 596 { 593 if (cbWritten || !cbSize) /* Did we write something or was there anything to write at all? */ 594 { 595 uStatus = INPUT_STS_WRITTEN; 596 uFlags = 0; 597 } 597 uStatus = INPUT_STS_WRITTEN; 598 uFlags = 0; /* No flags at the moment. */ 598 599 } 599 600 else … … 752 753 PVBOXSERVICECTRLTHREAD pNext = RTListNodeGetNext(&pThread->Node, VBOXSERVICECTRLTHREAD, Node); 753 754 bool fLast = RTListNodeIsLast(&g_lstControlThreadsInactive, &pThread->Node); 754 755 int rc2 = VBoxServiceControlThreadWait(pThread, 30 * 1000 /* 30 seconds max.*/);755 int rc2 = VBoxServiceControlThreadWait(pThread, 30 * 1000 /* 30 seconds max. */, 756 NULL /* rc */); 756 757 if (RT_SUCCESS(rc2)) 757 758 { … … 761 762 if (RT_FAILURE(rc2)) 762 763 { 763 VBoxServiceError(" Stopping guest process thread failed with rc=%Rrc\n", rc2);764 VBoxServiceError("Freeing guest process thread failed with rc=%Rrc\n", rc2); 764 765 if (RT_SUCCESS(rc)) /* Keep original failure. */ 765 766 rc = rc2; … … 806 807 807 808 int rc2 = VBoxServiceControlThreadWait(pThread, 808 30 * 1000 /* Wait 30 seconds max. */); 809 30 * 1000 /* Wait 30 seconds max. */, 810 NULL /* rc */); 809 811 if (RT_FAILURE(rc2)) 810 812 VBoxServiceError("Guest process thread failed to stop; rc=%Rrc\n", rc2); -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlThread.cpp
r40531 r40682 236 236 * @param pThread Thread to wait shutting down for. 237 237 * @param RTMSINTERVAL Timeout in ms to wait for shutdown. 238 * @param prc Where to store the thread's return code. Optional. 238 239 */ 239 240 int VBoxServiceControlThreadWait(const PVBOXSERVICECTRLTHREAD pThread, 240 RTMSINTERVAL msTimeout )241 RTMSINTERVAL msTimeout, int *prc) 241 242 { 242 243 AssertPtrReturn(pThread, VERR_INVALID_POINTER); 244 /* prc is optional. */ 245 243 246 int rc = VINF_SUCCESS; 244 247 if ( pThread->Thread != NIL_RTTHREAD 245 248 && ASMAtomicReadBool(&pThread->fStarted)) 246 249 { 247 VBoxServiceVerbose(2, "[PID %u]: Waiting for shutdown ...\n",248 pThread->uPID );250 VBoxServiceVerbose(2, "[PID %u]: Waiting for shutdown of pThread=0x%p = \"%s\"...\n", 251 pThread->uPID, pThread, pThread->pszCmd); 249 252 250 253 /* Wait a bit ... */ … … 258 261 else 259 262 { 260 if (RT_FAILURE(rcThread)) 261 { 262 VBoxServiceError("[PID %u]: Shutdown returned error rc=%Rrc\n", 263 pThread->uPID, rcThread); 264 rc = rcThread; 265 } 263 VBoxServiceVerbose(3, "[PID %u]: Thread reported exit code=%Rrc\n", 264 pThread->uPID, rcThread); 265 if (prc) 266 *prc = rcThread; 266 267 } 267 268 } … … 1379 1380 { 1380 1381 AssertPtrReturn(pThread, VERR_INVALID_POINTER); 1381 VBoxServiceVerbose(3, "Thread of process \"%s\" started\n", pThread->pszCmd); 1382 VBoxServiceVerbose(3, "Thread of process pThread=0x%p = \"%s\" started\n", 1383 pThread, pThread->pszCmd); 1382 1384 1383 1385 int rc = VBoxServiceControlListSet(VBOXSERVICECTRLTHREADLIST_RUNNING, pThread); -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceInternal.h
r40158 r40682 5 5 6 6 /* 7 * Copyright (C) 2007-201 1Oracle Corporation7 * Copyright (C) 2007-2012 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 397 397 extern int VBoxServiceControlThreadPerform(uint32_t uPID, PVBOXSERVICECTRLREQUEST pRequest); 398 398 extern int VBoxServiceControlThreadStop(const PVBOXSERVICECTRLTHREAD pThread); 399 extern int VBoxServiceControlThreadWait(const PVBOXSERVICECTRLTHREAD pThread, RTMSINTERVAL msTimeout); 399 extern int VBoxServiceControlThreadWait(const PVBOXSERVICECTRLTHREAD pThread, 400 RTMSINTERVAL msTimeout, int *prc); 400 401 extern int VBoxServiceControlThreadFree(PVBOXSERVICECTRLTHREAD pThread); 401 402 /* Request handling. */ -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp
r39612 r40682 5 5 6 6 /* 7 * Copyright (C) 201 1Oracle Corporation7 * Copyright (C) 2012 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as
Note:
See TracChangeset
for help on using the changeset viewer.