VirtualBox

Changeset 98266 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Jan 24, 2023 9:46:42 AM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
155469
Message:

Main/ConsoleImpl.cpp: rc -> hrc/vrc. bugref:10223

File:
1 edited

Legend:

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

    r98265 r98266  
    37873787    AssertReturn(enmVMState == VMSTATE_SUSPENDED, VERR_INVALID_STATE);
    37883788
    3789     int hrc = pThis->i_configMediumAttachment(pcszDevice,
     3789    int vrc = pThis->i_configMediumAttachment(pcszDevice,
    37903790                                              uInstance,
    37913791                                              enmBus,
     
    38063806                                              NULL /* paLedDevType */,
    38073807                                              NULL /* ppLunL0 */);
    3808     LogFlowFunc(("Returning %Rrc\n", hrc));
    3809     return hrc;
     3808    LogFlowFunc(("Returning %Rrc\n", vrc));
     3809    return vrc;
    38103810}
    38113811
     
    39673967    AssertReturn(enmVMState == VMSTATE_SUSPENDED, VERR_INVALID_STATE);
    39683968
    3969     int hrc = pThis->i_configMediumAttachment(pcszDevice,
     3969    int vrc = pThis->i_configMediumAttachment(pcszDevice,
    39703970                                              uInstance,
    39713971                                              enmBus,
     
    39863986                                              NULL /* paLedDevType */,
    39873987                                              NULL);
    3988     LogFlowFunc(("Returning %Rrc\n", hrc));
    3989     return hrc;
     3988    LogFlowFunc(("Returning %Rrc\n", vrc));
     3989    return vrc;
    39903990}
    39913991
     
    52605260                {
    52615261                    PPDMIBASE pBase;
    5262                     int rc2 = ptrVM.vtable()->pfnPDMR3QueryDriverOnLun(ptrVM.rawUVM(),
    5263                                                                        i_getAudioAdapterDeviceName(aAudioAdapter).c_str(),
    5264                                                                        0 /* iInstance */, ulLUN, "AUDIO", &pBase);
    5265                     if (RT_FAILURE(rc2))
     5262                    int vrc2 = ptrVM.vtable()->pfnPDMR3QueryDriverOnLun(ptrVM.rawUVM(),
     5263                                                                        i_getAudioAdapterDeviceName(aAudioAdapter).c_str(),
     5264                                                                        0 /* iInstance */, ulLUN, "AUDIO", &pBase);
     5265                    if (RT_FAILURE(vrc2))
    52665266                        continue;
    52675267
     
    68396839    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    68406840
    6841     HRESULT rc = S_OK;
    68426841    for (size_t i = 0; i < aAttachments.size(); ++i)
    68436842    {
     
    68796878
    68806879        BOOL fBuiltinIOCache;
    6881         rc = mMachine->COMGETTER(IOCacheEnabled)(&fBuiltinIOCache);
    6882         if (FAILED(rc))
     6880        hrc = mMachine->COMGETTER(IOCacheEnabled)(&fBuiltinIOCache);
     6881        if (FAILED(hrc))
    68836882            return hrc;
    68846883
     
    69006899                                                      fUseHostIOCache, fBuiltinIOCache, fInsertDiskIntegrityDrv,
    69016900                                                      false /* fSetupMerge */, 0 /* uMergeSource */, 0 /* uMergeTarget */,
    6902                                                       pAttachment, mMachineState, &rc);
     6901                                                      pAttachment, mMachineState, &hrc);
    69036902        if (RT_FAILURE(vrc))
    69046903            throw setErrorBoth(E_FAIL, vrc, "%Rrc", vrc);
     
    69146913HRESULT Console::i_onVMProcessPriorityChange(VMProcPriority_T priority)
    69156914{
    6916     HRESULT rc = S_OK;
    6917 
    69186915    AutoCaller autoCaller(this);
    6919     if (FAILED(autoCaller.hrc()))
    6920         return autoCaller.hrc();
     6916    HRESULT hrc = autoCaller.hrc();
     6917    if (FAILED(hrc))
     6918        return hrc;
    69216919
    69226920    RTPROCPRIORITY enmProcPriority = RTPROCPRIORITY_DEFAULT;
     
    69436941    int vrc = RTProcSetPriority(enmProcPriority);
    69446942    if (RT_FAILURE(vrc))
    6945         rc = setErrorBoth(VBOX_E_VM_ERROR, vrc,
    6946                           tr("Could not set the priority of the process (%Rrc). Try to set it when VM is not started."), vrc);
    6947 
    6948     return rc;
     6943        hrc = setErrorBoth(VBOX_E_VM_ERROR, vrc,
     6944                           tr("Could not set the priority of the process (%Rrc). Try to set it when VM is not started."), vrc);
     6945
     6946    return hrc;
    69496947}
    69506948
     
    72937291                    autoCaller.release();
    72947292
    7295                     HRESULT rc = i_powerDown();
    7296                     AssertComRC(rc);
     7293                    HRESULT hrc2 = i_powerDown();
     7294                    AssertComRC(hrc2);
    72977295
    72987296                    autoCaller.add();
     
    82468244
    82478245    AutoCaller autoCaller(this);
    8248     HRESULT rc = autoCaller.hrc();
    8249     if (FAILED(rc)) return rc;
     8246    HRESULT hrc = autoCaller.hrc();
     8247    if (FAILED(hrc))
     8248        return hrc;
    82508249
    82518250    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    82598258    /* Set up release logging as early as possible after the check if
    82608259     * there is already a running VM which we shouldn't disturb. */
    8261     rc = i_consoleInitReleaseLog(mMachine);
    8262     if (FAILED(rc))
    8263         return rc;
     8260    hrc = i_consoleInitReleaseLog(mMachine);
     8261    if (FAILED(hrc))
     8262        return hrc;
    82648263
    82658264#ifdef VBOX_OPENSSL_FIPS
     
    82698268    /* test and clear the TeleporterEnabled property  */
    82708269    BOOL fTeleporterEnabled;
    8271     rc = mMachine->COMGETTER(TeleporterEnabled)(&fTeleporterEnabled);
    8272     if (FAILED(rc))
    8273         return rc;
     8270    hrc = mMachine->COMGETTER(TeleporterEnabled)(&fTeleporterEnabled);
     8271    if (FAILED(hrc))
     8272        return hrc;
    82748273
    82758274#if 0 /** @todo we should save it afterwards, but that isn't necessarily a good idea. Find a better place for this (VBoxSVC).  */
    82768275    if (fTeleporterEnabled)
    82778276    {
    8278         rc = mMachine->COMSETTER(TeleporterEnabled)(FALSE);
    8279         if (FAILED(rc))
    8280             return rc;
     8277        hrc = mMachine->COMSETTER(TeleporterEnabled)(FALSE);
     8278        if (FAILED(hrc))
     8279            return hrc;
    82818280    }
    82828281#endif
     
    83178316        {
    83188317            Bstr bstrSavedStateFile;
    8319             rc = mMachine->COMGETTER(StateFilePath)(bstrSavedStateFile.asOutParam());
    8320             if (FAILED(rc))
    8321                 throw rc;
     8318            hrc = mMachine->COMGETTER(StateFilePath)(bstrSavedStateFile.asOutParam());
     8319            if (FAILED(hrc))
     8320                throw hrc;
    83228321            strSavedStateFile = bstrSavedStateFile;
    83238322
    83248323#ifdef VBOX_WITH_FULL_VM_ENCRYPTION
    8325             rc = mMachine->COMGETTER(StateKeyId)(bstrStateKeyId.asOutParam());
    8326             if (FAILED(rc))
    8327                 throw rc;
    8328             rc = mMachine->COMGETTER(StateKeyStore)(bstrStateKeyStore.asOutParam());
    8329             if (FAILED(rc))
    8330                 throw rc;
     8324            hrc = mMachine->COMGETTER(StateKeyId)(bstrStateKeyId.asOutParam());
     8325            if (FAILED(hrc))
     8326                throw hrc;
     8327            hrc = mMachine->COMGETTER(StateKeyStore)(bstrStateKeyStore.asOutParam());
     8328            if (FAILED(hrc))
     8329                throw hrc;
    83318330#endif
    83328331
     
    83678366         * saved state file (if not yet done).
    83688367         */
    8369         rc = i_loadDataFromSavedState();
    8370         if (FAILED(rc))
    8371             throw rc;
     8368        hrc = i_loadDataFromSavedState();
     8369        if (FAILED(hrc))
     8370            throw hrc;
    83728371
    83738372        /* Check all types of shared folders and compose a single list */
     
    84118410         * asynchronously */
    84128411        try { task = new VMPowerUpTask(this, pPowerupProgress); }
    8413         catch (std::bad_alloc &) { throw rc = E_OUTOFMEMORY; }
     8412        catch (std::bad_alloc &) { throw hrc = E_OUTOFMEMORY; }
    84148413        if (!task->isOk())
    84158414            throw task->hrc();
     
    84208419        if (mMachineState == MachineState_Saved || mMachineState == MachineState_AbortedSaved)
    84218420            try { task->mSavedStateFile = strSavedStateFile; }
    8422             catch (std::bad_alloc &) { throw rc = E_OUTOFMEMORY; }
     8421            catch (std::bad_alloc &) { throw hrc = E_OUTOFMEMORY; }
    84238422        task->mTeleporterEnabled = fTeleporterEnabled;
    84248423
     
    84328431         */
    84338432        ComPtr<ISnapshot> pCurrentSnapshot;
    8434         rc = mMachine->COMGETTER(CurrentSnapshot)(pCurrentSnapshot.asOutParam());
    8435         if (FAILED(rc))
    8436             throw rc;
     8433        hrc = mMachine->COMGETTER(CurrentSnapshot)(pCurrentSnapshot.asOutParam());
     8434        if (FAILED(hrc))
     8435            throw hrc;
    84378436
    84388437        BOOL fCurrentSnapshotIsOnline = false;
    84398438        if (pCurrentSnapshot)
    84408439        {
    8441             rc = pCurrentSnapshot->COMGETTER(Online)(&fCurrentSnapshotIsOnline);
    8442             if (FAILED(rc))
    8443                 throw rc;
     8440            hrc = pCurrentSnapshot->COMGETTER(Online)(&fCurrentSnapshotIsOnline);
     8441            if (FAILED(hrc))
     8442                throw hrc;
    84448443        }
    84458444
     
    84498448
    84508449            com::SafeIfaceArray<IMediumAttachment> atts;
    8451             rc = mMachine->COMGETTER(MediumAttachments)(ComSafeArrayAsOutParam(atts));
    8452             if (FAILED(rc))
    8453                 throw rc;
     8450            hrc = mMachine->COMGETTER(MediumAttachments)(ComSafeArrayAsOutParam(atts));
     8451            if (FAILED(hrc))
     8452                throw hrc;
    84548453
    84558454            for (size_t i = 0;
     
    84588457            {
    84598458                DeviceType_T devType;
    8460                 rc = atts[i]->COMGETTER(Type)(&devType);
     8459                hrc = atts[i]->COMGETTER(Type)(&devType);
    84618460                /** @todo later applies to floppies as well */
    84628461                if (devType == DeviceType_HardDisk)
    84638462                {
    84648463                    ComPtr<IMedium> pMedium;
    8465                     rc = atts[i]->COMGETTER(Medium)(pMedium.asOutParam());
    8466                     if (FAILED(rc))
    8467                         throw rc;
     8464                    hrc = atts[i]->COMGETTER(Medium)(pMedium.asOutParam());
     8465                    if (FAILED(hrc))
     8466                        throw hrc;
    84688467
    84698468                    /* needs autoreset? */
    84708469                    BOOL autoReset = FALSE;
    8471                     rc = pMedium->COMGETTER(AutoReset)(&autoReset);
    8472                     if (FAILED(rc))
    8473                         throw rc;
     8470                    hrc = pMedium->COMGETTER(AutoReset)(&autoReset);
     8471                    if (FAILED(hrc))
     8472                        throw hrc;
    84748473
    84758474                    if (autoReset)
    84768475                    {
    84778476                        ComPtr<IProgress> pResetProgress;
    8478                         rc = pMedium->Reset(pResetProgress.asOutParam());
    8479                         if (FAILED(rc))
    8480                             throw rc;
     8477                        hrc = pMedium->Reset(pResetProgress.asOutParam());
     8478                        if (FAILED(hrc))
     8479                            throw hrc;
    84818480
    84828481                        /* save for later use on the powerup thread */
     
    85528551                ulTotalOperationsWeight += 1;
    85538552            }
    8554             rc = pPowerupProgress->init(static_cast<IConsole *>(this),
    8555                                         progressDesc.raw(),
    8556                                         TRUE, // Cancelable
    8557                                         cOperations,
    8558                                         ulTotalOperationsWeight,
    8559                                         tr("Starting Hard Disk operations"),
    8560                                         1);
    8561             AssertComRCReturnRC(rc);
     8553            hrc = pPowerupProgress->init(static_cast<IConsole *>(this),
     8554                                         progressDesc.raw(),
     8555                                         TRUE, // Cancelable
     8556                                         cOperations,
     8557                                         ulTotalOperationsWeight,
     8558                                         tr("Starting Hard Disk operations"),
     8559                                         1);
     8560            AssertComRCReturnRC(hrc);
    85628561        }
    85638562        else if (   mMachineState == MachineState_Saved
    85648563                 || mMachineState == MachineState_AbortedSaved
    85658564                 || !fTeleporterEnabled)
    8566             rc = pPowerupProgress->init(static_cast<IConsole *>(this),
    8567                                         progressDesc.raw(),
    8568                                         FALSE /* aCancelable */);
     8565            hrc = pPowerupProgress->init(static_cast<IConsole *>(this),
     8566                                         progressDesc.raw(),
     8567                                         FALSE /* aCancelable */);
    85698568        else if (fTeleporterEnabled)
    8570             rc = pPowerupProgress->init(static_cast<IConsole *>(this),
    8571                                         progressDesc.raw(),
    8572                                         TRUE /* aCancelable */,
    8573                                         3    /* cOperations */,
    8574                                         10   /* ulTotalOperationsWeight */,
    8575                                         tr("Teleporting virtual machine"),
    8576                                         1    /* ulFirstOperationWeight */);
    8577 
    8578         if (FAILED(rc))
    8579             throw rc;
     8569            hrc = pPowerupProgress->init(static_cast<IConsole *>(this),
     8570                                         progressDesc.raw(),
     8571                                         TRUE /* aCancelable */,
     8572                                         3    /* cOperations */,
     8573                                         10   /* ulTotalOperationsWeight */,
     8574                                         tr("Teleporting virtual machine"),
     8575                                         1    /* ulFirstOperationWeight */);
     8576
     8577        if (FAILED(hrc))
     8578            throw hrc;
    85808579
    85818580        /* Tell VBoxSVC and Machine about the progress object so they can
    85828581           combine/proxy it to any openRemoteSession caller. */
    85838582        LogFlowThisFunc(("Calling BeginPowerUp...\n"));
    8584         rc = mControl->BeginPowerUp(pPowerupProgress);
    8585         if (FAILED(rc))
     8583        hrc = mControl->BeginPowerUp(pPowerupProgress);
     8584        if (FAILED(hrc))
    85868585        {
    85878586            LogFlowThisFunc(("BeginPowerUp failed\n"));
    8588             throw rc;
     8587            throw hrc;
    85898588        }
    85908589        fBeganPoweringUp = true;
     
    85928591        LogFlowThisFunc(("Checking if canceled...\n"));
    85938592        BOOL fCanceled;
    8594         rc = pPowerupProgress->COMGETTER(Canceled)(&fCanceled);
    8595         if (FAILED(rc))
    8596             throw rc;
     8593        hrc = pPowerupProgress->COMGETTER(Canceled)(&fCanceled);
     8594        if (FAILED(hrc))
     8595            throw hrc;
    85978596
    85988597        if (fCanceled)
     
    86588657        if (aProgress)
    86598658        {
    8660             rc = pPowerupProgress.queryInterfaceTo(aProgress);
    8661             AssertComRCReturnRC(rc);
     8659            hrc = pPowerupProgress.queryInterfaceTo(aProgress);
     8660            AssertComRCReturnRC(hrc);
    86628661        }
    86638662
     
    86688667#endif
    86698668
    8670         rc = task->createThread();
     8669        hrc = task->createThread();
    86718670        task = NULL;
    8672         if (FAILED(rc))
    8673             throw rc;
     8671        if (FAILED(hrc))
     8672            throw hrc;
    86748673
    86758674        /* finally, set the state: no right to fail in this method afterwards
     
    86858684    catch (HRESULT aRC)
    86868685    {
    8687         rc = aRC;
    8688     }
    8689 
    8690     if (FAILED(rc) && fBeganPoweringUp)
     8686        hrc = aRC;
     8687    }
     8688
     8689    if (FAILED(hrc) && fBeganPoweringUp)
    86918690    {
    86928691
    86938692        /* The progress object will fetch the current error info */
    86948693        if (!pPowerupProgress.isNull())
    8695             pPowerupProgress->i_notifyComplete(rc);
     8694            pPowerupProgress->i_notifyComplete(hrc);
    86968695
    86978696        /* Save the error info across the IPC below. Can't be done before the
     
    87028701
    87038702        /* signal end of operation */
    8704         mControl->EndPowerUp(rc);
     8703        mControl->EndPowerUp(hrc);
    87058704    }
    87068705
     
    87118710    }
    87128711
    8713     LogFlowThisFunc(("mMachineState=%d, rc=%Rhrc\n", mMachineState, rc));
     8712    LogFlowThisFunc(("mMachineState=%d, hrc=%Rhrc\n", mMachineState, hrc));
    87148713    LogFlowThisFuncLeave();
    8715     return rc;
     8714    return hrc;
    87168715}
    87178716
     
    87618760    ULONG step = 0;
    87628761
    8763     HRESULT rc = S_OK;
     8762    HRESULT hrc = S_OK;
    87648763    int vrc = VINF_SUCCESS;
    87658764
     
    89928991            mpUVM = pUVM;
    89938992            pUVM = NULL;
    8994             rc = setErrorBoth(VBOX_E_VM_ERROR, vrc, tr("Could not destroy the machine. (Error: %Rrc)"), vrc);
     8993            hrc = setErrorBoth(VBOX_E_VM_ERROR, vrc, tr("Could not destroy the machine. (Error: %Rrc)"), vrc);
    89958994        }
    89968995
     
    90089007    }
    90099008    else
    9010         rc = setErrorBoth(VBOX_E_VM_ERROR, vrc, tr("Could not power off the machine. (Error: %Rrc)"), vrc);
     9009        hrc = setErrorBoth(VBOX_E_VM_ERROR, vrc, tr("Could not power off the machine. (Error: %Rrc)"), vrc);
    90119010
    90129011    /*
     
    90249023
    90259024    LogFlowThisFuncLeave();
    9026     return rc;
     9025    return hrc;
    90279026}
    90289027
     
    90379036    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    90389037
    9039     HRESULT rc = S_OK;
     9038    HRESULT hrc = S_OK;
    90409039
    90419040    if (mMachineState != aMachineState)
     
    90739072             */
    90749073            LogFlowThisFunc(("Doing mControl->UpdateState()...\n"));
    9075             rc = mControl->UpdateState(aMachineState);
    9076             LogFlowThisFunc(("mControl->UpdateState()=%Rhrc\n", rc));
    9077         }
    9078     }
    9079 
    9080     return rc;
     9074            hrc = mControl->UpdateState(aMachineState);
     9075            LogFlowThisFunc(("mControl->UpdateState()=%Rhrc\n", hrc));
     9076        }
     9077    }
     9078
     9079    return hrc;
    90819080}
    90829081
     
    91339132                     && m_pVMMDev->isShFlActive();
    91349133
    9135     HRESULT rc = S_OK;
     9134    HRESULT hrc = S_OK;
    91369135
    91379136    try
     
    91509149
    91519150            SafeIfaceArray<ISharedFolder> folders;
    9152             rc = mMachine->COMGETTER(SharedFolders)(ComSafeArrayAsOutParam(folders));
    9153             if (FAILED(rc)) throw rc;
     9151            hrc = mMachine->COMGETTER(SharedFolders)(ComSafeArrayAsOutParam(folders));
     9152            if (FAILED(hrc)) throw hrc;
    91549153
    91559154            for (size_t i = 0; i < folders.size(); ++i)
     
    91589157
    91599158                Bstr bstr;
    9160                 rc = pSharedFolder->COMGETTER(Name)(bstr.asOutParam());
    9161                 if (FAILED(rc)) throw rc;
     9159                hrc = pSharedFolder->COMGETTER(Name)(bstr.asOutParam());
     9160                if (FAILED(hrc)) throw hrc;
    91629161                Utf8Str strName(bstr);
    91639162
    9164                 rc = pSharedFolder->COMGETTER(HostPath)(bstr.asOutParam());
    9165                 if (FAILED(rc)) throw rc;
     9163                hrc = pSharedFolder->COMGETTER(HostPath)(bstr.asOutParam());
     9164                if (FAILED(hrc)) throw hrc;
    91669165                Utf8Str strHostPath(bstr);
    91679166
    91689167                BOOL writable;
    9169                 rc = pSharedFolder->COMGETTER(Writable)(&writable);
    9170                 if (FAILED(rc)) throw rc;
     9168                hrc = pSharedFolder->COMGETTER(Writable)(&writable);
     9169                if (FAILED(hrc)) throw hrc;
    91719170
    91729171                BOOL autoMount;
    9173                 rc = pSharedFolder->COMGETTER(AutoMount)(&autoMount);
    9174                 if (FAILED(rc)) throw rc;
    9175 
    9176                 rc = pSharedFolder->COMGETTER(AutoMountPoint)(bstr.asOutParam());
    9177                 if (FAILED(rc)) throw rc;
     9172                hrc = pSharedFolder->COMGETTER(AutoMount)(&autoMount);
     9173                if (FAILED(hrc)) throw hrc;
     9174
     9175                hrc = pSharedFolder->COMGETTER(AutoMountPoint)(bstr.asOutParam());
     9176                if (FAILED(hrc)) throw hrc;
    91789177                Utf8Str strAutoMountPoint(bstr);
    91799178
     
    92019200                               )
    92029201                            {
    9203                                 rc = i_removeSharedFolder(strName);
    9204                                 if (FAILED(rc)) throw rc;
     9202                                hrc = i_removeSharedFolder(strName);
     9203                                if (FAILED(hrc)) throw hrc;
    92059204                            }
    92069205
    92079206                            /* create the new machine folder */
    9208                             rc = i_createSharedFolder(strName,
    9209                                                       SharedFolderData(strHostPath, !!writable, !!autoMount, strAutoMountPoint));
    9210                             if (FAILED(rc)) throw rc;
     9207                            hrc = i_createSharedFolder(strName,
     9208                                                       SharedFolderData(strHostPath, !!writable, !!autoMount, strAutoMountPoint));
     9209                            if (FAILED(hrc)) throw hrc;
    92119210                        }
    92129211                    }
     
    92289227                    {
    92299228                        /* remove the outdated machine folder */
    9230                         rc = i_removeSharedFolder(it->first);
    9231                         if (FAILED(rc)) throw rc;
     9229                        hrc = i_removeSharedFolder(it->first);
     9230                        if (FAILED(hrc)) throw hrc;
    92329231
    92339232                        /* create the global folder if there is any */
     
    92369235                        if (git != m_mapGlobalSharedFolders.end())
    92379236                        {
    9238                             rc = i_createSharedFolder(git->first, git->second);
    9239                             if (FAILED(rc)) throw rc;
     9237                            hrc = i_createSharedFolder(git->first, git->second);
     9238                            if (FAILED(hrc)) throw hrc;
    92409239                        }
    92419240                    }
     
    92449243        }
    92459244    }
    9246     catch (HRESULT rc2)
    9247     {
    9248         rc = rc2;
     9245    catch (HRESULT hrc2)
     9246    {
     9247        hrc = hrc2;
    92499248        if (online)
    92509249            i_atVMRuntimeErrorCallbackF(0, "BrokenSharedFolder", N_("Broken shared folder!"));
     
    92539252    LogFlowThisFunc(("Leaving\n"));
    92549253
    9255     return rc;
     9254    return hrc;
    92569255}
    92579256
     
    96449643                 */
    96459644                ComPtr<IProgress> pProgress;
    9646                 HRESULT rc = that->mControl->BeginPoweringDown(pProgress.asOutParam());
    9647                 AssertComRC(rc);
     9645                HRESULT hrc = that->mControl->BeginPoweringDown(pProgress.asOutParam());
     9646                AssertComRC(hrc);
    96489647
    96499648                /* sync the state with the server */
     
    96649663                {
    96659664                    LogRelFunc(("E_OUTOFMEMORY creating VMPowerDownTask"));
    9666                     rc = E_OUTOFMEMORY;
     9665                    hrc = E_OUTOFMEMORY;
    96679666                    break;
    96689667                }
     
    96779676                if (pTask->isOk())
    96789677                {
    9679                     rc = pTask->createThread();
     9678                    hrc = pTask->createThread();
    96809679                    pTask = NULL;
    9681                     if (FAILED(rc))
     9680                    if (FAILED(hrc))
    96829681                        LogRelFunc(("Problem with creating thread for VMPowerDownTask.\n"));
    96839682                }
     
    96879686                    delete pTask;
    96889687                    pTask = NULL;
    9689                     rc = E_FAIL;
     9688                    hrc = E_FAIL;
    96909689                }
    96919690            }
     
    97169715            {
    97179716                ComPtr<IVirtualBox> pVirtualBox;
    9718                 HRESULT rc = that->mMachine->COMGETTER(Parent)(pVirtualBox.asOutParam());
    9719                 AssertComRC(rc);
    9720                 if (SUCCEEDED(rc) && !pVirtualBox.isNull())
     9717                HRESULT hrc = that->mMachine->COMGETTER(Parent)(pVirtualBox.asOutParam());
     9718                AssertComRC(hrc);
     9719                if (SUCCEEDED(hrc) && !pVirtualBox.isNull())
    97219720                    stopCloudGateway(pVirtualBox, that->mGateway);
    97229721            }
     
    1004410043    }
    1004510044
    10046     int rc = pVMMDev->hgcmHostCall("VBoxDragAndDropSvc", DragAndDropSvc::HOST_DND_FN_SET_MODE, 1 /* cParms */, &parm);
    10047     if (RT_FAILURE(rc))
    10048         LogRel(("Error changing drag and drop mode: %Rrc\n", rc));
    10049 
    10050     return rc;
     10045    int vrc = pVMMDev->hgcmHostCall("VBoxDragAndDropSvc", DragAndDropSvc::HOST_DND_FN_SET_MODE, 1 /* cParms */, &parm);
     10046    if (RT_FAILURE(vrc))
     10047        LogRel(("Error changing drag and drop mode: %Rrc\n", vrc));
     10048
     10049    return vrc;
    1005110050}
    1005210051
     
    1032810327# endif /* VBOX_STRICT */
    1032910328
    10330     HRESULT rc = S_OK;
    10331 
    1033210329    ULONG slot = 0;
    10333     rc = networkAdapter->COMGETTER(Slot)(&slot);
    10334     AssertComRC(rc);
     10330    HRESULT hrc = networkAdapter->COMGETTER(Slot)(&slot);
     10331    AssertComRCReturnRC(hrc);
    1033510332
    1033610333# ifdef RT_OS_LINUX
     
    1034910346        /* The name of the TAP interface we are using */
    1035010347        Bstr tapDeviceName;
    10351         rc = networkAdapter->COMGETTER(BridgedInterface)(tapDeviceName.asOutParam());
    10352         if (FAILED(rc))
     10348        hrc = networkAdapter->COMGETTER(BridgedInterface)(tapDeviceName.asOutParam());
     10349        if (FAILED(hrc))
    1035310350            tapDeviceName.setNull(); /* Is this necessary? */
    1035410351        if (tapDeviceName.isEmpty())
    1035510352        {
    1035610353            LogRel(("No TAP device name was supplied.\n"));
    10357             rc = setError(E_FAIL, tr("No TAP device name was supplied for the host networking interface"));
    10358         }
    10359 
    10360         if (SUCCEEDED(rc))
     10354            hrc = setError(E_FAIL, tr("No TAP device name was supplied for the host networking interface"));
     10355        }
     10356
     10357        if (SUCCEEDED(hrc))
    1036110358        {
    1036210359            /* If we are using a static TAP device then try to open it. */
     
    1036810365            {
    1036910366                LogRel(("Failed to open the host network interface %ls\n", tapDeviceName.raw()));
    10370                 rc = setErrorBoth(E_FAIL, vrc, tr("Failed to open the host network interface %ls"), tapDeviceName.raw());
     10367                hrc = setErrorBoth(E_FAIL, vrc, tr("Failed to open the host network interface %ls"), tapDeviceName.raw());
    1037110368            }
    1037210369        }
    10373         if (SUCCEEDED(rc))
     10370        if (SUCCEEDED(hrc))
    1037410371        {
    1037510372            /*
     
    1039310390                LogRel(("Configuration error: Failed to configure /dev/net/tun non blocking. Error: %s\n", strerror(iErr)));
    1039410391                vrc = VERR_HOSTIF_BLOCKING;
    10395                 rc = setErrorBoth(E_FAIL, vrc, tr("could not set up the host networking device for non blocking access: %s"),
    10396                                   strerror(errno));
     10392                hrc = setErrorBoth(E_FAIL, vrc, tr("could not set up the host networking device for non blocking access: %s"),
     10393                                   strerror(errno));
    1039710394            }
    1039810395        }
     
    1040010397    else
    1040110398    {
    10402         LogRel(("Configuration error: Failed to open /dev/net/tun rc=%Rrc\n", vrc));
     10399        LogRel(("Configuration error: Failed to open /dev/net/tun vrc=%Rrc\n", vrc));
    1040310400        switch (vrc)
    1040410401        {
    1040510402            case VERR_ACCESS_DENIED:
    1040610403                /* will be handled by our caller */
    10407                 rc = E_ACCESSDENIED;
     10404                hrc = E_ACCESSDENIED;
    1040810405                break;
    1040910406            default:
    10410                 rc = setErrorBoth(E_FAIL, vrc, tr("Could not set up the host networking device: %Rrc"), vrc);
     10407                hrc = setErrorBoth(E_FAIL, vrc, tr("Could not set up the host networking device: %Rrc"), vrc);
    1041110408                break;
    1041210409        }
     
    1041910416    /* The name of the TAP interface we are using */
    1042010417    Bstr tapDeviceName;
    10421     rc = networkAdapter->COMGETTER(BridgedInterface)(tapDeviceName.asOutParam());
    10422     if (FAILED(rc))
     10418    hrc = networkAdapter->COMGETTER(BridgedInterface)(tapDeviceName.asOutParam());
     10419    if (FAILED(hrc))
    1042310420        tapDeviceName.setNull(); /* Is this necessary? */
    1042410421    if (tapDeviceName.isEmpty())
    1042510422    {
    1042610423        LogRel(("No TAP device name was supplied.\n"));
    10427         rc = setError(E_FAIL, tr("No TAP device name was supplied for the host networking interface"));
     10424        hrc = setError(E_FAIL, tr("No TAP device name was supplied for the host networking interface"));
    1042810425    }
    1042910426    char szTapdev[1024] = "/dev/";
     
    1044610443            case VERR_ACCESS_DENIED:
    1044710444                /* will be handled by our caller */
    10448                 rc = E_ACCESSDENIED;
     10445                hrc = E_ACCESSDENIED;
    1044910446                break;
    1045010447            default:
    10451                 rc = setErrorBoth(E_FAIL, vrc, tr("Failed to open the host network interface %ls"), tapDeviceName.raw());
     10448                hrc = setErrorBoth(E_FAIL, vrc, tr("Failed to open the host network interface %ls"), tapDeviceName.raw());
    1045210449                break;
    1045310450        }
     
    1045710454# endif
    1045810455    /* in case of failure, cleanup. */
    10459     if (RT_FAILURE(vrc) && SUCCEEDED(rc))
     10456    if (RT_FAILURE(vrc) && SUCCEEDED(hrc))
    1046010457    {
    1046110458        LogRel(("General failure attaching to host interface\n"));
    10462         rc = setErrorBoth(E_FAIL, vrc, tr("General failure attaching to host interface"));
    10463     }
    10464     LogFlowThisFunc(("rc=%Rhrc\n", rc));
    10465     return rc;
     10459        hrc = setErrorBoth(E_FAIL, vrc, tr("General failure attaching to host interface"));
     10460    }
     10461    LogFlowThisFunc(("hrc=%Rhrc\n", hrc));
     10462    return hrc;
    1046610463}
    1046710464
     
    1048310480    AssertReturn(isWriteLockOnCurrentThread(), E_FAIL);
    1048410481
    10485     HRESULT rc = S_OK;
    1048610482# ifdef VBOX_STRICT
    1048710483    /* paranoia */
     
    1049210488
    1049310489    ULONG slot = 0;
    10494     rc = networkAdapter->COMGETTER(Slot)(&slot);
    10495     AssertComRC(rc);
     10490    HRESULT hrc = networkAdapter->COMGETTER(Slot)(&slot);
     10491    AssertComRCReturnRC(hrc);
    1049610492
    1049710493    /* is there an open TAP device? */
     
    1050310499        Bstr tapDeviceName, tapTerminateApplication;
    1050410500        bool isStatic = true;
    10505         rc = networkAdapter->COMGETTER(BridgedInterface)(tapDeviceName.asOutParam());
    10506         if (FAILED(rc) || tapDeviceName.isEmpty())
     10501        hrc = networkAdapter->COMGETTER(BridgedInterface)(tapDeviceName.asOutParam());
     10502        if (FAILED(hrc) || tapDeviceName.isEmpty())
    1050710503        {
    1050810504            /* If the name is empty, this is a dynamic TAP device, so close it now,
     
    1051010506               need the FD to pass to the termination script. */
    1051110507            isStatic = false;
    10512             int rcVBox = RTFileClose(maTapFD[slot]);
    10513             AssertRC(rcVBox);
     10508            int vrc = RTFileClose(maTapFD[slot]);
     10509            AssertRC(vrc);
    1051410510            maTapFD[slot] = NIL_RTFILE;
    1051510511        }
     
    1051810514            /* If we are using a static TAP device, we close it now, after having called the
    1051910515               termination script. */
    10520             int rcVBox = RTFileClose(maTapFD[slot]);
    10521             AssertRC(rcVBox);
     10516            int vrc = RTFileClose(maTapFD[slot]);
     10517            AssertRC(vrc);
    1052210518        }
    1052310519        /* the TAP device name and handle are no longer valid */
     
    1052510521        maTAPDeviceName[slot] = "";
    1052610522    }
    10527     LogFlowThisFunc(("returning %d\n", rc));
    10528     return rc;
     10523    LogFlowThisFunc(("returning %Rhrc\n", hrc));
     10524    return hrc;
    1052910525}
    1053010526
     
    1054610542     * host interface termination handling
    1054710543     */
    10548     HRESULT rc = S_OK;
    1054910544    ComPtr<IVirtualBox> pVirtualBox;
    1055010545    mMachine->COMGETTER(Parent)(pVirtualBox.asOutParam());
     
    1055810553        pSystemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);
    1055910554
     10555    HRESULT hrc = S_OK;
    1056010556    for (ULONG slot = 0; slot < maxNetworkAdapters; slot++)
    1056110557    {
    1056210558        ComPtr<INetworkAdapter> pNetworkAdapter;
    10563         rc = mMachine->GetNetworkAdapter(slot, pNetworkAdapter.asOutParam());
    10564         if (FAILED(rc)) break;
     10559        hrc = mMachine->GetNetworkAdapter(slot, pNetworkAdapter.asOutParam());
     10560        if (FAILED(hrc)) break;
    1056510561
    1056610562        BOOL enabled = FALSE;
     
    1057410570        {
    1057510571#if ((defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)) && !defined(VBOX_WITH_NETFLT))
    10576             HRESULT rc2 = i_detachFromTapInterface(pNetworkAdapter);
    10577             if (FAILED(rc2) && SUCCEEDED(rc))
    10578                 rc = rc2;
     10572            HRESULT hrc2 = i_detachFromTapInterface(pNetworkAdapter);
     10573            if (FAILED(hrc2) && SUCCEEDED(hrc))
     10574                hrc = hrc2;
    1057910575#endif /* (RT_OS_LINUX || RT_OS_FREEBSD) && !VBOX_WITH_NETFLT */
    1058010576        }
    1058110577    }
    1058210578
    10583     return rc;
     10579    return hrc;
    1058410580}
    1058510581
     
    1061810614 */
    1061910615/*static*/ DECLCALLBACK(void)
    10620 Console::i_genericVMSetErrorCallback(PUVM pUVM, void *pvUser, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list args)
     10616Console::i_genericVMSetErrorCallback(PUVM pUVM, void *pvUser, int vrc, RT_SRC_POS_DECL, const char *pszFormat, va_list args)
    1062110617{
    1062210618    RT_SRC_POS_NOREF();
     
    1063210628    {
    1063310629        if (pErrorText->length())
    10634             pErrorText->appendPrintf(".\n%N (%Rrc)", pszFormat, &va2, rc, rc);
     10630            pErrorText->appendPrintf(".\n%N (%Rrc)", pszFormat, &va2, vrc, vrc);
    1063510631        else
    10636             pErrorText->printf("%N (%Rrc)", pszFormat, &va2, rc, rc);
     10632            pErrorText->printf("%N (%Rrc)", pszFormat, &va2, vrc, vrc);
    1063710633    }
    1063810634    catch (std::bad_alloc &)
     
    1092510921    VirtualBoxBase::initializeComForThread();
    1092610922
    10927     HRESULT rc = S_OK;
     10923    HRESULT hrc = S_OK;
    1092810924    int vrc = VINF_SUCCESS;
    1092910925
     
    1096210958             it != pTask->hardDiskProgresses.end(); ++it)
    1096310959        {
    10964             HRESULT rc2 = (*it)->WaitForCompletion(-1);
    10965             AssertComRC(rc2);
    10966 
    10967             rc = pTask->mProgress->SetNextOperation(BstrFmt(tr("Disk Image Reset Operation - Immutable Image")).raw(), 1);
    10968             AssertComRCReturnVoid(rc);
     10960            HRESULT hrc2 = (*it)->WaitForCompletion(-1);
     10961            AssertComRC(hrc2);
     10962
     10963            hrc = pTask->mProgress->SetNextOperation(BstrFmt(tr("Disk Image Reset Operation - Immutable Image")).raw(), 1);
     10964            AssertComRCReturnVoid(hrc);
    1096910965        }
    1097010966
     
    1097910975        if (!pTask->mTeleporterEnabled)
    1098010976        {
    10981             rc = pConsole->mControl->LockMedia();
    10982             if (FAILED(rc)) throw rc;
     10977            hrc = pConsole->mControl->LockMedia();
     10978            if (FAILED(hrc)) throw hrc;
    1098310979        }
    1098410980
     
    1107311069                    {
    1107411070                        const SharedFolderData &d = it->second;
    11075                         rc = pConsole->i_createSharedFolder(it->first, d);
    11076                         if (FAILED(rc))
     11071                        hrc = pConsole->i_createSharedFolder(it->first, d);
     11072                        if (FAILED(hrc))
    1107711073                        {
    1107811074                            ErrorInfoKeeper eik;
     
    1108411080                        }
    1108511081                    }
    11086                     if (FAILED(rc))
    11087                         rc = S_OK;          // do not fail with broken shared folders
     11082                    if (FAILED(hrc))
     11083                        hrc = S_OK;          // do not fail with broken shared folders
    1108811084
    1108911085                    /* acquire the lock again */
     
    1109811094                {
    1109911095                    BOOL fVRDEEnabled = FALSE;
    11100                     rc = pConsole->i_getVRDEServer()->COMGETTER(Enabled)(&fVRDEEnabled);
    11101                     AssertComRCBreak(rc, RT_NOTHING);
     11096                    hrc = pConsole->i_getVRDEServer()->COMGETTER(Enabled)(&fVRDEEnabled);
     11097                    AssertComRCBreak(hrc, RT_NOTHING);
    1110211098
    1110311099                    if (   fVRDEEnabled
     
    1111911115                {
    1112011116                    ComPtr<IRecordingSettings> ptrRecordingSettings;
    11121                     rc = pConsole->mMachine->COMGETTER(RecordingSettings)(ptrRecordingSettings.asOutParam());
    11122                     AssertComRCBreak(rc, RT_NOTHING);
    11123 
    11124                     rc = ptrRecordingSettings->COMGETTER(Enabled)(&fRecordingEnabled);
    11125                     AssertComRCBreak(rc, RT_NOTHING);
     11117                    hrc = pConsole->mMachine->COMGETTER(RecordingSettings)(ptrRecordingSettings.asOutParam());
     11118                    AssertComRCBreak(hrc, RT_NOTHING);
     11119
     11120                    hrc = ptrRecordingSettings->COMGETTER(Enabled)(&fRecordingEnabled);
     11121                    AssertComRCBreak(hrc, RT_NOTHING);
    1112611122                }
    1112711123                if (fRecordingEnabled)
     
    1114411140                 * Capture USB devices.
    1114511141                 */
    11146                 rc = pConsole->i_captureUSBDevices(pConsole->mpUVM);
    11147                 if (FAILED(rc))
     11142                hrc = pConsole->i_captureUSBDevices(pConsole->mpUVM);
     11143                if (FAILED(hrc))
    1114811144                {
    1114911145                    alock.acquire();
     
    1121111207                    /* -> ConsoleImplTeleporter.cpp */
    1121211208                    bool fPowerOffOnFailure;
    11213                     rc = pConsole->i_teleporterTrg(pConsole->mpUVM, pConsole->mpVMM, pMachine, &pTask->mErrorMsg,
    11214                                                    pTask->mStartPaused, pTask->mProgress, &fPowerOffOnFailure);
    11215                     if (FAILED(rc) && fPowerOffOnFailure)
     11209                    hrc = pConsole->i_teleporterTrg(pConsole->mpUVM, pConsole->mpVMM, pMachine, &pTask->mErrorMsg,
     11210                                                    pTask->mStartPaused, pTask->mProgress, &fPowerOffOnFailure);
     11211                    if (FAILED(hrc) && fPowerOffOnFailure)
    1121611212                    {
    1121711213                        ErrorInfoKeeper eik;
     
    1124211238
    1124311239            /* On failure, destroy the VM */
    11244             if (FAILED(rc) || RT_FAILURE(vrc))
     11240            if (FAILED(hrc) || RT_FAILURE(vrc))
    1124511241            {
    1124611242                /* preserve existing error info */
     
    1125011246                 * cleanup (VRDP, USB devices) */
    1125111247                alock.release();
    11252                 HRESULT rc2 = pConsole->i_powerDown();
     11248                HRESULT hrc2 = pConsole->i_powerDown();
    1125311249                alock.acquire();
    11254                 AssertComRC(rc2);
     11250                AssertComRC(hrc2);
    1125511251            }
    1125611252            else
     
    1128211278        }
    1128311279
    11284         if (SUCCEEDED(rc) && RT_FAILURE(vrc))
     11280        if (SUCCEEDED(hrc) && RT_FAILURE(vrc))
    1128511281        {
    1128611282            /* If VMR3Create() or one of the other calls in this function fail,
    1128711283             * an appropriate error message has been set in pTask->mErrorMsg.
    11288              * However since that happens via a callback, the rc status code in
     11284             * However since that happens via a callback, the hrc status code in
    1128911285             * this function is not updated.
    1129011286             */
     
    1130511301        }
    1130611302    }
    11307     catch (HRESULT aRC) { rc = aRC; }
     11303    catch (HRESULT hrcXcpt) { hrc = hrcXcpt; }
    1130811304
    1130911305    if (   pConsole->mMachineState == MachineState_Starting
     
    1133711333    alock.release();
    1133811334
    11339     if (SUCCEEDED(rc))
     11335    if (SUCCEEDED(hrc))
    1134011336    {
    1134111337        /* Notify the progress object of the success */
     
    1134511341    {
    1134611342        /* The progress object will fetch the current error info */
    11347         pTask->mProgress->i_notifyComplete(rc);
    11348         LogRel(("Power up failed (vrc=%Rrc, rc=%Rhrc (%#08X))\n", vrc, rc, rc));
     11343        pTask->mProgress->i_notifyComplete(hrc);
     11344        LogRel(("Power up failed (vrc=%Rrc, hrc=%Rhrc (%#08X))\n", vrc, hrc, hrc));
    1134911345    }
    1135011346
    1135111347    /* Notify VBoxSVC and any waiting openRemoteSession progress object. */
    11352     pConsole->mControl->EndPowerUp(rc);
     11348    pConsole->mControl->EndPowerUp(hrc);
    1135311349
    1135411350#if defined(RT_OS_WINDOWS)
     
    1141411410
    1141511411    /* Update the device instance configuration. */
    11416     int rc = pThis->i_configMediumAttachment(pcszDevice,
    11417                                              uInstance,
    11418                                              enmBus,
    11419                                              fUseHostIOCache,
    11420                                              fBuiltinIOCache,
    11421                                              fInsertDiskIntegrityDrv,
    11422                                              fSetupMerge,
    11423                                              uMergeSource,
    11424                                              uMergeTarget,
    11425                                              aMediumAtt,
    11426                                              aMachineState,
    11427                                              phrc,
    11428                                              true /* fAttachDetach */,
    11429                                              false /* fForceUnmount */,
    11430                                              false /* fHotplug */,
    11431                                              pUVM,
    11432                                              pVMM,
    11433                                              NULL /* paLedDevType */,
    11434                                              NULL /* ppLunL0)*/);
    11435     if (RT_FAILURE(rc))
    11436     {
    11437         AssertMsgFailed(("rc=%Rrc\n", rc));
    11438         return rc;
     11412    int vrc = pThis->i_configMediumAttachment(pcszDevice,
     11413                                              uInstance,
     11414                                              enmBus,
     11415                                              fUseHostIOCache,
     11416                                              fBuiltinIOCache,
     11417                                              fInsertDiskIntegrityDrv,
     11418                                              fSetupMerge,
     11419                                              uMergeSource,
     11420                                              uMergeTarget,
     11421                                              aMediumAtt,
     11422                                              aMachineState,
     11423                                              phrc,
     11424                                              true /* fAttachDetach */,
     11425                                              false /* fForceUnmount */,
     11426                                              false /* fHotplug */,
     11427                                              pUVM,
     11428                                              pVMM,
     11429                                              NULL /* paLedDevType */,
     11430                                              NULL /* ppLunL0)*/);
     11431    if (RT_FAILURE(vrc))
     11432    {
     11433        AssertMsgFailed(("vrc=%Rrc\n", vrc));
     11434        return vrc;
    1143911435    }
    1144011436
     
    1145511451void Console::i_powerDownThreadTask(VMPowerDownTask *pTask)
    1145611452{
    11457     int rc = VINF_SUCCESS; /* only used in assertion */
     11453    int vrc = VINF_SUCCESS; /* only used in assertion */
    1145811454    LogFlowFuncEnter();
    1145911455    try
    1146011456    {
    1146111457        if (pTask->isOk() == false)
    11462             rc = VERR_GENERAL_FAILURE;
     11458            vrc = VERR_GENERAL_FAILURE;
    1146311459
    1146411460        const ComObjPtr<Console> &that = pTask->mConsole;
     
    1148311479    catch (const std::exception &e)
    1148411480    {
    11485         AssertMsgFailed(("Exception %s was caught, rc=%Rrc\n", e.what(), rc));
    11486         NOREF(e); NOREF(rc);
     11481        AssertMsgFailed(("Exception %s was caught, vrc=%Rrc\n", e.what(), vrc));
     11482        NOREF(e); NOREF(vrc);
    1148711483    }
    1148811484
     
    1165411650    SecretKey *pKey = NULL;
    1165511651
    11656     int rc = pConsole->m_pKeyStore->retainSecretKey(Utf8Str(pszId), &pKey);
    11657     if (RT_SUCCESS(rc))
     11652    int vrc = pConsole->m_pKeyStore->retainSecretKey(Utf8Str(pszId), &pKey);
     11653    if (RT_SUCCESS(vrc))
    1165811654    {
    1165911655        *ppbKey = (const uint8_t *)pKey->getKeyBuffer();
     
    1166111657    }
    1166211658
    11663     return rc;
     11659    return vrc;
    1166411660}
    1166511661
     
    1168711683    SecretKey *pKey = NULL;
    1168811684
    11689     int rc = pConsole->m_pKeyStore->retainSecretKey(Utf8Str(pszId), &pKey);
    11690     if (RT_SUCCESS(rc))
     11685    int vrc = pConsole->m_pKeyStore->retainSecretKey(Utf8Str(pszId), &pKey);
     11686    if (RT_SUCCESS(vrc))
    1169111687        *ppszPassword = (const char *)pKey->getKeyBuffer();
    1169211688
    11693     return rc;
     11689    return vrc;
    1169411690}
    1169511691
     
    1177511771         */
    1177611772        PPDMLED pLed;
    11777         int rc = pThis->pLedPorts->pfnQueryStatusLed(pThis->pLedPorts, iLUN, &pLed);
    11778         if (RT_FAILURE(rc))
     11773        int vrc = pThis->pLedPorts->pfnQueryStatusLed(pThis->pLedPorts, iLUN, &pLed);
     11774        if (RT_FAILURE(vrc))
    1177911775            pLed = NULL;
    1178011776
     
    1182411820        {
    1182511821            IMedium *pMedium = NULL;
    11826             HRESULT rc = pMediumAtt->COMGETTER(Medium)(&pMedium);
    11827             AssertComRC(rc);
    11828             if (SUCCEEDED(rc) && pMedium)
     11822            HRESULT hrc = pMediumAtt->COMGETTER(Medium)(&pMedium);
     11823            AssertComRC(hrc);
     11824            if (SUCCEEDED(hrc) && pMedium)
    1182911825            {
    1183011826                BOOL fHostDrive = FALSE;
    11831                 rc = pMedium->COMGETTER(HostDrive)(&fHostDrive);
    11832                 AssertComRC(rc);
     11827                hrc = pMedium->COMGETTER(HostDrive)(&fHostDrive);
     11828                AssertComRC(hrc);
    1183311829                if (!fHostDrive)
    1183411830                {
     
    1183611832
    1183711833                    ComPtr<IMediumAttachment> pNewMediumAtt;
    11838                     rc = pThis->pConsole->mControl->EjectMedium(pMediumAtt, pNewMediumAtt.asOutParam());
    11839                     if (SUCCEEDED(rc))
     11834                    hrc = pThis->pConsole->mControl->EjectMedium(pMediumAtt, pNewMediumAtt.asOutParam());
     11835                    if (SUCCEEDED(hrc))
    1184011836                    {
    1184111837                        pThis->pConsole->mMachine->SaveSettings();
     
    1194211938
    1194311939    uint32_t iLedSet;
    11944     int rc = pHlp->pfnCFGMQueryU32(pCfg, "iLedSet", &iLedSet);
    11945     AssertLogRelMsgRCReturn(rc, ("Configuration error: Failed to query the \"iLedSet\" value! rc=%Rrc\n", rc), rc);
     11940    int vrc = pHlp->pfnCFGMQueryU32(pCfg, "iLedSet", &iLedSet);
     11941    AssertLogRelMsgRCReturn(vrc, ("Configuration error: Failed to query the \"iLedSet\" value! vrc=%Rrc\n", vrc), vrc);
    1194611942    pThis->papLeds = pConsole->i_getLedSet(iLedSet);
    1194711943
    11948     rc = pHlp->pfnCFGMQueryBoolDef(pCfg, "HasMediumAttachments", &pThis->fHasMediumAttachments, false);
    11949     AssertLogRelMsgRCReturn(rc, ("Configuration error: Failed to query the \"HasMediumAttachments\" value! rc=%Rrc\n", rc), rc);
     11944    vrc = pHlp->pfnCFGMQueryBoolDef(pCfg, "HasMediumAttachments", &pThis->fHasMediumAttachments, false);
     11945    AssertLogRelMsgRCReturn(vrc, ("Configuration error: Failed to query the \"HasMediumAttachments\" value! vrc=%Rrc\n", vrc), vrc);
    1195011946
    1195111947    if (pThis->fHasMediumAttachments)
    1195211948    {
    11953         rc = pHlp->pfnCFGMQueryStringAlloc(pCfg, "DeviceInstance", &pThis->pszDeviceInstance);
    11954         AssertLogRelMsgRCReturn(rc, ("Configuration error: Failed to query the \"DeviceInstance\" value! rc=%Rrc\n", rc), rc);
    11955     }
    11956 
    11957     rc = pHlp->pfnCFGMQueryU32Def(pCfg, "First", &pThis->iFirstLUN, 0);
    11958     AssertLogRelMsgRCReturn(rc, ("Configuration error: Failed to query the \"First\" value! rc=%Rrc\n", rc), rc);
    11959 
    11960     rc = pHlp->pfnCFGMQueryU32Def(pCfg, "Last", &pThis->iLastLUN, 0);
    11961     AssertLogRelMsgRCReturn(rc, ("Configuration error: Failed to query the \"Last\" value! rc=%Rrc\n", rc), rc);
     11949        vrc = pHlp->pfnCFGMQueryStringAlloc(pCfg, "DeviceInstance", &pThis->pszDeviceInstance);
     11950        AssertLogRelMsgRCReturn(vrc, ("Configuration error: Failed to query the \"DeviceInstance\" value! vrc=%Rrc\n", vrc), vrc);
     11951    }
     11952
     11953    vrc = pHlp->pfnCFGMQueryU32Def(pCfg, "First", &pThis->iFirstLUN, 0);
     11954    AssertLogRelMsgRCReturn(vrc, ("Configuration error: Failed to query the \"First\" value! vrc=%Rrc\n", vrc), vrc);
     11955
     11956    vrc = pHlp->pfnCFGMQueryU32Def(pCfg, "Last", &pThis->iLastLUN, 0);
     11957    AssertLogRelMsgRCReturn(vrc, ("Configuration error: Failed to query the \"Last\" value! vrc=%Rrc\n", vrc), vrc);
    1196211958
    1196311959    AssertLogRelMsgReturn(pThis->iFirstLUN <= pThis->iLastLUN,
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