Changeset 28463 in vbox for trunk/src/VBox/Main
- Timestamp:
- Apr 19, 2010 2:04:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/GuestImpl.cpp
r28448 r28463 492 492 PHOSTEXECCALLBACKDATA pData) 493 493 { 494 LogFlowFuncEnter(); 494 495 int rc = VINF_SUCCESS; 495 496 … … 507 508 508 509 /* Do progress handling. */ 510 Utf8Str errMsg; 511 HRESULT rc2 = S_OK; 509 512 switch (pData->u32Status) 510 513 { 514 case PROC_STS_STARTED: 515 break; 516 511 517 case PROC_STS_TEN: /* Terminated normally. */ 518 it->pProgress->notifyComplete(S_OK); 519 break; 520 512 521 case PROC_STS_TEA: /* Terminated abnormally. */ 522 errMsg = Utf8StrFmt(Guest::tr("Process terminated abnormally with status '%u'"), 523 pCBData->u32Flags); 524 break; 525 513 526 case PROC_STS_TES: /* Terminated through signal. */ 527 errMsg = Utf8StrFmt(Guest::tr("Process terminated via signal with status '%u'"), 528 pCBData->u32Flags); 529 break; 530 514 531 case PROC_STS_TOK: 532 errMsg = Utf8StrFmt(Guest::tr("Process timed out and was killed")); 533 break; 534 515 535 case PROC_STS_TOA: 536 errMsg = Utf8StrFmt(Guest::tr("Process timed out and could not be killed")); 537 break; 538 516 539 case PROC_STS_DWN: 517 518 if (!it->pProgress.isNull()) 519 it->pProgress->notifyComplete(S_OK); 540 errMsg = Utf8StrFmt(Guest::tr("Process exited because system is shutting down")); 520 541 break; 521 542 … … 524 545 } 525 546 547 if ( !it->pProgress.isNull() 548 && errMsg.length()) 549 { 550 it->pProgress->notifyComplete(E_FAIL /** @todo Find a better rc! */, COM_IIDOF(IGuest), 551 (CBSTR)Guest::getComponentName(), errMsg.c_str()); 552 } 526 553 ASMAtomicWriteBool(&it->bCalled, true); 527 554 } 555 LogFlowFuncLeave(); 528 556 return rc; 529 557 } … … 542 570 void Guest::removeCtrlCallbackContext(Guest::CallbackListIter it) 543 571 { 572 LogFlowFuncEnter(); 544 573 if (it->cbData) 545 574 { … … 556 585 } 557 586 mCallbackList.erase(it); 558 } 559 587 LogFlowFuncLeave(); 588 } 589 590 /* Adds a callback with a user provided data block and an optional progress object 591 * to the callback list. A callback is identified by a unique context ID which is used 592 * to identify a callback from the guest side. */ 560 593 uint32_t Guest::addCtrlCallbackContext(void *pvData, uint32_t cbData, Progress* pProgress) 561 594 { 595 LogFlowFuncEnter(); 596 562 597 uint32_t uNewContext = ASMAtomicIncU32(&mNextContextID); 563 598 /** @todo Add value clamping! */ … … 574 609 removeCtrlCallbackContext(mCallbackList.begin()); 575 610 611 LogFlowFuncLeave(); 576 612 return uNewContext; 577 613 } … … 608 644 */ 609 645 ComObjPtr <Progress> progress; 610 HRESULTrc = progress.createObject();646 rc = progress.createObject(); 611 647 if (SUCCEEDED(rc)) 612 648 {
Note:
See TracChangeset
for help on using the changeset viewer.