VirtualBox

Changeset 94949 in vbox


Ignore:
Timestamp:
May 9, 2022 11:45:03 AM (3 years ago)
Author:
vboxsync
Message:

Main/src-client/SessionImpl.cpp: Adjust to the new rules wrt. to rc -> hrc,vrc usage, ​bugref:10223

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/SessionImpl.cpp

    r93444 r94949  
    5858    LogFlowThisFunc(("\n"));
    5959
    60     HRESULT rc = init();
     60    HRESULT hrc = init();
    6161
    6262    BaseFinalConstruct();
    6363
    64     return rc;
     64    return hrc;
    6565}
    6666
     
    127127               mState == SessionState_Spawning);
    128128
    129         HRESULT rc = i_unlockMachine(true /* aFinalRelease */, false /* aFromServer */, alock);
    130         AssertComRC(rc);
     129        HRESULT hrc = i_unlockMachine(true /* aFinalRelease */, false /* aFromServer */, alock);
     130        AssertComRC(hrc);
    131131    }
    132132
     
    181181    CHECK_OPEN();
    182182
    183     HRESULT rc;
     183    HRESULT hrc;
    184184#ifndef VBOX_COM_INPROC_API_CLIENT
    185185    if (mConsole)
    186         rc = mConsole->i_machine().queryInterfaceTo(aMachine.asOutParam());
     186        hrc = mConsole->i_machine().queryInterfaceTo(aMachine.asOutParam());
    187187    else
    188188#endif
    189         rc = mRemoteMachine.queryInterfaceTo(aMachine.asOutParam());
    190     if (FAILED(rc))
     189        hrc = mRemoteMachine.queryInterfaceTo(aMachine.asOutParam());
     190    if (FAILED(hrc))
    191191    {
    192192#ifndef VBOX_COM_INPROC_API_CLIENT
    193193        if (mConsole)
    194             setError(rc, tr("Failed to query the session machine"));
     194            setError(hrc, tr("Failed to query the session machine"));
    195195        else
    196196#endif
    197         if (FAILED_DEAD_INTERFACE(rc))
    198             setError(rc, tr("Peer process crashed"));
     197        if (FAILED_DEAD_INTERFACE(hrc))
     198            setError(hrc, tr("Peer process crashed"));
    199199        else
    200             setError(rc, tr("Failed to query the remote session machine"));
    201     }
    202 
    203     return rc;
     200            setError(hrc, tr("Failed to query the remote session machine"));
     201    }
     202
     203    return hrc;
    204204}
    205205
     
    210210    CHECK_OPEN();
    211211
    212     HRESULT rc = S_OK;
     212    HRESULT hrc = S_OK;
    213213#ifndef VBOX_COM_INPROC_API_CLIENT
    214214    if (mConsole)
    215         rc = mConsole.queryInterfaceTo(aConsole.asOutParam());
     215        hrc = mConsole.queryInterfaceTo(aConsole.asOutParam());
    216216    else
    217217#endif
    218         rc = mRemoteConsole.queryInterfaceTo(aConsole.asOutParam());
    219 
    220     if (FAILED(rc))
     218        hrc = mRemoteConsole.queryInterfaceTo(aConsole.asOutParam());
     219
     220    if (FAILED(hrc))
    221221    {
    222222#ifndef VBOX_COM_INPROC_API_CLIENT
    223223        if (mConsole)
    224             setError(rc, tr("Failed to query the console"));
     224            setError(hrc, tr("Failed to query the console"));
    225225        else
    226226#endif
    227         if (FAILED_DEAD_INTERFACE(rc))
    228             setError(rc, tr("Peer process crashed"));
     227        if (FAILED_DEAD_INTERFACE(hrc))
     228            setError(hrc, tr("Peer process crashed"));
    229229        else
    230             setError(rc, tr("Failed to query the remote console"));
    231     }
    232 
    233     return rc;
     230            setError(hrc, tr("Failed to query the remote console"));
     231    }
     232
     233    return hrc;
    234234}
    235235
     
    336336    AssertReturn(!!mControl, E_FAIL);
    337337
    338     HRESULT rc = S_OK;
     338    HRESULT hrc = S_OK;
    339339#ifndef VBOX_COM_INPROC_API_CLIENT
    340340    if (aLockType == LockType_VM)
     
    342342        /* This is what is special about VM processes: they have a Console
    343343         * object which is the root of all VM related activity. */
    344         rc = mConsole.createObject();
    345         AssertComRCReturn(rc, rc);
    346 
    347         rc = mConsole->initWithMachine(aMachine, mControl, aLockType);
    348         AssertComRCReturn(rc, rc);
     344        hrc = mConsole.createObject();
     345        AssertComRCReturn(hrc, hrc);
     346
     347        hrc = mConsole->initWithMachine(aMachine, mControl, aLockType);
     348        AssertComRCReturn(hrc, hrc);
    349349    }
    350350    else
     
    373373            delete mClientTokenHolder;
    374374            mClientTokenHolder = NULL;
    375             rc = E_FAIL;
     375            hrc = E_FAIL;
    376376        }
    377377    }
    378378    catch (std::bad_alloc &)
    379379    {
    380         rc = E_OUTOFMEMORY;
     380        hrc = E_OUTOFMEMORY;
    381381    }
    382382
     
    385385     *  until the session is closed
    386386     */
    387     if (SUCCEEDED(rc))
    388        rc = aMachine->COMGETTER(Parent)(mVirtualBox.asOutParam());
    389 
    390     if (SUCCEEDED(rc))
     387    if (SUCCEEDED(hrc))
     388       hrc = aMachine->COMGETTER(Parent)(mVirtualBox.asOutParam());
     389
     390    if (SUCCEEDED(hrc))
    391391    {
    392392        mType = SessionType_WriteLock;
     
    406406    }
    407407
    408     return rc;
     408    return hrc;
    409409}
    410410
     
    420420                 mState == SessionState_Spawning, VBOX_E_INVALID_VM_STATE);
    421421
    422     HRESULT rc = E_FAIL;
     422    HRESULT hrc = E_FAIL;
    423423
    424424    /* query IInternalMachineControl interface */
     
    449449     *  until the session is closed
    450450     */
    451     rc = aMachine->COMGETTER(Parent)(mVirtualBox.asOutParam());
    452 
    453     if (SUCCEEDED(rc))
     451    hrc = aMachine->COMGETTER(Parent)(mVirtualBox.asOutParam());
     452
     453    if (SUCCEEDED(hrc))
    454454    {
    455455        /*
     
    472472    }
    473473
    474     LogFlowThisFunc(("rc=%08X\n", rc));
     474    LogFlowThisFunc(("hrc=%08X\n", hrc));
    475475    LogFlowThisFuncLeave();
    476476
    477     return rc;
     477    return hrc;
    478478}
    479479
     
    519519    AutoCaller autoCaller(this);
    520520
    521     HRESULT rc = S_OK;
     521    HRESULT hrc = S_OK;
    522522
    523523    if (getObjectState().getState() == ObjectState::Ready)
     
    547547
    548548        /* close ourselves */
    549         rc = i_unlockMachine(false /* aFinalRelease */, true /* aFromServer */, alock);
     549        hrc = i_unlockMachine(false /* aFinalRelease */, true /* aFromServer */, alock);
    550550    }
    551551    else if (getObjectState().getState() == ObjectState::InUninit)
     
    560560    {
    561561        Log1WarningThisFunc(("UNEXPECTED uninitialization!\n"));
    562         rc = autoCaller.rc();
    563     }
    564 
    565     LogFlowThisFunc(("rc=%08X\n", rc));
     562        hrc = autoCaller.rc();
     563    }
     564
     565    LogFlowThisFunc(("hrc=%08X\n", hrc));
    566566    LogFlowThisFuncLeave();
    567567
    568     return rc;
     568    return hrc;
    569569}
    570570
     
    11171117
    11181118    bool fLeftPaused = false;
    1119     HRESULT rc = mConsole->i_saveState(aReason, aProgress, aSnapshot, aStateFilePath, !!aPauseVM, fLeftPaused);
     1119    HRESULT hrc = mConsole->i_saveState(aReason, aProgress, aSnapshot, aStateFilePath, !!aPauseVM, fLeftPaused);
    11201120    if (aLeftPaused)
    11211121        *aLeftPaused = fLeftPaused;
    1122     return rc;
     1122    return hrc;
    11231123#else
    11241124    RT_NOREF(aReason, aProgress, aSnapshot, aStateFilePath, aPauseVM, aLeftPaused);
     
    12381238
    12391239        LogFlowThisFunc(("Calling mControl->OnSessionEnd()...\n"));
    1240         HRESULT rc = mControl->OnSessionEnd(this, progress.asOutParam());
    1241         LogFlowThisFunc(("mControl->OnSessionEnd()=%08X\n", rc));
     1240        HRESULT hrc = mControl->OnSessionEnd(this, progress.asOutParam());
     1241        LogFlowThisFunc(("mControl->OnSessionEnd()=%08X\n", hrc));
    12421242
    12431243        aLockW.acquire();
     
    12501250         *        ObjectState::addCaller.
    12511251         */
    1252         if (mType != SessionType_WriteLock && (rc == E_UNEXPECTED || rc == E_ACCESSDENIED))
    1253             rc = S_OK;
     1252        if (mType != SessionType_WriteLock && (hrc == E_UNEXPECTED || hrc == E_ACCESSDENIED))
     1253            hrc = S_OK;
    12541254
    12551255#if !defined(DEBUG_bird) && !defined(DEBUG_andy) /* I don't want clients crashing on me just because VBoxSVC went belly up. */
    1256         AssertComRC(rc);
     1256        AssertComRC(hrc);
    12571257#endif
    12581258    }
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