VirtualBox

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


Ignore:
Timestamp:
May 31, 2022 9:36:29 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
151633
Message:

Frontends + Main: Adjust to the new rules wrt. to rc -> hrc,vrc usage. This also fixes quite a few bugs wrt shadow variables, wrong return values and output error translations / exit codes. Also see @todos added [more stuff, build fix] ​bugref:10223

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/testcase/tstVBoxMultipleVM.cpp

    r94660 r95142  
    8787#define CHECK_ERROR_L(iface, method) \
    8888    do { \
    89         rc = iface->method; \
     89        hrc = iface->method; \
    9090        if (FAILED(rc)) \
    9191            RTPrintf("warning: %s->%s failed on line %u with hrc=%Rhrc\n", #iface, #method, __LINE__, rc);\
     
    100100static int tstStartVM(IVirtualBox *pVBox, ISession *pSession, Bstr machineID, bool fSkipUnlock)
    101101{
    102     HRESULT rc;
     102    HRESULT hrc;
    103103    ComPtr<IProgress> progress;
    104104    ComPtr<IMachine> machine;
    105105    Bstr machineName;
    106106
    107     rc = TST_COM_EXPR(pVBox->FindMachine(machineID.raw(), machine.asOutParam()));
    108     if(SUCCEEDED(rc))
    109         rc = TST_COM_EXPR(machine->COMGETTER(Name)(machineName.asOutParam()));
    110     if(SUCCEEDED(rc))
    111     {
    112         rc = machine->LaunchVMProcess(pSession, Bstr("headless").raw(),
     107    hrc = TST_COM_EXPR(pVBox->FindMachine(machineID.raw(), machine.asOutParam()));
     108    if(SUCCEEDED(hrc))
     109        hrc = TST_COM_EXPR(machine->COMGETTER(Name)(machineName.asOutParam()));
     110    if(SUCCEEDED(hrc))
     111    {
     112        hrc = machine->LaunchVMProcess(pSession, Bstr("headless").raw(),
    113113                                      ComSafeArrayNullInParam(), progress.asOutParam());
    114114    }
    115     if (SUCCEEDED(rc) && !progress.isNull())
     115    if (SUCCEEDED(hrc) && !progress.isNull())
    116116    {
    117117        CHECK_ERROR_L(progress, WaitForCompletion(-1));
    118         if (SUCCEEDED(rc))
     118        if (SUCCEEDED(hrc))
    119119        {
    120120            BOOL completed = true;
    121121            CHECK_ERROR_L(progress, COMGETTER(Completed)(&completed));
    122             if (SUCCEEDED(rc))
     122            if (SUCCEEDED(hrc))
    123123            {
    124124                Assert(completed);
    125125                LONG iRc;
    126126                CHECK_ERROR_L(progress, COMGETTER(ResultCode)(&iRc));
    127                 if (SUCCEEDED(rc))
     127                if (SUCCEEDED(hrc))
    128128                {
    129129                    if (FAILED(iRc))
     
    142142            RTPrintf("Session unlock skipped.\n");
    143143    }
    144     return rc;
     144    return hrc;
    145145}
    146146
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