VirtualBox

Changeset 98289 in vbox for trunk/src


Ignore:
Timestamp:
Jan 24, 2023 4:02:15 PM (2 years ago)
Author:
vboxsync
Message:

Main/src-server: rc -> hrc/vrc (partial). bugref:10223

Location:
trunk/src/VBox/Main/src-server
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/ApplianceImpl.cpp

    r98288 r98289  
    713713        hrc = explorer->init(li.storageType, li.strPath, li.strHostname, li.strUsername, li.strPassword, mVirtualBox);
    714714    }
    715     catch (HRESULT aRC)
    716     {
    717         hrc = aRC;
     715    catch (HRESULT hrcXcpt)
     716    {
     717        hrc = hrcXcpt;
    718718    }
    719719
     
    767767        *aCreated = i;
    768768    }
    769     catch (HRESULT aRC)
     769    catch (HRESULT hrcXcpt)
    770770    {
    771771        for (; i>0; --i)
     
    776776                break;
    777777        }
    778         hrc = aRC;
     778        hrc = hrcXcpt;
    779779    }
    780780
  • trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp

    r98288 r98289  
    726726            hrc = i_writeCloudImpl(m->locInfo, progress);
    727727        }
    728         catch (HRESULT aRC)
    729         {
    730             hrc = aRC;
     728        catch (HRESULT hrcXcpt)
     729        {
     730            hrc = hrcXcpt;
    731731        }
    732732
     
    816816
    817817        }
    818         catch (HRESULT aRC)
    819         {
    820             hrc = aRC;
     818        catch (HRESULT hrcXcpt)
     819        {
     820            hrc = hrcXcpt;
    821821        }
    822822
     
    28162816        hrc = setError(VBOX_E_FILE_ERROR, x.what());
    28172817    }
    2818     catch (HRESULT aRC)
    2819     {
    2820         hrc = aRC;
     2818    catch (HRESULT hrcXcpt)
     2819    {
     2820        hrc = hrcXcpt;
    28212821    }
    28222822
  • trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp

    r98288 r98289  
    106106        i_parseURI(aFile, m->locInfo); /* may throw hrc. */
    107107    }
    108     catch (HRESULT aRC)
    109     {
    110         return aRC;
     108    catch (HRESULT hrcXcpt)
     109    {
     110        return hrcXcpt;
    111111    }
    112112    catch (std::bad_alloc &)
     
    795795        }
    796796    }
    797     catch (HRESULT aRC)
     797    catch (HRESULT hrcXcpt)
    798798    {
    799799        /* On error we clear the list & return */
    800800        m->virtualSystemDescriptions.clear();
    801         hrc = aRC;
     801        hrc = hrcXcpt;
    802802    }
    803803
     
    25722572        hrc = setError(VBOX_E_FILE_ERROR, rXcpt.what());
    25732573    }
    2574     catch (HRESULT aRC)
    2575     {
    2576         hrc = aRC;
     2574    catch (HRESULT hrcXcpt)
     2575    {
     2576        hrc = hrcXcpt;
    25772577    }
    25782578    catch (...)
     
    48654865            stack.fSessionOpen = false;
    48664866        }
    4867         catch(HRESULT aRC)
     4867        catch (HRESULT hrcXcpt)
    48684868        {
    48694869            com::ErrorInfo info;
     
    48734873
    48744874            if (info.isFullAvailable())
    4875                 throw setError(aRC, Utf8Str(info.getText()).c_str());
     4875                throw setError(hrcXcpt, Utf8Str(info.getText()).c_str());
    48764876            else
    4877                 throw setError(aRC, tr("Unknown error during OVF import"));
     4877                throw setError(hrcXcpt, tr("Unknown error during OVF import"));
    48784878        }
    48794879    }
     
    52175217            stack.fSessionOpen = false;
    52185218        }
    5219         catch(HRESULT aRC)
     5219        catch (HRESULT hrcXcpt)
    52205220        {
    52215221            com::ErrorInfo info;
     
    52245224
    52255225            if (info.isFullAvailable())
    5226                 throw setError(aRC, Utf8Str(info.getText()).c_str());
     5226                throw setError(hrcXcpt, Utf8Str(info.getText()).c_str());
    52275227            else
    5228                 throw setError(aRC, tr("Unknown error during OVF import"));
     5228                throw setError(hrcXcpt, tr("Unknown error during OVF import"));
    52295229        }
    52305230    }
  • trunk/src/VBox/Main/src-server/MachineImplMoveVM.cpp

    r98262 r98289  
    5050    HRESULT add(const Utf8Str &folder, const Utf8Str &file)
    5151    {
    52         HRESULT rc = S_OK;
    5352        m_list.insert(std::make_pair(folder, file));
    54         return rc;
     53        return S_OK;
    5554    }
    5655
    5756    HRESULT add(const Utf8Str &fullPath)
    5857    {
    59         HRESULT rc = S_OK;
    6058        Utf8Str folder = fullPath;
    6159        folder.stripFilename();
     
    6361        filename.stripPath();
    6462        m_list.insert(std::make_pair(folder, filename));
    65         return rc;
     63        return S_OK;
    6664    }
    6765
    6866    HRESULT removeFileFromList(const Utf8Str &fullPath)
    6967    {
    70         HRESULT rc = S_OK;
    7168        Utf8Str folder = fullPath;
    7269        folder.stripFilename();
     
    8683        }
    8784
    88         return rc;
     85        return S_OK;
    8986    }
    9087
    9188    HRESULT removeFileFromList(const Utf8Str &path, const Utf8Str &fileName)
    9289    {
    93         HRESULT rc = S_OK;
    9490        rangeRes_t res = m_list.equal_range(path);
    9591        for (it_t it=res.first; it!=res.second;)
     
    104100                ++it;
    105101        }
    106         return rc;
     102        return S_OK;
    107103    }
    108104
    109105    HRESULT removeFolderFromList(const Utf8Str &path)
    110106    {
    111         HRESULT rc = S_OK;
    112107        m_list.erase(path);
    113         return rc;
     108        return S_OK;
    114109    }
    115110
     
    590585
    591586    BOOL fCanceled = false;
    592     HRESULT rc = pProgress->COMGETTER(Canceled)(&fCanceled);
    593     if (FAILED(rc)) return VERR_GENERAL_FAILURE;
     587    HRESULT hrc = pProgress->COMGETTER(Canceled)(&fCanceled);
     588    if (FAILED(hrc)) return VERR_GENERAL_FAILURE;
    594589    /* If canceled by the user tell it to the copy operation. */
    595590    if (fCanceled) return VERR_CANCELLED;
    596591    /* Set the new process. */
    597     rc = pProgress->SetCurrentOperationProgress(uPercentage);
    598     if (FAILED(rc)) return VERR_GENERAL_FAILURE;
     592    hrc = pProgress->SetCurrentOperationProgress(uPercentage);
     593    if (FAILED(hrc)) return VERR_GENERAL_FAILURE;
    599594
    600595    return VINF_SUCCESS;
     
    11411136                                    const Utf8Str &strTargetFolder)
    11421137{
    1143     HRESULT rc = S_OK;
     1138    HRESULT hrc = S_OK;
    11441139    ComObjPtr<Machine> &machine = m_pMachine;
    11451140    Utf8Str strLocation;
     
    11581153            Bstr bstrSrcName;
    11591154
    1160             rc = pMedium->COMGETTER(Name)(bstrSrcName.asOutParam());
    1161             if (FAILED(rc)) throw rc;
     1155            hrc = pMedium->COMGETTER(Name)(bstrSrcName.asOutParam());
     1156            if (FAILED(hrc)) throw hrc;
    11621157
    11631158            if (strTargetFolder.isNotEmpty())
    11641159            {
    11651160                strTargetImageName = strTargetFolder;
    1166                 rc = pMedium->COMGETTER(Location)(bstrLocation.asOutParam());
    1167                 if (FAILED(rc)) throw rc;
     1161                hrc = pMedium->COMGETTER(Location)(bstrLocation.asOutParam());
     1162                if (FAILED(hrc)) throw hrc;
    11681163                strLocation = bstrLocation;
    11691164
     
    11741169
    11751170                strTargetImageName.append(RTPATH_DELIMITER).append(strLocation);
    1176                 rc = m_pProgress->SetNextOperation(BstrFmt(tr("Moving medium '%ls' ..."),
    1177                                                            bstrSrcName.raw()).raw(),
    1178                                                    mt.uWeight);
    1179                 if (FAILED(rc)) throw rc;
     1171                hrc = m_pProgress->SetNextOperation(BstrFmt(tr("Moving medium '%ls' ..."), bstrSrcName.raw()).raw(), mt.uWeight);
     1172                if (FAILED(hrc)) throw hrc;
    11801173            }
    11811174            else
    11821175            {
    11831176                strTargetImageName = mt.strBaseName;//Should contain full path to the image
    1184                 rc = m_pProgress->SetNextOperation(BstrFmt(tr("Moving medium '%ls' back..."),
    1185                                                            bstrSrcName.raw()).raw(),
    1186                                                    mt.uWeight);
    1187                 if (FAILED(rc)) throw rc;
     1177                hrc = m_pProgress->SetNextOperation(BstrFmt(tr("Moving medium '%ls' back..."), bstrSrcName.raw()).raw(), mt.uWeight);
     1178                if (FAILED(hrc)) throw hrc;
    11881179            }
    11891180
     
    11961187
    11971188            MediumType_T mediumType;//immutable, shared, passthrough
    1198             rc = pMedium->COMGETTER(Type)(&mediumType);
    1199             if (FAILED(rc)) throw rc;
     1189            hrc = pMedium->COMGETTER(Type)(&mediumType);
     1190            if (FAILED(hrc)) throw hrc;
    12001191
    12011192            DeviceType_T deviceType;//floppy, hard, DVD
    1202             rc = pMedium->COMGETTER(DeviceType)(&deviceType);
    1203             if (FAILED(rc)) throw rc;
     1193            hrc = pMedium->COMGETTER(DeviceType)(&deviceType);
     1194            if (FAILED(hrc)) throw hrc;
    12041195
    12051196            /* Drop lock early because IMedium::MoveTo needs to get the VirtualBox one. */
     
    12071198
    12081199            ComPtr<IProgress> moveDiskProgress;
    1209             rc = pMedium->MoveTo(bstrLocation.raw(), moveDiskProgress.asOutParam());
    1210             if (SUCCEEDED(rc))
     1200            hrc = pMedium->MoveTo(bstrLocation.raw(), moveDiskProgress.asOutParam());
     1201            if (SUCCEEDED(hrc))
    12111202            {
    12121203                /* In case of failure moveDiskProgress would be in the invalid state or not initialized at all
     
    12141205                 */
    12151206                /* Wait until the other process has finished. */
    1216                 rc = m_pProgress->WaitForOtherProgressCompletion(moveDiskProgress, 0 /* indefinite wait */);
     1207                hrc = m_pProgress->WaitForOtherProgressCompletion(moveDiskProgress, 0 /* indefinite wait */);
    12171208            }
    12181209
     
    12201211            machineLock.acquire();
    12211212
    1222             if (FAILED(rc)) throw rc;
     1213            if (FAILED(hrc)) throw hrc;
    12231214
    12241215            Log2(("Moving %s has been finished\n", strTargetImageName.c_str()));
     
    12291220        machineLock.release();
    12301221    }
    1231     catch(HRESULT hrc)
     1222    catch (HRESULT hrcXcpt)
     1223    {
     1224        Log2(("Exception during moving the disk %s: %Rhrc\n", strLocation.c_str(), hrcXcpt));
     1225        hrc = hrcXcpt;
     1226        machineLock.release();
     1227    }
     1228    catch (...)
    12321229    {
    12331230        Log2(("Exception during moving the disk %s\n", strLocation.c_str()));
    1234         rc = hrc;
     1231        hrc = VirtualBoxBase::handleUnexpectedExceptions(m_pMachine, RT_SRC_POS);
    12351232        machineLock.release();
    12361233    }
    1237     catch (...)
    1238     {
    1239         Log2(("Exception during moving the disk %s\n", strLocation.c_str()));
    1240         rc = VirtualBoxBase::handleUnexpectedExceptions(m_pMachine, RT_SRC_POS);
    1241         machineLock.release();
    1242     }
    1243 
    1244     return rc;
     1234
     1235    return hrc;
    12451236}
    12461237
     
    12481239{
    12491240    ComObjPtr<Snapshot> pSnapshot;
    1250     HRESULT rc = m_pMachine->i_findSnapshotById(Guid() /* zero */, pSnapshot, true);
    1251     if (SUCCEEDED(rc) && !pSnapshot.isNull())
     1241    HRESULT hrc = m_pMachine->i_findSnapshotById(Guid() /* zero */, pSnapshot, true);
     1242    if (SUCCEEDED(hrc) && !pSnapshot.isNull())
    12521243        pSnapshot->i_updateSavedStatePaths(sourcePath.c_str(),
    12531244                                           targetPath.c_str());
     
    12691260{
    12701261    ComObjPtr<Snapshot> pSnapshot;
    1271     HRESULT rc = m_pMachine->i_findSnapshotById(Guid() /* zero */, pSnapshot, true);
    1272     if (SUCCEEDED(rc) && !pSnapshot.isNull())
     1262    HRESULT hrc = m_pMachine->i_findSnapshotById(Guid() /* zero */, pSnapshot, true);
     1263    if (SUCCEEDED(hrc) && !pSnapshot.isNull())
    12731264        pSnapshot->i_updateNVRAMPaths(sourcePath.c_str(),
    12741265                                      targetPath.c_str());
     
    14131404{
    14141405    ComPtr<IMedium> pBaseMedium;
    1415     HRESULT rc = pMedium->COMGETTER(Base)(pBaseMedium.asOutParam());
    1416     if (FAILED(rc)) return rc;
     1406    HRESULT hrc = pMedium->COMGETTER(Base)(pBaseMedium.asOutParam());
     1407    if (FAILED(hrc)) return hrc;
    14171408    Bstr bstrBaseName;
    1418     rc = pBaseMedium->COMGETTER(Name)(bstrBaseName.asOutParam());
    1419     if (FAILED(rc)) return rc;
     1409    hrc = pBaseMedium->COMGETTER(Name)(bstrBaseName.asOutParam());
     1410    if (FAILED(hrc)) return hrc;
    14201411    strBaseName = bstrBaseName;
    1421     return rc;
     1412    return hrc;
    14221413}
    14231414
     
    14251416{
    14261417    Bstr name;
    1427     HRESULT rc = pSnapshot->COMGETTER(Name)(name.asOutParam());
    1428     if (FAILED(rc)) return rc;
     1418    HRESULT hrc = pSnapshot->COMGETTER(Name)(name.asOutParam());
     1419    if (FAILED(hrc)) return hrc;
    14291420
    14301421    ComPtr<IMachine> l_pMachine;
    1431     rc = pSnapshot->COMGETTER(Machine)(l_pMachine.asOutParam());
    1432     if (FAILED(rc)) return rc;
     1422    hrc = pSnapshot->COMGETTER(Machine)(l_pMachine.asOutParam());
     1423    if (FAILED(hrc)) return hrc;
    14331424    machineList.push_back((Machine*)(IMachine*)l_pMachine);
    14341425
    14351426    SafeIfaceArray<ISnapshot> sfaChilds;
    1436     rc = pSnapshot->COMGETTER(Children)(ComSafeArrayAsOutParam(sfaChilds));
    1437     if (FAILED(rc)) return rc;
     1427    hrc = pSnapshot->COMGETTER(Children)(ComSafeArrayAsOutParam(sfaChilds));
     1428    if (FAILED(hrc)) return hrc;
    14381429    for (size_t i = 0; i < sfaChilds.size(); ++i)
    14391430    {
    1440         rc = createMachineList(sfaChilds[i]);
    1441         if (FAILED(rc)) return rc;
    1442     }
    1443 
    1444     return rc;
     1431        hrc = createMachineList(sfaChilds[i]);
     1432        if (FAILED(hrc)) return hrc;
     1433    }
     1434
     1435    return hrc;
    14451436}
    14461437
     
    14501441     * adding all directly and indirectly attached disk images to the worker
    14511442     * list. */
    1452     HRESULT rc = S_OK;
     1443    HRESULT hrc = S_OK;
    14531444    for (size_t i = 0; i < machineList.size(); ++i)
    14541445    {
     
    14581449         * machines to a worker list. */
    14591450        SafeIfaceArray<IMediumAttachment> sfaAttachments;
    1460         rc = machine->COMGETTER(MediumAttachments)(ComSafeArrayAsOutParam(sfaAttachments));
    1461         if (FAILED(rc)) return rc;
     1451        hrc = machine->COMGETTER(MediumAttachments)(ComSafeArrayAsOutParam(sfaAttachments));
     1452        if (FAILED(hrc)) return hrc;
    14621453        for (size_t a = 0; a < sfaAttachments.size(); ++a)
    14631454        {
    14641455            const ComPtr<IMediumAttachment> &pAtt = sfaAttachments[a];
    14651456            DeviceType_T deviceType;//floppy, hard, DVD
    1466             rc = pAtt->COMGETTER(Type)(&deviceType);
    1467             if (FAILED(rc)) return rc;
     1457            hrc = pAtt->COMGETTER(Type)(&deviceType);
     1458            if (FAILED(hrc)) return hrc;
    14681459
    14691460            /* Valid medium attached? */
    14701461            ComPtr<IMedium> pMedium;
    1471             rc = pAtt->COMGETTER(Medium)(pMedium.asOutParam());
    1472             if (FAILED(rc)) return rc;
     1462            hrc = pAtt->COMGETTER(Medium)(pMedium.asOutParam());
     1463            if (FAILED(hrc)) return hrc;
    14731464
    14741465            if (pMedium.isNull())
     
    14761467
    14771468            Bstr bstrLocation;
    1478             rc = pMedium->COMGETTER(Location)(bstrLocation.asOutParam());
    1479             if (FAILED(rc)) return rc;
     1469            hrc = pMedium->COMGETTER(Location)(bstrLocation.asOutParam());
     1470            if (FAILED(hrc)) return hrc;
    14801471
    14811472            /* Cast to ComObjPtr<Medium> */
     
    14831474
    14841475            /* Check for "read-only" medium in terms that VBox can't create this one */
    1485             rc = isMediumTypeSupportedForMoving(pMedium);
    1486             if (FAILED(rc))
    1487             {
    1488                 if (rc == S_FALSE)
    1489                 {
    1490                     Log2(("Skipping file %ls because of this medium type hasn't been supported for moving.\n",
    1491                           bstrLocation.raw()));
    1492                     continue;
    1493                 }
    1494                 else
    1495                     return rc;
     1476            hrc = isMediumTypeSupportedForMoving(pMedium);
     1477            if (FAILED(hrc))
     1478            {
     1479                if (hrc != S_FALSE)
     1480                    return hrc;
     1481                Log2(("Skipping file %ls because of this medium type hasn't been supported for moving.\n", bstrLocation.raw()));
     1482                continue;
    14961483            }
    14971484
     
    15051492                /* Refresh the state so that the file size get read. */
    15061493                MediumState_T e;
    1507                 rc = pMedium->RefreshState(&e);
    1508                 if (FAILED(rc)) return rc;
     1494                hrc = pMedium->RefreshState(&e);
     1495                if (FAILED(hrc)) return hrc;
    15091496
    15101497                LONG64 lSize;
    1511                 rc = pMedium->COMGETTER(Size)(&lSize);
    1512                 if (FAILED(rc)) return rc;
     1498                hrc = pMedium->COMGETTER(Size)(&lSize);
     1499                if (FAILED(hrc)) return hrc;
    15131500
    15141501                MediumType_T mediumType;//immutable, shared, passthrough
    1515                 rc = pMedium->COMGETTER(Type)(&mediumType);
    1516                 if (FAILED(rc)) return rc;
    1517 
    1518                 rc = pMedium->COMGETTER(Location)(bstrLocation.asOutParam());
    1519                 if (FAILED(rc)) return rc;
     1502                hrc = pMedium->COMGETTER(Type)(&mediumType);
     1503                if (FAILED(hrc)) return hrc;
     1504
     1505                hrc = pMedium->COMGETTER(Location)(bstrLocation.asOutParam());
     1506                if (FAILED(hrc)) return hrc;
    15201507
    15211508                MEDIUMTASKMOVE mt;// = {false, "basename", NULL, 0, 0};
     
    15341521
    15351522                /* Query next parent. */
    1536                 rc = pMedium->COMGETTER(Parent)(pMedium.asOutParam());
    1537                 if (FAILED(rc)) return rc;
     1523                hrc = pMedium->COMGETTER(Parent)(pMedium.asOutParam());
     1524                if (FAILED(hrc)) return hrc;
    15381525            }
    15391526
     
    15421529
    15431530        /* Add the save state files of this machine if there is one. */
    1544         rc = addSaveState(machine);
    1545         if (FAILED(rc)) return rc;
     1531        hrc = addSaveState(machine);
     1532        if (FAILED(hrc)) return hrc;
    15461533
    15471534        /* Add the NVRAM files of this machine if there is one. */
    1548         rc = addNVRAM(machine);
    1549         if (FAILED(rc)) return rc;
     1535        hrc = addNVRAM(machine);
     1536        if (FAILED(hrc)) return hrc;
    15501537    }
    15511538
     
    15611548    }
    15621549
    1563     return rc;
     1550    return hrc;
    15641551}
    15651552
     
    15671554{
    15681555    Bstr bstrSrcSaveStatePath;
    1569     HRESULT rc = machine->COMGETTER(StateFilePath)(bstrSrcSaveStatePath.asOutParam());
    1570     if (FAILED(rc)) return rc;
     1556    HRESULT hrc = machine->COMGETTER(StateFilePath)(bstrSrcSaveStatePath.asOutParam());
     1557    if (FAILED(hrc)) return hrc;
    15711558    if (!bstrSrcSaveStatePath.isEmpty())
    15721559    {
     
    15951582{
    15961583    ComPtr<INvramStore> pNvramStore;
    1597     HRESULT rc = machine->COMGETTER(NonVolatileStore)(pNvramStore.asOutParam());
    1598     if (FAILED(rc)) return rc;
     1584    HRESULT hrc = machine->COMGETTER(NonVolatileStore)(pNvramStore.asOutParam());
     1585    if (FAILED(hrc)) return hrc;
    15991586    Bstr bstrSrcNVRAMPath;
    1600     rc = pNvramStore->COMGETTER(NonVolatileStorageFile)(bstrSrcNVRAMPath.asOutParam());
    1601     if (FAILED(rc)) return rc;
     1587    hrc = pNvramStore->COMGETTER(NonVolatileStorageFile)(bstrSrcNVRAMPath.asOutParam());
     1588    if (FAILED(hrc)) return hrc;
    16021589    Utf8Str strSrcNVRAMPath(bstrSrcNVRAMPath);
    16031590    if (!strSrcNVRAMPath.isEmpty() && RTFileExists(strSrcNVRAMPath.c_str()))
     
    16521639{
    16531640    Bstr bstrLocation;
    1654     HRESULT rc = pMedium->COMGETTER(Location)(bstrLocation.asOutParam());
    1655     if (FAILED(rc))
    1656         return rc;
     1641    HRESULT hrc = pMedium->COMGETTER(Location)(bstrLocation.asOutParam());
     1642    if (FAILED(hrc))
     1643        return hrc;
    16571644
    16581645    DeviceType_T deviceType;
    1659     rc = pMedium->COMGETTER(DeviceType)(&deviceType);
    1660     if (FAILED(rc))
    1661         return rc;
     1646    hrc = pMedium->COMGETTER(DeviceType)(&deviceType);
     1647    if (FAILED(hrc))
     1648        return hrc;
    16621649
    16631650    ComPtr<IMediumFormat> mediumFormat;
    1664     rc = pMedium->COMGETTER(MediumFormat)(mediumFormat.asOutParam());
    1665     if (FAILED(rc))
    1666         return rc;
     1651    hrc = pMedium->COMGETTER(MediumFormat)(mediumFormat.asOutParam());
     1652    if (FAILED(hrc))
     1653        return hrc;
    16671654
    16681655    /* Check whether VBox is able to create this medium format or not, i.e. medium can be "read-only" */
    16691656    Bstr bstrFormatName;
    1670     rc = mediumFormat->COMGETTER(Name)(bstrFormatName.asOutParam());
    1671     if (FAILED(rc))
    1672         return rc;
     1657    hrc = mediumFormat->COMGETTER(Name)(bstrFormatName.asOutParam());
     1658    if (FAILED(hrc))
     1659        return hrc;
    16731660
    16741661    Utf8Str formatName = Utf8Str(bstrFormatName);
  • trunk/src/VBox/Main/src-server/MediumIOImpl.cpp

    r98262 r98289  
    115115          mVirtualBoxCaller(NULL)
    116116    {
    117         AssertReturnVoidStmt(pMediumIO, mRC = E_FAIL);
    118         AssertReturnVoidStmt(pDataStream, mRC = E_FAIL);
    119         mRC = mMediumCaller.hrc();
    120         if (FAILED(mRC))
     117        AssertReturnVoidStmt(pMediumIO, mHrc = E_FAIL);
     118        AssertReturnVoidStmt(pDataStream, mHrc = E_FAIL);
     119        mHrc = mMediumCaller.hrc();
     120        if (FAILED(mHrc))
    121121            return;
    122122
     
    125125        mVirtualBox = pVirtualBox;
    126126        mVirtualBoxCaller.attach(pVirtualBox);
    127         mRC = mVirtualBoxCaller.hrc();
    128         if (FAILED(mRC))
     127        mHrc = mVirtualBoxCaller.hrc();
     128        if (FAILED(mHrc))
    129129            return;
    130130    }
     
    136136        if (   isAsync()
    137137            && !mProgress.isNull())
    138             mProgress->i_notifyComplete(mRC);
    139     }
    140 
    141     HRESULT hrc() const { return mRC; }
     138            mProgress->i_notifyComplete(mHrc);
     139    }
     140
     141    HRESULT hrc() const { return mHrc; }
    142142    bool isOk() const { return SUCCEEDED(hrc()); }
    143143
     
    153153        try
    154154        {
    155             mRC = executeTask(); /* (destructor picks up mRC, see above) */
    156             LogFlowFunc(("hrc=%Rhrc\n", mRC));
     155            mHrc = executeTask(); /* (destructor picks up mHrc, see above) */
     156            LogFlowFunc(("hrc=%Rhrc\n", mHrc));
    157157        }
    158158        catch (...)
     
    168168
    169169protected:
    170     HRESULT         mRC;
     170    HRESULT         mHrc;
    171171
    172172    ComObjPtr<DataStream> m_pDataStream;
     
    843843            throw rc;
    844844    }
    845     catch (HRESULT aRC) { rc = aRC; }
     845    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    846846
    847847    if (SUCCEEDED(rc))
  • trunk/src/VBox/Main/src-server/MediumImpl.cpp

    r98263 r98289  
    308308          mNotifyAboutChanges(fNotifyAboutChanges)
    309309    {
    310         AssertReturnVoidStmt(aMedium, mRC = E_FAIL);
    311         mRC = mMediumCaller.hrc();
    312         if (FAILED(mRC))
     310        AssertReturnVoidStmt(aMedium, mHrc = E_FAIL);
     311        mHrc = mMediumCaller.hrc();
     312        if (FAILED(mHrc))
    313313            return;
    314314
     
    317317        mVirtualBox = pVirtualBox;
    318318        mVirtualBoxCaller.attach(pVirtualBox);
    319         mRC = mVirtualBoxCaller.hrc();
    320         if (FAILED(mRC))
     319        mHrc = mVirtualBoxCaller.hrc();
     320        if (FAILED(mHrc))
    321321            return;
    322322
     
    334334            AssertRC(vrc);
    335335            if (RT_FAILURE(vrc))
    336                 mRC = E_FAIL;
     336                mHrc = E_FAIL;
    337337        }
    338338    }
     
    344344        if (   isAsync()
    345345            && !mProgress.isNull())
    346             mProgress->i_notifyComplete(mRC);
    347     }
    348 
    349     HRESULT hrc() const { return mRC; }
     346            mProgress->i_notifyComplete(mHrc);
     347    }
     348
     349    HRESULT hrc() const { return mHrc; }
    350350    bool isOk() const { return SUCCEEDED(hrc()); }
    351351    bool NotifyAboutChanges() const { return mNotifyAboutChanges; }
     
    361361        LogFlowFuncEnter();
    362362
    363         mRC = executeTask();
    364 
    365         LogFlowFunc(("rc=%Rhrc\n", mRC));
     363        mHrc = executeTask();
     364
     365        LogFlowFunc(("hrc=%Rhrc\n", mHrc));
    366366        LogFlowFuncLeave();
    367         return mRC;
     367        return mHrc;
    368368    }
    369369
     
    377377        try
    378378        {
    379             mRC = executeTask(); /* (destructor picks up mRC, see above) */
    380             LogFlowFunc(("rc=%Rhrc\n", mRC));
     379            mHrc = executeTask(); /* (destructor picks up mHrc, see above) */
     380            LogFlowFunc(("hrc=%Rhrc\n", mHrc));
    381381        }
    382382        catch (...)
     
    394394
    395395protected:
    396     HRESULT mRC;
     396    HRESULT mHrc;
    397397
    398398private:
     
    455455          mfKeepMediumLockList(fKeepMediumLockList)
    456456    {
    457         AssertReturnVoidStmt(aTarget != NULL, mRC = E_FAIL);
    458         mRC = mTargetCaller.hrc();
    459         if (FAILED(mRC))
     457        AssertReturnVoidStmt(aTarget != NULL, mHrc = E_FAIL);
     458        mHrc = mTargetCaller.hrc();
     459        if (FAILED(mHrc))
    460460            return;
    461461        m_strTaskName = "createDiff";
     
    513513          mfKeepTargetMediumLockList(fKeepTargetMediumLockList)
    514514    {
    515         AssertReturnVoidStmt(aTarget != NULL, mRC = E_FAIL);
    516         mRC = mTargetCaller.hrc();
    517         if (FAILED(mRC))
     515        AssertReturnVoidStmt(aTarget != NULL, mHrc = E_FAIL);
     516        mHrc = mTargetCaller.hrc();
     517        if (FAILED(mHrc))
    518518            return;
    519519        /* aParent may be NULL */
    520         mRC = mParentCaller.hrc();
    521         if (FAILED(mRC))
     520        mHrc = mParentCaller.hrc();
     521        if (FAILED(mHrc))
    522522            return;
    523         AssertReturnVoidStmt(aSourceMediumLockList != NULL, mRC = E_FAIL);
    524         AssertReturnVoidStmt(aTargetMediumLockList != NULL, mRC = E_FAIL);
     523        AssertReturnVoidStmt(aSourceMediumLockList != NULL, mHrc = E_FAIL);
     524        AssertReturnVoidStmt(aTargetMediumLockList != NULL, mHrc = E_FAIL);
    525525        m_strTaskName = "createClone";
    526526    }
     
    569569          mfKeepMediumLockList(fKeepMediumLockList)
    570570    {
    571         AssertReturnVoidStmt(aMediumLockList != NULL, mRC = E_FAIL);
     571        AssertReturnVoidStmt(aMediumLockList != NULL, mHrc = E_FAIL);
    572572        m_strTaskName = "createMove";
    573573    }
     
    603603          mfKeepMediumLockList(fKeepMediumLockList)
    604604    {
    605         AssertReturnVoidStmt(aMediumLockList != NULL, mRC = E_FAIL);
     605        AssertReturnVoidStmt(aMediumLockList != NULL, mHrc = E_FAIL);
    606606        m_strTaskName = "createCompact";
    607607    }
     
    638638          mfKeepMediumLockList(fKeepMediumLockList)
    639639    {
    640         AssertReturnVoidStmt(aMediumLockList != NULL, mRC = E_FAIL);
     640        AssertReturnVoidStmt(aMediumLockList != NULL, mHrc = E_FAIL);
    641641        m_strTaskName = "createResize";
    642642    }
     
    746746          mfKeepMediumLockList(fKeepMediumLockList)
    747747    {
    748         AssertReturnVoidStmt(aMediumLockList != NULL, mRC = E_FAIL);
     748        AssertReturnVoidStmt(aMediumLockList != NULL, mHrc = E_FAIL);
    749749        m_strTaskName = "createMerge";
    750750    }
     
    800800          mfKeepTargetMediumLockList(fKeepTargetMediumLockList)
    801801    {
    802         AssertReturnVoidStmt(aTargetMediumLockList != NULL, mRC = E_FAIL);
     802        AssertReturnVoidStmt(aTargetMediumLockList != NULL, mHrc = E_FAIL);
    803803        /* aParent may be NULL */
    804         mRC = mParentCaller.hrc();
    805         if (FAILED(mRC))
     804        mHrc = mParentCaller.hrc();
     805        if (FAILED(mHrc))
    806806            return;
    807807
     
    809809
    810810        int vrc = VDIfCreateFromVfsStream(aVfsIosSrc, RTFILE_O_READ, &mpVfsIoIf);
    811         AssertRCReturnVoidStmt(vrc, mRC = E_FAIL);
     811        AssertRCReturnVoidStmt(vrc, mHrc = E_FAIL);
    812812
    813813        vrc = VDInterfaceAdd(&mpVfsIoIf->Core, "Medium::ImportTaskVfsIos",
    814814                             VDINTERFACETYPE_IO, mpVfsIoIf,
    815815                             sizeof(VDINTERFACEIO), &mVDImageIfaces);
    816         AssertRCReturnVoidStmt(vrc, mRC = E_FAIL);
     816        AssertRCReturnVoidStmt(vrc, mHrc = E_FAIL);
    817817        m_strTaskName = "createImport";
    818818    }
     
    864864          mpMediumLockList(aMediumLockList)
    865865    {
    866         AssertReturnVoidStmt(aMediumLockList != NULL, mRC = E_FAIL);
     866        AssertReturnVoidStmt(aMediumLockList != NULL, mHrc = E_FAIL);
    867867        /* aParent may be NULL */
    868         mRC = mParentCaller.hrc();
    869         if (FAILED(mRC))
     868        mHrc = mParentCaller.hrc();
     869        if (FAILED(mHrc))
    870870            return;
    871871
     
    10361036    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    10371037
    1038     HRESULT rc = S_OK;
     1038    HRESULT hrc = S_OK;
    10391039
    10401040    unconst(m->pVirtualBox) = aVirtualBox;
     
    10531053    /* No storage unit is created yet, no need to call Medium::i_queryInfo */
    10541054
    1055     rc = i_setFormat(aFormat);
    1056     if (FAILED(rc)) return rc;
    1057 
    1058     rc = i_setLocation(aLocation);
    1059     if (FAILED(rc)) return rc;
     1055    hrc = i_setFormat(aFormat);
     1056    if (FAILED(hrc)) return hrc;
     1057
     1058    hrc = i_setLocation(aLocation);
     1059    if (FAILED(hrc)) return hrc;
    10601060
    10611061    if (!(m->formatObj->i_getCapabilities() & (  MediumFormatCapabilities_CreateFixed
     
    10961096        }
    10971097
    1098         rc = m->pVirtualBox->i_registerMedium(this, &pMedium, treeLock);
    1099         Assert(this == pMedium || FAILED(rc));
     1098        hrc = m->pVirtualBox->i_registerMedium(this, &pMedium, treeLock);
     1099        Assert(this == pMedium || FAILED(hrc));
    11001100    }
    11011101
    11021102    /* Confirm a successful initialization when it's the case */
    1103     if (SUCCEEDED(rc))
     1103    if (SUCCEEDED(hrc))
    11041104        autoInitSpan.setSucceeded();
    11051105
    1106     return rc;
     1106    return hrc;
    11071107}
    11081108
     
    11411141    AssertReturn(!aLocation.isEmpty(), E_INVALIDARG);
    11421142
    1143     HRESULT rc = S_OK;
     1143    HRESULT hrc = S_OK;
    11441144
    11451145    {
     
    11671167            m->type = MediumType_Writethrough;
    11681168
    1169         rc = i_setLocation(aLocation);
    1170         if (FAILED(rc)) return rc;
     1169        hrc = i_setLocation(aLocation);
     1170        if (FAILED(hrc)) return hrc;
    11711171
    11721172        /* get all the information about the medium from the storage unit */
     
    11921192    /* need to call i_queryInfo immediately to correctly place the medium in
    11931193     * the respective media tree and update other information such as uuid */
    1194     rc = i_queryInfo(fForceNewUuid /* fSetImageId */, false /* fSetParentId */,
    1195                      autoCaller);
    1196     if (SUCCEEDED(rc))
     1194    hrc = i_queryInfo(fForceNewUuid /* fSetImageId */, false /* fSetParentId */, autoCaller);
     1195    if (SUCCEEDED(hrc))
    11971196    {
    11981197        AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    12031202        {
    12041203            Assert(!m->strLastAccessError.isEmpty());
    1205             rc = setError(E_FAIL, "%s", m->strLastAccessError.c_str());
     1204            hrc = setError(E_FAIL, "%s", m->strLastAccessError.c_str());
    12061205            alock.release();
    12071206            autoCaller.release();
     
    12261225    }
    12271226
    1228     return rc;
     1227    return hrc;
    12291228}
    12301229
     
    12531252                        const settings::Medium &data)
    12541253{
    1255     HRESULT rc;
     1254    HRESULT hrc;
    12561255
    12571256    if (uuidMachineRegistry.isValid() && !uuidMachineRegistry.isZero())
     
    12861285    {
    12871286        AssertReturn(!data.strFormat.isEmpty(), E_FAIL);
    1288         rc = i_setFormat(data.strFormat);
    1289         if (FAILED(rc)) return rc;
     1287        hrc = i_setFormat(data.strFormat);
     1288        if (FAILED(hrc)) return hrc;
    12901289    }
    12911290    else
     
    12931292        /// @todo handle host drive settings here as well?
    12941293        if (!data.strFormat.isEmpty())
    1295             rc = i_setFormat(data.strFormat);
     1294            hrc = i_setFormat(data.strFormat);
    12961295        else
    1297             rc = i_setFormat("RAW");
    1298         if (FAILED(rc)) return rc;
     1296            hrc = i_setFormat("RAW");
     1297        if (FAILED(hrc)) return hrc;
    12991298    }
    13001299
     
    13561355        strFull = data.strLocation;
    13571356
    1358     rc = i_setLocation(strFull);
    1359     if (FAILED(rc)) return rc;
     1357    hrc = i_setLocation(strFull);
     1358    if (FAILED(hrc)) return hrc;
    13601359
    13611360    if (aDeviceType == DeviceType_HardDisk)
     
    14171416    AssertReturn(aVirtualBox, E_INVALIDARG);
    14181417
    1419     HRESULT rc = S_OK;
     1418    HRESULT hrc = S_OK;
    14201419
    14211420    MediaList llMediaTocleanup;
     
    14351434        bool fReleasedMediaTreeLock = false;
    14361435        ComObjPtr<Medium> pMedium;
    1437         rc = pMedium.createObject();
    1438         if (FAILED(rc))
     1436        hrc = pMedium.createObject();
     1437        if (FAILED(hrc))
    14391438            break;
    14401439        ComObjPtr<Medium> pActualMedium(pMedium);
     
    14421441        {
    14431442            AutoInitSpan autoInitSpan(pMedium);
    1444             AssertBreakStmt(autoInitSpan.isOk(), rc = E_FAIL);
     1443            AssertBreakStmt(autoInitSpan.isOk(), hrc = E_FAIL);
    14451444
    14461445            unconst(pMedium->m->pVirtualBox) = aVirtualBox;
    1447             rc = pMedium->initOne(pParent, aDeviceType, uuidMachineRegistry, strMachineFolder, *current);
    1448             if (FAILED(rc))
     1446            hrc = pMedium->initOne(pParent, aDeviceType, uuidMachineRegistry, strMachineFolder, *current);
     1447            if (FAILED(hrc))
    14491448                break;
    1450             rc = aVirtualBox->i_registerMedium(pActualMedium, &pActualMedium, mediaTreeLock, true /*fCalledFromMediumInit*/);
    1451             if (FAILED(rc))
     1449            hrc = aVirtualBox->i_registerMedium(pActualMedium, &pActualMedium, mediaTreeLock, true /*fCalledFromMediumInit*/);
     1450            if (FAILED(hrc))
    14521451                break;
    14531452
     
    14861485    }
    14871486
    1488     if (SUCCEEDED(rc))
     1487    if (SUCCEEDED(hrc))
    14891488    {
    14901489        /* Check for consistency. */
     
    15241523    }
    15251524
    1526     return rc;
     1525    return hrc;
    15271526}
    15281527
     
    15781577    m->state = MediumState_Created;
    15791578    m->hostDrive = true;
    1580     HRESULT rc = i_setFormat("RAW");
    1581     if (FAILED(rc)) return rc;
    1582     rc = i_setLocation(aLocation);
    1583     if (FAILED(rc)) return rc;
     1579    HRESULT hrc = i_setFormat("RAW");
     1580    if (FAILED(hrc)) return hrc;
     1581    hrc = i_setLocation(aLocation);
     1582    if (FAILED(hrc)) return hrc;
    15841583    m->strDescription = aDescription;
    15851584
     
    17561755    /// require to add the mRegistered flag to data
    17571756
    1758     HRESULT rc = S_OK;
     1757    HRESULT hrc = S_OK;
    17591758
    17601759    MediumLockList *pMediumLockList(new MediumLockList());
     
    17711770
    17721771        /* Build the lock list. */
    1773         rc = i_createMediumLockList(true /* fFailIfInaccessible */,
    1774                                     this /* pToLockWrite */,
    1775                                     true /* fMediumLockWriteAll */,
    1776                                     NULL,
    1777                                     *pMediumLockList);
    1778         if (FAILED(rc))
    1779         {
     1772        hrc = i_createMediumLockList(true /* fFailIfInaccessible */,
     1773                                     this /* pToLockWrite */,
     1774                                     true /* fMediumLockWriteAll */,
     1775                                     NULL,
     1776                                     *pMediumLockList);
     1777        if (FAILED(hrc))
    17801778            pszError = tr("Failed to create medium lock list for '%s'");
    1781         }
    17821779        else
    17831780        {
    1784             rc = pMediumLockList->Lock();
    1785             if (FAILED(rc))
     1781            hrc = pMediumLockList->Lock();
     1782            if (FAILED(hrc))
    17861783                pszError = tr("Failed to lock media '%s'");
    17871784        }
     
    17961793        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    17971794
    1798         if (FAILED(rc))
    1799             throw setError(rc, pszError, i_getLocationFull().c_str());
     1795        if (FAILED(hrc))
     1796            throw setError(hrc, pszError, i_getLocationFull().c_str());
    18001797
    18011798        /* Set a new description */
     
    18101807        m->pVirtualBox->i_onMediumConfigChanged(this);
    18111808    }
    1812     catch (HRESULT aRC) { rc = aRC; }
     1809    catch (HRESULT hrcXcpt) { hrc = hrcXcpt; }
    18131810
    18141811    delete pMediumLockList;
    18151812
    1816     return rc;
     1813    return hrc;
    18171814}
    18181815
     
    22702267    alock.release();
    22712268
    2272     HRESULT rc = i_queryInfo(!!aSetImageId /* fSetImageId */,
    2273                              !!aSetParentId /* fSetParentId */,
    2274                              autoCaller);
     2269    HRESULT hrc = i_queryInfo(!!aSetImageId /* fSetImageId */,
     2270                              !!aSetParentId /* fSetParentId */,
     2271                              autoCaller);
    22752272
    22762273    AutoReadLock arlock(this COMMA_LOCKVAL_SRC_POS);
     
    22792276    arlock.release();
    22802277
    2281     if (SUCCEEDED(rc))
     2278    if (SUCCEEDED(hrc))
    22822279    {
    22832280        if (uCurrImage != uPrevImage)
     
    22922289    }
    22932290
    2294     return rc;
     2291    return hrc;
    22952292}
    22962293
     
    22992296    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    23002297
    2301     HRESULT rc = S_OK;
     2298    HRESULT hrc = S_OK;
    23022299
    23032300    switch (m->state)
     
    23102307            alock.release();
    23112308
    2312             rc = i_queryInfo(false /* fSetImageId */, false /* fSetParentId */,
    2313                              autoCaller);
     2309            hrc = i_queryInfo(false /* fSetImageId */, false /* fSetParentId */, autoCaller);
    23142310
    23152311            alock.acquire();
     
    23222318    *aState = m->state;
    23232319
    2324     return rc;
     2320    return hrc;
    23252321}
    23262322
     
    23832379    }
    23842380
    2385     HRESULT rc = S_OK;
     2381    HRESULT hrc = S_OK;
    23862382
    23872383    switch (m->state)
     
    23932389            ++m->readers;
    23942390
    2395             ComAssertMsgBreak(m->readers != 0, (tr("Counter overflow")), rc = E_FAIL);
     2391            ComAssertMsgBreak(m->readers != 0, (tr("Counter overflow")), hrc = E_FAIL);
    23962392
    23972393            /* Remember pre-lock state */
     
    24032399
    24042400            ComObjPtr<MediumLockToken> pToken;
    2405             rc = pToken.createObject();
    2406             if (SUCCEEDED(rc))
    2407                 rc = pToken->init(this, false /* fWrite */);
    2408             if (FAILED(rc))
     2401            hrc = pToken.createObject();
     2402            if (SUCCEEDED(hrc))
     2403                hrc = pToken->init(this, false /* fWrite */);
     2404            if (FAILED(hrc))
    24092405            {
    24102406                --m->readers;
    24112407                if (m->readers == 0)
    24122408                    m->state = m->preLockState;
    2413                 return rc;
     2409                return hrc;
    24142410            }
    24152411
     
    24202416        {
    24212417            LogFlowThisFunc(("Failing - state=%d\n", m->state));
    2422             rc = i_setStateError();
     2418            hrc = i_setStateError();
    24232419            break;
    24242420        }
    24252421    }
    24262422
    2427     return rc;
     2423    return hrc;
    24282424}
    24292425
     
    24392435    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    24402436
    2441     HRESULT rc = S_OK;
     2437    HRESULT hrc = S_OK;
    24422438
    24432439    switch (m->state)
     
    24452441        case MediumState_LockedRead:
    24462442        {
    2447             ComAssertMsgBreak(m->readers != 0, (tr("Counter underflow")), rc = E_FAIL);
     2443            ComAssertMsgBreak(m->readers != 0, (tr("Counter underflow")), hrc = E_FAIL);
    24482444            --m->readers;
    24492445
     
    24652461        {
    24662462            LogFlowThisFunc(("Failing - state=%d\n", m->state));
    2467             rc = setError(VBOX_E_INVALID_OBJECT_STATE,
    2468                           tr("Medium '%s' is not locked for reading"),
    2469                           m->strLocationFull.c_str());
     2463            hrc = setError(VBOX_E_INVALID_OBJECT_STATE, tr("Medium '%s' is not locked for reading"), m->strLocationFull.c_str());
    24702464            break;
    24712465        }
     
    24762470        *aState = m->state;
    24772471
    2478     return rc;
     2472    return hrc;
    24792473}
    24802474HRESULT Medium::lockWrite(ComPtr<IToken> &aToken)
     
    25002494    }
    25012495
    2502     HRESULT rc = S_OK;
     2496    HRESULT hrc = S_OK;
    25032497
    25042498    switch (m->state)
     
    25132507
    25142508            ComObjPtr<MediumLockToken> pToken;
    2515             rc = pToken.createObject();
    2516             if (SUCCEEDED(rc))
    2517                 rc = pToken->init(this, true /* fWrite */);
    2518             if (FAILED(rc))
     2509            hrc = pToken.createObject();
     2510            if (SUCCEEDED(hrc))
     2511                hrc = pToken->init(this, true /* fWrite */);
     2512            if (FAILED(hrc))
    25192513            {
    25202514                m->state = m->preLockState;
    2521                 return rc;
     2515                return hrc;
    25222516            }
    25232517
     
    25282522        {
    25292523            LogFlowThisFunc(("Failing - state=%d locationFull=%s\n", m->state, i_getLocationFull().c_str()));
    2530             rc = i_setStateError();
     2524            hrc = i_setStateError();
    25312525            break;
    25322526        }
    25332527    }
    25342528
    2535     return rc;
     2529    return hrc;
    25362530}
    25372531
     
    25472541    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    25482542
    2549     HRESULT rc = S_OK;
     2543    HRESULT hrc = S_OK;
    25502544
    25512545    switch (m->state)
     
    25652559        {
    25662560            LogFlowThisFunc(("Failing - state=%d locationFull=%s\n", m->state, i_getLocationFull().c_str()));
    2567             rc = setError(VBOX_E_INVALID_OBJECT_STATE,
    2568                           tr("Medium '%s' is not locked for writing"),
    2569                           m->strLocationFull.c_str());
     2561            hrc = setError(VBOX_E_INVALID_OBJECT_STATE, tr("Medium '%s' is not locked for writing"), m->strLocationFull.c_str());
    25702562            break;
    25712563        }
     
    25762568        *aState = m->state;
    25772569
    2578     return rc;
     2570    return hrc;
    25792571}
    25802572
     
    27722764        return setError(E_INVALIDARG, tr("The medium size argument (%lld) is negative"), aLogicalSize);
    27732765
    2774     HRESULT rc = S_OK;
     2766    HRESULT hrc = S_OK;
    27752767    ComObjPtr<Progress> pProgress;
    27762768    Medium::Task *pTask = NULL;
     
    28112803
    28122804        pProgress.createObject();
    2813         rc = pProgress->init(m->pVirtualBox,
    2814                              static_cast<IMedium*>(this),
    2815                              (mediumVariantFlags & MediumVariant_Fixed)
    2816                                ? BstrFmt(tr("Creating fixed medium storage unit '%s'"), m->strLocationFull.c_str()).raw()
    2817                                : BstrFmt(tr("Creating dynamic medium storage unit '%s'"), m->strLocationFull.c_str()).raw(),
    2818                              TRUE /* aCancelable */);
    2819         if (FAILED(rc))
    2820             throw rc;
     2805        hrc = pProgress->init(m->pVirtualBox,
     2806                              static_cast<IMedium*>(this),
     2807                              mediumVariantFlags & MediumVariant_Fixed
     2808                              ? BstrFmt(tr("Creating fixed medium storage unit '%s'"), m->strLocationFull.c_str()).raw()
     2809                              : BstrFmt(tr("Creating dynamic medium storage unit '%s'"), m->strLocationFull.c_str()).raw(),
     2810                              TRUE /* aCancelable */);
     2811        if (FAILED(hrc))
     2812            throw hrc;
    28212813
    28222814        /* setup task object to carry out the operation asynchronously */
    28232815        pTask = new Medium::CreateBaseTask(this, pProgress, (uint64_t)aLogicalSize,
    28242816                                           (MediumVariant_T)mediumVariantFlags);
    2825         rc = pTask->hrc();
    2826         AssertComRC(rc);
    2827         if (FAILED(rc))
    2828             throw rc;
     2817        hrc = pTask->hrc();
     2818        AssertComRC(hrc);
     2819        if (FAILED(hrc))
     2820            throw hrc;
    28292821
    28302822        m->state = MediumState_Creating;
    28312823    }
    2832     catch (HRESULT aRC) { rc = aRC; }
    2833 
    2834     if (SUCCEEDED(rc))
    2835     {
    2836         rc = pTask->createThread();
     2824    catch (HRESULT hrcXcpt)
     2825    {
     2826        hrc = hrcXcpt;
     2827    }
     2828
     2829    if (SUCCEEDED(hrc))
     2830    {
     2831        hrc = pTask->createThread();
    28372832        pTask = NULL;
    28382833
    2839         if (SUCCEEDED(rc))
     2834        if (SUCCEEDED(hrc))
    28402835            pProgress.queryInterfaceTo(aProgress.asOutParam());
    28412836    }
     
    28432838        delete pTask;
    28442839
    2845     return rc;
     2840    return hrc;
    28462841}
    28472842
     
    29022897    autoCaller.release();
    29032898    treeLock.release();
    2904     HRESULT rc = diff->i_createMediumLockList(true /* fFailIfInaccessible */,
    2905                                               diff /* pToLockWrite */,
    2906                                               false /* fMediumLockWriteAll */,
    2907                                               this,
    2908                                               *pMediumLockList);
     2899    HRESULT hrc = diff->i_createMediumLockList(true /* fFailIfInaccessible */,
     2900                                               diff /* pToLockWrite */,
     2901                                               false /* fMediumLockWriteAll */,
     2902                                               this,
     2903                                               *pMediumLockList);
    29092904    treeLock.acquire();
    29102905    autoCaller.add();
    29112906    if (FAILED(autoCaller.hrc()))
    2912         rc = autoCaller.hrc();
     2907        hrc = autoCaller.hrc();
    29132908    alock.acquire();
    2914     if (FAILED(rc))
     2909    if (FAILED(hrc))
    29152910    {
    29162911        delete pMediumLockList;
    2917         return rc;
     2912        return hrc;
    29182913    }
    29192914
     
    29212916    autoCaller.release();
    29222917    treeLock.release();
    2923     rc = pMediumLockList->Lock();
     2918    hrc = pMediumLockList->Lock();
    29242919    treeLock.acquire();
    29252920    autoCaller.add();
    29262921    if (FAILED(autoCaller.hrc()))
    2927         rc = autoCaller.hrc();
     2922        hrc = autoCaller.hrc();
    29282923    alock.acquire();
    2929     if (FAILED(rc))
     2924    if (FAILED(hrc))
    29302925    {
    29312926        delete pMediumLockList;
    29322927
    2933         return setError(rc, tr("Could not lock medium when creating diff '%s'"),
     2928        return setError(hrc, tr("Could not lock medium when creating diff '%s'"),
    29342929                        diff->i_getLocationFull().c_str());
    29352930    }
     
    29702965    }
    29712966
    2972     rc = i_createDiffStorage(diff, (MediumVariant_T)mediumVariantFlags, pMediumLockList,
    2973                              &pProgress, false /* aWait */, true /* aNotify */);
    2974     if (FAILED(rc))
     2967    hrc = i_createDiffStorage(diff, (MediumVariant_T)mediumVariantFlags, pMediumLockList,
     2968                              &pProgress, false /* aWait */, true /* aNotify */);
     2969    if (FAILED(hrc))
    29752970        delete pMediumLockList;
    29762971    else
    29772972        pProgress.queryInterfaceTo(aProgress.asOutParam());
    29782973
    2979     return rc;
     2974    return hrc;
    29802975}
    29812976
     
    29942989    MediumLockList *pMediumLockList = NULL;
    29952990
    2996     HRESULT rc = S_OK;
    2997 
    2998     rc = i_prepareMergeTo(pTarget, NULL, NULL, true, fMergeForward,
    2999                           pParentForTarget, pChildrenToReparent, pMediumLockList);
    3000     if (FAILED(rc)) return rc;
     2991    HRESULT hrc = i_prepareMergeTo(pTarget, NULL, NULL, true, fMergeForward,
     2992                                   pParentForTarget, pChildrenToReparent, pMediumLockList);
     2993    if (FAILED(hrc)) return hrc;
    30012994
    30022995    ComObjPtr<Progress> pProgress;
    30032996
    3004     rc = i_mergeTo(pTarget, fMergeForward, pParentForTarget, pChildrenToReparent,
    3005                    pMediumLockList, &pProgress, false /* aWait */, true /* aNotify */);
    3006     if (FAILED(rc))
     2997    hrc = i_mergeTo(pTarget, fMergeForward, pParentForTarget, pChildrenToReparent,
     2998                    pMediumLockList, &pProgress, false /* aWait */, true /* aNotify */);
     2999    if (FAILED(hrc))
    30073000        i_cancelMergeTo(pChildrenToReparent, pMediumLockList);
    30083001    else
    30093002        pProgress.queryInterfaceTo(aProgress.asOutParam());
    30103003
    3011     return rc;
     3004    return hrc;
    30123005}
    30133006
     
    30403033    }
    30413034
    3042     HRESULT rc = S_OK;
     3035    HRESULT hrc = S_OK;
    30433036    ComObjPtr<Progress> pProgress;
    30443037    Medium::Task *pTask = NULL;
     
    30663059        MediumLockList *pSourceMediumLockList(new MediumLockList());
    30673060        alock.release();
    3068         rc = i_createMediumLockList(true /* fFailIfInaccessible */,
    3069                                     NULL /* pToLockWrite */,
    3070                                     false /* fMediumLockWriteAll */,
    3071                                     NULL,
    3072                                     *pSourceMediumLockList);
     3061        hrc = i_createMediumLockList(true /* fFailIfInaccessible */,
     3062                                     NULL /* pToLockWrite */,
     3063                                     false /* fMediumLockWriteAll */,
     3064                                     NULL,
     3065                                     *pSourceMediumLockList);
    30733066        alock.acquire();
    3074         if (FAILED(rc))
     3067        if (FAILED(hrc))
    30753068        {
    30763069            delete pSourceMediumLockList;
    3077             throw rc;
     3070            throw hrc;
    30783071        }
    30793072
     
    30813074        MediumLockList *pTargetMediumLockList(new MediumLockList());
    30823075        alock.release();
    3083         rc = pTarget->i_createMediumLockList(true /* fFailIfInaccessible */,
    3084                                              pTarget /* pToLockWrite */,
    3085                                              false /* fMediumLockWriteAll */,
    3086                                              pParent,
    3087                                              *pTargetMediumLockList);
     3076        hrc = pTarget->i_createMediumLockList(true /* fFailIfInaccessible */,
     3077                                              pTarget /* pToLockWrite */,
     3078                                              false /* fMediumLockWriteAll */,
     3079                                              pParent,
     3080                                              *pTargetMediumLockList);
    30883081        alock.acquire();
    3089         if (FAILED(rc))
     3082        if (FAILED(hrc))
    30903083        {
    30913084            delete pSourceMediumLockList;
    30923085            delete pTargetMediumLockList;
    3093             throw rc;
     3086            throw hrc;
    30943087        }
    30953088
    30963089        alock.release();
    3097         rc = pSourceMediumLockList->Lock();
     3090        hrc = pSourceMediumLockList->Lock();
    30983091        alock.acquire();
    3099         if (FAILED(rc))
     3092        if (FAILED(hrc))
    31003093        {
    31013094            delete pSourceMediumLockList;
    31023095            delete pTargetMediumLockList;
    3103             throw setError(rc,
     3096            throw setError(hrc,
    31043097                           tr("Failed to lock source media '%s'"),
    31053098                           i_getLocationFull().c_str());
    31063099        }
    31073100        alock.release();
    3108         rc = pTargetMediumLockList->Lock();
     3101        hrc = pTargetMediumLockList->Lock();
    31093102        alock.acquire();
    3110         if (FAILED(rc))
     3103        if (FAILED(hrc))
    31113104        {
    31123105            delete pSourceMediumLockList;
    31133106            delete pTargetMediumLockList;
    3114             throw setError(rc,
     3107            throw setError(hrc,
    31153108                           tr("Failed to lock target media '%s'"),
    31163109                           pTarget->i_getLocationFull().c_str());
     
    31183111
    31193112        pProgress.createObject();
    3120         rc = pProgress->init(m->pVirtualBox,
    3121                              static_cast <IMedium *>(this),
    3122                              BstrFmt(tr("Creating clone medium '%s'"), pTarget->m->strLocationFull.c_str()).raw(),
    3123                              TRUE /* aCancelable */);
    3124         if (FAILED(rc))
     3113        hrc = pProgress->init(m->pVirtualBox,
     3114                              static_cast <IMedium *>(this),
     3115                              BstrFmt(tr("Creating clone medium '%s'"), pTarget->m->strLocationFull.c_str()).raw(),
     3116                              TRUE /* aCancelable */);
     3117        if (FAILED(hrc))
    31253118        {
    31263119            delete pSourceMediumLockList;
    31273120            delete pTargetMediumLockList;
    3128             throw rc;
     3121            throw hrc;
    31293122        }
    31303123
     
    31503143                                      pParent, UINT32_MAX, UINT32_MAX,
    31513144                                      pSourceMediumLockList, pTargetMediumLockList);
    3152         rc = pTask->hrc();
    3153         AssertComRC(rc);
    3154         if (FAILED(rc))
    3155             throw rc;
     3145        hrc = pTask->hrc();
     3146        AssertComRC(hrc);
     3147        if (FAILED(hrc))
     3148            throw hrc;
    31563149
    31573150        if (pTarget->m->state == MediumState_NotCreated)
    31583151            pTarget->m->state = MediumState_Creating;
    31593152    }
    3160     catch (HRESULT aRC) { rc = aRC; }
    3161 
    3162     if (SUCCEEDED(rc))
    3163     {
    3164         rc = pTask->createThread();
     3153    catch (HRESULT hrcXcpt)
     3154    {
     3155        hrc = hrcXcpt;
     3156    }
     3157
     3158    if (SUCCEEDED(hrc))
     3159    {
     3160        hrc = pTask->createThread();
    31653161        pTask = NULL;
    3166         if (SUCCEEDED(rc))
     3162        if (SUCCEEDED(hrc))
    31673163            pProgress.queryInterfaceTo(aProgress.asOutParam());
    31683164    }
     
    31703166        delete pTask;
    31713167
    3172     return rc;
     3168    return hrc;
    31733169}
    31743170
     
    32063202
    32073203    /* Set up variables. Fetch needed data in lockable blocks */
    3208     HRESULT rc = S_OK;
     3204    HRESULT hrc = S_OK;
    32093205    Medium::Task *pTask = NULL;
    32103206
     
    32263222    ComObjPtr<Progress> pProgress;
    32273223    pProgress.createObject();
    3228     rc = pProgress->init(m->pVirtualBox,
    3229                 static_cast<IMedium*>(this),
    3230                 BstrFmt(tr("Resizing medium and cloning into it")).raw(),
    3231                 TRUE, /* aCancelable */
    3232                 2, /* Number of opearations */
    3233                 BstrFmt(tr("Resizing medium before clone")).raw()
    3234                 );
    3235 
    3236     if (FAILED(rc))
    3237         return rc;
     3224    hrc = pProgress->init(m->pVirtualBox,
     3225                          static_cast<IMedium*>(this),
     3226                          BstrFmt(tr("Resizing medium and cloning into it")).raw(),
     3227                          TRUE, /* aCancelable */
     3228                          2, /* Number of opearations */
     3229                          BstrFmt(tr("Resizing medium before clone")).raw()
     3230                          );
     3231    if (FAILED(hrc))
     3232        return hrc;
    32383233
    32393234    /* If target does not exist, handle resize. */
     
    32433238            if (!i_isMediumFormatFile())
    32443239            {
    3245                 rc = setError(VBOX_E_NOT_SUPPORTED,
    3246                               tr("Sizes of '%s' and '%s' are different and \
    3247                                  medium format does not support resing"),
    3248                               strSourceName.c_str(), strTargetName.c_str());
    3249                 return rc;
     3240                hrc = setError(VBOX_E_NOT_SUPPORTED,
     3241                               tr("Sizes of '%s' and '%s' are different and medium format does not support resing"),
     3242                               strSourceName.c_str(), strTargetName.c_str());
     3243                return hrc;
    32503244            }
    32513245
     
    32563250
    32573251            ComPtr<IToken> pToken;
    3258             rc = pTarget->LockWrite(pToken.asOutParam());
    3259 
    3260             if (FAILED(rc)) return rc;
     3252            hrc = pTarget->LockWrite(pToken.asOutParam());
     3253
     3254            if (FAILED(hrc)) return hrc;
    32613255
    32623256            /**
     
    32683262            pMediumLockListForResize->Append(pTarget, pTarget->m->state == MediumState_LockedWrite);
    32693263
    3270             rc = pMediumLockListForResize->Lock(true /* fSkipOverLockedMedia */);
    3271 
    3272             if (FAILED(rc))
     3264            hrc = pMediumLockListForResize->Lock(true /* fSkipOverLockedMedia */);
     3265            if (FAILED(hrc))
    32733266            {
    32743267                AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    3275                 rc = setError(rc,
    3276                                 tr("Failed to lock the medium '%s' to resize before merge"),
    3277                                 strTargetName.c_str());
     3268                hrc = setError(hrc,
     3269                               tr("Failed to lock the medium '%s' to resize before merge"),
     3270                               strTargetName.c_str());
    32783271                delete pMediumLockListForResize;
    3279                 return rc;
    3280             }
    3281 
    3282 
    3283             rc = pTarget->i_resize((uint64_t)aLogicalSize, pMediumLockListForResize, &pProgress, true, false);
    3284 
    3285             if (FAILED(rc))
     3272                return hrc;
     3273            }
     3274
     3275
     3276            hrc = pTarget->i_resize((uint64_t)aLogicalSize, pMediumLockListForResize, &pProgress, true, false);
     3277            if (FAILED(hrc))
    32863278            {
    32873279                /* No need to setError becasue i_resize and i_taskResizeHandler handle this automatically. */
    32883280                AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    32893281                delete pMediumLockListForResize;
    3290                 return rc;
     3282                return hrc;
    32913283            }
    32923284
     
    33013293
    33023294    /* Report progress to supplied progress argument */
    3303     if (SUCCEEDED(rc))
     3295    if (SUCCEEDED(hrc))
    33043296    {
    33053297        pProgress.queryInterfaceTo(aProgress.asOutParam());
     
    33283320        MediumLockList *pSourceMediumLockList(new MediumLockList());
    33293321        alock.release();
    3330         rc = i_createMediumLockList(true /* fFailIfInaccessible */,
    3331                                     NULL /* pToLockWrite */,
    3332                                     false /* fMediumLockWriteAll */,
    3333                                     NULL,
    3334                                     *pSourceMediumLockList);
     3322        hrc = i_createMediumLockList(true /* fFailIfInaccessible */,
     3323                                     NULL /* pToLockWrite */,
     3324                                     false /* fMediumLockWriteAll */,
     3325                                     NULL,
     3326                                     *pSourceMediumLockList);
    33353327        alock.acquire();
    3336         if (FAILED(rc))
     3328        if (FAILED(hrc))
    33373329        {
    33383330            delete pSourceMediumLockList;
    3339             throw rc;
     3331            throw hrc;
    33403332        }
    33413333
     
    33433335        MediumLockList *pTargetMediumLockList(new MediumLockList());
    33443336        alock.release();
    3345         rc = pTarget->i_createMediumLockList(true /* fFailIfInaccessible */,
    3346                                              pTarget /* pToLockWrite */,
    3347                                              false /* fMediumLockWriteAll */,
    3348                                              pParent,
    3349                                              *pTargetMediumLockList);
     3337        hrc = pTarget->i_createMediumLockList(true /* fFailIfInaccessible */,
     3338                                              pTarget /* pToLockWrite */,
     3339                                              false /* fMediumLockWriteAll */,
     3340                                              pParent,
     3341                                              *pTargetMediumLockList);
    33503342        alock.acquire();
    3351         if (FAILED(rc))
     3343        if (FAILED(hrc))
    33523344        {
    33533345            delete pSourceMediumLockList;
    33543346            delete pTargetMediumLockList;
    3355             throw rc;
     3347            throw hrc;
    33563348        }
    33573349
    33583350        alock.release();
    3359         rc = pSourceMediumLockList->Lock();
     3351        hrc = pSourceMediumLockList->Lock();
    33603352        alock.acquire();
    3361         if (FAILED(rc))
     3353        if (FAILED(hrc))
    33623354        {
    33633355            delete pSourceMediumLockList;
    33643356            delete pTargetMediumLockList;
    3365             throw setError(rc,
     3357            throw setError(hrc,
    33663358                           tr("Failed to lock source media '%s'"),
    33673359                           i_getLocationFull().c_str());
    33683360        }
    33693361        alock.release();
    3370         rc = pTargetMediumLockList->Lock();
     3362        hrc = pTargetMediumLockList->Lock();
    33713363        alock.acquire();
    3372         if (FAILED(rc))
     3364        if (FAILED(hrc))
    33733365        {
    33743366            delete pSourceMediumLockList;
    33753367            delete pTargetMediumLockList;
    3376             throw setError(rc,
     3368            throw setError(hrc,
    33773369                           tr("Failed to lock target media '%s'"),
    33783370                           pTarget->i_getLocationFull().c_str());
     
    34143406        }
    34153407
    3416         rc = pTask->hrc();
    3417         AssertComRC(rc);
    3418         if (FAILED(rc))
    3419             throw rc;
     3408        hrc = pTask->hrc();
     3409        AssertComRC(hrc);
     3410        if (FAILED(hrc))
     3411            throw hrc;
    34203412
    34213413        if (pTarget->m->state == MediumState_NotCreated)
    34223414            pTarget->m->state = MediumState_Creating;
    34233415    }
    3424     catch (HRESULT aRC) { rc = aRC; }
    3425 
    3426     if (SUCCEEDED(rc))
    3427     {
    3428         rc = pTask->createThread();
     3416    catch (HRESULT hrcXcpt) { hrc = hrcXcpt; }
     3417
     3418    if (SUCCEEDED(hrc))
     3419    {
     3420        hrc = pTask->createThread();
    34293421        pTask = NULL;
    3430         if (SUCCEEDED(rc))
     3422        if (SUCCEEDED(hrc))
    34313423            pProgress.queryInterfaceTo(aProgress.asOutParam());
    34323424    }
     
    34343426        delete pTask;
    34353427
    3436     return rc;
     3428    return hrc;
    34373429}
    34383430
     
    34413433    ComObjPtr<Medium> pParent;
    34423434    ComObjPtr<Progress> pProgress;
    3443     HRESULT rc = S_OK;
     3435    HRESULT hrc = S_OK;
    34443436    Medium::Task *pTask = NULL;
    34453437
     
    34743466            if (aLocation.isEmpty())
    34753467            {
    3476                 rc = setErrorVrc(VERR_PATH_ZERO_LENGTH,
    3477                                  tr("Medium '%s' can't be moved. Destination path is empty."),
    3478                                  i_getLocationFull().c_str());
    3479                 throw rc;
     3468                hrc = setErrorVrc(VERR_PATH_ZERO_LENGTH,
     3469                                  tr("Medium '%s' can't be moved. Destination path is empty."),
     3470                                  i_getLocationFull().c_str());
     3471                throw hrc;
    34803472            }
    34813473
     
    35413533                                break;
    35423534                            default:
    3543                                 rc = setErrorVrc(VERR_NOT_A_FILE, /** @todo r=bird: Mixing status codes again. */
    3544                                                  tr("Medium '%s' has RAW type. \"Move\" operation isn't supported for this type."),
    3545                                                  i_getLocationFull().c_str());
    3546                                 throw rc;
     3535                                hrc = setErrorVrc(VERR_NOT_A_FILE, /** @todo r=bird: Mixing status codes again. */
     3536                                                  tr("Medium '%s' has RAW type. \"Move\" operation isn't supported for this type."),
     3537                                                  i_getLocationFull().c_str());
     3538                                throw hrc;
    35473539                        }
    35483540                    }
     
    35623554            /* Simple check for existence */
    35633555            if (RTFileExists(destPath.c_str()))
    3564             {
    3565                 rc = setError(VBOX_E_FILE_ERROR,
    3566                               tr("The given path '%s' is an existing file. Delete or rename this file."),
    3567                               destPath.c_str());
    3568                 throw rc;
    3569             }
     3556                throw setError(VBOX_E_FILE_ERROR,
     3557                               tr("The given path '%s' is an existing file. Delete or rename this file."),
     3558                               destPath.c_str());
    35703559
    35713560            if (!i_isMediumFormatFile())
    3572             {
    3573                 rc = setErrorVrc(VERR_NOT_A_FILE,
    3574                                  tr("Medium '%s' isn't a file object. \"Move\" operation isn't supported."),
    3575                                  i_getLocationFull().c_str());
    3576                 throw rc;
    3577             }
     3561                throw setErrorVrc(VERR_NOT_A_FILE,
     3562                                  tr("Medium '%s' isn't a file object. \"Move\" operation isn't supported."),
     3563                                  i_getLocationFull().c_str());
    35783564            /* Path must be absolute */
    35793565            if (!RTPathStartsWithRoot(destPath.c_str()))
    3580             {
    3581                 rc = setError(VBOX_E_FILE_ERROR,
    3582                               tr("The given path '%s' is not fully qualified"),
    3583                               destPath.c_str());
    3584                 throw rc;
    3585             }
     3566                throw setError(VBOX_E_FILE_ERROR,
     3567                               tr("The given path '%s' is not fully qualified"),
     3568                               destPath.c_str());
    35863569            /* Check path for a new file object */
    3587             rc = VirtualBox::i_ensureFilePathExists(destPath, true);
    3588             if (FAILED(rc))
    3589                 throw rc;
     3570            hrc = VirtualBox::i_ensureFilePathExists(destPath, true);
     3571            if (FAILED(hrc))
     3572                throw hrc;
    35903573
    35913574            /* Set needed variables for "moving" procedure. It'll be used later in separate thread task */
    3592             rc = i_preparationForMoving(destPath);
    3593             if (FAILED(rc))
    3594             {
    3595                 rc = setErrorVrc(VERR_NO_CHANGE,
    3596                                  tr("Medium '%s' is already in the correct location"),
    3597                                  i_getLocationFull().c_str());
    3598                 throw rc;
    3599             }
     3575            hrc = i_preparationForMoving(destPath);
     3576            if (FAILED(hrc))
     3577                throw setErrorVrc(VERR_NO_CHANGE,
     3578                                  tr("Medium '%s' is already in the correct location"),
     3579                                  i_getLocationFull().c_str());
    36003580        }
    36013581
    36023582        /* Check VMs which have this medium attached to*/
    36033583        std::vector<com::Guid> aMachineIds;
    3604         rc = getMachineIds(aMachineIds);
     3584        hrc = getMachineIds(aMachineIds);
    36053585        std::vector<com::Guid>::const_iterator currMachineID = aMachineIds.begin();
    36063586        std::vector<com::Guid>::const_iterator lastMachineID = aMachineIds.end();
     
    36143594            autoCaller.release();
    36153595            treeLock.release();
    3616             rc = m->pVirtualBox->i_findMachine(id, false, true, &aMachine);
     3596            hrc = m->pVirtualBox->i_findMachine(id, false, true, &aMachine);
    36173597            treeLock.acquire();
    36183598            autoCaller.add();
     
    36203600            alock.acquire();
    36213601
    3622             if (SUCCEEDED(rc))
     3602            if (SUCCEEDED(hrc))
    36233603            {
    36243604                ComObjPtr<SessionMachine> sm;
     
    36353615
    36363616                if (ses)
    3637                 {
    3638                     rc = setError(VBOX_E_INVALID_VM_STATE,
    3639                                   tr("At least the VM '%s' to whom this medium '%s' attached has currently an opened session. Stop all VMs before relocating this medium"),
    3640                                   id.toString().c_str(),
    3641                                   i_getLocationFull().c_str());
    3642                     throw rc;
    3643                 }
     3617                    throw setError(VBOX_E_INVALID_VM_STATE,
     3618                                   tr("At least the VM '%s' to whom this medium '%s' attached has currently an opened session. Stop all VMs before relocating this medium"),
     3619                                   id.toString().c_str(), i_getLocationFull().c_str());
    36443620            }
    36453621            ++currMachineID;
     
    36513627        autoCaller.release();
    36523628        treeLock.release();
    3653         rc = i_createMediumLockList(true /* fFailIfInaccessible */,
    3654                                     this /* pToLockWrite */,
    3655                                     true /* fMediumLockWriteAll */,
    3656                                     NULL,
    3657                                     *pMediumLockList);
     3629        hrc = i_createMediumLockList(true /* fFailIfInaccessible */,
     3630                                     this /* pToLockWrite */,
     3631                                     true /* fMediumLockWriteAll */,
     3632                                     NULL,
     3633                                     *pMediumLockList);
    36583634        treeLock.acquire();
    36593635        autoCaller.add();
    36603636        AssertComRCThrowRC(autoCaller.hrc());
    36613637        alock.acquire();
    3662         if (FAILED(rc))
     3638        if (FAILED(hrc))
    36633639        {
    36643640            delete pMediumLockList;
    3665             throw setError(rc,
    3666                            tr("Failed to create medium lock list for '%s'"),
    3667                            i_getLocationFull().c_str());
     3641            throw setError(hrc, tr("Failed to create medium lock list for '%s'"), i_getLocationFull().c_str());
    36683642        }
    36693643        alock.release();
    36703644        autoCaller.release();
    36713645        treeLock.release();
    3672         rc = pMediumLockList->Lock();
     3646        hrc = pMediumLockList->Lock();
    36733647        treeLock.acquire();
    36743648        autoCaller.add();
    36753649        AssertComRCThrowRC(autoCaller.hrc());
    36763650        alock.acquire();
    3677         if (FAILED(rc))
     3651        if (FAILED(hrc))
    36783652        {
    36793653            delete pMediumLockList;
    3680             throw setError(rc,
    3681                            tr("Failed to lock media '%s'"),
    3682                            i_getLocationFull().c_str());
     3654            throw setError(hrc, tr("Failed to lock media '%s'"), i_getLocationFull().c_str());
    36833655        }
    36843656
    36853657        pProgress.createObject();
    3686         rc = pProgress->init(m->pVirtualBox,
    3687                              static_cast <IMedium *>(this),
    3688                              BstrFmt(tr("Moving medium '%s'"), m->strLocationFull.c_str()).raw(),
    3689                              TRUE /* aCancelable */);
     3658        hrc = pProgress->init(m->pVirtualBox,
     3659                              static_cast <IMedium *>(this),
     3660                              BstrFmt(tr("Moving medium '%s'"), m->strLocationFull.c_str()).raw(),
     3661                              TRUE /* aCancelable */);
    36903662
    36913663        /* Do the disk moving. */
    3692         if (SUCCEEDED(rc))
     3664        if (SUCCEEDED(hrc))
    36933665        {
    36943666            ULONG mediumVariantFlags = i_getVariant();
     
    36983670                                         (MediumVariant_T)mediumVariantFlags,
    36993671                                         pMediumLockList);
    3700             rc = pTask->hrc();
    3701             AssertComRC(rc);
    3702             if (FAILED(rc))
    3703                 throw rc;
    3704         }
    3705 
    3706     }
    3707     catch (HRESULT aRC) { rc = aRC; }
    3708 
    3709     if (SUCCEEDED(rc))
    3710     {
    3711         rc = pTask->createThread();
     3672            hrc = pTask->hrc();
     3673            AssertComRC(hrc);
     3674            if (FAILED(hrc))
     3675                throw hrc;
     3676        }
     3677
     3678    }
     3679    catch (HRESULT hrcXcpt) { hrc = hrcXcpt; }
     3680
     3681    if (SUCCEEDED(hrc))
     3682    {
     3683        hrc = pTask->createThread();
    37123684        pTask = NULL;
    3713         if (SUCCEEDED(rc))
     3685        if (SUCCEEDED(hrc))
    37143686            pProgress.queryInterfaceTo(aProgress.asOutParam());
    37153687    }
     
    37203692    }
    37213693
    3722     return rc;
     3694    return hrc;
    37233695}
    37243696
    37253697HRESULT Medium::setLocation(const com::Utf8Str &aLocation)
    37263698{
    3727     HRESULT rc = S_OK;
     3699    HRESULT hrc = S_OK;
    37283700
    37293701    try
     
    37453717            /* Path must be absolute */
    37463718            if (!RTPathStartsWithRoot(destPath.c_str()))
    3747             {
    3748                 rc = setError(VBOX_E_FILE_ERROR,
    3749                               tr("The given path '%s' is not fully qualified"),
    3750                               destPath.c_str());
    3751                 throw rc;
    3752             }
     3719                throw setError(VBOX_E_FILE_ERROR, tr("The given path '%s' is not fully qualified"), destPath.c_str());
    37533720
    37543721            /* Simple check for existence */
    37553722            if (!RTFileExists(destPath.c_str()))
    3756             {
    3757                 rc = setError(VBOX_E_FILE_ERROR,
    3758                               tr("The given path '%s' is not an existing file. New location is invalid."),
    3759                               destPath.c_str());
    3760                 throw rc;
    3761             }
     3723                throw setError(VBOX_E_FILE_ERROR,
     3724                               tr("The given path '%s' is not an existing file. New location is invalid."),
     3725                               destPath.c_str());
    37623726        }
    37633727
    37643728        /* Check VMs which have this medium attached to*/
    37653729        std::vector<com::Guid> aMachineIds;
    3766         rc = getMachineIds(aMachineIds);
     3730        hrc = getMachineIds(aMachineIds);
    37673731
    37683732        // switch locks only if there are machines with this medium attached
     
    37803744                Guid id(*currMachineID);
    37813745                ComObjPtr<Machine> aMachine;
    3782                 rc = m->pVirtualBox->i_findMachine(id, false, true, &aMachine);
    3783                 if (SUCCEEDED(rc))
     3746                hrc = m->pVirtualBox->i_findMachine(id, false, true, &aMachine);
     3747                if (SUCCEEDED(hrc))
    37843748                {
    37853749                    ComObjPtr<SessionMachine> sm;
     
    37943758                        alock.acquire();
    37953759
    3796                         rc = setError(VBOX_E_INVALID_VM_STATE,
    3797                                       tr("At least the VM '%s' to whom this medium '%s' attached has currently an opened session. Stop all VMs before set location for this medium"),
    3798                                       id.toString().c_str(),
    3799                                       i_getLocationFull().c_str());
    3800                         throw rc;
     3760                        throw setError(VBOX_E_INVALID_VM_STATE,
     3761                                       tr("At least the VM '%s' to whom this medium '%s' attached has currently an opened session. Stop all VMs before set location for this medium"),
     3762                                       id.toString().c_str(),
     3763                                       i_getLocationFull().c_str());
    38013764                    }
    38023765                }
     
    38243787        m->pVirtualBox->i_onMediumConfigChanged(this);
    38253788    }
    3826     catch (HRESULT aRC) { rc = aRC; }
    3827 
    3828     return rc;
     3789    catch (HRESULT hrcXcpt) { hrc = hrcXcpt; }
     3790
     3791    return hrc;
    38293792}
    38303793
    38313794HRESULT Medium::compact(ComPtr<IProgress> &aProgress)
    38323795{
    3833     HRESULT rc = S_OK;
     3796    HRESULT hrc = S_OK;
    38343797    ComObjPtr<Progress> pProgress;
    38353798    Medium::Task *pTask = NULL;
     
    38423805        MediumLockList *pMediumLockList(new MediumLockList());
    38433806        alock.release();
    3844         rc = i_createMediumLockList(true /* fFailIfInaccessible */ ,
    3845                                     this /* pToLockWrite */,
    3846                                     false /* fMediumLockWriteAll */,
    3847                                     NULL,
    3848                                     *pMediumLockList);
     3807        hrc = i_createMediumLockList(true /* fFailIfInaccessible */ ,
     3808                                     this /* pToLockWrite */,
     3809                                     false /* fMediumLockWriteAll */,
     3810                                     NULL,
     3811                                     *pMediumLockList);
    38493812        alock.acquire();
    3850         if (FAILED(rc))
     3813        if (FAILED(hrc))
    38513814        {
    38523815            delete pMediumLockList;
    3853             throw rc;
     3816            throw hrc;
    38543817        }
    38553818
    38563819        alock.release();
    3857         rc = pMediumLockList->Lock();
     3820        hrc = pMediumLockList->Lock();
    38583821        alock.acquire();
    3859         if (FAILED(rc))
     3822        if (FAILED(hrc))
    38603823        {
    38613824            delete pMediumLockList;
    3862             throw setError(rc,
     3825            throw setError(hrc,
    38633826                           tr("Failed to lock media when compacting '%s'"),
    38643827                           i_getLocationFull().c_str());
     
    38663829
    38673830        pProgress.createObject();
    3868         rc = pProgress->init(m->pVirtualBox,
    3869                              static_cast <IMedium *>(this),
    3870                              BstrFmt(tr("Compacting medium '%s'"), m->strLocationFull.c_str()).raw(),
    3871                              TRUE /* aCancelable */);
    3872         if (FAILED(rc))
     3831        hrc = pProgress->init(m->pVirtualBox,
     3832                              static_cast <IMedium *>(this),
     3833                              BstrFmt(tr("Compacting medium '%s'"), m->strLocationFull.c_str()).raw(),
     3834                              TRUE /* aCancelable */);
     3835        if (FAILED(hrc))
    38733836        {
    38743837            delete pMediumLockList;
    3875             throw rc;
     3838            throw hrc;
    38763839        }
    38773840
    38783841        /* setup task object to carry out the operation asynchronously */
    38793842        pTask = new Medium::CompactTask(this, pProgress, pMediumLockList);
    3880         rc = pTask->hrc();
    3881         AssertComRC(rc);
    3882         if (FAILED(rc))
    3883             throw rc;
    3884     }
    3885     catch (HRESULT aRC) { rc = aRC; }
    3886 
    3887     if (SUCCEEDED(rc))
    3888     {
    3889         rc = pTask->createThread();
     3843        hrc = pTask->hrc();
     3844        AssertComRC(hrc);
     3845        if (FAILED(hrc))
     3846            throw hrc;
     3847    }
     3848    catch (HRESULT hrcXcpt) { hrc = hrcXcpt; }
     3849
     3850    if (SUCCEEDED(hrc))
     3851    {
     3852        hrc = pTask->createThread();
    38903853        pTask = NULL;
    3891         if (SUCCEEDED(rc))
     3854        if (SUCCEEDED(hrc))
    38923855            pProgress.queryInterfaceTo(aProgress.asOutParam());
    38933856    }
     
    38953858        delete pTask;
    38963859
    3897     return rc;
     3860    return hrc;
    38983861}
    38993862
     
    39023865{
    39033866    CheckComArgExpr(aLogicalSize, aLogicalSize > 0);
    3904     HRESULT rc = S_OK;
     3867    HRESULT hrc = S_OK;
    39053868    ComObjPtr<Progress> pProgress;
    39063869
     
    39123875        const char *pszError = NULL;
    39133876
    3914         rc = i_createMediumLockList(true /* fFailIfInaccessible */ ,
    3915                                     this /* pToLockWrite */,
    3916                                     false /* fMediumLockWriteAll */,
    3917                                     NULL,
    3918                                     *pMediumLockList);
    3919         if (FAILED(rc))
    3920         {
     3877        hrc = i_createMediumLockList(true /* fFailIfInaccessible */ ,
     3878                                     this /* pToLockWrite */,
     3879                                     false /* fMediumLockWriteAll */,
     3880                                     NULL,
     3881                                     *pMediumLockList);
     3882        if (FAILED(hrc))
    39213883            pszError = tr("Failed to create medium lock list when resizing '%s'");
    3922         }
    39233884        else
    39243885        {
    3925             rc = pMediumLockList->Lock();
    3926             if (FAILED(rc))
     3886            hrc = pMediumLockList->Lock();
     3887            if (FAILED(hrc))
    39273888                pszError = tr("Failed to lock media when resizing '%s'");
    39283889        }
     
    39313892        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    39323893
    3933         if (FAILED(rc))
    3934         {
    3935             throw setError(rc, pszError, i_getLocationFull().c_str());
     3894        if (FAILED(hrc))
     3895        {
     3896            throw setError(hrc, pszError, i_getLocationFull().c_str());
    39363897        }
    39373898
    39383899        pProgress.createObject();
    3939         rc = pProgress->init(m->pVirtualBox,
    3940                              static_cast <IMedium *>(this),
    3941                              BstrFmt(tr("Resizing medium '%s'"), m->strLocationFull.c_str()).raw(),
    3942                              TRUE /* aCancelable */);
    3943         if (FAILED(rc))
    3944         {
    3945             throw rc;
    3946         }
    3947     }
    3948     catch (HRESULT aRC) { rc = aRC; }
    3949 
    3950     if (SUCCEEDED(rc))
    3951         rc = i_resize((uint64_t)aLogicalSize, pMediumLockList, &pProgress, false /* aWait */, true /* aNotify */);
    3952 
    3953     if (SUCCEEDED(rc))
     3900        hrc = pProgress->init(m->pVirtualBox,
     3901                              static_cast <IMedium *>(this),
     3902                              BstrFmt(tr("Resizing medium '%s'"), m->strLocationFull.c_str()).raw(),
     3903                              TRUE /* aCancelable */);
     3904        if (FAILED(hrc))
     3905        {
     3906            throw hrc;
     3907        }
     3908    }
     3909    catch (HRESULT hrcXcpt) { hrc = hrcXcpt; }
     3910
     3911    if (SUCCEEDED(hrc))
     3912        hrc = i_resize((uint64_t)aLogicalSize, pMediumLockList, &pProgress, false /* aWait */, true /* aNotify */);
     3913
     3914    if (SUCCEEDED(hrc))
    39543915        pProgress.queryInterfaceTo(aProgress.asOutParam());
    39553916    else
    39563917        delete pMediumLockList;
    39573918
    3958     return rc;
     3919    return hrc;
    39593920}
    39603921
     
    40333994            throw rc;
    40343995    }
    4035     catch (HRESULT aRC) { rc = aRC; }
     3996    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    40363997
    40373998    if (SUCCEEDED(rc))
     
    41704131            throw rc;
    41714132    }
    4172     catch (HRESULT aRC) { rc = aRC; }
     4133    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    41734134
    41744135    if (SUCCEEDED(rc))
     
    42594220# endif
    42604221    }
    4261     catch (HRESULT aRC) { rc = aRC; }
     4222    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    42624223
    42634224    return rc;
     
    43304291# endif
    43314292    }
    4332     catch (HRESULT aRC) { rc = aRC; }
     4293    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    43334294
    43344295    return rc;
     
    55845545        aTarget->m->state = MediumState_Creating;
    55855546    }
    5586     catch (HRESULT aRC) { rc = aRC; }
     5547    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    55875548
    55885549    if (SUCCEEDED(rc))
     
    59525913            throw rc;
    59535914    }
    5954     catch (HRESULT aRC) { rc = aRC; }
     5915    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    59555916
    59565917    if (SUCCEEDED(rc))
     
    61716132        }
    61726133    }
    6173     catch (HRESULT aRC) { rc = aRC; }
     6134    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    61746135
    61756136    return rc;
     
    64986459        }
    64996460    }
    6500     catch (HRESULT aRC) { rc = aRC; }
     6461    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    65016462
    65026463    if (FAILED(rc))
     
    66636624            throw rc;
    66646625    }
    6665     catch (HRESULT aRC) { rc = aRC; }
     6626    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    66666627
    66676628    if (SUCCEEDED(rc))
     
    68276788            throw rc;
    68286789    }
    6829     catch (HRESULT aRC) { rc = aRC; }
     6790    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    68306791
    68316792    if (SUCCEEDED(rc))
     
    69236884            }
    69246885        }
    6925         catch (HRESULT aRC) { rc = aRC; }
     6886        catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    69266887        catch (int aVRC)
    69276888        {
     
    69346895        VDDestroy(hdd);
    69356896    }
    6936     catch (HRESULT aRC) { rc = aRC; }
     6897    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    69376898
    69386899    return rc;
     
    72107171            m->state = MediumState_Creating;
    72117172    }
    7212     catch (HRESULT aRC) { rc = aRC; }
     7173    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    72137174
    72147175    if (SUCCEEDED(rc))
     
    73587319            aTarget->m->state = MediumState_Creating;
    73597320    }
    7360     catch (HRESULT aRC) { rc = aRC; }
     7321    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    73617322
    73627323    if (SUCCEEDED(rc))
     
    78947855            success = true;
    78957856        }
    7896         catch (HRESULT aRC)
    7897         {
    7898             rc = aRC;
     7857        catch (HRESULT hrcXcpt)
     7858        {
     7859            rc = hrcXcpt;
    78997860        }
    79007861
     
    79087869        }
    79097870    }
    7910     catch (HRESULT aRC)
    7911     {
    7912         rc = aRC;
     7871    catch (HRESULT hrcXcpt)
     7872    {
     7873        rc = hrcXcpt;
    79137874    }
    79147875
     
    79897950                    ComAssertRCThrow(vrc, E_FAIL);
    79907951                }
    7991                 catch (HRESULT aRC)
     7952                catch (HRESULT hrcXcpt)
    79927953                {
    7993                     rc = aRC;
     7954                    rc = hrcXcpt;
    79947955                }
    79957956
    79967957                VDDestroy(hdd);
    79977958            }
    7998             catch (HRESULT aRC)
    7999             {
    8000                 rc = aRC;
     7959            catch (HRESULT hrcXcpt)
     7960            {
     7961                rc = hrcXcpt;
    80017962            }
    80027963
     
    90328993                variant = (MediumVariant_T)uImageFlags;
    90338994        }
    9034         catch (HRESULT aRC) { rc = aRC; }
     8995        catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    90358996
    90368997        VDDestroy(hdd);
    90378998    }
    9038     catch (HRESULT aRC) { rc = aRC; }
     8999    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    90399000
    90409001    if (SUCCEEDED(rc))
     
    92309191                variant = (MediumVariant_T)uImageFlags;
    92319192        }
    9232         catch (HRESULT aRC) { rcTmp = aRC; }
     9193        catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }
    92339194
    92349195        VDDestroy(hdd);
    92359196    }
    9236     catch (HRESULT aRC) { rcTmp = aRC; }
     9197    catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }
    92379198
    92389199    MultiResult mrc(rcTmp);
     
    95549515            }
    95559516        }
    9556         catch (HRESULT aRC) { rcTmp = aRC; }
     9517        catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }
    95579518        catch (int aVRC)
    95589519        {
     
    95669527        VDDestroy(hdd);
    95679528    }
    9568     catch (HRESULT aRC) { rcTmp = aRC; }
     9529    catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }
    95699530
    95709531    ErrorInfoKeeper eik;
     
    99559916                    variant = (MediumVariant_T)uImageFlags;
    99569917            }
    9957             catch (HRESULT aRC) { rcTmp = aRC; }
     9918            catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }
    99589919
    99599920            VDDestroy(targetHdd);
    99609921        }
    9961         catch (HRESULT aRC) { rcTmp = aRC; }
     9922        catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }
    99629923
    99639924        VDDestroy(hdd);
    99649925    }
    9965     catch (HRESULT aRC) { rcTmp = aRC; }
     9926    catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }
    99669927
    99679928    ErrorInfoKeeper eik;
     
    1022310184
    1022410185            }
    10225             catch (HRESULT aRC) { rcOut = aRC; }
    10226 
    10227         }
    10228         catch (HRESULT aRC) { rcOut = aRC; }
     10186            catch (HRESULT hrcXcpt) { rcOut = hrcXcpt; }
     10187
     10188        }
     10189        catch (HRESULT hrcXcpt) { rcOut = hrcXcpt; }
    1022910190
    1023010191        VDDestroy(hdd);
    1023110192    }
    10232     catch (HRESULT aRC) { rcOut = aRC; }
     10193    catch (HRESULT hrcXcpt) { rcOut = hrcXcpt; }
    1023310194
    1023410195    ErrorInfoKeeper eik;
     
    1030610267
    1030710268        }
    10308         catch (HRESULT aRC) { rc = aRC; }
     10269        catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    1030910270
    1031010271        VDDestroy(hdd);
    1031110272    }
    10312     catch (HRESULT aRC) { rc = aRC; }
     10273    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    1031310274
    1031410275    AutoWriteLock thisLock(this COMMA_LOCKVAL_SRC_POS);
     
    1046210423                variant = (MediumVariant_T)uImageFlags;
    1046310424        }
    10464         catch (HRESULT aRC) { rc = aRC; }
     10425        catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    1046510426
    1046610427        VDDestroy(hdd);
    1046710428    }
    10468     catch (HRESULT aRC) { rc = aRC; }
     10429    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    1046910430
    1047010431    AutoWriteLock thisLock(this COMMA_LOCKVAL_SRC_POS);
     
    1056810529            }
    1056910530        }
    10570         catch (HRESULT aRC) { rc = aRC; }
     10531        catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    1057110532
    1057210533        VDDestroy(hdd);
    1057310534    }
    10574     catch (HRESULT aRC) { rc = aRC; }
     10535    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    1057510536
    1057610537    if (task.NotifyAboutChanges() && SUCCEEDED(rc))
     
    1068110642            logicalSize = VDGetSize(hdd, VD_LAST_IMAGE);
    1068210643        }
    10683         catch (HRESULT aRC) { rc = aRC; }
     10644        catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    1068410645
    1068510646        VDDestroy(hdd);
    1068610647    }
    10687     catch (HRESULT aRC) { rc = aRC; }
     10648    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    1068810649
    1068910650    if (SUCCEEDED(rc))
     
    1087110832                    variant = (MediumVariant_T)uImageFlags;
    1087210833            }
    10873             catch (HRESULT aRC) { rcTmp = aRC; }
     10834            catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }
    1087410835
    1087510836            VDDestroy(targetHdd);
    1087610837        }
    10877         catch (HRESULT aRC) { rcTmp = aRC; }
     10838        catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }
    1087810839
    1087910840        VDDestroy(hdd);
    1088010841    }
    10881     catch (HRESULT aRC) { rcTmp = aRC; }
     10842    catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }
    1088210843
    1088310844    ErrorInfoKeeper eik;
     
    1121211173            m->pVirtualBox->i_saveModifiedRegistries();
    1121311174        }
    11214         catch (HRESULT aRC) { rc = aRC; }
     11175        catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    1121511176
    1121611177        if (pvBuf)
     
    1122311184# endif
    1122411185    }
    11225     catch (HRESULT aRC) { rc = aRC; }
     11186    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    1122611187
    1122711188    /* Everything is explicitly unlocked when the task exits,
  • trunk/src/VBox/Main/src-server/SnapshotImpl.cpp

    r98262 r98289  
    25882588        }
    25892589    }
    2590     catch (HRESULT aRC)
    2591     {
    2592         rc = aRC;
     2590    catch (HRESULT hrcXcpt)
     2591    {
     2592        rc = hrcXcpt;
    25932593    }
    25942594
     
    35753575        }
    35763576    }
    3577     catch (HRESULT aRC) {
    3578         mrc = aRC;
     3577    catch (HRESULT hrcXcpt)
     3578    {
     3579        mrc = hrcXcpt;
    35793580    }
    35803581
     
    41414142            throw rc;
    41424143    }
    4143     catch (HRESULT aRC) { rc = aRC; }
     4144    catch (HRESULT hrcXcpt) { rc = hrcXcpt; }
    41444145
    41454146    // The callback mentioned above takes care of update the medium state
  • trunk/src/VBox/Main/src-server/VFSExplorerImpl.cpp

    r98262 r98289  
    314314                aTask->m_ptrProgress->SetCurrentOperationProgress(66);
    315315        }
    316         catch (HRESULT aRC)
    317         {
    318             rc = aRC;
     316        catch (HRESULT hrcXcpt)
     317        {
     318            rc = hrcXcpt;
    319319        }
    320320
     
    374374        }
    375375    }
    376     catch (HRESULT aRC)
    377     {
    378         rc = aRC;
     376    catch (HRESULT hrcXcpt)
     377    {
     378        rc = hrcXcpt;
    379379    }
    380380
     
    416416        rc = pTask->createThreadWithType(RTTHREADTYPE_MAIN_HEAVY_WORKER);
    417417    }
    418     catch (HRESULT aRC)
    419     {
    420         rc = aRC;
     418    catch (HRESULT hrcXcpt)
     419    {
     420        rc = hrcXcpt;
    421421    }
    422422
     
    534534        rc = pTask->createThreadWithType(RTTHREADTYPE_MAIN_HEAVY_WORKER);
    535535    }
    536     catch (HRESULT aRC)
    537     {
    538         rc = aRC;
     536    catch (HRESULT hrcXcpt)
     537    {
     538        rc = hrcXcpt;
    539539    }
    540540
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r98285 r98289  
    868868            ComAssertThrow(m->pAsyncEventQ, E_FAIL);
    869869        }
    870         catch (HRESULT aRC)
    871         {
    872             hrc = aRC;
     870        catch (HRESULT hrcXcpt)
     871        {
     872            hrc = hrcXcpt;
    873873        }
    874874    }
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