VirtualBox

Changeset 28463 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Apr 19, 2010 2:04:12 PM (15 years ago)
Author:
vboxsync
Message:

Guest Control: Update (extended error info, callback bugfixes).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/GuestImpl.cpp

    r28448 r28463  
    492492                          PHOSTEXECCALLBACKDATA pData)
    493493{
     494    LogFlowFuncEnter();
    494495    int rc = VINF_SUCCESS;
    495496
     
    507508
    508509        /* Do progress handling. */
     510        Utf8Str errMsg;
     511        HRESULT rc2 = S_OK;
    509512        switch (pData->u32Status)
    510513        {
     514            case PROC_STS_STARTED:
     515                break;
     516
    511517            case PROC_STS_TEN: /* Terminated normally. */
     518                it->pProgress->notifyComplete(S_OK);
     519                break;
     520
    512521            case PROC_STS_TEA: /* Terminated abnormally. */
     522                errMsg = Utf8StrFmt(Guest::tr("Process terminated abnormally with status '%u'"),
     523                                    pCBData->u32Flags);
     524                break;
     525
    513526            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
    514531            case PROC_STS_TOK:
     532                errMsg = Utf8StrFmt(Guest::tr("Process timed out and was killed"));
     533                break;
     534
    515535            case PROC_STS_TOA:
     536                errMsg = Utf8StrFmt(Guest::tr("Process timed out and could not be killed"));
     537                break;
     538
    516539            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"));
    520541                break;
    521542
     
    524545        }
    525546
     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        }
    526553        ASMAtomicWriteBool(&it->bCalled, true);
    527554    }
     555    LogFlowFuncLeave();
    528556    return rc;
    529557}
     
    542570void Guest::removeCtrlCallbackContext(Guest::CallbackListIter it)
    543571{
     572    LogFlowFuncEnter();
    544573    if (it->cbData)
    545574    {
     
    556585    }
    557586    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. */
    560593uint32_t Guest::addCtrlCallbackContext(void *pvData, uint32_t cbData, Progress* pProgress)
    561594{
     595    LogFlowFuncEnter();
     596
    562597    uint32_t uNewContext = ASMAtomicIncU32(&mNextContextID);
    563598    /** @todo Add value clamping! */
     
    574609        removeCtrlCallbackContext(mCallbackList.begin());
    575610
     611    LogFlowFuncLeave();
    576612    return uNewContext;
    577613}
     
    608644         */
    609645        ComObjPtr <Progress> progress;
    610         HRESULT rc = progress.createObject();
     646        rc = progress.createObject();
    611647        if (SUCCEEDED(rc))
    612648        {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette