Changeset 44045 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Dec 6, 2012 8:19:53 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp
r43259 r44045 440 440 * @param uPID PID of process to retrieve the output from. 441 441 * @param uHandleId Stream ID (stdout = 0, stderr = 2) to get the output from. 442 * @param uTimeout Timeout (in ms) to wait for output becoming available. 442 * @param cMsTimeout Timeout (in ms) to wait for output becoming 443 * available. 443 444 * @param pvBuf Pointer to a pre-allocated buffer to store the output. 444 445 * @param cbBuf Size (in bytes) of the pre-allocated buffer. … … 446 447 */ 447 448 int VBoxServiceControlExecGetOutput(uint32_t uPID, uint32_t uCID, 448 uint32_t uHandleId, uint32_t uTimeout,449 uint32_t uHandleId, uint32_t cMsTimeout, 449 450 void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead) 450 451 { 451 452 AssertPtrReturn(pvBuf, VERR_INVALID_POINTER); 452 453 AssertReturn(cbBuf, VERR_INVALID_PARAMETER); 453 /* pcbRead is optional. */454 455 int rc= VINF_SUCCESS;456 VBOXSERVICECTRLREQUESTTYPE reqType;454 AssertPtrNullReturn(pcbRead, VERR_INVALID_POINTER); 455 456 int rc = VINF_SUCCESS; 457 VBOXSERVICECTRLREQUESTTYPE reqType = VBOXSERVICECTRLREQUEST_UNKNOWN; /* (gcc maybe, well, wrong.) */ 457 458 switch (uHandleId) 458 459 { … … 471 472 } 472 473 473 PVBOXSERVICECTRLREQUEST pRequest;474 if (RT_SUCCESS(rc))475 {476 rc = VBoxServiceControlThreadRequestAllocEx(&pRequest, reqType, 477 pvBuf, cbBuf, uCID);478 if (RT_SUCCESS(rc))474 if (RT_SUCCESS(rc)) 475 { 476 PVBOXSERVICECTRLREQUEST pRequest; 477 rc = VBoxServiceControlThreadRequestAllocEx(&pRequest, reqType, pvBuf, cbBuf, uCID); 478 if (RT_SUCCESS(rc)) 479 { 479 480 rc = VBoxServiceControlThreadPerform(uPID, pRequest); 480 481 if (RT_SUCCESS(rc)) 482 { 483 if (pcbRead) 481 if (RT_SUCCESS(rc) && pcbRead) 484 482 *pcbRead = pRequest->cbData; 485 } 486 487 VBoxServiceControlThreadRequestFree(pRequest); 483 VBoxServiceControlThreadRequestFree(pRequest); 484 } 488 485 } 489 486
Note:
See TracChangeset
for help on using the changeset viewer.