VirtualBox

Ignore:
Timestamp:
Jan 25, 2023 1:59:25 AM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
155502
Message:

Main: rc -> hrc/vrc for all but testcases. Enabled scm rc checks accordingly. bugref:10223

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/glue/ErrorInfo.cpp

    r98103 r98297  
    5656HRESULT ErrorInfo::getVirtualBoxErrorInfo(ComPtr<IVirtualBoxErrorInfo> &pVirtualBoxErrorInfo)
    5757{
    58     HRESULT rc = S_OK;
     58    HRESULT hrc = S_OK;
    5959    if (mErrorInfo)
    60         rc = mErrorInfo.queryInterfaceTo(pVirtualBoxErrorInfo.asOutParam());
     60        hrc = mErrorInfo.queryInterfaceTo(pVirtualBoxErrorInfo.asOutParam());
    6161    else
    6262        pVirtualBoxErrorInfo.setNull();
    63     return rc;
     63    return hrc;
    6464}
    6565
     
    111111void ErrorInfo::init(bool aKeepObj /* = false */)
    112112{
    113     HRESULT rc = E_FAIL;
     113    HRESULT hrc = E_FAIL;
    114114
    115115#if !defined(VBOX_WITH_XPCOM)
    116116
    117117    ComPtr<IErrorInfo> err;
    118     rc = ::GetErrorInfo(0, err.asOutParam());
    119     if (rc == S_OK && err)
     118    hrc = ::GetErrorInfo(0, err.asOutParam());
     119    if (hrc == S_OK && err)
    120120    {
    121121        if (aKeepObj)
     
    123123
    124124        ComPtr<IVirtualBoxErrorInfo> info;
    125         rc = err.queryInterfaceTo(info.asOutParam());
    126         if (SUCCEEDED(rc) && info)
     125        hrc = err.queryInterfaceTo(info.asOutParam());
     126        if (SUCCEEDED(hrc) && info)
    127127            init(info);
    128128
     
    131131            bool gotSomething = false;
    132132
    133             rc = err->GetGUID(mInterfaceID.asOutParam());
    134             gotSomething |= SUCCEEDED(rc);
    135             if (SUCCEEDED(rc))
     133            hrc = err->GetGUID(mInterfaceID.asOutParam());
     134            gotSomething |= SUCCEEDED(hrc);
     135            if (SUCCEEDED(hrc))
    136136                GetInterfaceNameByIID(mInterfaceID.ref(), mInterfaceName.asOutParam());
    137137
    138             rc = err->GetSource(mComponent.asOutParam());
    139             gotSomething |= SUCCEEDED(rc);
    140 
    141             rc = err->GetDescription(mText.asOutParam());
    142             gotSomething |= SUCCEEDED(rc);
     138            hrc = err->GetSource(mComponent.asOutParam());
     139            gotSomething |= SUCCEEDED(hrc);
     140
     141            hrc = err->GetDescription(mText.asOutParam());
     142            gotSomething |= SUCCEEDED(hrc);
    143143
    144144            if (gotSomething)
     
    152152
    153153    nsCOMPtr<nsIExceptionService> es;
    154     es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, &rc);
    155     if (NS_SUCCEEDED(rc))
     154    es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, &hrc);
     155    if (NS_SUCCEEDED(hrc))
    156156    {
    157157        nsCOMPtr<nsIExceptionManager> em;
    158         rc = es->GetCurrentExceptionManager(getter_AddRefs(em));
    159         if (NS_SUCCEEDED(rc))
     158        hrc = es->GetCurrentExceptionManager(getter_AddRefs(em));
     159        if (NS_SUCCEEDED(hrc))
    160160        {
    161161            ComPtr<nsIException> ex;
    162             rc = em->GetCurrentException(ex.asOutParam());
    163             if (NS_SUCCEEDED(rc) && ex)
     162            hrc = em->GetCurrentException(ex.asOutParam());
     163            if (NS_SUCCEEDED(hrc) && ex)
    164164            {
    165165                if (aKeepObj)
     
    167167
    168168                ComPtr<IVirtualBoxErrorInfo> info;
    169                 rc = ex.queryInterfaceTo(info.asOutParam());
    170                 if (NS_SUCCEEDED(rc) && info)
     169                hrc = ex.queryInterfaceTo(info.asOutParam());
     170                if (NS_SUCCEEDED(hrc) && info)
    171171                    init(info);
    172172
     
    175175                    bool gotSomething = false;
    176176
    177                     rc = ex->GetResult(&mResultCode);
    178                     gotSomething |= NS_SUCCEEDED(rc);
     177                    hrc = ex->GetResult(&mResultCode);
     178                    gotSomething |= NS_SUCCEEDED(hrc);
    179179
    180180                    char *pszMsg;
    181                     rc = ex->GetMessage(&pszMsg);
    182                     gotSomething |= NS_SUCCEEDED(rc);
    183                     if (NS_SUCCEEDED(rc))
     181                    hrc = ex->GetMessage(&pszMsg);
     182                    gotSomething |= NS_SUCCEEDED(hrc);
     183                    if (NS_SUCCEEDED(hrc))
    184184                    {
    185185                        mText = Bstr(pszMsg);
     
    196196                em->SetCurrentException(NULL);
    197197
    198                 rc = NS_OK;
     198                hrc = NS_OK;
    199199            }
    200200        }
    201201    }
    202202    /* Ignore failure when called after nsComponentManagerImpl::Shutdown(). */
    203     else if (rc == NS_ERROR_UNEXPECTED)
    204         rc = NS_OK;
    205 
    206     AssertComRC(rc);
     203    else if (hrc == NS_ERROR_UNEXPECTED)
     204        hrc = NS_OK;
     205
     206    AssertComRC(hrc);
    207207
    208208#endif // defined(VBOX_WITH_XPCOM)
     
    219219    ComPtr<IUnknown> iface = aI;
    220220    ComPtr<ISupportErrorInfo> serr;
    221     HRESULT rc = iface.queryInterfaceTo(serr.asOutParam());
    222     if (SUCCEEDED(rc))
    223     {
    224         rc = serr->InterfaceSupportsErrorInfo(aIID);
    225         if (SUCCEEDED(rc))
     221    HRESULT hrc = iface.queryInterfaceTo(serr.asOutParam());
     222    if (SUCCEEDED(hrc))
     223    {
     224        hrc = serr->InterfaceSupportsErrorInfo(aIID);
     225        if (SUCCEEDED(hrc))
    226226            init(aKeepObj);
    227227    }
     
    244244    AssertReturnVoid(info);
    245245
    246     HRESULT rc = E_FAIL;
     246    HRESULT hrc = E_FAIL;
    247247    bool gotSomething = false;
    248248    bool gotAll = true;
    249249    LONG lrc, lrd;
    250250
    251     rc = info->COMGETTER(ResultCode)(&lrc); mResultCode = lrc;
    252     gotSomething |= SUCCEEDED(rc);
    253     gotAll &= SUCCEEDED(rc);
    254 
    255     rc = info->COMGETTER(ResultDetail)(&lrd); mResultDetail = lrd;
    256     gotSomething |= SUCCEEDED(rc);
    257     gotAll &= SUCCEEDED(rc);
     251    hrc = info->COMGETTER(ResultCode)(&lrc); mResultCode = lrc;
     252    gotSomething |= SUCCEEDED(hrc);
     253    gotAll &= SUCCEEDED(hrc);
     254
     255    hrc = info->COMGETTER(ResultDetail)(&lrd); mResultDetail = lrd;
     256    gotSomething |= SUCCEEDED(hrc);
     257    gotAll &= SUCCEEDED(hrc);
    258258
    259259    Bstr iid;
    260     rc = info->COMGETTER(InterfaceID)(iid.asOutParam());
    261     gotSomething |= SUCCEEDED(rc);
    262     gotAll &= SUCCEEDED(rc);
    263     if (SUCCEEDED(rc))
     260    hrc = info->COMGETTER(InterfaceID)(iid.asOutParam());
     261    gotSomething |= SUCCEEDED(hrc);
     262    gotAll &= SUCCEEDED(hrc);
     263    if (SUCCEEDED(hrc))
    264264    {
    265265        mInterfaceID = iid;
     
    267267    }
    268268
    269     rc = info->COMGETTER(Component)(mComponent.asOutParam());
    270     gotSomething |= SUCCEEDED(rc);
    271     gotAll &= SUCCEEDED(rc);
    272 
    273     rc = info->COMGETTER(Text)(mText.asOutParam());
    274     gotSomething |= SUCCEEDED(rc);
    275     gotAll &= SUCCEEDED(rc);
     269    hrc = info->COMGETTER(Component)(mComponent.asOutParam());
     270    gotSomething |= SUCCEEDED(hrc);
     271    gotAll &= SUCCEEDED(hrc);
     272
     273    hrc = info->COMGETTER(Text)(mText.asOutParam());
     274    gotSomething |= SUCCEEDED(hrc);
     275    gotAll &= SUCCEEDED(hrc);
    276276
    277277    m_pNext = NULL;
    278278
    279279    ComPtr<IVirtualBoxErrorInfo> next;
    280     rc = info->COMGETTER(Next)(next.asOutParam());
    281     if (SUCCEEDED(rc) && !next.isNull())
     280    hrc = info->COMGETTER(Next)(next.asOutParam());
     281    if (SUCCEEDED(hrc) && !next.isNull())
    282282    {
    283283        m_pNext = new ErrorInfo(next);
    284284        Assert(m_pNext != NULL);
    285285        if (!m_pNext)
    286             rc = E_OUTOFMEMORY;
    287     }
    288 
    289     gotSomething |= SUCCEEDED(rc);
    290     gotAll &= SUCCEEDED(rc);
     286            hrc = E_OUTOFMEMORY;
     287    }
     288
     289    gotSomething |= SUCCEEDED(hrc);
     290    gotAll &= SUCCEEDED(hrc);
    291291
    292292    mIsBasicAvailable = gotSomething;
     
    312312
    313313    ComPtr<IVirtualBoxErrorInfo> info;
    314     HRESULT rc = progress->COMGETTER(ErrorInfo)(info.asOutParam());
    315     if (SUCCEEDED(rc) && info)
     314    HRESULT hrc = progress->COMGETTER(ErrorInfo)(info.asOutParam());
     315    if (SUCCEEDED(hrc) && info)
    316316        init(info);
    317317}
     
    328328        return S_OK;
    329329
    330     HRESULT rc = S_OK;
     330    HRESULT hrc = S_OK;
    331331
    332332#if !defined(VBOX_WITH_XPCOM)
     
    335335    if (!mErrorInfo.isNull())
    336336    {
    337         rc = mErrorInfo.queryInterfaceTo(err.asOutParam());
    338         AssertComRC(rc);
    339     }
    340     rc = ::SetErrorInfo(0, err);
     337        hrc = mErrorInfo.queryInterfaceTo(err.asOutParam());
     338        AssertComRC(hrc);
     339    }
     340    hrc = ::SetErrorInfo(0, err);
    341341
    342342#else // defined(VBOX_WITH_XPCOM)
    343343
    344344    nsCOMPtr <nsIExceptionService> es;
    345     es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, &rc);
    346     if (NS_SUCCEEDED(rc))
     345    es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, &hrc);
     346    if (NS_SUCCEEDED(hrc))
    347347    {
    348348        nsCOMPtr <nsIExceptionManager> em;
    349         rc = es->GetCurrentExceptionManager(getter_AddRefs(em));
    350         if (NS_SUCCEEDED(rc))
     349        hrc = es->GetCurrentExceptionManager(getter_AddRefs(em));
     350        if (NS_SUCCEEDED(hrc))
    351351        {
    352352            ComPtr<nsIException> ex;
    353353            if (!mErrorInfo.isNull())
    354354            {
    355                 rc = mErrorInfo.queryInterfaceTo(ex.asOutParam());
    356                 AssertComRC(rc);
     355                hrc = mErrorInfo.queryInterfaceTo(ex.asOutParam());
     356                AssertComRC(hrc);
    357357            }
    358             rc = em->SetCurrentException(ex);
     358            hrc = em->SetCurrentException(ex);
    359359        }
    360360    }
     
    362362#endif // defined(VBOX_WITH_XPCOM)
    363363
    364     if (SUCCEEDED(rc))
     364    if (SUCCEEDED(hrc))
    365365    {
    366366        mErrorInfo.setNull();
     
    368368    }
    369369
    370     return rc;
     370    return hrc;
    371371}
    372372
Note: See TracChangeset for help on using the changeset viewer.

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