- Timestamp:
- Jan 24, 2023 4:02:15 PM (2 years ago)
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImpl.cpp
r98288 r98289 713 713 hrc = explorer->init(li.storageType, li.strPath, li.strHostname, li.strUsername, li.strPassword, mVirtualBox); 714 714 } 715 catch (HRESULT aRC)716 { 717 hrc = aRC;715 catch (HRESULT hrcXcpt) 716 { 717 hrc = hrcXcpt; 718 718 } 719 719 … … 767 767 *aCreated = i; 768 768 } 769 catch (HRESULT aRC)769 catch (HRESULT hrcXcpt) 770 770 { 771 771 for (; i>0; --i) … … 776 776 break; 777 777 } 778 hrc = aRC;778 hrc = hrcXcpt; 779 779 } 780 780 -
trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
r98288 r98289 726 726 hrc = i_writeCloudImpl(m->locInfo, progress); 727 727 } 728 catch (HRESULT aRC)729 { 730 hrc = aRC;728 catch (HRESULT hrcXcpt) 729 { 730 hrc = hrcXcpt; 731 731 } 732 732 … … 816 816 817 817 } 818 catch (HRESULT aRC)819 { 820 hrc = aRC;818 catch (HRESULT hrcXcpt) 819 { 820 hrc = hrcXcpt; 821 821 } 822 822 … … 2816 2816 hrc = setError(VBOX_E_FILE_ERROR, x.what()); 2817 2817 } 2818 catch (HRESULT aRC)2819 { 2820 hrc = aRC;2818 catch (HRESULT hrcXcpt) 2819 { 2820 hrc = hrcXcpt; 2821 2821 } 2822 2822 -
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r98288 r98289 106 106 i_parseURI(aFile, m->locInfo); /* may throw hrc. */ 107 107 } 108 catch (HRESULT aRC)109 { 110 return aRC;108 catch (HRESULT hrcXcpt) 109 { 110 return hrcXcpt; 111 111 } 112 112 catch (std::bad_alloc &) … … 795 795 } 796 796 } 797 catch (HRESULT aRC)797 catch (HRESULT hrcXcpt) 798 798 { 799 799 /* On error we clear the list & return */ 800 800 m->virtualSystemDescriptions.clear(); 801 hrc = aRC;801 hrc = hrcXcpt; 802 802 } 803 803 … … 2572 2572 hrc = setError(VBOX_E_FILE_ERROR, rXcpt.what()); 2573 2573 } 2574 catch (HRESULT aRC)2575 { 2576 hrc = aRC;2574 catch (HRESULT hrcXcpt) 2575 { 2576 hrc = hrcXcpt; 2577 2577 } 2578 2578 catch (...) … … 4865 4865 stack.fSessionOpen = false; 4866 4866 } 4867 catch (HRESULT aRC)4867 catch (HRESULT hrcXcpt) 4868 4868 { 4869 4869 com::ErrorInfo info; … … 4873 4873 4874 4874 if (info.isFullAvailable()) 4875 throw setError( aRC, Utf8Str(info.getText()).c_str());4875 throw setError(hrcXcpt, Utf8Str(info.getText()).c_str()); 4876 4876 else 4877 throw setError( aRC, tr("Unknown error during OVF import"));4877 throw setError(hrcXcpt, tr("Unknown error during OVF import")); 4878 4878 } 4879 4879 } … … 5217 5217 stack.fSessionOpen = false; 5218 5218 } 5219 catch (HRESULT aRC)5219 catch (HRESULT hrcXcpt) 5220 5220 { 5221 5221 com::ErrorInfo info; … … 5224 5224 5225 5225 if (info.isFullAvailable()) 5226 throw setError( aRC, Utf8Str(info.getText()).c_str());5226 throw setError(hrcXcpt, Utf8Str(info.getText()).c_str()); 5227 5227 else 5228 throw setError( aRC, tr("Unknown error during OVF import"));5228 throw setError(hrcXcpt, tr("Unknown error during OVF import")); 5229 5229 } 5230 5230 } -
trunk/src/VBox/Main/src-server/MachineImplMoveVM.cpp
r98262 r98289 50 50 HRESULT add(const Utf8Str &folder, const Utf8Str &file) 51 51 { 52 HRESULT rc = S_OK;53 52 m_list.insert(std::make_pair(folder, file)); 54 return rc;53 return S_OK; 55 54 } 56 55 57 56 HRESULT add(const Utf8Str &fullPath) 58 57 { 59 HRESULT rc = S_OK;60 58 Utf8Str folder = fullPath; 61 59 folder.stripFilename(); … … 63 61 filename.stripPath(); 64 62 m_list.insert(std::make_pair(folder, filename)); 65 return rc;63 return S_OK; 66 64 } 67 65 68 66 HRESULT removeFileFromList(const Utf8Str &fullPath) 69 67 { 70 HRESULT rc = S_OK;71 68 Utf8Str folder = fullPath; 72 69 folder.stripFilename(); … … 86 83 } 87 84 88 return rc;85 return S_OK; 89 86 } 90 87 91 88 HRESULT removeFileFromList(const Utf8Str &path, const Utf8Str &fileName) 92 89 { 93 HRESULT rc = S_OK;94 90 rangeRes_t res = m_list.equal_range(path); 95 91 for (it_t it=res.first; it!=res.second;) … … 104 100 ++it; 105 101 } 106 return rc;102 return S_OK; 107 103 } 108 104 109 105 HRESULT removeFolderFromList(const Utf8Str &path) 110 106 { 111 HRESULT rc = S_OK;112 107 m_list.erase(path); 113 return rc;108 return S_OK; 114 109 } 115 110 … … 590 585 591 586 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; 594 589 /* If canceled by the user tell it to the copy operation. */ 595 590 if (fCanceled) return VERR_CANCELLED; 596 591 /* 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; 599 594 600 595 return VINF_SUCCESS; … … 1141 1136 const Utf8Str &strTargetFolder) 1142 1137 { 1143 HRESULT rc = S_OK;1138 HRESULT hrc = S_OK; 1144 1139 ComObjPtr<Machine> &machine = m_pMachine; 1145 1140 Utf8Str strLocation; … … 1158 1153 Bstr bstrSrcName; 1159 1154 1160 rc = pMedium->COMGETTER(Name)(bstrSrcName.asOutParam());1161 if (FAILED( rc)) throwrc;1155 hrc = pMedium->COMGETTER(Name)(bstrSrcName.asOutParam()); 1156 if (FAILED(hrc)) throw hrc; 1162 1157 1163 1158 if (strTargetFolder.isNotEmpty()) 1164 1159 { 1165 1160 strTargetImageName = strTargetFolder; 1166 rc = pMedium->COMGETTER(Location)(bstrLocation.asOutParam());1167 if (FAILED( rc)) throwrc;1161 hrc = pMedium->COMGETTER(Location)(bstrLocation.asOutParam()); 1162 if (FAILED(hrc)) throw hrc; 1168 1163 strLocation = bstrLocation; 1169 1164 … … 1174 1169 1175 1170 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; 1180 1173 } 1181 1174 else 1182 1175 { 1183 1176 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; 1188 1179 } 1189 1180 … … 1196 1187 1197 1188 MediumType_T mediumType;//immutable, shared, passthrough 1198 rc = pMedium->COMGETTER(Type)(&mediumType);1199 if (FAILED( rc)) throwrc;1189 hrc = pMedium->COMGETTER(Type)(&mediumType); 1190 if (FAILED(hrc)) throw hrc; 1200 1191 1201 1192 DeviceType_T deviceType;//floppy, hard, DVD 1202 rc = pMedium->COMGETTER(DeviceType)(&deviceType);1203 if (FAILED( rc)) throwrc;1193 hrc = pMedium->COMGETTER(DeviceType)(&deviceType); 1194 if (FAILED(hrc)) throw hrc; 1204 1195 1205 1196 /* Drop lock early because IMedium::MoveTo needs to get the VirtualBox one. */ … … 1207 1198 1208 1199 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)) 1211 1202 { 1212 1203 /* In case of failure moveDiskProgress would be in the invalid state or not initialized at all … … 1214 1205 */ 1215 1206 /* 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 */); 1217 1208 } 1218 1209 … … 1220 1211 machineLock.acquire(); 1221 1212 1222 if (FAILED( rc)) throwrc;1213 if (FAILED(hrc)) throw hrc; 1223 1214 1224 1215 Log2(("Moving %s has been finished\n", strTargetImageName.c_str())); … … 1229 1220 machineLock.release(); 1230 1221 } 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 (...) 1232 1229 { 1233 1230 Log2(("Exception during moving the disk %s\n", strLocation.c_str())); 1234 rc = hrc;1231 hrc = VirtualBoxBase::handleUnexpectedExceptions(m_pMachine, RT_SRC_POS); 1235 1232 machineLock.release(); 1236 1233 } 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; 1245 1236 } 1246 1237 … … 1248 1239 { 1249 1240 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()) 1252 1243 pSnapshot->i_updateSavedStatePaths(sourcePath.c_str(), 1253 1244 targetPath.c_str()); … … 1269 1260 { 1270 1261 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()) 1273 1264 pSnapshot->i_updateNVRAMPaths(sourcePath.c_str(), 1274 1265 targetPath.c_str()); … … 1413 1404 { 1414 1405 ComPtr<IMedium> pBaseMedium; 1415 HRESULT rc = pMedium->COMGETTER(Base)(pBaseMedium.asOutParam());1416 if (FAILED( rc)) returnrc;1406 HRESULT hrc = pMedium->COMGETTER(Base)(pBaseMedium.asOutParam()); 1407 if (FAILED(hrc)) return hrc; 1417 1408 Bstr bstrBaseName; 1418 rc = pBaseMedium->COMGETTER(Name)(bstrBaseName.asOutParam());1419 if (FAILED( rc)) returnrc;1409 hrc = pBaseMedium->COMGETTER(Name)(bstrBaseName.asOutParam()); 1410 if (FAILED(hrc)) return hrc; 1420 1411 strBaseName = bstrBaseName; 1421 return rc;1412 return hrc; 1422 1413 } 1423 1414 … … 1425 1416 { 1426 1417 Bstr name; 1427 HRESULT rc = pSnapshot->COMGETTER(Name)(name.asOutParam());1428 if (FAILED( rc)) returnrc;1418 HRESULT hrc = pSnapshot->COMGETTER(Name)(name.asOutParam()); 1419 if (FAILED(hrc)) return hrc; 1429 1420 1430 1421 ComPtr<IMachine> l_pMachine; 1431 rc = pSnapshot->COMGETTER(Machine)(l_pMachine.asOutParam());1432 if (FAILED( rc)) returnrc;1422 hrc = pSnapshot->COMGETTER(Machine)(l_pMachine.asOutParam()); 1423 if (FAILED(hrc)) return hrc; 1433 1424 machineList.push_back((Machine*)(IMachine*)l_pMachine); 1434 1425 1435 1426 SafeIfaceArray<ISnapshot> sfaChilds; 1436 rc = pSnapshot->COMGETTER(Children)(ComSafeArrayAsOutParam(sfaChilds));1437 if (FAILED( rc)) returnrc;1427 hrc = pSnapshot->COMGETTER(Children)(ComSafeArrayAsOutParam(sfaChilds)); 1428 if (FAILED(hrc)) return hrc; 1438 1429 for (size_t i = 0; i < sfaChilds.size(); ++i) 1439 1430 { 1440 rc = createMachineList(sfaChilds[i]);1441 if (FAILED( rc)) returnrc;1442 } 1443 1444 return rc;1431 hrc = createMachineList(sfaChilds[i]); 1432 if (FAILED(hrc)) return hrc; 1433 } 1434 1435 return hrc; 1445 1436 } 1446 1437 … … 1450 1441 * adding all directly and indirectly attached disk images to the worker 1451 1442 * list. */ 1452 HRESULT rc = S_OK;1443 HRESULT hrc = S_OK; 1453 1444 for (size_t i = 0; i < machineList.size(); ++i) 1454 1445 { … … 1458 1449 * machines to a worker list. */ 1459 1450 SafeIfaceArray<IMediumAttachment> sfaAttachments; 1460 rc = machine->COMGETTER(MediumAttachments)(ComSafeArrayAsOutParam(sfaAttachments));1461 if (FAILED( rc)) returnrc;1451 hrc = machine->COMGETTER(MediumAttachments)(ComSafeArrayAsOutParam(sfaAttachments)); 1452 if (FAILED(hrc)) return hrc; 1462 1453 for (size_t a = 0; a < sfaAttachments.size(); ++a) 1463 1454 { 1464 1455 const ComPtr<IMediumAttachment> &pAtt = sfaAttachments[a]; 1465 1456 DeviceType_T deviceType;//floppy, hard, DVD 1466 rc = pAtt->COMGETTER(Type)(&deviceType);1467 if (FAILED( rc)) returnrc;1457 hrc = pAtt->COMGETTER(Type)(&deviceType); 1458 if (FAILED(hrc)) return hrc; 1468 1459 1469 1460 /* Valid medium attached? */ 1470 1461 ComPtr<IMedium> pMedium; 1471 rc = pAtt->COMGETTER(Medium)(pMedium.asOutParam());1472 if (FAILED( rc)) returnrc;1462 hrc = pAtt->COMGETTER(Medium)(pMedium.asOutParam()); 1463 if (FAILED(hrc)) return hrc; 1473 1464 1474 1465 if (pMedium.isNull()) … … 1476 1467 1477 1468 Bstr bstrLocation; 1478 rc = pMedium->COMGETTER(Location)(bstrLocation.asOutParam());1479 if (FAILED( rc)) returnrc;1469 hrc = pMedium->COMGETTER(Location)(bstrLocation.asOutParam()); 1470 if (FAILED(hrc)) return hrc; 1480 1471 1481 1472 /* Cast to ComObjPtr<Medium> */ … … 1483 1474 1484 1475 /* 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; 1496 1483 } 1497 1484 … … 1505 1492 /* Refresh the state so that the file size get read. */ 1506 1493 MediumState_T e; 1507 rc = pMedium->RefreshState(&e);1508 if (FAILED( rc)) returnrc;1494 hrc = pMedium->RefreshState(&e); 1495 if (FAILED(hrc)) return hrc; 1509 1496 1510 1497 LONG64 lSize; 1511 rc = pMedium->COMGETTER(Size)(&lSize);1512 if (FAILED( rc)) returnrc;1498 hrc = pMedium->COMGETTER(Size)(&lSize); 1499 if (FAILED(hrc)) return hrc; 1513 1500 1514 1501 MediumType_T mediumType;//immutable, shared, passthrough 1515 rc = pMedium->COMGETTER(Type)(&mediumType);1516 if (FAILED( rc)) returnrc;1517 1518 rc = pMedium->COMGETTER(Location)(bstrLocation.asOutParam());1519 if (FAILED( rc)) returnrc;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; 1520 1507 1521 1508 MEDIUMTASKMOVE mt;// = {false, "basename", NULL, 0, 0}; … … 1534 1521 1535 1522 /* Query next parent. */ 1536 rc = pMedium->COMGETTER(Parent)(pMedium.asOutParam());1537 if (FAILED( rc)) returnrc;1523 hrc = pMedium->COMGETTER(Parent)(pMedium.asOutParam()); 1524 if (FAILED(hrc)) return hrc; 1538 1525 } 1539 1526 … … 1542 1529 1543 1530 /* Add the save state files of this machine if there is one. */ 1544 rc = addSaveState(machine);1545 if (FAILED( rc)) returnrc;1531 hrc = addSaveState(machine); 1532 if (FAILED(hrc)) return hrc; 1546 1533 1547 1534 /* Add the NVRAM files of this machine if there is one. */ 1548 rc = addNVRAM(machine);1549 if (FAILED( rc)) returnrc;1535 hrc = addNVRAM(machine); 1536 if (FAILED(hrc)) return hrc; 1550 1537 } 1551 1538 … … 1561 1548 } 1562 1549 1563 return rc;1550 return hrc; 1564 1551 } 1565 1552 … … 1567 1554 { 1568 1555 Bstr bstrSrcSaveStatePath; 1569 HRESULT rc = machine->COMGETTER(StateFilePath)(bstrSrcSaveStatePath.asOutParam());1570 if (FAILED( rc)) returnrc;1556 HRESULT hrc = machine->COMGETTER(StateFilePath)(bstrSrcSaveStatePath.asOutParam()); 1557 if (FAILED(hrc)) return hrc; 1571 1558 if (!bstrSrcSaveStatePath.isEmpty()) 1572 1559 { … … 1595 1582 { 1596 1583 ComPtr<INvramStore> pNvramStore; 1597 HRESULT rc = machine->COMGETTER(NonVolatileStore)(pNvramStore.asOutParam());1598 if (FAILED( rc)) returnrc;1584 HRESULT hrc = machine->COMGETTER(NonVolatileStore)(pNvramStore.asOutParam()); 1585 if (FAILED(hrc)) return hrc; 1599 1586 Bstr bstrSrcNVRAMPath; 1600 rc = pNvramStore->COMGETTER(NonVolatileStorageFile)(bstrSrcNVRAMPath.asOutParam());1601 if (FAILED( rc)) returnrc;1587 hrc = pNvramStore->COMGETTER(NonVolatileStorageFile)(bstrSrcNVRAMPath.asOutParam()); 1588 if (FAILED(hrc)) return hrc; 1602 1589 Utf8Str strSrcNVRAMPath(bstrSrcNVRAMPath); 1603 1590 if (!strSrcNVRAMPath.isEmpty() && RTFileExists(strSrcNVRAMPath.c_str())) … … 1652 1639 { 1653 1640 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; 1657 1644 1658 1645 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; 1662 1649 1663 1650 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; 1667 1654 1668 1655 /* Check whether VBox is able to create this medium format or not, i.e. medium can be "read-only" */ 1669 1656 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; 1673 1660 1674 1661 Utf8Str formatName = Utf8Str(bstrFormatName); -
trunk/src/VBox/Main/src-server/MediumIOImpl.cpp
r98262 r98289 115 115 mVirtualBoxCaller(NULL) 116 116 { 117 AssertReturnVoidStmt(pMediumIO, m RC= E_FAIL);118 AssertReturnVoidStmt(pDataStream, m RC= E_FAIL);119 m RC= mMediumCaller.hrc();120 if (FAILED(m RC))117 AssertReturnVoidStmt(pMediumIO, mHrc = E_FAIL); 118 AssertReturnVoidStmt(pDataStream, mHrc = E_FAIL); 119 mHrc = mMediumCaller.hrc(); 120 if (FAILED(mHrc)) 121 121 return; 122 122 … … 125 125 mVirtualBox = pVirtualBox; 126 126 mVirtualBoxCaller.attach(pVirtualBox); 127 m RC= mVirtualBoxCaller.hrc();128 if (FAILED(m RC))127 mHrc = mVirtualBoxCaller.hrc(); 128 if (FAILED(mHrc)) 129 129 return; 130 130 } … … 136 136 if ( isAsync() 137 137 && !mProgress.isNull()) 138 mProgress->i_notifyComplete(m RC);139 } 140 141 HRESULT hrc() const { return m RC; }138 mProgress->i_notifyComplete(mHrc); 139 } 140 141 HRESULT hrc() const { return mHrc; } 142 142 bool isOk() const { return SUCCEEDED(hrc()); } 143 143 … … 153 153 try 154 154 { 155 m RC = executeTask(); /* (destructor picks up mRC, see above) */156 LogFlowFunc(("hrc=%Rhrc\n", m RC));155 mHrc = executeTask(); /* (destructor picks up mHrc, see above) */ 156 LogFlowFunc(("hrc=%Rhrc\n", mHrc)); 157 157 } 158 158 catch (...) … … 168 168 169 169 protected: 170 HRESULT m RC;170 HRESULT mHrc; 171 171 172 172 ComObjPtr<DataStream> m_pDataStream; … … 843 843 throw rc; 844 844 } 845 catch (HRESULT aRC) { rc = aRC; }845 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 846 846 847 847 if (SUCCEEDED(rc)) -
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r98263 r98289 308 308 mNotifyAboutChanges(fNotifyAboutChanges) 309 309 { 310 AssertReturnVoidStmt(aMedium, m RC= E_FAIL);311 m RC= mMediumCaller.hrc();312 if (FAILED(m RC))310 AssertReturnVoidStmt(aMedium, mHrc = E_FAIL); 311 mHrc = mMediumCaller.hrc(); 312 if (FAILED(mHrc)) 313 313 return; 314 314 … … 317 317 mVirtualBox = pVirtualBox; 318 318 mVirtualBoxCaller.attach(pVirtualBox); 319 m RC= mVirtualBoxCaller.hrc();320 if (FAILED(m RC))319 mHrc = mVirtualBoxCaller.hrc(); 320 if (FAILED(mHrc)) 321 321 return; 322 322 … … 334 334 AssertRC(vrc); 335 335 if (RT_FAILURE(vrc)) 336 m RC= E_FAIL;336 mHrc = E_FAIL; 337 337 } 338 338 } … … 344 344 if ( isAsync() 345 345 && !mProgress.isNull()) 346 mProgress->i_notifyComplete(m RC);347 } 348 349 HRESULT hrc() const { return m RC; }346 mProgress->i_notifyComplete(mHrc); 347 } 348 349 HRESULT hrc() const { return mHrc; } 350 350 bool isOk() const { return SUCCEEDED(hrc()); } 351 351 bool NotifyAboutChanges() const { return mNotifyAboutChanges; } … … 361 361 LogFlowFuncEnter(); 362 362 363 m RC= executeTask();364 365 LogFlowFunc((" rc=%Rhrc\n", mRC));363 mHrc = executeTask(); 364 365 LogFlowFunc(("hrc=%Rhrc\n", mHrc)); 366 366 LogFlowFuncLeave(); 367 return m RC;367 return mHrc; 368 368 } 369 369 … … 377 377 try 378 378 { 379 m RC = 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)); 381 381 } 382 382 catch (...) … … 394 394 395 395 protected: 396 HRESULT m RC;396 HRESULT mHrc; 397 397 398 398 private: … … 455 455 mfKeepMediumLockList(fKeepMediumLockList) 456 456 { 457 AssertReturnVoidStmt(aTarget != NULL, m RC= E_FAIL);458 m RC= mTargetCaller.hrc();459 if (FAILED(m RC))457 AssertReturnVoidStmt(aTarget != NULL, mHrc = E_FAIL); 458 mHrc = mTargetCaller.hrc(); 459 if (FAILED(mHrc)) 460 460 return; 461 461 m_strTaskName = "createDiff"; … … 513 513 mfKeepTargetMediumLockList(fKeepTargetMediumLockList) 514 514 { 515 AssertReturnVoidStmt(aTarget != NULL, m RC= E_FAIL);516 m RC= mTargetCaller.hrc();517 if (FAILED(m RC))515 AssertReturnVoidStmt(aTarget != NULL, mHrc = E_FAIL); 516 mHrc = mTargetCaller.hrc(); 517 if (FAILED(mHrc)) 518 518 return; 519 519 /* aParent may be NULL */ 520 m RC= mParentCaller.hrc();521 if (FAILED(m RC))520 mHrc = mParentCaller.hrc(); 521 if (FAILED(mHrc)) 522 522 return; 523 AssertReturnVoidStmt(aSourceMediumLockList != NULL, m RC= E_FAIL);524 AssertReturnVoidStmt(aTargetMediumLockList != NULL, m RC= E_FAIL);523 AssertReturnVoidStmt(aSourceMediumLockList != NULL, mHrc = E_FAIL); 524 AssertReturnVoidStmt(aTargetMediumLockList != NULL, mHrc = E_FAIL); 525 525 m_strTaskName = "createClone"; 526 526 } … … 569 569 mfKeepMediumLockList(fKeepMediumLockList) 570 570 { 571 AssertReturnVoidStmt(aMediumLockList != NULL, m RC= E_FAIL);571 AssertReturnVoidStmt(aMediumLockList != NULL, mHrc = E_FAIL); 572 572 m_strTaskName = "createMove"; 573 573 } … … 603 603 mfKeepMediumLockList(fKeepMediumLockList) 604 604 { 605 AssertReturnVoidStmt(aMediumLockList != NULL, m RC= E_FAIL);605 AssertReturnVoidStmt(aMediumLockList != NULL, mHrc = E_FAIL); 606 606 m_strTaskName = "createCompact"; 607 607 } … … 638 638 mfKeepMediumLockList(fKeepMediumLockList) 639 639 { 640 AssertReturnVoidStmt(aMediumLockList != NULL, m RC= E_FAIL);640 AssertReturnVoidStmt(aMediumLockList != NULL, mHrc = E_FAIL); 641 641 m_strTaskName = "createResize"; 642 642 } … … 746 746 mfKeepMediumLockList(fKeepMediumLockList) 747 747 { 748 AssertReturnVoidStmt(aMediumLockList != NULL, m RC= E_FAIL);748 AssertReturnVoidStmt(aMediumLockList != NULL, mHrc = E_FAIL); 749 749 m_strTaskName = "createMerge"; 750 750 } … … 800 800 mfKeepTargetMediumLockList(fKeepTargetMediumLockList) 801 801 { 802 AssertReturnVoidStmt(aTargetMediumLockList != NULL, m RC= E_FAIL);802 AssertReturnVoidStmt(aTargetMediumLockList != NULL, mHrc = E_FAIL); 803 803 /* aParent may be NULL */ 804 m RC= mParentCaller.hrc();805 if (FAILED(m RC))804 mHrc = mParentCaller.hrc(); 805 if (FAILED(mHrc)) 806 806 return; 807 807 … … 809 809 810 810 int vrc = VDIfCreateFromVfsStream(aVfsIosSrc, RTFILE_O_READ, &mpVfsIoIf); 811 AssertRCReturnVoidStmt(vrc, m RC= E_FAIL);811 AssertRCReturnVoidStmt(vrc, mHrc = E_FAIL); 812 812 813 813 vrc = VDInterfaceAdd(&mpVfsIoIf->Core, "Medium::ImportTaskVfsIos", 814 814 VDINTERFACETYPE_IO, mpVfsIoIf, 815 815 sizeof(VDINTERFACEIO), &mVDImageIfaces); 816 AssertRCReturnVoidStmt(vrc, m RC= E_FAIL);816 AssertRCReturnVoidStmt(vrc, mHrc = E_FAIL); 817 817 m_strTaskName = "createImport"; 818 818 } … … 864 864 mpMediumLockList(aMediumLockList) 865 865 { 866 AssertReturnVoidStmt(aMediumLockList != NULL, m RC= E_FAIL);866 AssertReturnVoidStmt(aMediumLockList != NULL, mHrc = E_FAIL); 867 867 /* aParent may be NULL */ 868 m RC= mParentCaller.hrc();869 if (FAILED(m RC))868 mHrc = mParentCaller.hrc(); 869 if (FAILED(mHrc)) 870 870 return; 871 871 … … 1036 1036 AssertReturn(autoInitSpan.isOk(), E_FAIL); 1037 1037 1038 HRESULT rc = S_OK;1038 HRESULT hrc = S_OK; 1039 1039 1040 1040 unconst(m->pVirtualBox) = aVirtualBox; … … 1053 1053 /* No storage unit is created yet, no need to call Medium::i_queryInfo */ 1054 1054 1055 rc = i_setFormat(aFormat);1056 if (FAILED( rc)) returnrc;1057 1058 rc = i_setLocation(aLocation);1059 if (FAILED( rc)) returnrc;1055 hrc = i_setFormat(aFormat); 1056 if (FAILED(hrc)) return hrc; 1057 1058 hrc = i_setLocation(aLocation); 1059 if (FAILED(hrc)) return hrc; 1060 1060 1061 1061 if (!(m->formatObj->i_getCapabilities() & ( MediumFormatCapabilities_CreateFixed … … 1096 1096 } 1097 1097 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)); 1100 1100 } 1101 1101 1102 1102 /* Confirm a successful initialization when it's the case */ 1103 if (SUCCEEDED( rc))1103 if (SUCCEEDED(hrc)) 1104 1104 autoInitSpan.setSucceeded(); 1105 1105 1106 return rc;1106 return hrc; 1107 1107 } 1108 1108 … … 1141 1141 AssertReturn(!aLocation.isEmpty(), E_INVALIDARG); 1142 1142 1143 HRESULT rc = S_OK;1143 HRESULT hrc = S_OK; 1144 1144 1145 1145 { … … 1167 1167 m->type = MediumType_Writethrough; 1168 1168 1169 rc = i_setLocation(aLocation);1170 if (FAILED( rc)) returnrc;1169 hrc = i_setLocation(aLocation); 1170 if (FAILED(hrc)) return hrc; 1171 1171 1172 1172 /* get all the information about the medium from the storage unit */ … … 1192 1192 /* need to call i_queryInfo immediately to correctly place the medium in 1193 1193 * 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)) 1197 1196 { 1198 1197 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); … … 1203 1202 { 1204 1203 Assert(!m->strLastAccessError.isEmpty()); 1205 rc = setError(E_FAIL, "%s", m->strLastAccessError.c_str());1204 hrc = setError(E_FAIL, "%s", m->strLastAccessError.c_str()); 1206 1205 alock.release(); 1207 1206 autoCaller.release(); … … 1226 1225 } 1227 1226 1228 return rc;1227 return hrc; 1229 1228 } 1230 1229 … … 1253 1252 const settings::Medium &data) 1254 1253 { 1255 HRESULT rc;1254 HRESULT hrc; 1256 1255 1257 1256 if (uuidMachineRegistry.isValid() && !uuidMachineRegistry.isZero()) … … 1286 1285 { 1287 1286 AssertReturn(!data.strFormat.isEmpty(), E_FAIL); 1288 rc = i_setFormat(data.strFormat);1289 if (FAILED( rc)) returnrc;1287 hrc = i_setFormat(data.strFormat); 1288 if (FAILED(hrc)) return hrc; 1290 1289 } 1291 1290 else … … 1293 1292 /// @todo handle host drive settings here as well? 1294 1293 if (!data.strFormat.isEmpty()) 1295 rc = i_setFormat(data.strFormat);1294 hrc = i_setFormat(data.strFormat); 1296 1295 else 1297 rc = i_setFormat("RAW");1298 if (FAILED( rc)) returnrc;1296 hrc = i_setFormat("RAW"); 1297 if (FAILED(hrc)) return hrc; 1299 1298 } 1300 1299 … … 1356 1355 strFull = data.strLocation; 1357 1356 1358 rc = i_setLocation(strFull);1359 if (FAILED( rc)) returnrc;1357 hrc = i_setLocation(strFull); 1358 if (FAILED(hrc)) return hrc; 1360 1359 1361 1360 if (aDeviceType == DeviceType_HardDisk) … … 1417 1416 AssertReturn(aVirtualBox, E_INVALIDARG); 1418 1417 1419 HRESULT rc = S_OK;1418 HRESULT hrc = S_OK; 1420 1419 1421 1420 MediaList llMediaTocleanup; … … 1435 1434 bool fReleasedMediaTreeLock = false; 1436 1435 ComObjPtr<Medium> pMedium; 1437 rc = pMedium.createObject();1438 if (FAILED( rc))1436 hrc = pMedium.createObject(); 1437 if (FAILED(hrc)) 1439 1438 break; 1440 1439 ComObjPtr<Medium> pActualMedium(pMedium); … … 1442 1441 { 1443 1442 AutoInitSpan autoInitSpan(pMedium); 1444 AssertBreakStmt(autoInitSpan.isOk(), rc = E_FAIL);1443 AssertBreakStmt(autoInitSpan.isOk(), hrc = E_FAIL); 1445 1444 1446 1445 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)) 1449 1448 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)) 1452 1451 break; 1453 1452 … … 1486 1485 } 1487 1486 1488 if (SUCCEEDED( rc))1487 if (SUCCEEDED(hrc)) 1489 1488 { 1490 1489 /* Check for consistency. */ … … 1524 1523 } 1525 1524 1526 return rc;1525 return hrc; 1527 1526 } 1528 1527 … … 1578 1577 m->state = MediumState_Created; 1579 1578 m->hostDrive = true; 1580 HRESULT rc = i_setFormat("RAW");1581 if (FAILED( rc)) returnrc;1582 rc = i_setLocation(aLocation);1583 if (FAILED( rc)) returnrc;1579 HRESULT hrc = i_setFormat("RAW"); 1580 if (FAILED(hrc)) return hrc; 1581 hrc = i_setLocation(aLocation); 1582 if (FAILED(hrc)) return hrc; 1584 1583 m->strDescription = aDescription; 1585 1584 … … 1756 1755 /// require to add the mRegistered flag to data 1757 1756 1758 HRESULT rc = S_OK;1757 HRESULT hrc = S_OK; 1759 1758 1760 1759 MediumLockList *pMediumLockList(new MediumLockList()); … … 1771 1770 1772 1771 /* 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)) 1780 1778 pszError = tr("Failed to create medium lock list for '%s'"); 1781 }1782 1779 else 1783 1780 { 1784 rc = pMediumLockList->Lock();1785 if (FAILED( rc))1781 hrc = pMediumLockList->Lock(); 1782 if (FAILED(hrc)) 1786 1783 pszError = tr("Failed to lock media '%s'"); 1787 1784 } … … 1796 1793 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1797 1794 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()); 1800 1797 1801 1798 /* Set a new description */ … … 1810 1807 m->pVirtualBox->i_onMediumConfigChanged(this); 1811 1808 } 1812 catch (HRESULT aRC) { rc = aRC; }1809 catch (HRESULT hrcXcpt) { hrc = hrcXcpt; } 1813 1810 1814 1811 delete pMediumLockList; 1815 1812 1816 return rc;1813 return hrc; 1817 1814 } 1818 1815 … … 2270 2267 alock.release(); 2271 2268 2272 HRESULT rc = i_queryInfo(!!aSetImageId /* fSetImageId */,2273 !!aSetParentId /* fSetParentId */,2274 autoCaller);2269 HRESULT hrc = i_queryInfo(!!aSetImageId /* fSetImageId */, 2270 !!aSetParentId /* fSetParentId */, 2271 autoCaller); 2275 2272 2276 2273 AutoReadLock arlock(this COMMA_LOCKVAL_SRC_POS); … … 2279 2276 arlock.release(); 2280 2277 2281 if (SUCCEEDED( rc))2278 if (SUCCEEDED(hrc)) 2282 2279 { 2283 2280 if (uCurrImage != uPrevImage) … … 2292 2289 } 2293 2290 2294 return rc;2291 return hrc; 2295 2292 } 2296 2293 … … 2299 2296 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 2300 2297 2301 HRESULT rc = S_OK;2298 HRESULT hrc = S_OK; 2302 2299 2303 2300 switch (m->state) … … 2310 2307 alock.release(); 2311 2308 2312 rc = i_queryInfo(false /* fSetImageId */, false /* fSetParentId */, 2313 autoCaller); 2309 hrc = i_queryInfo(false /* fSetImageId */, false /* fSetParentId */, autoCaller); 2314 2310 2315 2311 alock.acquire(); … … 2322 2318 *aState = m->state; 2323 2319 2324 return rc;2320 return hrc; 2325 2321 } 2326 2322 … … 2383 2379 } 2384 2380 2385 HRESULT rc = S_OK;2381 HRESULT hrc = S_OK; 2386 2382 2387 2383 switch (m->state) … … 2393 2389 ++m->readers; 2394 2390 2395 ComAssertMsgBreak(m->readers != 0, (tr("Counter overflow")), rc = E_FAIL);2391 ComAssertMsgBreak(m->readers != 0, (tr("Counter overflow")), hrc = E_FAIL); 2396 2392 2397 2393 /* Remember pre-lock state */ … … 2403 2399 2404 2400 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)) 2409 2405 { 2410 2406 --m->readers; 2411 2407 if (m->readers == 0) 2412 2408 m->state = m->preLockState; 2413 return rc;2409 return hrc; 2414 2410 } 2415 2411 … … 2420 2416 { 2421 2417 LogFlowThisFunc(("Failing - state=%d\n", m->state)); 2422 rc = i_setStateError();2418 hrc = i_setStateError(); 2423 2419 break; 2424 2420 } 2425 2421 } 2426 2422 2427 return rc;2423 return hrc; 2428 2424 } 2429 2425 … … 2439 2435 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 2440 2436 2441 HRESULT rc = S_OK;2437 HRESULT hrc = S_OK; 2442 2438 2443 2439 switch (m->state) … … 2445 2441 case MediumState_LockedRead: 2446 2442 { 2447 ComAssertMsgBreak(m->readers != 0, (tr("Counter underflow")), rc = E_FAIL);2443 ComAssertMsgBreak(m->readers != 0, (tr("Counter underflow")), hrc = E_FAIL); 2448 2444 --m->readers; 2449 2445 … … 2465 2461 { 2466 2462 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()); 2470 2464 break; 2471 2465 } … … 2476 2470 *aState = m->state; 2477 2471 2478 return rc;2472 return hrc; 2479 2473 } 2480 2474 HRESULT Medium::lockWrite(ComPtr<IToken> &aToken) … … 2500 2494 } 2501 2495 2502 HRESULT rc = S_OK;2496 HRESULT hrc = S_OK; 2503 2497 2504 2498 switch (m->state) … … 2513 2507 2514 2508 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)) 2519 2513 { 2520 2514 m->state = m->preLockState; 2521 return rc;2515 return hrc; 2522 2516 } 2523 2517 … … 2528 2522 { 2529 2523 LogFlowThisFunc(("Failing - state=%d locationFull=%s\n", m->state, i_getLocationFull().c_str())); 2530 rc = i_setStateError();2524 hrc = i_setStateError(); 2531 2525 break; 2532 2526 } 2533 2527 } 2534 2528 2535 return rc;2529 return hrc; 2536 2530 } 2537 2531 … … 2547 2541 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 2548 2542 2549 HRESULT rc = S_OK;2543 HRESULT hrc = S_OK; 2550 2544 2551 2545 switch (m->state) … … 2565 2559 { 2566 2560 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()); 2570 2562 break; 2571 2563 } … … 2576 2568 *aState = m->state; 2577 2569 2578 return rc;2570 return hrc; 2579 2571 } 2580 2572 … … 2772 2764 return setError(E_INVALIDARG, tr("The medium size argument (%lld) is negative"), aLogicalSize); 2773 2765 2774 HRESULT rc = S_OK;2766 HRESULT hrc = S_OK; 2775 2767 ComObjPtr<Progress> pProgress; 2776 2768 Medium::Task *pTask = NULL; … … 2811 2803 2812 2804 pProgress.createObject(); 2813 rc = pProgress->init(m->pVirtualBox,2814 static_cast<IMedium*>(this),2815 (mediumVariantFlags & MediumVariant_Fixed)2816 2817 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; 2821 2813 2822 2814 /* setup task object to carry out the operation asynchronously */ 2823 2815 pTask = new Medium::CreateBaseTask(this, pProgress, (uint64_t)aLogicalSize, 2824 2816 (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; 2829 2821 2830 2822 m->state = MediumState_Creating; 2831 2823 } 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(); 2837 2832 pTask = NULL; 2838 2833 2839 if (SUCCEEDED( rc))2834 if (SUCCEEDED(hrc)) 2840 2835 pProgress.queryInterfaceTo(aProgress.asOutParam()); 2841 2836 } … … 2843 2838 delete pTask; 2844 2839 2845 return rc;2840 return hrc; 2846 2841 } 2847 2842 … … 2902 2897 autoCaller.release(); 2903 2898 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); 2909 2904 treeLock.acquire(); 2910 2905 autoCaller.add(); 2911 2906 if (FAILED(autoCaller.hrc())) 2912 rc = autoCaller.hrc();2907 hrc = autoCaller.hrc(); 2913 2908 alock.acquire(); 2914 if (FAILED( rc))2909 if (FAILED(hrc)) 2915 2910 { 2916 2911 delete pMediumLockList; 2917 return rc;2912 return hrc; 2918 2913 } 2919 2914 … … 2921 2916 autoCaller.release(); 2922 2917 treeLock.release(); 2923 rc = pMediumLockList->Lock();2918 hrc = pMediumLockList->Lock(); 2924 2919 treeLock.acquire(); 2925 2920 autoCaller.add(); 2926 2921 if (FAILED(autoCaller.hrc())) 2927 rc = autoCaller.hrc();2922 hrc = autoCaller.hrc(); 2928 2923 alock.acquire(); 2929 if (FAILED( rc))2924 if (FAILED(hrc)) 2930 2925 { 2931 2926 delete pMediumLockList; 2932 2927 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'"), 2934 2929 diff->i_getLocationFull().c_str()); 2935 2930 } … … 2970 2965 } 2971 2966 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)) 2975 2970 delete pMediumLockList; 2976 2971 else 2977 2972 pProgress.queryInterfaceTo(aProgress.asOutParam()); 2978 2973 2979 return rc;2974 return hrc; 2980 2975 } 2981 2976 … … 2994 2989 MediumLockList *pMediumLockList = NULL; 2995 2990 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; 3001 2994 3002 2995 ComObjPtr<Progress> pProgress; 3003 2996 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)) 3007 3000 i_cancelMergeTo(pChildrenToReparent, pMediumLockList); 3008 3001 else 3009 3002 pProgress.queryInterfaceTo(aProgress.asOutParam()); 3010 3003 3011 return rc;3004 return hrc; 3012 3005 } 3013 3006 … … 3040 3033 } 3041 3034 3042 HRESULT rc = S_OK;3035 HRESULT hrc = S_OK; 3043 3036 ComObjPtr<Progress> pProgress; 3044 3037 Medium::Task *pTask = NULL; … … 3066 3059 MediumLockList *pSourceMediumLockList(new MediumLockList()); 3067 3060 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); 3073 3066 alock.acquire(); 3074 if (FAILED( rc))3067 if (FAILED(hrc)) 3075 3068 { 3076 3069 delete pSourceMediumLockList; 3077 throw rc;3070 throw hrc; 3078 3071 } 3079 3072 … … 3081 3074 MediumLockList *pTargetMediumLockList(new MediumLockList()); 3082 3075 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); 3088 3081 alock.acquire(); 3089 if (FAILED( rc))3082 if (FAILED(hrc)) 3090 3083 { 3091 3084 delete pSourceMediumLockList; 3092 3085 delete pTargetMediumLockList; 3093 throw rc;3086 throw hrc; 3094 3087 } 3095 3088 3096 3089 alock.release(); 3097 rc = pSourceMediumLockList->Lock();3090 hrc = pSourceMediumLockList->Lock(); 3098 3091 alock.acquire(); 3099 if (FAILED( rc))3092 if (FAILED(hrc)) 3100 3093 { 3101 3094 delete pSourceMediumLockList; 3102 3095 delete pTargetMediumLockList; 3103 throw setError( rc,3096 throw setError(hrc, 3104 3097 tr("Failed to lock source media '%s'"), 3105 3098 i_getLocationFull().c_str()); 3106 3099 } 3107 3100 alock.release(); 3108 rc = pTargetMediumLockList->Lock();3101 hrc = pTargetMediumLockList->Lock(); 3109 3102 alock.acquire(); 3110 if (FAILED( rc))3103 if (FAILED(hrc)) 3111 3104 { 3112 3105 delete pSourceMediumLockList; 3113 3106 delete pTargetMediumLockList; 3114 throw setError( rc,3107 throw setError(hrc, 3115 3108 tr("Failed to lock target media '%s'"), 3116 3109 pTarget->i_getLocationFull().c_str()); … … 3118 3111 3119 3112 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)) 3125 3118 { 3126 3119 delete pSourceMediumLockList; 3127 3120 delete pTargetMediumLockList; 3128 throw rc;3121 throw hrc; 3129 3122 } 3130 3123 … … 3150 3143 pParent, UINT32_MAX, UINT32_MAX, 3151 3144 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; 3156 3149 3157 3150 if (pTarget->m->state == MediumState_NotCreated) 3158 3151 pTarget->m->state = MediumState_Creating; 3159 3152 } 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(); 3165 3161 pTask = NULL; 3166 if (SUCCEEDED( rc))3162 if (SUCCEEDED(hrc)) 3167 3163 pProgress.queryInterfaceTo(aProgress.asOutParam()); 3168 3164 } … … 3170 3166 delete pTask; 3171 3167 3172 return rc;3168 return hrc; 3173 3169 } 3174 3170 … … 3206 3202 3207 3203 /* Set up variables. Fetch needed data in lockable blocks */ 3208 HRESULT rc = S_OK;3204 HRESULT hrc = S_OK; 3209 3205 Medium::Task *pTask = NULL; 3210 3206 … … 3226 3222 ComObjPtr<Progress> pProgress; 3227 3223 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; 3238 3233 3239 3234 /* If target does not exist, handle resize. */ … … 3243 3238 if (!i_isMediumFormatFile()) 3244 3239 { 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; 3250 3244 } 3251 3245 … … 3256 3250 3257 3251 ComPtr<IToken> pToken; 3258 rc = pTarget->LockWrite(pToken.asOutParam());3259 3260 if (FAILED( rc)) returnrc;3252 hrc = pTarget->LockWrite(pToken.asOutParam()); 3253 3254 if (FAILED(hrc)) return hrc; 3261 3255 3262 3256 /** … … 3268 3262 pMediumLockListForResize->Append(pTarget, pTarget->m->state == MediumState_LockedWrite); 3269 3263 3270 rc = pMediumLockListForResize->Lock(true /* fSkipOverLockedMedia */); 3271 3272 if (FAILED(rc)) 3264 hrc = pMediumLockListForResize->Lock(true /* fSkipOverLockedMedia */); 3265 if (FAILED(hrc)) 3273 3266 { 3274 3267 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 3275 rc = setError(rc,3276 3277 3268 hrc = setError(hrc, 3269 tr("Failed to lock the medium '%s' to resize before merge"), 3270 strTargetName.c_str()); 3278 3271 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)) 3286 3278 { 3287 3279 /* No need to setError becasue i_resize and i_taskResizeHandler handle this automatically. */ 3288 3280 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 3289 3281 delete pMediumLockListForResize; 3290 return rc;3282 return hrc; 3291 3283 } 3292 3284 … … 3301 3293 3302 3294 /* Report progress to supplied progress argument */ 3303 if (SUCCEEDED( rc))3295 if (SUCCEEDED(hrc)) 3304 3296 { 3305 3297 pProgress.queryInterfaceTo(aProgress.asOutParam()); … … 3328 3320 MediumLockList *pSourceMediumLockList(new MediumLockList()); 3329 3321 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); 3335 3327 alock.acquire(); 3336 if (FAILED( rc))3328 if (FAILED(hrc)) 3337 3329 { 3338 3330 delete pSourceMediumLockList; 3339 throw rc;3331 throw hrc; 3340 3332 } 3341 3333 … … 3343 3335 MediumLockList *pTargetMediumLockList(new MediumLockList()); 3344 3336 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); 3350 3342 alock.acquire(); 3351 if (FAILED( rc))3343 if (FAILED(hrc)) 3352 3344 { 3353 3345 delete pSourceMediumLockList; 3354 3346 delete pTargetMediumLockList; 3355 throw rc;3347 throw hrc; 3356 3348 } 3357 3349 3358 3350 alock.release(); 3359 rc = pSourceMediumLockList->Lock();3351 hrc = pSourceMediumLockList->Lock(); 3360 3352 alock.acquire(); 3361 if (FAILED( rc))3353 if (FAILED(hrc)) 3362 3354 { 3363 3355 delete pSourceMediumLockList; 3364 3356 delete pTargetMediumLockList; 3365 throw setError( rc,3357 throw setError(hrc, 3366 3358 tr("Failed to lock source media '%s'"), 3367 3359 i_getLocationFull().c_str()); 3368 3360 } 3369 3361 alock.release(); 3370 rc = pTargetMediumLockList->Lock();3362 hrc = pTargetMediumLockList->Lock(); 3371 3363 alock.acquire(); 3372 if (FAILED( rc))3364 if (FAILED(hrc)) 3373 3365 { 3374 3366 delete pSourceMediumLockList; 3375 3367 delete pTargetMediumLockList; 3376 throw setError( rc,3368 throw setError(hrc, 3377 3369 tr("Failed to lock target media '%s'"), 3378 3370 pTarget->i_getLocationFull().c_str()); … … 3414 3406 } 3415 3407 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; 3420 3412 3421 3413 if (pTarget->m->state == MediumState_NotCreated) 3422 3414 pTarget->m->state = MediumState_Creating; 3423 3415 } 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(); 3429 3421 pTask = NULL; 3430 if (SUCCEEDED( rc))3422 if (SUCCEEDED(hrc)) 3431 3423 pProgress.queryInterfaceTo(aProgress.asOutParam()); 3432 3424 } … … 3434 3426 delete pTask; 3435 3427 3436 return rc;3428 return hrc; 3437 3429 } 3438 3430 … … 3441 3433 ComObjPtr<Medium> pParent; 3442 3434 ComObjPtr<Progress> pProgress; 3443 HRESULT rc = S_OK;3435 HRESULT hrc = S_OK; 3444 3436 Medium::Task *pTask = NULL; 3445 3437 … … 3474 3466 if (aLocation.isEmpty()) 3475 3467 { 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; 3480 3472 } 3481 3473 … … 3541 3533 break; 3542 3534 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; 3547 3539 } 3548 3540 } … … 3562 3554 /* Simple check for existence */ 3563 3555 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()); 3570 3559 3571 3560 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()); 3578 3564 /* Path must be absolute */ 3579 3565 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()); 3586 3569 /* 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; 3590 3573 3591 3574 /* 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()); 3600 3580 } 3601 3581 3602 3582 /* Check VMs which have this medium attached to*/ 3603 3583 std::vector<com::Guid> aMachineIds; 3604 rc = getMachineIds(aMachineIds);3584 hrc = getMachineIds(aMachineIds); 3605 3585 std::vector<com::Guid>::const_iterator currMachineID = aMachineIds.begin(); 3606 3586 std::vector<com::Guid>::const_iterator lastMachineID = aMachineIds.end(); … … 3614 3594 autoCaller.release(); 3615 3595 treeLock.release(); 3616 rc = m->pVirtualBox->i_findMachine(id, false, true, &aMachine);3596 hrc = m->pVirtualBox->i_findMachine(id, false, true, &aMachine); 3617 3597 treeLock.acquire(); 3618 3598 autoCaller.add(); … … 3620 3600 alock.acquire(); 3621 3601 3622 if (SUCCEEDED( rc))3602 if (SUCCEEDED(hrc)) 3623 3603 { 3624 3604 ComObjPtr<SessionMachine> sm; … … 3635 3615 3636 3616 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()); 3644 3620 } 3645 3621 ++currMachineID; … … 3651 3627 autoCaller.release(); 3652 3628 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); 3658 3634 treeLock.acquire(); 3659 3635 autoCaller.add(); 3660 3636 AssertComRCThrowRC(autoCaller.hrc()); 3661 3637 alock.acquire(); 3662 if (FAILED( rc))3638 if (FAILED(hrc)) 3663 3639 { 3664 3640 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()); 3668 3642 } 3669 3643 alock.release(); 3670 3644 autoCaller.release(); 3671 3645 treeLock.release(); 3672 rc = pMediumLockList->Lock();3646 hrc = pMediumLockList->Lock(); 3673 3647 treeLock.acquire(); 3674 3648 autoCaller.add(); 3675 3649 AssertComRCThrowRC(autoCaller.hrc()); 3676 3650 alock.acquire(); 3677 if (FAILED( rc))3651 if (FAILED(hrc)) 3678 3652 { 3679 3653 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()); 3683 3655 } 3684 3656 3685 3657 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 */); 3690 3662 3691 3663 /* Do the disk moving. */ 3692 if (SUCCEEDED( rc))3664 if (SUCCEEDED(hrc)) 3693 3665 { 3694 3666 ULONG mediumVariantFlags = i_getVariant(); … … 3698 3670 (MediumVariant_T)mediumVariantFlags, 3699 3671 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(); 3712 3684 pTask = NULL; 3713 if (SUCCEEDED( rc))3685 if (SUCCEEDED(hrc)) 3714 3686 pProgress.queryInterfaceTo(aProgress.asOutParam()); 3715 3687 } … … 3720 3692 } 3721 3693 3722 return rc;3694 return hrc; 3723 3695 } 3724 3696 3725 3697 HRESULT Medium::setLocation(const com::Utf8Str &aLocation) 3726 3698 { 3727 HRESULT rc = S_OK;3699 HRESULT hrc = S_OK; 3728 3700 3729 3701 try … … 3745 3717 /* Path must be absolute */ 3746 3718 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()); 3753 3720 3754 3721 /* Simple check for existence */ 3755 3722 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()); 3762 3726 } 3763 3727 3764 3728 /* Check VMs which have this medium attached to*/ 3765 3729 std::vector<com::Guid> aMachineIds; 3766 rc = getMachineIds(aMachineIds);3730 hrc = getMachineIds(aMachineIds); 3767 3731 3768 3732 // switch locks only if there are machines with this medium attached … … 3780 3744 Guid id(*currMachineID); 3781 3745 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)) 3784 3748 { 3785 3749 ComObjPtr<SessionMachine> sm; … … 3794 3758 alock.acquire(); 3795 3759 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()); 3801 3764 } 3802 3765 } … … 3824 3787 m->pVirtualBox->i_onMediumConfigChanged(this); 3825 3788 } 3826 catch (HRESULT aRC) { rc = aRC; }3827 3828 return rc;3789 catch (HRESULT hrcXcpt) { hrc = hrcXcpt; } 3790 3791 return hrc; 3829 3792 } 3830 3793 3831 3794 HRESULT Medium::compact(ComPtr<IProgress> &aProgress) 3832 3795 { 3833 HRESULT rc = S_OK;3796 HRESULT hrc = S_OK; 3834 3797 ComObjPtr<Progress> pProgress; 3835 3798 Medium::Task *pTask = NULL; … … 3842 3805 MediumLockList *pMediumLockList(new MediumLockList()); 3843 3806 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); 3849 3812 alock.acquire(); 3850 if (FAILED( rc))3813 if (FAILED(hrc)) 3851 3814 { 3852 3815 delete pMediumLockList; 3853 throw rc;3816 throw hrc; 3854 3817 } 3855 3818 3856 3819 alock.release(); 3857 rc = pMediumLockList->Lock();3820 hrc = pMediumLockList->Lock(); 3858 3821 alock.acquire(); 3859 if (FAILED( rc))3822 if (FAILED(hrc)) 3860 3823 { 3861 3824 delete pMediumLockList; 3862 throw setError( rc,3825 throw setError(hrc, 3863 3826 tr("Failed to lock media when compacting '%s'"), 3864 3827 i_getLocationFull().c_str()); … … 3866 3829 3867 3830 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)) 3873 3836 { 3874 3837 delete pMediumLockList; 3875 throw rc;3838 throw hrc; 3876 3839 } 3877 3840 3878 3841 /* setup task object to carry out the operation asynchronously */ 3879 3842 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(); 3890 3853 pTask = NULL; 3891 if (SUCCEEDED( rc))3854 if (SUCCEEDED(hrc)) 3892 3855 pProgress.queryInterfaceTo(aProgress.asOutParam()); 3893 3856 } … … 3895 3858 delete pTask; 3896 3859 3897 return rc;3860 return hrc; 3898 3861 } 3899 3862 … … 3902 3865 { 3903 3866 CheckComArgExpr(aLogicalSize, aLogicalSize > 0); 3904 HRESULT rc = S_OK;3867 HRESULT hrc = S_OK; 3905 3868 ComObjPtr<Progress> pProgress; 3906 3869 … … 3912 3875 const char *pszError = NULL; 3913 3876 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)) 3921 3883 pszError = tr("Failed to create medium lock list when resizing '%s'"); 3922 }3923 3884 else 3924 3885 { 3925 rc = pMediumLockList->Lock();3926 if (FAILED( rc))3886 hrc = pMediumLockList->Lock(); 3887 if (FAILED(hrc)) 3927 3888 pszError = tr("Failed to lock media when resizing '%s'"); 3928 3889 } … … 3931 3892 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 3932 3893 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()); 3936 3897 } 3937 3898 3938 3899 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)) 3954 3915 pProgress.queryInterfaceTo(aProgress.asOutParam()); 3955 3916 else 3956 3917 delete pMediumLockList; 3957 3918 3958 return rc;3919 return hrc; 3959 3920 } 3960 3921 … … 4033 3994 throw rc; 4034 3995 } 4035 catch (HRESULT aRC) { rc = aRC; }3996 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 4036 3997 4037 3998 if (SUCCEEDED(rc)) … … 4170 4131 throw rc; 4171 4132 } 4172 catch (HRESULT aRC) { rc = aRC; }4133 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 4173 4134 4174 4135 if (SUCCEEDED(rc)) … … 4259 4220 # endif 4260 4221 } 4261 catch (HRESULT aRC) { rc = aRC; }4222 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 4262 4223 4263 4224 return rc; … … 4330 4291 # endif 4331 4292 } 4332 catch (HRESULT aRC) { rc = aRC; }4293 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 4333 4294 4334 4295 return rc; … … 5584 5545 aTarget->m->state = MediumState_Creating; 5585 5546 } 5586 catch (HRESULT aRC) { rc = aRC; }5547 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 5587 5548 5588 5549 if (SUCCEEDED(rc)) … … 5952 5913 throw rc; 5953 5914 } 5954 catch (HRESULT aRC) { rc = aRC; }5915 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 5955 5916 5956 5917 if (SUCCEEDED(rc)) … … 6171 6132 } 6172 6133 } 6173 catch (HRESULT aRC) { rc = aRC; }6134 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 6174 6135 6175 6136 return rc; … … 6498 6459 } 6499 6460 } 6500 catch (HRESULT aRC) { rc = aRC; }6461 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 6501 6462 6502 6463 if (FAILED(rc)) … … 6663 6624 throw rc; 6664 6625 } 6665 catch (HRESULT aRC) { rc = aRC; }6626 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 6666 6627 6667 6628 if (SUCCEEDED(rc)) … … 6827 6788 throw rc; 6828 6789 } 6829 catch (HRESULT aRC) { rc = aRC; }6790 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 6830 6791 6831 6792 if (SUCCEEDED(rc)) … … 6923 6884 } 6924 6885 } 6925 catch (HRESULT aRC) { rc = aRC; }6886 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 6926 6887 catch (int aVRC) 6927 6888 { … … 6934 6895 VDDestroy(hdd); 6935 6896 } 6936 catch (HRESULT aRC) { rc = aRC; }6897 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 6937 6898 6938 6899 return rc; … … 7210 7171 m->state = MediumState_Creating; 7211 7172 } 7212 catch (HRESULT aRC) { rc = aRC; }7173 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 7213 7174 7214 7175 if (SUCCEEDED(rc)) … … 7358 7319 aTarget->m->state = MediumState_Creating; 7359 7320 } 7360 catch (HRESULT aRC) { rc = aRC; }7321 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 7361 7322 7362 7323 if (SUCCEEDED(rc)) … … 7894 7855 success = true; 7895 7856 } 7896 catch (HRESULT aRC)7897 { 7898 rc = aRC;7857 catch (HRESULT hrcXcpt) 7858 { 7859 rc = hrcXcpt; 7899 7860 } 7900 7861 … … 7908 7869 } 7909 7870 } 7910 catch (HRESULT aRC)7911 { 7912 rc = aRC;7871 catch (HRESULT hrcXcpt) 7872 { 7873 rc = hrcXcpt; 7913 7874 } 7914 7875 … … 7989 7950 ComAssertRCThrow(vrc, E_FAIL); 7990 7951 } 7991 catch (HRESULT aRC)7952 catch (HRESULT hrcXcpt) 7992 7953 { 7993 rc = aRC;7954 rc = hrcXcpt; 7994 7955 } 7995 7956 7996 7957 VDDestroy(hdd); 7997 7958 } 7998 catch (HRESULT aRC)7999 { 8000 rc = aRC;7959 catch (HRESULT hrcXcpt) 7960 { 7961 rc = hrcXcpt; 8001 7962 } 8002 7963 … … 9032 8993 variant = (MediumVariant_T)uImageFlags; 9033 8994 } 9034 catch (HRESULT aRC) { rc = aRC; }8995 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 9035 8996 9036 8997 VDDestroy(hdd); 9037 8998 } 9038 catch (HRESULT aRC) { rc = aRC; }8999 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 9039 9000 9040 9001 if (SUCCEEDED(rc)) … … 9230 9191 variant = (MediumVariant_T)uImageFlags; 9231 9192 } 9232 catch (HRESULT aRC) { rcTmp = aRC; }9193 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; } 9233 9194 9234 9195 VDDestroy(hdd); 9235 9196 } 9236 catch (HRESULT aRC) { rcTmp = aRC; }9197 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; } 9237 9198 9238 9199 MultiResult mrc(rcTmp); … … 9554 9515 } 9555 9516 } 9556 catch (HRESULT aRC) { rcTmp = aRC; }9517 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; } 9557 9518 catch (int aVRC) 9558 9519 { … … 9566 9527 VDDestroy(hdd); 9567 9528 } 9568 catch (HRESULT aRC) { rcTmp = aRC; }9529 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; } 9569 9530 9570 9531 ErrorInfoKeeper eik; … … 9955 9916 variant = (MediumVariant_T)uImageFlags; 9956 9917 } 9957 catch (HRESULT aRC) { rcTmp = aRC; }9918 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; } 9958 9919 9959 9920 VDDestroy(targetHdd); 9960 9921 } 9961 catch (HRESULT aRC) { rcTmp = aRC; }9922 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; } 9962 9923 9963 9924 VDDestroy(hdd); 9964 9925 } 9965 catch (HRESULT aRC) { rcTmp = aRC; }9926 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; } 9966 9927 9967 9928 ErrorInfoKeeper eik; … … 10223 10184 10224 10185 } 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; } 10229 10190 10230 10191 VDDestroy(hdd); 10231 10192 } 10232 catch (HRESULT aRC) { rcOut = aRC; }10193 catch (HRESULT hrcXcpt) { rcOut = hrcXcpt; } 10233 10194 10234 10195 ErrorInfoKeeper eik; … … 10306 10267 10307 10268 } 10308 catch (HRESULT aRC) { rc = aRC; }10269 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 10309 10270 10310 10271 VDDestroy(hdd); 10311 10272 } 10312 catch (HRESULT aRC) { rc = aRC; }10273 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 10313 10274 10314 10275 AutoWriteLock thisLock(this COMMA_LOCKVAL_SRC_POS); … … 10462 10423 variant = (MediumVariant_T)uImageFlags; 10463 10424 } 10464 catch (HRESULT aRC) { rc = aRC; }10425 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 10465 10426 10466 10427 VDDestroy(hdd); 10467 10428 } 10468 catch (HRESULT aRC) { rc = aRC; }10429 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 10469 10430 10470 10431 AutoWriteLock thisLock(this COMMA_LOCKVAL_SRC_POS); … … 10568 10529 } 10569 10530 } 10570 catch (HRESULT aRC) { rc = aRC; }10531 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 10571 10532 10572 10533 VDDestroy(hdd); 10573 10534 } 10574 catch (HRESULT aRC) { rc = aRC; }10535 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 10575 10536 10576 10537 if (task.NotifyAboutChanges() && SUCCEEDED(rc)) … … 10681 10642 logicalSize = VDGetSize(hdd, VD_LAST_IMAGE); 10682 10643 } 10683 catch (HRESULT aRC) { rc = aRC; }10644 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 10684 10645 10685 10646 VDDestroy(hdd); 10686 10647 } 10687 catch (HRESULT aRC) { rc = aRC; }10648 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 10688 10649 10689 10650 if (SUCCEEDED(rc)) … … 10871 10832 variant = (MediumVariant_T)uImageFlags; 10872 10833 } 10873 catch (HRESULT aRC) { rcTmp = aRC; }10834 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; } 10874 10835 10875 10836 VDDestroy(targetHdd); 10876 10837 } 10877 catch (HRESULT aRC) { rcTmp = aRC; }10838 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; } 10878 10839 10879 10840 VDDestroy(hdd); 10880 10841 } 10881 catch (HRESULT aRC) { rcTmp = aRC; }10842 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; } 10882 10843 10883 10844 ErrorInfoKeeper eik; … … 11212 11173 m->pVirtualBox->i_saveModifiedRegistries(); 11213 11174 } 11214 catch (HRESULT aRC) { rc = aRC; }11175 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 11215 11176 11216 11177 if (pvBuf) … … 11223 11184 # endif 11224 11185 } 11225 catch (HRESULT aRC) { rc = aRC; }11186 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 11226 11187 11227 11188 /* Everything is explicitly unlocked when the task exits, -
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r98262 r98289 2588 2588 } 2589 2589 } 2590 catch (HRESULT aRC)2591 { 2592 rc = aRC;2590 catch (HRESULT hrcXcpt) 2591 { 2592 rc = hrcXcpt; 2593 2593 } 2594 2594 … … 3575 3575 } 3576 3576 } 3577 catch (HRESULT aRC) { 3578 mrc = aRC; 3577 catch (HRESULT hrcXcpt) 3578 { 3579 mrc = hrcXcpt; 3579 3580 } 3580 3581 … … 4141 4142 throw rc; 4142 4143 } 4143 catch (HRESULT aRC) { rc = aRC; }4144 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 4144 4145 4145 4146 // The callback mentioned above takes care of update the medium state -
trunk/src/VBox/Main/src-server/VFSExplorerImpl.cpp
r98262 r98289 314 314 aTask->m_ptrProgress->SetCurrentOperationProgress(66); 315 315 } 316 catch (HRESULT aRC)317 { 318 rc = aRC;316 catch (HRESULT hrcXcpt) 317 { 318 rc = hrcXcpt; 319 319 } 320 320 … … 374 374 } 375 375 } 376 catch (HRESULT aRC)377 { 378 rc = aRC;376 catch (HRESULT hrcXcpt) 377 { 378 rc = hrcXcpt; 379 379 } 380 380 … … 416 416 rc = pTask->createThreadWithType(RTTHREADTYPE_MAIN_HEAVY_WORKER); 417 417 } 418 catch (HRESULT aRC)419 { 420 rc = aRC;418 catch (HRESULT hrcXcpt) 419 { 420 rc = hrcXcpt; 421 421 } 422 422 … … 534 534 rc = pTask->createThreadWithType(RTTHREADTYPE_MAIN_HEAVY_WORKER); 535 535 } 536 catch (HRESULT aRC)537 { 538 rc = aRC;536 catch (HRESULT hrcXcpt) 537 { 538 rc = hrcXcpt; 539 539 } 540 540 -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r98285 r98289 868 868 ComAssertThrow(m->pAsyncEventQ, E_FAIL); 869 869 } 870 catch (HRESULT aRC)871 { 872 hrc = aRC;870 catch (HRESULT hrcXcpt) 871 { 872 hrc = hrcXcpt; 873 873 } 874 874 }
Note:
See TracChangeset
for help on using the changeset viewer.