Changeset 98292 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Jan 25, 2023 1:14:53 AM (23 months ago)
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 43 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r98289 r98292 3685 3685 Bstr bstrGuid = guid.toUtf16(); 3686 3686 ComPtr<IMachine> failedMachine; 3687 HRESULT rc2 = mVirtualBox->FindMachine(bstrGuid.raw(), failedMachine.asOutParam());3688 if (SUCCEEDED( rc2))3687 HRESULT hrc2 = mVirtualBox->FindMachine(bstrGuid.raw(), failedMachine.asOutParam()); 3688 if (SUCCEEDED(hrc2)) 3689 3689 { 3690 3690 SafeIfaceArray<IMedium> aMedia; 3691 rc2 = failedMachine->Unregister(CleanupMode_DetachAllReturnHardDisksOnly, ComSafeArrayAsOutParam(aMedia));3691 hrc2 = failedMachine->Unregister(CleanupMode_DetachAllReturnHardDisksOnly, ComSafeArrayAsOutParam(aMedia)); 3692 3692 ComPtr<IProgress> pProgress2; 3693 rc2 = failedMachine->DeleteConfig(ComSafeArrayAsInParam(aMedia), pProgress2.asOutParam());3693 hrc2 = failedMachine->DeleteConfig(ComSafeArrayAsInParam(aMedia), pProgress2.asOutParam()); 3694 3694 pProgress2->WaitForCompletion(-1); 3695 3695 } … … 4365 4365 4366 4366 StorageBus_T enmStorageBus = StorageBus_Null; 4367 HRESULT vrc = pSysProps->GetStorageBusForStorageControllerType(aStorageControllerType, &enmStorageBus);4368 if (FAILED( vrc))4369 return vrc;4370 4371 vrc = pSysProps->GetMaxPortCountForStorageBus(enmStorageBus, aMaxPortCount);4372 if (FAILED( vrc))4373 return vrc;4367 HRESULT hrc = pSysProps->GetStorageBusForStorageControllerType(aStorageControllerType, &enmStorageBus); 4368 if (FAILED(hrc)) 4369 return hrc; 4370 4371 hrc = pSysProps->GetMaxPortCountForStorageBus(enmStorageBus, aMaxPortCount); 4372 if (FAILED(hrc)) 4373 return hrc; 4374 4374 4375 4375 if (uControllerPort >= *aMaxPortCount) -
trunk/src/VBox/Main/src-server/HostImpl.cpp
r98288 r98292 590 590 591 591 MediaList *pList; 592 HRESULT vrc = i_getDrives(DeviceType_DVD, true /* fRefresh */, pList, treeLock);593 if (FAILED( vrc))594 return vrc;592 HRESULT hrc = i_getDrives(DeviceType_DVD, true /* fRefresh */, pList, treeLock); 593 if (FAILED(hrc)) 594 return hrc; 595 595 596 596 aDVDDrives.resize(pList->size()); … … 613 613 614 614 MediaList *pList; 615 HRESULT vrc = i_getDrives(DeviceType_Floppy, true /* fRefresh */, pList, treeLock);616 if (FAILED( vrc))617 return vrc;615 HRESULT hrc = i_getDrives(DeviceType_Floppy, true /* fRefresh */, pList, treeLock); 616 if (FAILED(hrc)) 617 return hrc; 618 618 619 619 aFloppyDrives.resize(pList->size()); … … 830 830 #if defined(RT_OS_WINDOWS) || defined(VBOX_WITH_NETFLT) /*|| defined(RT_OS_OS2)*/ 831 831 # ifdef VBOX_WITH_HOSTNETIF_API 832 HRESULT vrc = i_updateNetIfList();833 if (FAILED( vrc))834 { 835 Log(("Failed to update host network interface list with vrc=%Rhrc\n", vrc));836 return vrc;832 HRESULT hrc = i_updateNetIfList(); 833 if (FAILED(hrc)) 834 { 835 Log(("Failed to update host network interface list with hrc=%Rhrc\n", hrc)); 836 return hrc; 837 837 } 838 838 #if defined(RT_OS_WINDOWS) 839 vrc = i_updatePersistentConfigForHostOnlyAdapters();840 if (FAILED( vrc))841 { 842 LogRel(("Failed to update persistent config for host-only adapters with vrc=%Rhrc\n", vrc));843 return vrc;839 hrc = i_updatePersistentConfigForHostOnlyAdapters(); 840 if (FAILED(hrc)) 841 { 842 LogRel(("Failed to update persistent config for host-only adapters with hrc=%Rhrc\n", hrc)); 843 return hrc; 844 844 } 845 845 #endif /* defined(RT_OS_WINDOWS) */ … … 1032 1032 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1033 1033 1034 MultiResult vrc = i_checkUSBProxyService();1035 if (FAILED( vrc) || SUCCEEDED_WARNING(vrc))1036 return vrc;1034 MultiResult mrc = i_checkUSBProxyService(); 1035 if (FAILED(mrc) || SUCCEEDED_WARNING(mrc)) 1036 return mrc; 1037 1037 1038 1038 return m->pUSBProxyService->getDeviceCollection(aUSBDevices); … … 1081 1081 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1082 1082 1083 MultiResult vrc = i_checkUSBProxyService();1084 if (FAILED( vrc))1085 return vrc;1083 MultiResult mrc = i_checkUSBProxyService(); 1084 if (FAILED(mrc)) 1085 return mrc; 1086 1086 1087 1087 aUSBDeviceFilters.resize(m->llUSBDeviceFilters.size()); … … 1090 1090 (*it).queryInterfaceTo(aUSBDeviceFilters[i].asOutParam()); 1091 1091 1092 return vrc;1092 return mrc; 1093 1093 #else 1094 1094 /* Note: The GUI depends on this method returning E_NOTIMPL with no … … 2909 2909 2910 2910 const char *pszDevPath = pszDisk ? pszDisk : pszPartition0 ? pszPartition0 : pszSlice0; 2911 int hrc = RTStrCopy(pDrive->szRawDiskPath, sizeof(pDrive->szRawDiskPath), pszDevPath);2912 AssertRC( hrc);2911 int vrc = RTStrCopy(pDrive->szRawDiskPath, sizeof(pDrive->szRawDiskPath), pszDevPath); 2912 AssertRC(vrc); 2913 2913 2914 2914 if (*ppDrives) … … 3766 3766 /* For now we are concerned with the root file system only. */ 3767 3767 pm::DiskList disksUsage, disksLoad; 3768 int hrc = hal->getDiskListByFs("/", disksUsage, disksLoad);3769 if (RT_FAILURE( hrc))3768 int vrc = hal->getDiskListByFs("/", disksUsage, disksLoad); 3769 if (RT_FAILURE(vrc)) 3770 3770 return; 3771 3771 pm::DiskList::iterator it; -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r98288 r98292 3496 3496 { 3497 3497 Bstr bstrSessionName; 3498 HRESULT rc2 = aSession->COMGETTER(Name)(bstrSessionName.asOutParam());3499 if (SUCCEEDED( rc2))3498 HRESULT hrc2 = aSession->COMGETTER(Name)(bstrSessionName.asOutParam()); 3499 if (SUCCEEDED(hrc2)) 3500 3500 strSessionName = bstrSessionName; 3501 3501 } … … 11437 11437 ErrorInfoKeeper eik; 11438 11438 11439 HRESULT rc1= lockedMediaMap->Clear();11440 AssertComRC( rc1);11439 HRESULT hrc2 = lockedMediaMap->Clear(); 11440 AssertComRC(hrc2); 11441 11441 } 11442 11442 … … 11608 11608 ErrorInfoKeeper eik; 11609 11609 11610 HRESULT rc1= lockedMediaMap->Clear();11611 AssertComRC( rc1);11610 HRESULT hrc2 = lockedMediaMap->Clear(); 11611 AssertComRC(hrc2); 11612 11612 } 11613 11613 … … 11677 11677 ErrorInfoKeeper eik; 11678 11678 11679 HRESULT rc1= lockedMediaMap->Clear();11680 AssertComRC( rc1);11679 HRESULT hrc2 = lockedMediaMap->Clear(); 11680 AssertComRC(hrc2); 11681 11681 } 11682 11682 -
trunk/src/VBox/Main/src-server/MediumIOImpl.cpp
r98289 r98292 231 231 AssertReturn((fOpen & RTFILE_O_ACCESS_MASK) == RTFILE_O_WRITE, VERR_INVALID_PARAMETER); 232 232 233 int rc = VINF_SUCCESS;233 int vrc = VINF_SUCCESS; 234 234 PSTREAMFILE pStreamFile = (PSTREAMFILE)RTMemAllocZ(sizeof(*pStreamFile)); 235 235 if (RT_LIKELY(pStreamFile)) … … 241 241 } 242 242 else 243 rc = VERR_NO_MEMORY;244 245 return rc;243 vrc = VERR_NO_MEMORY; 244 245 return vrc; 246 246 } 247 247 … … 250 250 RT_NOREF(pvUser); 251 251 PSTREAMFILE pStreamFile = (PSTREAMFILE)pStorage; 252 int rc = VINF_SUCCESS;252 int vrc = VINF_SUCCESS; 253 253 254 254 /* Fill up to the configured file size. */ … … 263 263 cbThisWrite = (size_t)(pStreamFile->cbFile - pStreamFile->uOffsetLast); 264 264 265 rc = pStreamFile->pDataStream->i_write(&g_abRTZero64K[0], cbThisWrite, &cbWritten);266 if (RT_SUCCESS( rc))265 vrc = pStreamFile->pDataStream->i_write(&g_abRTZero64K[0], cbThisWrite, &cbWritten); 266 if (RT_SUCCESS(vrc)) 267 267 pStreamFile->uOffsetLast += cbWritten; 268 268 269 } while ( RT_SUCCESS( rc)269 } while ( RT_SUCCESS(vrc) 270 270 && pStreamFile->uOffsetLast < pStreamFile->cbFile); 271 271 } 272 272 273 int rc2 = pStreamFile->pDataStream->i_close();274 if (RT_SUCCESS( rc))275 rc =rc2;273 int vrc2 = pStreamFile->pDataStream->i_close(); 274 if (RT_SUCCESS(vrc)) 275 vrc = vrc2; 276 276 277 277 RTMemFree(pStreamFile); 278 return rc;278 return vrc; 279 279 } 280 280 … … 328 328 329 329 /* Reducing the size is not supported. */ 330 int rc = VINF_SUCCESS;330 int vrc = VINF_SUCCESS; 331 331 if (pStreamFile->cbFile < cbSize) 332 332 pStreamFile->cbFile = cbSize; 333 333 else 334 rc = VERR_NOT_SUPPORTED;335 336 return rc;334 vrc = VERR_NOT_SUPPORTED; 335 336 return vrc; 337 337 } 338 338 … … 354 354 RT_NOREF(pvUser); 355 355 PSTREAMFILE pStreamFile = (PSTREAMFILE)pStorage; 356 int rc = VINF_SUCCESS;356 int vrc = VINF_SUCCESS; 357 357 358 358 /* Fill up to the new offset if there is non consecutive access. */ … … 367 367 cbThisWrite = (size_t)(uOffset - pStreamFile->uOffsetLast); 368 368 369 rc = pStreamFile->pDataStream->i_write(&g_abRTZero64K[0], cbThisWrite, &cbWritten);370 if (RT_SUCCESS( rc))369 vrc = pStreamFile->pDataStream->i_write(&g_abRTZero64K[0], cbThisWrite, &cbWritten); 370 if (RT_SUCCESS(vrc)) 371 371 pStreamFile->uOffsetLast += cbWritten; 372 372 373 } while ( RT_SUCCESS( rc)373 } while ( RT_SUCCESS(vrc) 374 374 && pStreamFile->uOffsetLast < uOffset); 375 375 } 376 376 377 if (RT_SUCCESS( rc))377 if (RT_SUCCESS(vrc)) 378 378 { 379 379 if (pcbWritten) 380 rc = pStreamFile->pDataStream->i_write(pvBuffer, cbBuffer, pcbWritten);380 vrc = pStreamFile->pDataStream->i_write(pvBuffer, cbBuffer, pcbWritten); 381 381 else 382 382 { … … 385 385 size_t cbWritten = 0; 386 386 while ( cbLeft > 0 387 && RT_SUCCESS( rc))387 && RT_SUCCESS(vrc)) 388 388 { 389 rc = pStreamFile->pDataStream->i_write(pbBuf, cbLeft, &cbWritten);390 if (RT_SUCCESS( rc))389 vrc = pStreamFile->pDataStream->i_write(pbBuf, cbLeft, &cbWritten); 390 if (RT_SUCCESS(vrc)) 391 391 { 392 392 pbBuf += cbWritten; … … 396 396 } 397 397 398 if (RT_SUCCESS( rc))398 if (RT_SUCCESS(vrc)) 399 399 { 400 400 size_t cbWritten = pcbWritten ? *pcbWritten : cbBuffer; … … 408 408 } 409 409 410 return rc;410 return vrc; 411 411 } 412 412 … … 807 807 ComPtr<IProgress> &aProgress) 808 808 { 809 HRESULT rc = S_OK;809 HRESULT hrc = S_OK; 810 810 ComObjPtr<Progress> pProgress; 811 811 ComObjPtr<DataStream> pDataStream; … … 815 815 { 816 816 pDataStream.createObject(); 817 rc = pDataStream->init(aBufferSize);818 if (FAILED( rc))819 throw rc;817 hrc = pDataStream->init(aBufferSize); 818 if (FAILED(hrc)) 819 throw hrc; 820 820 821 821 pProgress.createObject(); 822 rc = pProgress->init(m->ptrVirtualBox,823 static_cast<IMediumIO*>(this),824 BstrFmt(tr("Converting medium '%s' to data stream"), m->ptrMedium->i_getLocationFull().c_str()),825 TRUE /* aCancelable */);826 if (FAILED( rc))827 throw rc;822 hrc = pProgress->init(m->ptrVirtualBox, 823 static_cast<IMediumIO*>(this), 824 BstrFmt(tr("Converting medium '%s' to data stream"), m->ptrMedium->i_getLocationFull().c_str()), 825 TRUE /* aCancelable */); 826 if (FAILED(hrc)) 827 throw hrc; 828 828 829 829 ULONG mediumVariantFlags = 0; … … 838 838 pTask = new MediumIO::StreamTask(this, pDataStream, pProgress, 839 839 aFormat.c_str(), (MediumVariant_T)mediumVariantFlags); 840 rc = pTask->hrc();841 AssertComRC( rc);842 if (FAILED( rc))843 throw rc;844 } 845 catch (HRESULT hrcXcpt) { rc = hrcXcpt; }846 847 if (SUCCEEDED( rc))848 { 849 rc = pTask->createThread();840 hrc = pTask->hrc(); 841 AssertComRC(hrc); 842 if (FAILED(hrc)) 843 throw hrc; 844 } 845 catch (HRESULT hrcXcpt) { hrc = hrcXcpt; } 846 847 if (SUCCEEDED(hrc)) 848 { 849 hrc = pTask->createThread(); 850 850 pTask = NULL; 851 if (SUCCEEDED( rc))851 if (SUCCEEDED(hrc)) 852 852 { 853 853 pDataStream.queryInterfaceTo(aStream.asOutParam()); … … 858 858 delete pTask; 859 859 860 return rc;860 return hrc; 861 861 } 862 862 -
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r98291 r98292 5233 5233 /* Encrypt the plain secret. If that does not work (i.e. no or wrong settings key 5234 5234 * specified), just use the encrypted secret (if there is any). */ 5235 int hrc = m->pVirtualBox->i_encryptSetting(itPln->second, &strCiphertext);5236 if (RT_SUCCESS( hrc))5235 int vrc = m->pVirtualBox->i_encryptSetting(itPln->second, &strCiphertext); 5236 if (RT_SUCCESS(vrc)) 5237 5237 fHaveInitiatorSecretEncrypted = true; 5238 5238 } … … 9048 9048 * to lock order violations, it probably causes lock order issues related 9049 9049 * to the AutoCaller usage. */ 9050 HRESULT rcTmp = S_OK;9050 HRESULT hrcTmp = S_OK; 9051 9051 9052 9052 const ComObjPtr<Medium> &pTarget = task.mTarget; … … 9174 9174 variant = (MediumVariant_T)uImageFlags; 9175 9175 } 9176 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }9176 catch (HRESULT hrcXcpt) { hrcTmp = hrcXcpt; } 9177 9177 9178 9178 VDDestroy(hdd); 9179 9179 } 9180 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }9181 9182 MultiResult mrc( rcTmp);9180 catch (HRESULT hrcXcpt) { hrcTmp = hrcXcpt; } 9181 9182 MultiResult mrc(hrcTmp); 9183 9183 9184 9184 if (SUCCEEDED(mrc)) … … 9278 9278 * to lock order violations, it probably causes lock order issues related 9279 9279 * to the AutoCaller usage. */ 9280 HRESULT rcTmp = S_OK;9280 HRESULT hrcTmp = S_OK; 9281 9281 9282 9282 const ComObjPtr<Medium> &pTarget = task.mTarget; … … 9495 9495 } 9496 9496 } 9497 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }9497 catch (HRESULT hrcXcpt) { hrcTmp = hrcXcpt; } 9498 9498 catch (int aVRC) 9499 9499 { 9500 rcTmp = setErrorBoth(VBOX_E_FILE_ERROR, aVRC,9501 tr("Could not merge the medium '%s' to '%s'%s"),9502 m->strLocationFull.c_str(),9503 pTarget->m->strLocationFull.c_str(),9504 i_vdError(aVRC).c_str());9500 hrcTmp = setErrorBoth(VBOX_E_FILE_ERROR, aVRC, 9501 tr("Could not merge the medium '%s' to '%s'%s"), 9502 m->strLocationFull.c_str(), 9503 pTarget->m->strLocationFull.c_str(), 9504 i_vdError(aVRC).c_str()); 9505 9505 } 9506 9506 9507 9507 VDDestroy(hdd); 9508 9508 } 9509 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }9509 catch (HRESULT hrcXcpt) { hrcTmp = hrcXcpt; } 9510 9510 9511 9511 ErrorInfoKeeper eik; 9512 MultiResult mrc( rcTmp);9512 MultiResult mrc(hrcTmp); 9513 9513 HRESULT hrc2; 9514 9514 … … 9699 9699 * to lock order violations, it probably causes lock order issues related 9700 9700 * to the AutoCaller usage. */ 9701 HRESULT rcTmp = S_OK;9701 HRESULT hrcTmp = S_OK; 9702 9702 9703 9703 const ComObjPtr<Medium> &pTarget = task.mTarget; … … 9895 9895 variant = (MediumVariant_T)uImageFlags; 9896 9896 } 9897 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }9897 catch (HRESULT hrcXcpt) { hrcTmp = hrcXcpt; } 9898 9898 9899 9899 VDDestroy(targetHdd); 9900 9900 } 9901 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }9901 catch (HRESULT hrcXcpt) { hrcTmp = hrcXcpt; } 9902 9902 9903 9903 VDDestroy(hdd); 9904 9904 } 9905 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }9905 catch (HRESULT hrcXcpt) { hrcTmp = hrcXcpt; } 9906 9906 9907 9907 ErrorInfoKeeper eik; 9908 MultiResult mrc( rcTmp);9908 MultiResult mrc(hrcTmp); 9909 9909 9910 9910 /* Only do the parent changes for newly created media. */ … … 10657 10657 * to lock order violations, it probably causes lock order issues related 10658 10658 * to the AutoCaller usage. */ 10659 HRESULT rcTmp = S_OK;10659 HRESULT hrcTmp = S_OK; 10660 10660 10661 10661 const ComObjPtr<Medium> &pParent = task.mParent; … … 10810 10810 variant = (MediumVariant_T)uImageFlags; 10811 10811 } 10812 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }10812 catch (HRESULT hrcXcpt) { hrcTmp = hrcXcpt; } 10813 10813 10814 10814 VDDestroy(targetHdd); 10815 10815 } 10816 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }10816 catch (HRESULT hrcXcpt) { hrcTmp = hrcXcpt; } 10817 10817 10818 10818 VDDestroy(hdd); 10819 10819 } 10820 catch (HRESULT hrcXcpt) { rcTmp = hrcXcpt; }10820 catch (HRESULT hrcXcpt) { hrcTmp = hrcXcpt; } 10821 10821 10822 10822 ErrorInfoKeeper eik; 10823 MultiResult mrc( rcTmp);10823 MultiResult mrc(hrcTmp); 10824 10824 10825 10825 /* Only do the parent changes for newly created media. */ -
trunk/src/VBox/Main/src-server/MediumLock.cpp
r98262 r98292 65 65 Unlock(); 66 66 mLockWrite = aLockWrite; 67 HRESULT rc = Lock();68 if (FAILED( rc))67 HRESULT hrc = Lock(); 68 if (FAILED(hrc)) 69 69 { 70 70 mLockWrite = fPrevLockWrite; 71 71 Lock(); 72 return rc;72 return hrc; 73 73 } 74 74 return S_OK; … … 106 106 } 107 107 108 HRESULT rc = S_OK;108 HRESULT hrc = S_OK; 109 109 MediumState_T state; 110 110 { … … 125 125 || state == MediumState_LockedWrite)) 126 126 return S_OK; 127 else 128 rc = mMedium->LockWrite(mToken.asOutParam()); 127 hrc = mMedium->LockWrite(mToken.asOutParam()); 129 128 } 130 129 else … … 132 131 if (aIgnoreLockedMedia && state == MediumState_LockedWrite) 133 132 return S_OK; 134 else 135 rc = mMedium->LockRead(mToken.asOutParam()); 133 hrc = mMedium->LockRead(mToken.asOutParam()); 136 134 } 137 135 } 138 if (SUCCEEDED( rc))136 if (SUCCEEDED(hrc)) 139 137 { 140 138 mIsLocked = true; 141 139 return S_OK; 142 140 } 143 else 144 { 145 mMediumCaller.attach(NULL); 146 return VBOX_E_INVALID_OBJECT_STATE; 147 } 141 mMediumCaller.attach(NULL); 142 return VBOX_E_INVALID_OBJECT_STATE; 148 143 } 149 144 150 145 HRESULT MediumLock::Unlock() 151 146 { 152 HRESULT rc = S_OK;147 HRESULT hrc = S_OK; 153 148 if (mIsLocked && !mLockSkipped && mToken) 154 149 { … … 159 154 mLockSkipped = false; 160 155 mIsLocked = false; 161 return rc;156 return hrc; 162 157 } 163 158 … … 211 206 HRESULT MediumLockList::RemoveByIterator(Base::iterator &aIt) 212 207 { 213 HRESULT rc = aIt->Unlock();208 HRESULT hrc = aIt->Unlock(); 214 209 aIt = mMediumLocks.erase(aIt); 215 return rc;210 return hrc; 216 211 } 217 212 218 213 HRESULT MediumLockList::Clear() 219 214 { 220 HRESULT rc = Unlock();215 HRESULT hrc = Unlock(); 221 216 mMediumLocks.clear(); 222 return rc;217 return hrc; 223 218 } 224 219 … … 237 232 if (mIsLocked) 238 233 return S_OK; 239 HRESULT rc = S_OK;234 HRESULT hrc = S_OK; 240 235 for (MediumLockList::Base::iterator it = mMediumLocks.begin(); 241 236 it != mMediumLocks.end(); 242 237 ++it) 243 238 { 244 rc = it->Lock(fSkipOverLockedMedia);245 if (FAILED( rc))239 hrc = it->Lock(fSkipOverLockedMedia); 240 if (FAILED(hrc)) 246 241 { 247 242 for (MediumLockList::Base::iterator it2 = mMediumLocks.begin(); … … 249 244 ++it2) 250 245 { 251 HRESULT rc2 = it2->Unlock();252 AssertComRC( rc2);246 HRESULT hrc2 = it2->Unlock(); 247 AssertComRC(hrc2); 253 248 } 254 249 break; 255 250 } 256 251 } 257 if (SUCCEEDED( rc))252 if (SUCCEEDED(hrc)) 258 253 mIsLocked = true; 259 return rc;254 return hrc; 260 255 } 261 256 … … 264 259 if (!mIsLocked) 265 260 return S_OK; 266 HRESULT rc = S_OK;261 HRESULT hrc = S_OK; 267 262 for (MediumLockList::Base::iterator it = mMediumLocks.begin(); 268 263 it != mMediumLocks.end(); 269 264 ++it) 270 265 { 271 HRESULT rc2 = it->Unlock();272 if (SUCCEEDED( rc) && FAILED(rc2))273 rc =rc2;274 } 275 mIsLocked = false; 276 return rc;266 HRESULT hrc2 = it->Unlock(); 267 if (SUCCEEDED(hrc) && FAILED(hrc2)) 268 hrc = hrc2; 269 } 270 mIsLocked = false; 271 return hrc; 277 272 } 278 273 … … 331 326 HRESULT MediumLockListMap::Clear() 332 327 { 333 HRESULT rc = Unlock();328 HRESULT hrc = Unlock(); 334 329 for (MediumLockListMap::Base::iterator it = mMediumLocks.begin(); 335 330 it != mMediumLocks.end(); … … 340 335 } 341 336 mMediumLocks.clear(); 342 return rc;337 return hrc; 343 338 } 344 339 … … 360 355 if (mIsLocked) 361 356 return S_OK; 362 HRESULT rc = S_OK;357 HRESULT hrc = S_OK; 363 358 for (MediumLockListMap::Base::const_iterator it = mMediumLocks.begin(); 364 359 it != mMediumLocks.end(); 365 360 ++it) 366 361 { 367 rc = it->second->Lock();368 if (FAILED( rc))362 hrc = it->second->Lock(); 363 if (FAILED(hrc)) 369 364 { 370 365 for (MediumLockListMap::Base::const_iterator it2 = mMediumLocks.begin(); … … 372 367 ++it2) 373 368 { 374 HRESULT rc2 = it2->second->Unlock();375 AssertComRC( rc2);369 HRESULT hrc2 = it2->second->Unlock(); 370 AssertComRC(hrc2); 376 371 } 377 372 break; 378 373 } 379 374 } 380 if (SUCCEEDED( rc))375 if (SUCCEEDED(hrc)) 381 376 mIsLocked = true; 382 return rc;377 return hrc; 383 378 } 384 379 … … 387 382 if (!mIsLocked) 388 383 return S_OK; 389 HRESULT rc = S_OK;384 HRESULT hrc = S_OK; 390 385 for (MediumLockListMap::Base::const_iterator it = mMediumLocks.begin(); 391 386 it != mMediumLocks.end(); … … 393 388 { 394 389 MediumLockList *pMediumLockList = it->second; 395 HRESULT rc2 = pMediumLockList->Unlock();396 if (SUCCEEDED( rc) && FAILED(rc2))397 rc =rc2;398 } 399 mIsLocked = false; 400 return rc;401 } 390 HRESULT hrc2 = pMediumLockList->Unlock(); 391 if (SUCCEEDED(hrc) && FAILED(hrc2)) 392 hrc = hrc2; 393 } 394 mIsLocked = false; 395 return hrc; 396 } -
trunk/src/VBox/Main/src-server/NATEngineImpl.cpp
r98262 r98292 380 380 381 381 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 382 HRESULT rc = S_OK;382 HRESULT hrc = S_OK; 383 383 data = *mData->m.data(); 384 return rc;384 return hrc; 385 385 } 386 386 … … 416 416 417 417 /* parses as an IPv4 address */ 418 int rc = RTNetStrToIPv4Addr(aHostIP.c_str(), &addr);419 if (RT_FAILURE( rc))418 int vrc = RTNetStrToIPv4Addr(aHostIP.c_str(), &addr); 419 if (RT_FAILURE(vrc)) 420 420 return setError(E_INVALIDARG, "Invalid IPv4 address \"%s\"", aHostIP.c_str()); 421 421 -
trunk/src/VBox/Main/src-server/NATNetworkImpl.cpp
r98262 r98292 247 247 248 248 AutoWriteLock vboxLock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 249 HRESULT rc = m->pVirtualBox->i_saveSettings();250 ComAssertComRCRetRC( rc);249 HRESULT hrc = m->pVirtualBox->i_saveSettings(); 250 ComAssertComRCRetRC(hrc); 251 251 252 252 return S_OK; … … 271 271 272 272 AutoWriteLock vboxLock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 273 HRESULT rc = m->pVirtualBox->i_saveSettings();274 ComAssertComRCRetRC( rc);273 HRESULT hrc = m->pVirtualBox->i_saveSettings(); 274 ComAssertComRCRetRC(hrc); 275 275 return S_OK; 276 276 } … … 291 291 HRESULT NATNetwork::setNetwork(const com::Utf8Str &aIPv4NetworkCidr) 292 292 { 293 RTNETADDRIPV4 Net , Mask;293 RTNETADDRIPV4 Net; 294 294 int iPrefix; 295 int rc; 296 297 rc = RTNetStrToIPv4Cidr(aIPv4NetworkCidr.c_str(), &Net, &iPrefix); 298 if (RT_FAILURE(rc)) 299 return setError(E_FAIL, tr("%s is not a valid IPv4 CIDR notation"), 300 aIPv4NetworkCidr.c_str()); 295 int vrc = RTNetStrToIPv4Cidr(aIPv4NetworkCidr.c_str(), &Net, &iPrefix); 296 if (RT_FAILURE(vrc)) 297 return setErrorBoth(E_FAIL, vrc, tr("%s is not a valid IPv4 CIDR notation"), aIPv4NetworkCidr.c_str()); 301 298 302 299 /* … … 312 309 return setError(E_FAIL, tr("%s specifies zero prefix"), aIPv4NetworkCidr.c_str()); 313 310 314 rc = RTNetPrefixToMaskIPv4(iPrefix, &Mask);315 AssertRCReturn(rc, setError(E_FAIL,316 "%s: internal error: failed to convert prefix %d to netmask: %Rrc",317 aIPv4NetworkCidr.c_str(), iPrefix,rc));311 RTNETADDRIPV4 Mask; 312 vrc = RTNetPrefixToMaskIPv4(iPrefix, &Mask); 313 AssertRCReturn(vrc, setErrorBoth(E_FAIL, vrc, tr("%s: internal error: failed to convert prefix %d to netmask: %Rrc"), 314 aIPv4NetworkCidr.c_str(), iPrefix, vrc)); 318 315 319 316 if ((Net.u & ~Mask.u) != 0) 320 return setError(E_FAIL, 321 tr("%s: the specified address is longer than the specified prefix"), 322 aIPv4NetworkCidr.c_str()); 317 return setError(E_FAIL, tr("%s: the specified address is longer than the specified prefix"), 318 aIPv4NetworkCidr.c_str()); 323 319 324 320 /** @todo r=uwe Check the address is unicast, not a loopback, etc. */ … … 360 356 const RTNETADDRIPV4 &MaskNew) 361 357 { 362 RTNETADDRIPV4 NetOld, MaskOld;363 int iPrefixOld;364 int rc;365 366 358 if (s.mapPortForwardRules4.empty()) 367 359 return; /* nothing to do */ 368 360 369 rc = RTNetStrToIPv4Cidr(s.strIPv4NetworkCidr.c_str(), &NetOld, &iPrefixOld); 370 if (RT_FAILURE(rc)) 361 RTNETADDRIPV4 NetOld; 362 int iPrefixOld; 363 int vrc = RTNetStrToIPv4Cidr(s.strIPv4NetworkCidr.c_str(), &NetOld, &iPrefixOld); 364 if (RT_FAILURE(vrc)) 371 365 return; 372 366 373 rc = RTNetPrefixToMaskIPv4(iPrefixOld, &MaskOld); 374 if (RT_FAILURE(rc)) 367 RTNETADDRIPV4 MaskOld; 368 vrc = RTNetPrefixToMaskIPv4(iPrefixOld, &MaskOld); 369 if (RT_FAILURE(vrc)) 375 370 return; 376 371 … … 383 378 /* parse the old destination address */ 384 379 RTNETADDRIPV4 AddrOld; 385 rc = RTNetStrToIPv4Addr(rule.strGuestIP.c_str(), &AddrOld);386 if (RT_FAILURE( rc))380 vrc = RTNetStrToIPv4Addr(rule.strGuestIP.c_str(), &AddrOld); 381 if (RT_FAILURE(vrc)) 387 382 continue; 388 383 … … 433 428 434 429 AutoWriteLock vboxLock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 435 HRESULT rc = m->pVirtualBox->i_saveSettings();436 ComAssertComRCRetRC( rc);430 HRESULT hrc = m->pVirtualBox->i_saveSettings(); 431 ComAssertComRCRetRC(hrc); 437 432 438 433 return S_OK; … … 451 446 { 452 447 HRESULT hrc; 453 int rc;448 int vrc; 454 449 455 450 /* Since we store it in text form, use canonical representation */ … … 461 456 RTNETADDRIPV6 Net6; 462 457 int iPrefixLength; 463 rc = RTNetStrToIPv6Cidr(aIPv6Prefix.c_str(), &Net6, &iPrefixLength); 464 if (RT_FAILURE(rc)) 465 return setError(E_INVALIDARG, 466 tr("%s is not a valid IPv6 prefix"), 467 aIPv6Prefix.c_str()); 458 vrc = RTNetStrToIPv6Cidr(aIPv6Prefix.c_str(), &Net6, &iPrefixLength); 459 if (RT_FAILURE(vrc)) 460 return setError(E_INVALIDARG, tr("%s is not a valid IPv6 prefix"), aIPv6Prefix.c_str()); 468 461 469 462 /* Accept both addr:: and addr::/64 */ … … 471 464 iPrefixLength = 64; /* take it to mean /64 which we require anyway */ 472 465 else if (iPrefixLength != 64) 473 return setError(E_INVALIDARG, 474 tr("Invalid IPv6 prefix length %d, must be 64"), 475 iPrefixLength); 466 return setError(E_INVALIDARG, tr("Invalid IPv6 prefix length %d, must be 64"), iPrefixLength); 476 467 477 468 /* Verify the address is unicast. */ 478 if ( ((Net6.au8[0] & 0xe0) != 0x20) /* global 2000::/3 */ 479 && ((Net6.au8[0] & 0xfe) != 0xfc)) /* local fc00::/7 */ 480 return setError(E_INVALIDARG, 481 tr("IPv6 prefix %RTnaipv6 is not unicast"), 482 &Net6); 469 if ( (Net6.au8[0] & 0xe0) != 0x20 /* global 2000::/3 */ 470 && (Net6.au8[0] & 0xfe) != 0xfc) /* local fc00::/7 */ 471 return setError(E_INVALIDARG, tr("IPv6 prefix %RTnaipv6 is not unicast"), &Net6); 483 472 484 473 /* Verify the interfaces ID part is zero */ 485 474 if (Net6.au64[1] != 0) 486 return setError(E_INVALIDARG, 487 tr("Non-zero bits in the interface ID part" 488 " of the IPv6 prefix %RTnaipv6/64"), 489 &Net6); 490 491 rc = strNormalizedIPv6Prefix.printfNoThrow("%RTnaipv6/64", &Net6); 492 if (RT_FAILURE(rc)) 475 return setError(E_INVALIDARG, tr("Non-zero bits in the interface ID part of the IPv6 prefix %RTnaipv6/64"), &Net6); 476 477 vrc = strNormalizedIPv6Prefix.printfNoThrow("%RTnaipv6/64", &Net6); 478 if (RT_FAILURE(vrc)) 493 479 { 494 if ( rc == VERR_NO_MEMORY)480 if (vrc == VERR_NO_MEMORY) 495 481 return setError(E_OUTOFMEMORY); 496 else 497 return setError(E_FAIL, tr("Internal error")); 482 return setError(E_FAIL, tr("Internal error")); 498 483 } 499 484 } … … 557 542 558 543 AutoWriteLock vboxLock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 559 HRESULT rc = m->pVirtualBox->i_saveSettings();560 ComAssertComRCRetRC( rc);544 HRESULT hrc = m->pVirtualBox->i_saveSettings(); 545 ComAssertComRCRetRC(hrc); 561 546 562 547 return S_OK; … … 586 571 587 572 AutoWriteLock vboxLock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 588 HRESULT rc = m->pVirtualBox->i_saveSettings();589 ComAssertComRCRetRC( rc);573 HRESULT hrc = m->pVirtualBox->i_saveSettings(); 574 ComAssertComRCRetRC(hrc); 590 575 591 576 return S_OK; … … 611 596 HRESULT NATNetwork::addLocalMapping(const com::Utf8Str &aHostId, LONG aOffset) 612 597 { 613 RTNETADDRIPV4 addr, net, mask; 614 615 int rc = RTNetStrToIPv4Addr(Utf8Str(aHostId).c_str(), &addr); 616 if (RT_FAILURE(rc)) 598 RTNETADDRIPV4 addr; 599 int vrc = RTNetStrToIPv4Addr(Utf8Str(aHostId).c_str(), &addr); 600 if (RT_FAILURE(vrc)) 617 601 return E_INVALIDARG; 618 602 … … 622 606 623 607 /* check against networkid vs network mask */ 624 rc = RTCidrStrToIPv4(Utf8Str(m->s.strIPv4NetworkCidr).c_str(), &net, &mask); 625 if (RT_FAILURE(rc)) 608 RTNETADDRIPV4 net, mask; 609 vrc = RTCidrStrToIPv4(Utf8Str(m->s.strIPv4NetworkCidr).c_str(), &net, &mask); 610 if (RT_FAILURE(vrc)) 626 611 return E_INVALIDARG; 627 612 … … 773 758 { 774 759 AutoWriteLock vboxLock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 775 HRESULT rc = m->pVirtualBox->i_saveSettings();776 ComAssertComRCRetRC( rc);760 HRESULT hrc = m->pVirtualBox->i_saveSettings(); 761 ComAssertComRCRetRC(hrc); 777 762 } 778 763 … … 818 803 { 819 804 AutoWriteLock vboxLock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 820 HRESULT rc = m->pVirtualBox->i_saveSettings();821 ComAssertComRCRetRC( rc);805 HRESULT hrc = m->pVirtualBox->i_saveSettings(); 806 ComAssertComRCRetRC(hrc); 822 807 } 823 808 … … 857 842 { 858 843 RTNETADDRIPV4 networkid, netmask; 859 860 int rc = RTCidrStrToIPv4(m->s.strIPv4NetworkCidr.c_str(), &networkid, &netmask); 861 if (RT_FAILURE(rc)) 862 { 863 LogRel(("NATNetwork: Failed to parse cidr %s with %Rrc\n", m->s.strIPv4NetworkCidr.c_str(), rc)); 844 int vrc = RTCidrStrToIPv4(m->s.strIPv4NetworkCidr.c_str(), &networkid, &netmask); 845 if (RT_FAILURE(vrc)) 846 { 847 LogRel(("NATNetwork: Failed to parse cidr %s with %Rrc\n", m->s.strIPv4NetworkCidr.c_str(), vrc)); 864 848 return; 865 849 } … … 898 882 for (size_t i = 0; i < cAddresses; ++i) 899 883 { 884 com::Utf8Str strNameServerAddress(nameServers[i]); 900 885 RTNETADDRIPV4 addr; 901 902 com::Utf8Str strNameServerAddress(nameServers[i]); 903 rc = RTNetStrToIPv4Addr(strNameServerAddress.c_str(), &addr); 904 if (RT_FAILURE(rc)) 886 vrc = RTNetStrToIPv4Addr(strNameServerAddress.c_str(), &addr); 887 if (RT_FAILURE(vrc)) 905 888 { 906 LogRel(("NATNetwork: Failed to parse IP address %s with %Rrc\n", strNameServerAddress.c_str(), rc));889 LogRel(("NATNetwork: Failed to parse IP address %s with %Rrc\n", strNameServerAddress.c_str(), vrc)); 907 890 continue; 908 891 } … … 1092 1075 { 1093 1076 RTNETADDRIPV4 network, netmask; 1094 1095 int rc = RTCidrStrToIPv4(m->s.strIPv4NetworkCidr.c_str(), 1096 &network, 1097 &netmask); 1098 AssertRCReturn(rc, rc); 1077 int vrc = RTCidrStrToIPv4(m->s.strIPv4NetworkCidr.c_str(), &network, &netmask); 1078 AssertRCReturn(vrc, vrc); 1099 1079 1100 1080 uint32_t off; … … 1146 1126 { 1147 1127 RTNETADDRIPV4 network, netmask; 1148 int rc = RTCidrStrToIPv4(m->s.strIPv4NetworkCidr.c_str(), 1149 &network, 1150 &netmask); 1151 AssertRCReturn(rc, rc); 1128 int vrc = RTCidrStrToIPv4(m->s.strIPv4NetworkCidr.c_str(), &network, &netmask); 1129 AssertRCReturn(vrc, vrc); 1152 1130 1153 1131 i_findFirstAvailableOffset(ADDR_GATEWAY, &m->offGateway); … … 1203 1181 int NATNetwork::i_recalculateIPv6Prefix() 1204 1182 { 1205 int rc;1206 1207 1183 RTNETADDRIPV4 net, mask; 1208 rc = RTCidrStrToIPv4(Utf8Str(m->s.strIPv4NetworkCidr).c_str(), &net, &mask);1209 if (RT_FAILURE( rc))1210 return rc;1184 int vrc = RTCidrStrToIPv4(Utf8Str(m->s.strIPv4NetworkCidr).c_str(), &net, &mask); 1185 if (RT_FAILURE(vrc)) 1186 return vrc; 1211 1187 1212 1188 net.u = RT_H2N_U32(net.u); /* XXX: fix RTCidrStrToIPv4! */ -
trunk/src/VBox/Main/src-server/NetworkAdapterImpl.cpp
r98262 r98292 351 351 HRESULT NetworkAdapter::i_updateMacAddress(Utf8Str aMACAddress) 352 352 { 353 HRESULT rc = S_OK;353 HRESULT hrc = S_OK; 354 354 355 355 /* … … 369 369 char *macAddressStr = aMACAddress.mutableRaw(); 370 370 int i = 0; 371 while ((i < 13) && macAddressStr && *macAddressStr && (rc == S_OK))371 while ((i < 13) && macAddressStr && *macAddressStr && hrc == S_OK) 372 372 { 373 373 char c = *macAddressStr; … … 381 381 if ( (c < '0' || c > '9') 382 382 && (c < 'A' || c > 'F')) 383 rc = setError(E_INVALIDARG, tr("Invalid MAC address format"));383 hrc = setError(E_INVALIDARG, tr("Invalid MAC address format")); 384 384 /* the second digit must have even value for unicast addresses */ 385 385 if ( (i == 1) 386 386 && (!!(c & 1) == (c >= '0' && c <= '9'))) 387 rc = setError(E_INVALIDARG, tr("Invalid MAC address format"));387 hrc = setError(E_INVALIDARG, tr("Invalid MAC address format")); 388 388 389 389 macAddressStr++; … … 392 392 /* we must have parsed exactly 12 characters */ 393 393 if (i != 12) 394 rc = setError(E_INVALIDARG, tr("Invalid MAC address format"));394 hrc = setError(E_INVALIDARG, tr("Invalid MAC address format")); 395 395 } 396 396 397 if (SUCCEEDED( rc))397 if (SUCCEEDED(hrc)) 398 398 mData->strMACAddress = aMACAddress; 399 399 } 400 400 } 401 401 402 return rc;402 return hrc; 403 403 } 404 404 … … 412 412 mData.backup(); 413 413 414 HRESULT rc = i_updateMacAddress(aMACAddress);415 if (SUCCEEDED( rc))414 HRESULT hrc = i_updateMacAddress(aMACAddress); 415 if (SUCCEEDED(hrc)) 416 416 { 417 417 // leave the lock before informing callbacks … … 427 427 } 428 428 429 return rc;429 return hrc; 430 430 } 431 431 … … 507 507 com::SafeIfaceArray<IHostNetworkInterface> hostNetworkInterfaces; 508 508 ComPtr<IHost> host; 509 HRESULT rc = mParent->i_getVirtualBox()->COMGETTER(Host)(host.asOutParam());510 if (SUCCEEDED( rc))509 HRESULT hrc = mParent->i_getVirtualBox()->COMGETTER(Host)(host.asOutParam()); 510 if (SUCCEEDED(hrc)) 511 511 { 512 512 host->FindHostNetworkInterfacesOfType(HostNetworkInterfaceType_Bridged, … … 1212 1212 * default to B. */ 1213 1213 1214 HRESULT rc = S_OK;1215 1216 1214 /* MAC address (can be null) */ 1217 rc = i_updateMacAddress(data.strMACAddress);1218 if (FAILED( rc)) returnrc;1215 HRESULT hrc = i_updateMacAddress(data.strMACAddress); 1216 if (FAILED(hrc)) return hrc; 1219 1217 1220 1218 mData.assignCopy(&data); … … 1223 1221 { 1224 1222 ComObjPtr<BandwidthGroup> group; 1225 rc = bwctl->i_getBandwidthGroupByName(data.strBandwidthGroup, group, true);1226 if (FAILED( rc)) returnrc;1223 hrc = bwctl->i_getBandwidthGroupByName(data.strBandwidthGroup, group, true); 1224 if (FAILED(hrc)) return hrc; 1227 1225 group->i_reference(); 1228 1226 } … … 1234 1232 alock.release(); 1235 1233 1236 rc = COMSETTER(AttachmentType)(data.mode);1237 if (FAILED( rc)) returnrc;1234 hrc = COMSETTER(AttachmentType)(data.mode); 1235 if (FAILED(hrc)) return hrc; 1238 1236 1239 1237 return S_OK; … … 1417 1415 1418 1416 ComObjPtr<GuestOSType> pGuestOSType; 1419 HRESULT rc = mParent->i_getVirtualBox()->i_findGuestOSType(mParent->i_getOSTypeId(), 1420 pGuestOSType); 1421 if (FAILED(rc)) 1417 HRESULT hrc = mParent->i_getVirtualBox()->i_findGuestOSType(mParent->i_getOSTypeId(), pGuestOSType); 1418 if (FAILED(hrc)) 1422 1419 return false; 1423 1420 -
trunk/src/VBox/Main/src-server/NetworkServiceRunner.cpp
r98103 r98292 170 170 int NetworkServiceRunner::addArgPair(const char *pszOption, const char *pszValue) 171 171 { 172 int rc = addArgument(pszOption);173 if (RT_SUCCESS( rc))174 rc = addArgument(pszValue);175 return rc;172 int vrc = addArgument(pszOption); 173 if (RT_SUCCESS(vrc)) 174 vrc = addArgument(pszValue); 175 return vrc; 176 176 } 177 177 … … 221 221 * Start the process: 222 222 */ 223 intrc = RTProcCreate(szExePath, m->papszArgs, RTENV_DEFAULT, 0, &m->Process);224 if (RT_SUCCESS( rc))223 vrc = RTProcCreate(szExePath, m->papszArgs, RTENV_DEFAULT, 0, &m->Process); 224 if (RT_SUCCESS(vrc)) 225 225 LogRel(("NetworkServiceRunning: started '%s', pid %RTproc\n", m->pszProcName, m->Process)); 226 226 else … … 229 229 m->fKillProcessOnStop = aKillProcessOnStop; 230 230 231 return rc;231 return vrc; 232 232 } 233 233 … … 267 267 RTProcTerminate(m->Process); 268 268 269 int rc = RTProcWait(m->Process, RTPROCWAIT_FLAGS_BLOCK, NULL);270 NOREF( rc);269 int vrc = RTProcWait(m->Process, RTPROCWAIT_FLAGS_BLOCK, NULL); 270 NOREF(vrc); 271 271 } 272 272 … … 287 287 { 288 288 RTPROCSTATUS ExitStatus; 289 int rc = RTProcWait(Process, RTPROCWAIT_FLAGS_NOBLOCK, &ExitStatus);290 if ( rc == VERR_PROCESS_RUNNING)289 int vrc = RTProcWait(Process, RTPROCWAIT_FLAGS_NOBLOCK, &ExitStatus); 290 if (vrc == VERR_PROCESS_RUNNING) 291 291 return true; 292 292 LogRel(("NetworkServiceRunning: %s (pid %RTproc) stopped: iStatus=%u enmReason=%d\n", -
trunk/src/VBox/Main/src-server/Performance.cpp
r98262 r98292 425 425 { 426 426 Assert(mGuests.size() == 0); 427 int rcThread = 0;428 427 HRESULT hrc = enqueueRequest(new CGRQAbort()); 429 428 if (SUCCEEDED(hrc)) … … 431 430 /* We wait only if we were able to put the abort request to a queue */ 432 431 Log7Func(("{%p}: Waiting for CGM request processing thread to stop...\n", this)); 433 int vrc = RTThreadWait(mThread, 1000 /* 1 sec */, &rcThread); 434 Log7Func(("{%p}: RTThreadWait returned %Rrc (thread exit code: %Rrc)\n", this, vrc, rcThread)); 432 int vrcThread = VINF_SUCCESS; 433 int vrc = RTThreadWait(mThread, 1000 /* 1 sec */, &vrcThread); 434 Log7Func(("{%p}: RTThreadWait returned %Rrc (thread exit code: %Rrc)\n", this, vrc, vrcThread)); 435 435 RT_NOREF(vrc); 436 436 } … … 559 559 CollectorGuestManager *mgr = static_cast<CollectorGuestManager*>(pvUser); 560 560 561 HRESULT rc = S_OK;561 HRESULT hrc = S_OK; 562 562 563 563 Log7Func(("{%p}: Starting request processing loop...\n", mgr)); … … 568 568 #endif /* DEBUG */ 569 569 mgr->mGuestBeingCalled = pReq->getGuest(); 570 rc = pReq->execute();570 hrc = pReq->execute(); 571 571 mgr->mGuestBeingCalled = NULL; 572 572 delete pReq; 573 if ( rc == E_ABORT)573 if (hrc == E_ABORT) 574 574 break; 575 if (FAILED( rc))576 Log7Func(("{%p}: request::execute returned % u\n", mgr,rc));577 } 578 Log7Func(("{%p}: Exiting request processing loop... rc=%u\n", mgr,rc));575 if (FAILED(hrc)) 576 Log7Func(("{%p}: request::execute returned %Rhrc\n", mgr, hrc)); 577 } 578 Log7Func(("{%p}: Exiting request processing loop... hrc=%Rhrc\n", mgr, hrc)); 579 579 580 580 return VINF_SUCCESS; … … 960 960 HRESULT HostRamVmm::disable() 961 961 { 962 HRESULT rc = S_OK;962 HRESULT hrc = S_OK; 963 963 BaseMetric::disable(); 964 964 CollectorGuest *provider = mCollectorGuestManager->getVMMStatsProvider(); 965 965 if (provider) 966 rc = provider->disable(VMSTATS_VMM_RAM);967 return rc;966 hrc = provider->disable(VMSTATS_VMM_RAM); 967 return hrc; 968 968 } 969 969 … … 1140 1140 HRESULT MachineNetRate::enable() 1141 1141 { 1142 HRESULT rc = mCGuest->enable(VMSTATS_NET_RATE);1142 HRESULT hrc = mCGuest->enable(VMSTATS_NET_RATE); 1143 1143 BaseMetric::enable(); 1144 return rc;1144 return hrc; 1145 1145 } 1146 1146 … … 1184 1184 HRESULT GuestCpuLoad::enable() 1185 1185 { 1186 HRESULT rc = mCGuest->enable(VMSTATS_GUEST_CPULOAD);1186 HRESULT hrc = mCGuest->enable(VMSTATS_GUEST_CPULOAD); 1187 1187 BaseMetric::enable(); 1188 return rc;1188 return hrc; 1189 1189 } 1190 1190 … … 1224 1224 HRESULT GuestRamUsage::enable() 1225 1225 { 1226 HRESULT rc = mCGuest->enable(VMSTATS_GUEST_RAMUSAGE);1226 HRESULT hrc = mCGuest->enable(VMSTATS_GUEST_RAMUSAGE); 1227 1227 BaseMetric::enable(); 1228 return rc;1228 return hrc; 1229 1229 } 1230 1230 -
trunk/src/VBox/Main/src-server/PerformanceImpl.cpp
r98262 r98292 190 190 LogFlowThisFuncEnter(); 191 191 192 HRESULT rc = S_OK;192 HRESULT hrc = S_OK; 193 193 194 194 m.hal = pm::createHAL(); … … 203 203 AssertMsgRC(vrc, ("Failed to create resource usage sampling timer(%Rra)\n", vrc)); 204 204 if (RT_FAILURE(vrc)) 205 rc = E_FAIL;206 207 if (SUCCEEDED( rc))205 hrc = E_FAIL; 206 207 if (SUCCEEDED(hrc)) 208 208 autoInitSpan.setSucceeded(); 209 209 210 210 LogFlowThisFuncLeave(); 211 211 212 return rc;212 return hrc; 213 213 } 214 214 … … 288 288 { 289 289 ComObjPtr<PerformanceMetric> metric; 290 HRESULT rc = metric.createObject();291 if (SUCCEEDED( rc))292 rc = metric->init(src);293 AssertComRCReturnRC( rc);290 HRESULT hrc = metric.createObject(); 291 if (SUCCEEDED(hrc)) 292 hrc = metric->init(src); 293 AssertComRCReturnRC(hrc); 294 294 dst = metric; 295 return rc;295 return hrc; 296 296 } 297 297 … … 299 299 { 300 300 ComObjPtr<PerformanceMetric> metric; 301 HRESULT rc = metric.createObject();302 if (SUCCEEDED( rc))303 rc = metric->init(src);304 AssertComRCReturnRC( rc);301 HRESULT hrc = metric.createObject(); 302 if (SUCCEEDED(hrc)) 303 hrc = metric->init(src); 304 AssertComRCReturnRC(hrc); 305 305 dst = metric; 306 return rc;306 return hrc; 307 307 } 308 308 … … 319 319 std::vector<ComPtr<IPerformanceMetric> > &aMetrics) 320 320 { 321 HRESULT rc = S_OK;321 HRESULT hrc = S_OK; 322 322 323 323 pm::Filter filter(aMetricNames, aObjects); … … 336 336 { 337 337 ComObjPtr<PerformanceMetric> metric; 338 rc = metric.createObject();339 if (SUCCEEDED( rc))340 rc = metric->init(*it);341 AssertComRCReturnRC( rc);338 hrc = metric.createObject(); 339 if (SUCCEEDED(hrc)) 340 hrc = metric->init(*it); 341 AssertComRCReturnRC(hrc); 342 342 LogFlow(("PerformanceCollector::GetMetrics() store a metric at retMetrics[%zu]...\n", i)); 343 343 aMetrics[i++] = metric; 344 344 } 345 return rc;345 return hrc; 346 346 } 347 347 … … 356 356 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 357 357 358 HRESULT rc = S_OK;358 HRESULT hrc = S_OK; 359 359 BaseMetricList filteredMetrics; 360 360 BaseMetricList::iterator it; … … 369 369 LogFlow(("PerformanceCollector::SetupMetrics() disabling %s\n", 370 370 (*it)->getName())); 371 rc = (*it)->disable();372 if (FAILED( rc))371 hrc = (*it)->disable(); 372 if (FAILED(hrc)) 373 373 break; 374 374 } … … 377 377 LogFlow(("PerformanceCollector::SetupMetrics() enabling %s\n", 378 378 (*it)->getName())); 379 rc = (*it)->enable();380 if (FAILED( rc))379 hrc = (*it)->enable(); 380 if (FAILED(hrc)) 381 381 break; 382 382 } … … 387 387 size_t i = 0; 388 388 for (it = filteredMetrics.begin(); 389 it != filteredMetrics.end() && SUCCEEDED( rc); ++it)390 rc = toIPerformanceMetric(*it, aAffectedMetrics[i++]);391 392 if (FAILED( rc))389 it != filteredMetrics.end() && SUCCEEDED(hrc); ++it) 390 hrc = toIPerformanceMetric(*it, aAffectedMetrics[i++]); 391 392 if (FAILED(hrc)) 393 393 return setError(E_FAIL, tr("Failed to setup metrics for '%s'"), 394 394 getFailedGuestName().c_str()); 395 return rc;395 return hrc; 396 396 } 397 397 … … 406 406 /* care for those who come next :-). */ 407 407 408 HRESULT rc = S_OK;408 HRESULT hrc = S_OK; 409 409 BaseMetricList filteredMetrics; 410 410 BaseMetricList::iterator it; … … 412 412 if (filter.match((*it)->getObject(), (*it)->getName())) 413 413 { 414 rc = (*it)->enable();415 if (FAILED( rc))414 hrc = (*it)->enable(); 415 if (FAILED(hrc)) 416 416 break; 417 417 filteredMetrics.push_back(*it); … … 421 421 size_t i = 0; 422 422 for (it = filteredMetrics.begin(); 423 it != filteredMetrics.end() && SUCCEEDED( rc); ++it)424 rc = toIPerformanceMetric(*it, aAffectedMetrics[i++]);423 it != filteredMetrics.end() && SUCCEEDED(hrc); ++it) 424 hrc = toIPerformanceMetric(*it, aAffectedMetrics[i++]); 425 425 426 426 LogFlowThisFuncLeave(); 427 427 428 if (FAILED( rc))428 if (FAILED(hrc)) 429 429 return setError(E_FAIL, tr("Failed to enable metrics for '%s'"), 430 430 getFailedGuestName().c_str()); 431 return rc;431 return hrc; 432 432 } 433 433 … … 442 442 /* care for those who come next :-). */ 443 443 444 HRESULT rc = S_OK;444 HRESULT hrc = S_OK; 445 445 BaseMetricList filteredMetrics; 446 446 BaseMetricList::iterator it; … … 448 448 if (filter.match((*it)->getObject(), (*it)->getName())) 449 449 { 450 rc = (*it)->disable();451 if (FAILED( rc))450 hrc = (*it)->disable(); 451 if (FAILED(hrc)) 452 452 break; 453 453 filteredMetrics.push_back(*it); … … 457 457 size_t i = 0; 458 458 for (it = filteredMetrics.begin(); 459 it != filteredMetrics.end() && SUCCEEDED( rc); ++it)460 rc = toIPerformanceMetric(*it, aAffectedMetrics[i++]);459 it != filteredMetrics.end() && SUCCEEDED(hrc); ++it) 460 hrc = toIPerformanceMetric(*it, aAffectedMetrics[i++]); 461 461 462 462 LogFlowThisFuncLeave(); 463 463 464 if (FAILED( rc))464 if (FAILED(hrc)) 465 465 return setError(E_FAIL, tr("Failed to disable metrics for '%s'"), 466 466 getFailedGuestName().c_str()); 467 return rc;467 return hrc; 468 468 } 469 469 … … 621 621 if (!SUCCEEDED(autoCaller.hrc())) return; 622 622 623 int rc = RTTimerLRStop(m.sampler);624 if ( RT_FAILURE( rc)625 && rc != VERR_TIMER_SUSPENDED) /* calling suspendSampling() successively shouldn't assert. See @bugref{3495}. */626 AssertMsgFailed(("PerformanceCollector::suspendSampling(): RTTimerLRStop returned %Rrc\n", rc));623 int vrc = RTTimerLRStop(m.sampler); 624 if ( RT_FAILURE(vrc) 625 && vrc != VERR_TIMER_SUSPENDED) /* calling suspendSampling() successively shouldn't assert. See @bugref{3495}. */ 626 AssertMsgFailed(("PerformanceCollector::suspendSampling(): RTTimerLRStop returned %Rrc\n", vrc)); 627 627 } 628 628 … … 632 632 if (!SUCCEEDED(autoCaller.hrc())) return; 633 633 634 int rc = RTTimerLRStart(m.sampler, 0);635 if ( RT_FAILURE( rc)636 && rc != VERR_TIMER_ACTIVE) /* calling resumeSampling() successively shouldn't assert. See @bugref{3495}. */637 AssertMsgFailed(("PerformanceCollector::resumeSampling(): RTTimerLRStart returned %Rrc\n", rc));634 int vrc = RTTimerLRStart(m.sampler, 0); 635 if ( RT_FAILURE(vrc) 636 && vrc != VERR_TIMER_ACTIVE) /* calling resumeSampling() successively shouldn't assert. See @bugref{3495}. */ 637 AssertMsgFailed(("PerformanceCollector::resumeSampling(): RTTimerLRStart returned %Rrc\n", vrc)); 638 638 } 639 639 -
trunk/src/VBox/Main/src-server/ProgressProxyImpl.cpp
r98262 r98292 55 55 muOtherProgressStartOperation = 0; 56 56 57 HRESULT rc = Progress::FinalConstruct(); 58 return rc; 57 return Progress::FinalConstruct(); 59 58 } 60 59 -
trunk/src/VBox/Main/src-server/RecordingSettingsImpl.cpp
r98262 r98292 577 577 pGraphicsAdapter->COMGETTER(MonitorCount)(&cMonitors); 578 578 579 int rc2 = i_syncToMachineDisplays(cMonitors);580 AssertRC( rc2);579 int vrc2 = i_syncToMachineDisplays(cMonitors); 580 AssertRC(vrc2); 581 581 582 582 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); -
trunk/src/VBox/Main/src-server/SerialPortImpl.cpp
r98262 r98292 404 404 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 405 405 406 HRESULT rc = S_OK;406 HRESULT hrc = S_OK; 407 407 408 408 if (m->bd->ulIOBase != aIOBase) … … 422 422 } 423 423 424 return rc;424 return hrc; 425 425 } 426 426 … … 445 445 if (aPath != m->bd->strPath) 446 446 { 447 HRESULT rc = i_checkSetPath(aPath);448 if (FAILED( rc)) returnrc;447 HRESULT hrc = i_checkSetPath(aPath); 448 if (FAILED(hrc)) return hrc; 449 449 450 450 m->bd.backup(); -
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r98289 r98292 384 384 HRESULT Snapshot::setName(const com::Utf8Str &aName) 385 385 { 386 HRESULT rc = S_OK;386 HRESULT hrc = S_OK; 387 387 388 388 // prohibit setting a UUID only as the machine name, or else it can … … 399 399 m->strName = aName; 400 400 alock.release(); /* Important! (child->parent locks are forbidden) */ 401 rc = m->pMachine->i_onSnapshotChange(this);402 } 403 404 return rc;401 hrc = m->pMachine->i_onSnapshotChange(this); 402 } 403 404 return hrc; 405 405 } 406 406 … … 414 414 HRESULT Snapshot::setDescription(const com::Utf8Str &aDescription) 415 415 { 416 HRESULT rc = S_OK;416 HRESULT hrc = S_OK; 417 417 418 418 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 421 421 m->strDescription = aDescription; 422 422 alock.release(); /* Important! (child->parent locks are forbidden) */ 423 rc = m->pMachine->i_onSnapshotChange(this);424 } 425 426 return rc;423 hrc = m->pMachine->i_onSnapshotChange(this); 424 } 425 426 return hrc; 427 427 } 428 428 … … 903 903 llSettingsTodo.pop_front(); 904 904 905 HRESULT rc = pSnapshot->i_saveSnapshotOne(*current);906 if (FAILED( rc))907 return rc;905 HRESULT hrc = pSnapshot->i_saveSnapshotOne(*current); 906 if (FAILED(hrc)) 907 return hrc; 908 908 909 909 /* save all children */ … … 954 954 Assert(m->pMachine->isWriteLockOnCurrentThread()); 955 955 956 HRESULT rc = S_OK;956 HRESULT hrc = S_OK; 957 957 958 958 SnapshotsList llSnapshotsTodo; … … 987 987 llSnapshotsAll.pop_front(); 988 988 989 rc = pSnapshot->m->pMachine->i_detachAllMedia(writeLock, 990 pSnapshot, 991 cleanupMode, 992 llMedia); 993 if (SUCCEEDED(rc)) 989 hrc = pSnapshot->m->pMachine->i_detachAllMedia(writeLock, pSnapshot, cleanupMode, llMedia); 990 if (SUCCEEDED(hrc)) 994 991 { 995 992 Utf8Str strFile; … … 1096 1093 mSSData->strStateFilePath = aStateFilePath; 1097 1094 1098 HRESULT rc = S_OK;1095 HRESULT hrc = S_OK; 1099 1096 1100 1097 /* Create copies of all attachments (mMediaData after attaching a copy … … 1110 1107 ComObjPtr<MediumAttachment> pAtt; 1111 1108 pAtt.createObject(); 1112 rc = pAtt->initCopy(this, *it);1113 if (FAILED( rc)) returnrc;1109 hrc = pAtt->initCopy(this, *it); 1110 if (FAILED(hrc)) return hrc; 1114 1111 mMediumAttachments->push_back(pAtt); 1115 1112 … … 1117 1114 if (pMedium) // can be NULL for non-harddisk 1118 1115 { 1119 rc = pMedium->i_addBackReference(mData->mUuid, mSnapshotId);1120 AssertComRC( rc);1116 hrc = pMedium->i_addBackReference(mData->mUuid, mSnapshotId); 1117 AssertComRC(hrc); 1121 1118 } 1122 1119 } … … 1131 1128 ComObjPtr<SharedFolder> pFolder; 1132 1129 pFolder.createObject(); 1133 rc = pFolder->initCopy(this, *it);1134 if (FAILED( rc)) returnrc;1130 hrc = pFolder->initCopy(this, *it); 1131 if (FAILED(hrc)) return hrc; 1135 1132 *it = pFolder; 1136 1133 } … … 1145 1142 ComObjPtr<PCIDeviceAttachment> pDev; 1146 1143 pDev.createObject(); 1147 rc = pDev->initCopy(this, *it);1148 if (FAILED( rc)) returnrc;1144 hrc = pDev->initCopy(this, *it); 1145 if (FAILED(hrc)) return hrc; 1149 1146 *it = pDev; 1150 1147 } … … 1160 1157 ComObjPtr<StorageController> ctrl; 1161 1158 ctrl.createObject(); 1162 rc = ctrl->initCopy(this, *it);1163 if (FAILED( rc)) returnrc;1159 hrc = ctrl->initCopy(this, *it); 1160 if (FAILED(hrc)) return hrc; 1164 1161 mStorageControllers->push_back(ctrl); 1165 1162 } … … 1168 1165 1169 1166 unconst(mBIOSSettings).createObject(); 1170 rc = mBIOSSettings->initCopy(this, pMachine->mBIOSSettings);1171 if (FAILED( rc)) returnrc;1167 hrc = mBIOSSettings->initCopy(this, pMachine->mBIOSSettings); 1168 if (FAILED(hrc)) return hrc; 1172 1169 1173 1170 unconst(mRecordingSettings).createObject(); 1174 rc = mRecordingSettings->initCopy(this, pMachine->mRecordingSettings);1175 if (FAILED( rc)) returnrc;1171 hrc = mRecordingSettings->initCopy(this, pMachine->mRecordingSettings); 1172 if (FAILED(hrc)) return hrc; 1176 1173 1177 1174 unconst(mTrustedPlatformModule).createObject(); 1178 rc = mTrustedPlatformModule->initCopy(this, pMachine->mTrustedPlatformModule);1179 if (FAILED( rc)) returnrc;1175 hrc = mTrustedPlatformModule->initCopy(this, pMachine->mTrustedPlatformModule); 1176 if (FAILED(hrc)) return hrc; 1180 1177 1181 1178 unconst(mNvramStore).createObject(); 1182 rc = mNvramStore->initCopy(this, pMachine->mNvramStore);1183 if (FAILED( rc)) returnrc;1179 hrc = mNvramStore->initCopy(this, pMachine->mNvramStore); 1180 if (FAILED(hrc)) return hrc; 1184 1181 1185 1182 unconst(mGraphicsAdapter).createObject(); 1186 rc = mGraphicsAdapter->initCopy(this, pMachine->mGraphicsAdapter);1187 if (FAILED( rc)) returnrc;1183 hrc = mGraphicsAdapter->initCopy(this, pMachine->mGraphicsAdapter); 1184 if (FAILED(hrc)) return hrc; 1188 1185 1189 1186 unconst(mVRDEServer).createObject(); 1190 rc = mVRDEServer->initCopy(this, pMachine->mVRDEServer);1191 if (FAILED( rc)) returnrc;1187 hrc = mVRDEServer->initCopy(this, pMachine->mVRDEServer); 1188 if (FAILED(hrc)) return hrc; 1192 1189 1193 1190 unconst(mAudioSettings).createObject(); 1194 rc = mAudioSettings->initCopy(this, pMachine->mAudioSettings);1195 if (FAILED( rc)) returnrc;1191 hrc = mAudioSettings->initCopy(this, pMachine->mAudioSettings); 1192 if (FAILED(hrc)) return hrc; 1196 1193 1197 1194 /* create copies of all USB controllers (mUSBControllerData … … 1205 1202 ComObjPtr<USBController> ctrl; 1206 1203 ctrl.createObject(); 1207 rc = ctrl->initCopy(this, *it);1208 if (FAILED( rc)) returnrc;1204 hrc = ctrl->initCopy(this, *it); 1205 if (FAILED(hrc)) return hrc; 1209 1206 mUSBControllers->push_back(ctrl); 1210 1207 } 1211 1208 1212 1209 unconst(mUSBDeviceFilters).createObject(); 1213 rc = mUSBDeviceFilters->initCopy(this, pMachine->mUSBDeviceFilters);1214 if (FAILED( rc)) returnrc;1210 hrc = mUSBDeviceFilters->initCopy(this, pMachine->mUSBDeviceFilters); 1211 if (FAILED(hrc)) return hrc; 1215 1212 1216 1213 mNetworkAdapters.resize(pMachine->mNetworkAdapters.size()); … … 1218 1215 { 1219 1216 unconst(mNetworkAdapters[slot]).createObject(); 1220 rc = mNetworkAdapters[slot]->initCopy(this, pMachine->mNetworkAdapters[slot]);1221 if (FAILED( rc)) returnrc;1217 hrc = mNetworkAdapters[slot]->initCopy(this, pMachine->mNetworkAdapters[slot]); 1218 if (FAILED(hrc)) return hrc; 1222 1219 } 1223 1220 … … 1225 1222 { 1226 1223 unconst(mSerialPorts[slot]).createObject(); 1227 rc = mSerialPorts[slot]->initCopy(this, pMachine->mSerialPorts[slot]);1228 if (FAILED( rc)) returnrc;1224 hrc = mSerialPorts[slot]->initCopy(this, pMachine->mSerialPorts[slot]); 1225 if (FAILED(hrc)) return hrc; 1229 1226 } 1230 1227 … … 1232 1229 { 1233 1230 unconst(mParallelPorts[slot]).createObject(); 1234 rc = mParallelPorts[slot]->initCopy(this, pMachine->mParallelPorts[slot]);1235 if (FAILED( rc)) returnrc;1231 hrc = mParallelPorts[slot]->initCopy(this, pMachine->mParallelPorts[slot]); 1232 if (FAILED(hrc)) return hrc; 1236 1233 } 1237 1234 1238 1235 unconst(mBandwidthControl).createObject(); 1239 rc = mBandwidthControl->initCopy(this, pMachine->mBandwidthControl);1240 if (FAILED( rc)) returnrc;1236 hrc = mBandwidthControl->initCopy(this, pMachine->mBandwidthControl); 1237 if (FAILED(hrc)) return hrc; 1241 1238 1242 1239 unconst(mGuestDebugControl).createObject(); 1243 rc = mGuestDebugControl->initCopy(this, pMachine->mGuestDebugControl);1244 if (FAILED( rc)) returnrc;1240 hrc = mGuestDebugControl->initCopy(this, pMachine->mGuestDebugControl); 1241 if (FAILED(hrc)) return hrc; 1245 1242 1246 1243 /* Confirm a successful initialization when it's the case */ … … 1436 1433 mMachine->i_setModified(Machine::IsModified_Snapshots, false /* fAllowStateModification */); 1437 1434 slock.release(); 1438 HRESULT rc = mMachine->i_saveSettings(&fNeedsGlobalSaveSettings,1439 alock,1440 SaveS_Force); // we know we need saving, no need to check1435 HRESULT hrc = mMachine->i_saveSettings(&fNeedsGlobalSaveSettings, 1436 alock, 1437 SaveS_Force); // we know we need saving, no need to check 1441 1438 alock.release(); 1442 1439 1443 if (SUCCEEDED( rc) && fNeedsGlobalSaveSettings)1440 if (SUCCEEDED(hrc) && fNeedsGlobalSaveSettings) 1444 1441 { 1445 1442 // save the global settings 1446 1443 AutoWriteLock vboxlock(mParent COMMA_LOCKVAL_SRC_POS); 1447 rc = mParent->i_saveSettings();1444 hrc = mParent->i_saveSettings(); 1448 1445 } 1449 1446 … … 1451 1448 mParent->i_onSnapshotChanged(uuidMachine, uuidSnapshot); 1452 1449 1453 return rc;1450 return hrc; 1454 1451 } 1455 1452 … … 1634 1631 Global::stringifyMachineState(mData->mMachineState)); 1635 1632 1636 HRESULT rc = i_checkStateDependency(MutableOrSavedOrRunningStateDep);1637 if (FAILED( rc))1638 return rc;1633 HRESULT hrc = i_checkStateDependency(MutableOrSavedOrRunningStateDep); 1634 if (FAILED(hrc)) 1635 return hrc; 1639 1636 1640 1637 // prepare the progress object: … … 1672 1669 ComObjPtr<Progress> pProgress; 1673 1670 pProgress.createObject(); 1674 rc = pProgress->init(mParent,1675 static_cast<IMachine *>(this),1676 Bstr(tr("Taking a snapshot of the virtual machine")).raw(),1677 fTakingSnapshotOnline /* aCancelable */,1678 cOperations,1679 ulTotalOperationsWeight,1680 Bstr(tr("Setting up snapshot operation")).raw(), // first sub-op description1681 1); // ulFirstOperationWeight1682 if (FAILED( rc))1683 return rc;1671 hrc = pProgress->init(mParent, 1672 static_cast<IMachine *>(this), 1673 Bstr(tr("Taking a snapshot of the virtual machine")).raw(), 1674 fTakingSnapshotOnline /* aCancelable */, 1675 cOperations, 1676 ulTotalOperationsWeight, 1677 Bstr(tr("Setting up snapshot operation")).raw(), // first sub-op description 1678 1); // ulFirstOperationWeight 1679 if (FAILED(hrc)) 1680 return hrc; 1684 1681 1685 1682 /* create an ID for the snapshot */ … … 1700 1697 fTakingSnapshotOnline); 1701 1698 MachineState_T const machineStateBackup = pTask->m_machineStateBackup; 1702 rc = pTask->createThread();1699 hrc = pTask->createThread(); 1703 1700 pTask = NULL; 1704 if (FAILED( rc))1705 return rc;1701 if (FAILED(hrc)) 1702 return hrc; 1706 1703 1707 1704 /* set the proper machine state (note: after creating a Task instance) */ … … 1720 1717 pProgress.queryInterfaceTo(aProgress.asOutParam()); 1721 1718 1722 return rc;1719 return hrc; 1723 1720 } 1724 1721 … … 1746 1743 // 5) update the various snapshot/machine objects, save settings 1747 1744 1748 HRESULT rc = S_OK;1745 HRESULT hrc = S_OK; 1749 1746 AutoCaller autoCaller(this); 1750 1747 LogFlowThisFunc(("state=%d\n", getObjectState().getState())); … … 1753 1750 /* we might have been uninitialized because the session was accidentally 1754 1751 * closed by the client, so don't assert */ 1755 rc = setError(E_FAIL, 1756 tr("The session has been accidentally closed")); 1757 task.m_pProgress->i_notifyComplete(rc); 1752 hrc = setError(E_FAIL, tr("The session has been accidentally closed")); 1753 task.m_pProgress->i_notifyComplete(hrc); 1758 1754 LogFlowThisFuncLeave(); 1759 1755 return; … … 1789 1785 /* save settings to ensure current changes are committed and 1790 1786 * hard disks are fixed up */ 1791 rc = i_saveSettings(NULL, alock); /******************1 */1787 hrc = i_saveSettings(NULL, alock); /******************1 */ 1792 1788 // no need to check for whether VirtualBox.xml needs changing since 1793 1789 // we can't have a machine XML rename pending at this point 1794 if (FAILED( rc))1795 throw rc;1790 if (FAILED(hrc)) 1791 throw hrc; 1796 1792 1797 1793 /* task.m_strStateFilePath is "" when the machine is offline or saved */ … … 1799 1795 { 1800 1796 Bstr value; 1801 rc = GetExtraData(Bstr("VBoxInternal2/ForceTakeSnapshotWithoutState").raw(), 1802 value.asOutParam()); 1803 if (FAILED(rc) || value != "1") 1797 hrc = GetExtraData(Bstr("VBoxInternal2/ForceTakeSnapshotWithoutState").raw(), value.asOutParam()); 1798 if (FAILED(hrc) || value != "1") 1804 1799 // creating a new online snapshot: we need a fresh saved state file 1805 1800 i_composeSavedStateFilename(task.m_strStateFilePath); … … 1812 1807 { 1813 1808 // ensure the directory for the saved state file exists 1814 rc = VirtualBox::i_ensureFilePathExists(task.m_strStateFilePath, true /* fCreate */);1815 if (FAILED( rc))1816 throw rc;1809 hrc = VirtualBox::i_ensureFilePathExists(task.m_strStateFilePath, true /* fCreate */); 1810 if (FAILED(hrc)) 1811 throw hrc; 1817 1812 } 1818 1813 … … 1822 1817 ComObjPtr<SnapshotMachine> pSnapshotMachine; 1823 1818 pSnapshotMachine.createObject(); 1824 rc = pSnapshotMachine->init(this, task.m_uuidSnapshot.ref(), task.m_strStateFilePath);1825 AssertComRCThrowRC( rc);1819 hrc = pSnapshotMachine->init(this, task.m_uuidSnapshot.ref(), task.m_strStateFilePath); 1820 AssertComRCThrowRC(hrc); 1826 1821 1827 1822 /* create a snapshot object */ … … 1829 1824 RTTimeNow(&time); 1830 1825 task.m_pSnapshot.createObject(); 1831 rc = task.m_pSnapshot->init(mParent,1832 task.m_uuidSnapshot,1833 task.m_strName,1834 task.m_strDescription,1835 time,1836 pSnapshotMachine,1837 mData->mCurrentSnapshot);1838 AssertComRCThrowRC( rc);1826 hrc = task.m_pSnapshot->init(mParent, 1827 task.m_uuidSnapshot, 1828 task.m_strName, 1829 task.m_strDescription, 1830 time, 1831 pSnapshotMachine, 1832 mData->mCurrentSnapshot); 1833 AssertComRCThrowRC(hrc); 1839 1834 1840 1835 /* STEP 2: create the diff images */ 1841 LogFlowThisFunc(("Creating differencing hard disks (online=%d)...\n", 1842 task.m_fTakingSnapshotOnline)); 1836 LogFlowThisFunc(("Creating differencing hard disks (online=%d)...\n", task.m_fTakingSnapshotOnline)); 1843 1837 1844 1838 // Backup the media data so we can recover if something goes wrong. … … 1849 1843 alock.release(); 1850 1844 /* create new differencing hard disks and attach them to this machine */ 1851 rc = i_createImplicitDiffs(task.m_pProgress,1852 1, // operation weight; must be the same as in Machine::TakeSnapshot()1853 task.m_fTakingSnapshotOnline);1854 if (FAILED( rc))1855 throw rc;1845 hrc = i_createImplicitDiffs(task.m_pProgress, 1846 1, // operation weight; must be the same as in Machine::TakeSnapshot() 1847 task.m_fTakingSnapshotOnline); 1848 if (FAILED(hrc)) 1849 throw hrc; 1856 1850 alock.acquire(); 1857 1851 … … 1873 1867 alock.release(); 1874 1868 task.m_pProgress->i_setCancelCallback(i_takeSnapshotProgressCancelCallback, &task); 1875 rc = task.m_pDirectControl->SaveStateWithReason(Reason_Snapshot,1876 task.m_pProgress,1877 task.m_pSnapshot,1878 Bstr(task.m_strStateFilePath).raw(),1879 task.m_fPause,1880 &fSuspendedBySave);1869 hrc = task.m_pDirectControl->SaveStateWithReason(Reason_Snapshot, 1870 task.m_pProgress, 1871 task.m_pSnapshot, 1872 Bstr(task.m_strStateFilePath).raw(), 1873 task.m_fPause, 1874 &fSuspendedBySave); 1881 1875 task.m_pProgress->i_setCancelCallback(NULL, NULL); 1882 1876 alock.acquire(); 1883 if (FAILED( rc))1884 throw rc;1877 if (FAILED(hrc)) 1878 throw hrc; 1885 1879 } 1886 1880 else … … 1897 1891 1898 1892 com::SafeIfaceArray<IMediumAttachment> atts; 1899 rc = COMGETTER(MediumAttachments)(ComSafeArrayAsOutParam(atts));1900 if (FAILED( rc))1901 throw rc;1893 hrc = COMGETTER(MediumAttachments)(ComSafeArrayAsOutParam(atts)); 1894 if (FAILED(hrc)) 1895 throw hrc; 1902 1896 1903 1897 alock.release(); 1904 rc = task.m_pDirectControl->ReconfigureMediumAttachments(ComSafeArrayAsInParam(atts));1898 hrc = task.m_pDirectControl->ReconfigureMediumAttachments(ComSafeArrayAsInParam(atts)); 1905 1899 alock.acquire(); 1906 if (FAILED( rc))1907 throw rc;1900 if (FAILED(hrc)) 1901 throw hrc; 1908 1902 } 1909 1903 … … 1915 1909 Utf8Str strNVRAMSnapAbs; 1916 1910 i_calculateFullPath(strNVRAMSnap, strNVRAMSnapAbs); 1917 rc = VirtualBox::i_ensureFilePathExists(strNVRAMSnapAbs, true /* fCreate */);1918 if (FAILED( rc))1919 throw rc;1911 hrc = VirtualBox::i_ensureFilePathExists(strNVRAMSnapAbs, true /* fCreate */); 1912 if (FAILED(hrc)) 1913 throw hrc; 1920 1914 int vrc = RTFileCopy(strNVRAM.c_str(), strNVRAMSnapAbs.c_str()); 1921 1915 if (RT_FAILURE(vrc)) … … 1965 1959 * machine state to the state it had at the beginning. 1966 1960 */ 1967 rc = i_finishTakingSnapshot(task, alock, true /*aSuccess*/); /*******************2+3 */1968 // do not throw rc here because we can't call i_finishTakingSnapshot() twice1969 LogFlowThisFunc(("i_finishTakingSnapshot -> %Rhrc [mMachineState=%s]\n", rc, ::stringifyMachineState(mData->mMachineState)));1970 } 1971 catch (HRESULT rcThrown)1972 { 1973 rc = rcThrown;1974 LogThisFunc(("Caught %Rhrc [mMachineState=%s]\n", rc, ::stringifyMachineState(mData->mMachineState)));1961 hrc = i_finishTakingSnapshot(task, alock, true /*aSuccess*/); /*******************2+3 */ 1962 // do not throw hrc here because we can't call i_finishTakingSnapshot() twice 1963 LogFlowThisFunc(("i_finishTakingSnapshot -> %Rhrc [mMachineState=%s]\n", hrc, ::stringifyMachineState(mData->mMachineState))); 1964 } 1965 catch (HRESULT hrcXcpt) 1966 { 1967 hrc = hrcXcpt; 1968 LogThisFunc(("Caught %Rhrc [mMachineState=%s]\n", hrc, ::stringifyMachineState(mData->mMachineState))); 1975 1969 1976 1970 /// @todo r=klaus check that the implicit diffs created above are cleaned up im the relevant error cases … … 2013 2007 { 2014 2008 MachineState_T enmMachineState = MachineState_Null; 2015 HRESULT rc2 = task.m_pDirectControl->COMGETTER(NominalState)(&enmMachineState);2016 if (FAILED( rc2) || enmMachineState == MachineState_Null)2009 HRESULT hrc2 = task.m_pDirectControl->COMGETTER(NominalState)(&enmMachineState); 2010 if (FAILED(hrc2) || enmMachineState == MachineState_Null) 2017 2011 { 2018 2012 AssertMsgFailed(("state=%s\n", ::stringifyMachineState(enmMachineState))); … … 2025 2019 { 2026 2020 alock.release(); 2027 rc2 = task.m_pDirectControl->ResumeWithReason(Reason_Snapshot);2021 hrc2 = task.m_pDirectControl->ResumeWithReason(Reason_Snapshot); 2028 2022 alock.acquire(); 2029 if (SUCCEEDED( rc2))2023 if (SUCCEEDED(hrc2)) 2030 2024 enmMachineState = task.m_machineStateBackup; 2031 2025 } … … 2057 2051 } 2058 2052 2059 task.m_pProgress->i_notifyComplete( rc);2060 2061 if (SUCCEEDED( rc))2053 task.m_pProgress->i_notifyComplete(hrc); 2054 2055 if (SUCCEEDED(hrc)) 2062 2056 mParent->i_onSnapshotTaken(mData->mUuid, task.m_uuidSnapshot); 2063 2057 2064 if (SUCCEEDED( rc))2058 if (SUCCEEDED(hrc)) 2065 2059 { 2066 2060 for (std::map<Guid, DeviceType_T>::const_iterator it = uIdsForNotify.begin(); … … 2126 2120 ComObjPtr<Snapshot> pOldCurrentSnap = mData->mCurrentSnapshot; 2127 2121 2128 HRESULT rc = S_OK;2122 HRESULT hrc = S_OK; 2129 2123 2130 2124 if (aSuccess) … … 2144 2138 flSaveSettings |= SaveS_ResetCurStateModified; 2145 2139 2146 rc = i_saveSettings(NULL, alock, flSaveSettings); /******************2 */2147 } 2148 2149 if (aSuccess && SUCCEEDED( rc))2140 hrc = i_saveSettings(NULL, alock, flSaveSettings); /******************2 */ 2141 } 2142 2143 if (aSuccess && SUCCEEDED(hrc)) 2150 2144 { 2151 2145 /* associate old hard disks with the snapshot and do locking/unlocking*/ … … 2186 2180 alock.acquire(); 2187 2181 2188 return rc;2182 return hrc; 2189 2183 } 2190 2184 … … 2228 2222 Global::stringifyMachineState(mData->mMachineState)); 2229 2223 2230 HRESULT rc = i_checkStateDependency(MutableOrSavedStateDep);2231 if (FAILED( rc))2232 return rc;2224 HRESULT hrc = i_checkStateDependency(MutableOrSavedStateDep); 2225 if (FAILED(hrc)) 2226 return hrc; 2233 2227 2234 2228 /* We need to explicitly check if the given snapshot is valid and bail out if not. */ … … 2285 2279 "RestoreSnap", 2286 2280 pSnapshot); 2287 rc = pTask->createThread();2281 hrc = pTask->createThread(); 2288 2282 pTask = NULL; 2289 if (FAILED( rc))2290 return rc;2283 if (FAILED(hrc)) 2284 return hrc; 2291 2285 2292 2286 /* set the proper machine state (note: after creating a Task instance) */ … … 2333 2327 } 2334 2328 2335 HRESULT rc = S_OK;2329 HRESULT hrc = S_OK; 2336 2330 Guid snapshotId; 2337 2331 std::set<ComObjPtr<Medium> > pMediumsForNotify; … … 2362 2356 task.modifyBackedUpState(MachineState_PoweredOff); 2363 2357 2364 rc = i_saveStateSettings(SaveSTS_StateFilePath);2365 if (FAILED( rc))2366 throw rc;2358 hrc = i_saveStateSettings(SaveSTS_StateFilePath); 2359 if (FAILED(hrc)) 2360 throw hrc; 2367 2361 } 2368 2362 … … 2405 2399 alock.release(); 2406 2400 2407 rc = i_createImplicitDiffs(task.m_pProgress, 2408 1, 2409 false /* aOnline */); 2410 if (FAILED(rc)) 2411 throw rc; 2401 hrc = i_createImplicitDiffs(task.m_pProgress, 1, false /* aOnline */); 2402 if (FAILED(hrc)) 2403 throw hrc; 2412 2404 2413 2405 alock.acquire(); … … 2553 2545 // save machine settings, reset the modified flag and commit; 2554 2546 bool fNeedsGlobalSaveSettings = false; 2555 rc = i_saveSettings(&fNeedsGlobalSaveSettings, alock, 2556 SaveS_ResetCurStateModified); 2557 if (FAILED(rc)) 2558 throw rc; 2547 hrc = i_saveSettings(&fNeedsGlobalSaveSettings, alock, SaveS_ResetCurStateModified); 2548 if (FAILED(hrc)) 2549 throw hrc; 2559 2550 2560 2551 // release the locks before updating registry and deleting image files … … 2576 2567 // store the id here because it becomes NULL after deleting storage. 2577 2568 com::Guid id = pMedium->i_getId(); 2578 HRESULT rc2 = pMedium->i_deleteStorage(NULL /* aProgress */, 2579 true /* aWait */, 2580 false /* aNotify */); 2569 HRESULT hrc2 = pMedium->i_deleteStorage(NULL /* aProgress */, true /* aWait */, false /* aNotify */); 2581 2570 // ignore errors here because we cannot roll back after i_saveSettings() above 2582 if (SUCCEEDED( rc2))2571 if (SUCCEEDED(hrc2)) 2583 2572 { 2584 2573 pMediumsForNotify.insert(pParent); … … 2590 2579 catch (HRESULT hrcXcpt) 2591 2580 { 2592 rc = hrcXcpt;2593 } 2594 2595 if (FAILED( rc))2581 hrc = hrcXcpt; 2582 } 2583 2584 if (FAILED(hrc)) 2596 2585 { 2597 2586 /* preserve existing error info */ … … 2609 2598 2610 2599 /* set the result (this will try to fetch current error info on failure) */ 2611 task.m_pProgress->i_notifyComplete( rc);2612 2613 if (SUCCEEDED( rc))2600 task.m_pProgress->i_notifyComplete(hrc); 2601 2602 if (SUCCEEDED(hrc)) 2614 2603 { 2615 2604 mParent->i_onSnapshotRestored(mData->mUuid, snapshotId); … … 2629 2618 } 2630 2619 2631 LogFlowThisFunc(("Done restoring snapshot ( rc=%08X)\n",rc));2620 LogFlowThisFunc(("Done restoring snapshot (hrc=%08X)\n", hrc)); 2632 2621 2633 2622 LogFlowThisFuncLeave(); … … 2731 2720 Global::stringifyMachineState(mData->mMachineState)); 2732 2721 2733 HRESULT rc = i_checkStateDependency(MutableOrSavedOrRunningStateDep);2734 if (FAILED( rc))2735 return rc;2722 HRESULT hrc = i_checkStateDependency(MutableOrSavedOrRunningStateDep); 2723 if (FAILED(hrc)) 2724 return hrc; 2736 2725 2737 2726 ComObjPtr<Snapshot> pSnapshot; 2738 rc = i_findSnapshotById(aStartId, pSnapshot, true /* aSetError */);2739 if (FAILED( rc))2740 return rc;2727 hrc = i_findSnapshotById(aStartId, pSnapshot, true /* aSetError */); 2728 if (FAILED(hrc)) 2729 return hrc; 2741 2730 2742 2731 AutoWriteLock snapshotLock(pSnapshot COMMA_LOCKVAL_SRC_POS); … … 2766 2755 { 2767 2756 snapshotLock.release(); 2768 rc = i_saveSettings(NULL, alock);2757 hrc = i_saveSettings(NULL, alock); 2769 2758 snapshotLock.acquire(); 2770 2759 // no need to change for whether VirtualBox.xml needs saving since 2771 2760 // we can't have a machine XML rename pending at this point 2772 if (FAILED( rc)) returnrc;2761 if (FAILED(hrc)) return hrc; 2773 2762 } 2774 2763 } … … 2839 2828 fDeleteOnline, 2840 2829 pSnapshot); 2841 rc = pTask->createThread();2830 hrc = pTask->createThread(); 2842 2831 pTask = NULL; 2843 if (FAILED( rc))2844 return rc;2832 if (FAILED(hrc)) 2833 return hrc; 2845 2834 2846 2835 // the task might start running but will block on acquiring the machine's write lock … … 2988 2977 try 2989 2978 { 2990 HRESULT rc = S_OK;2979 HRESULT hrc = S_OK; 2991 2980 2992 2981 /* Locking order: */ … … 3069 3058 if (pOnlineMediumAttachment) 3070 3059 { 3071 rc = mData->mSession.mLockedMedia.Get(pOnlineMediumAttachment, 3072 pVMMALockList); 3073 if (FAILED(rc)) 3060 hrc = mData->mSession.mLockedMedia.Get(pOnlineMediumAttachment, pVMMALockList); 3061 if (FAILED(hrc)) 3074 3062 fOnlineMergePossible = false; 3075 3063 } … … 3082 3070 3083 3071 treeLock.release(); 3084 rc = i_prepareDeleteSnapshotMedium(pHD, machineId, snapshotId,3085 fOnlineMergePossible,3086 pVMMALockList, pSource, pTarget,3087 fMergeForward, pParentForTarget,3088 pChildrenToReparent,3089 fNeedsOnlineMerge,3090 pMediumLockList,3091 pHDLockToken);3072 hrc = i_prepareDeleteSnapshotMedium(pHD, machineId, snapshotId, 3073 fOnlineMergePossible, 3074 pVMMALockList, pSource, pTarget, 3075 fMergeForward, pParentForTarget, 3076 pChildrenToReparent, 3077 fNeedsOnlineMerge, 3078 pMediumLockList, 3079 pHDLockToken); 3092 3080 treeLock.acquire(); 3093 if (FAILED( rc))3094 throw rc;3081 if (FAILED(hrc)) 3082 throw hrc; 3095 3083 3096 3084 // For simplicity, prepareDeleteSnapshotMedium selects the merge … … 3107 3095 // not going to merge a big source into a small target on online merge. Otherwise it will be resized 3108 3096 if (fNeedsOnlineMerge && pSource->i_getLogicalSize() > pTarget->i_getLogicalSize()) 3109 { 3110 rc = setError(E_FAIL, 3111 tr("Unable to merge storage '%s', because it is smaller than the source image. If you resize it to have a capacity of at least %lld bytes you can retry", 3112 "", pSource->i_getLogicalSize()), 3113 pTarget->i_getLocationFull().c_str(), pSource->i_getLogicalSize()); 3114 throw rc; 3115 } 3097 throw setError(E_FAIL, 3098 tr("Unable to merge storage '%s', because it is smaller than the source image. If you resize it to have a capacity of at least %lld bytes you can retry", 3099 "", pSource->i_getLogicalSize()), 3100 pTarget->i_getLocationFull().c_str(), pSource->i_getLogicalSize()); 3116 3101 3117 3102 // a couple paranoia checks for backward merges … … 3147 3132 // Note that the medium attachment object stays associated 3148 3133 // with the snapshot until the merge was successful. 3149 HRESULT rc2 = S_OK; 3150 rc2 = pSource->i_removeBackReference(replaceMachineId, replaceSnapshotId); 3151 AssertComRC(rc2); 3134 HRESULT hrc2 = pSource->i_removeBackReference(replaceMachineId, replaceSnapshotId); 3135 AssertComRC(hrc2); 3152 3136 3153 3137 toDelete.push_back(MediumDeleteRec(pHD, pSource, pTarget, … … 3199 3183 } 3200 3184 3201 rc = pTarget_local->COMGETTER(MediumFormat)(pTargetFormat.asOutParam());3202 if (FAILED( rc))3203 throw rc;3185 hrc = pTarget_local->COMGETTER(MediumFormat)(pTargetFormat.asOutParam()); 3186 if (FAILED(hrc)) 3187 throw hrc; 3204 3188 3205 3189 if (pTarget_local->i_isMediumFormatFile()) … … 3207 3191 int vrc = RTFsQuerySerial(pTarget_local->i_getLocationFull().c_str(), &pu32Serial); 3208 3192 if (RT_FAILURE(vrc)) 3209 { 3210 rc = setError(E_FAIL, 3211 tr("Unable to merge storage '%s'. Can't get storage UID"), 3212 pTarget_local->i_getLocationFull().c_str()); 3213 throw rc; 3214 } 3193 throw setError(E_FAIL, 3194 tr("Unable to merge storage '%s'. Can't get storage UID"), 3195 pTarget_local->i_getLocationFull().c_str()); 3215 3196 3216 3197 pSource_local->COMGETTER(Size)((LONG64*)&diskSize); … … 3250 3231 LogFlowThisFunc(("Path to the storage wasn't found...\n")); 3251 3232 3252 rc = setError(E_INVALIDARG, 3253 tr("Unable to merge storage '%s'. Path to the storage wasn't found"), 3254 it_sm->second); 3255 throw rc; 3233 throw setError(E_INVALIDARG, 3234 tr("Unable to merge storage '%s'. Path to the storage wasn't found"), 3235 it_sm->second); 3256 3236 } 3257 3237 … … 3259 3239 if (RT_FAILURE(vrc)) 3260 3240 { 3261 rc = setError(E_FAIL, 3262 tr("Unable to merge storage '%s'. Can't get the storage size"), 3263 it_sm->second); 3264 throw rc; 3241 throw setError(E_FAIL, 3242 tr("Unable to merge storage '%s'. Can't get the storage size"), 3243 it_sm->second); 3265 3244 } 3266 3245 … … 3269 3248 LogFlowThisFunc(("Not enough free space to merge...\n")); 3270 3249 3271 rc = setError(E_OUTOFMEMORY, 3272 tr("Unable to merge storage '%s'. Not enough free storage space"), 3273 it_sm->second); 3274 throw rc; 3250 throw setError(E_OUTOFMEMORY, 3251 tr("Unable to merge storage '%s'. Not enough free storage space"), 3252 it_sm->second); 3275 3253 } 3276 3254 … … 3363 3341 Guid uMedium = pMedium->i_getId(); 3364 3342 DeviceType_T uMediumType = pMedium->i_getDeviceType(); 3365 rc = pMedium->i_deleteStorage(&task.m_pProgress, 3366 true /* aWait */, 3367 false /* aNotify */); 3368 if (FAILED(rc)) 3369 throw rc; 3343 hrc = pMedium->i_deleteStorage(&task.m_pProgress, true /* aWait */, false /* aNotify */); 3344 if (FAILED(hrc)) 3345 throw hrc; 3370 3346 3371 3347 pMediumsForNotify.insert(pParent); … … 3424 3400 mConsoleTaskData.mDeleteSnapshotInfo = (void *)&(*it); 3425 3401 // online medium merge, in the direction decided earlier 3426 rc = i_onlineMergeMedium(it->mpOnlineMediumAttachment,3427 it->mpSource,3428 it->mpTarget,3429 it->mfMergeForward,3430 it->mpParentForTarget,3431 it->mpChildrenToReparent,3432 it->mpMediumLockList,3433 task.m_pProgress,3434 &fNeedsSave);3402 hrc = i_onlineMergeMedium(it->mpOnlineMediumAttachment, 3403 it->mpSource, 3404 it->mpTarget, 3405 it->mfMergeForward, 3406 it->mpParentForTarget, 3407 it->mpChildrenToReparent, 3408 it->mpMediumLockList, 3409 task.m_pProgress, 3410 &fNeedsSave); 3435 3411 mConsoleTaskData.mDeleteSnapshotInfo = NULL; 3436 3412 } … … 3438 3414 { 3439 3415 // normal medium merge, in the direction decided earlier 3440 rc = it->mpSource->i_mergeTo(it->mpTarget,3441 it->mfMergeForward,3442 it->mpParentForTarget,3443 it->mpChildrenToReparent,3444 it->mpMediumLockList,3445 &task.m_pProgress,3446 true /* aWait */,3447 false /* aNotify */);3416 hrc = it->mpSource->i_mergeTo(it->mpTarget, 3417 it->mfMergeForward, 3418 it->mpParentForTarget, 3419 it->mpChildrenToReparent, 3420 it->mpMediumLockList, 3421 &task.m_pProgress, 3422 true /* aWait */, 3423 false /* aNotify */); 3448 3424 } 3449 3425 … … 3454 3430 // moment) is still there or not. Be careful not to lose the 3455 3431 // error code below, before the "Delayed failure exit". 3456 if (FAILED( rc))3432 if (FAILED(hrc)) 3457 3433 { 3458 3434 AutoReadLock mlock(it->mpSource COMMA_LOCKVAL_SRC_POS); … … 3460 3436 // Diff medium not backed by a file - cannot get status so 3461 3437 // be pessimistic. 3462 throw rc;3438 throw hrc; 3463 3439 const Utf8Str &loc = it->mpSource->i_getLocationFull(); 3464 3440 // Source medium is still there, so merge failed early. 3465 3441 if (RTFileExists(loc.c_str())) 3466 throw rc;3442 throw hrc; 3467 3443 3468 3444 // Source medium is gone. Assume the merge succeeded and … … 3551 3527 // Delayed failure exit when the merge cleanup failed but the 3552 3528 // merge actually succeeded. 3553 if (FAILED( rc))3554 throw rc;3529 if (FAILED(hrc)) 3530 throw hrc; 3555 3531 } 3556 3532 … … 3638 3614 } 3639 3615 3640 LogFlowThisFunc(("Done deleting snapshot ( rc=%08X)\n", (HRESULT)mrc));3616 LogFlowThisFunc(("Done deleting snapshot (mrc=%08X)\n", (HRESULT)mrc)); 3641 3617 LogFlowThisFuncLeave(); 3642 3618 } … … 3764 3740 childLock.release(); 3765 3741 alock.release(); 3766 HRESULT rc = aHD->i_queryPreferredMergeDirection(pChild, fMergeForward);3742 HRESULT hrc = aHD->i_queryPreferredMergeDirection(pChild, fMergeForward); 3767 3743 alock.acquire(); 3768 3744 childLock.acquire(); 3769 3745 3770 if (FAILED( rc) &&rc != E_FAIL)3771 return rc;3746 if (FAILED(hrc) && hrc != E_FAIL) 3747 return hrc; 3772 3748 3773 3749 if (fMergeForward) … … 3785 3761 } 3786 3762 3787 HRESULT rc;3763 HRESULT hrc; 3788 3764 childLock.release(); 3789 3765 alock.release(); 3790 rc = aSource->i_prepareMergeTo(aTarget, &aMachineId, &aSnapshotId,3791 !fOnlineMergePossible /* fLockMedia */,3792 aMergeForward, aParentForTarget,3793 aChildrenToReparent, aMediumLockList);3766 hrc = aSource->i_prepareMergeTo(aTarget, &aMachineId, &aSnapshotId, 3767 !fOnlineMergePossible /* fLockMedia */, 3768 aMergeForward, aParentForTarget, 3769 aChildrenToReparent, aMediumLockList); 3794 3770 alock.acquire(); 3795 3771 childLock.acquire(); 3796 if (SUCCEEDED( rc) && fOnlineMergePossible)3772 if (SUCCEEDED(hrc) && fOnlineMergePossible) 3797 3773 { 3798 3774 /* Try to lock the newly constructed medium lock list. If it succeeds … … 3802 3778 childLock.release(); 3803 3779 alock.release(); 3804 rc = aMediumLockList->Lock();3780 hrc = aMediumLockList->Lock(); 3805 3781 alock.acquire(); 3806 3782 childLock.acquire(); 3807 if (FAILED( rc))3783 if (FAILED(hrc)) 3808 3784 { 3809 3785 /* Locking failed, this cannot be done as an offline merge. Try to … … 3834 3810 childLock.release(); 3835 3811 alock.release(); 3836 rc = it->UpdateLock(fLockReq);3812 hrc = it->UpdateLock(fLockReq); 3837 3813 alock.acquire(); 3838 3814 childLock.acquire(); 3839 if (FAILED( rc))3815 if (FAILED(hrc)) 3840 3816 { 3841 3817 // could not update the lock, trigger cleanup below … … 3862 3838 childLock.release(); 3863 3839 alock.release(); 3864 rc = aChildrenToReparent->Lock(true /* fSkipOverLockedMedia */);3840 hrc = aChildrenToReparent->Lock(true /* fSkipOverLockedMedia */); 3865 3841 alock.acquire(); 3866 3842 childLock.acquire(); … … 3878 3854 childLock.release(); 3879 3855 alock.release(); 3880 rc = aVMMALockList->Update(pMedium, true);3856 hrc = aVMMALockList->Update(pMedium, true); 3881 3857 alock.acquire(); 3882 3858 childLock.acquire(); 3883 3859 mediumLock.acquire(); 3884 if (FAILED( rc))3885 throw rc;3860 if (FAILED(hrc)) 3861 throw hrc; 3886 3862 } 3887 3863 } … … 3893 3869 childLock.release(); 3894 3870 alock.release(); 3895 rc = aVMMALockList->Lock();3871 hrc = aVMMALockList->Lock(); 3896 3872 alock.acquire(); 3897 3873 childLock.acquire(); 3898 if (FAILED( rc))3874 if (FAILED(hrc)) 3899 3875 { 3900 3876 aSource->i_cancelMergeTo(aChildrenToReparent, aMediumLockList); 3901 rc = setError(rc,3902 tr("Cannot lock hard disk '%s' for a live merge"),3903 aHD->i_getLocationFull().c_str());3877 hrc = setError(hrc, 3878 tr("Cannot lock hard disk '%s' for a live merge"), 3879 aHD->i_getLocationFull().c_str()); 3904 3880 } 3905 3881 else … … 3913 3889 { 3914 3890 aSource->i_cancelMergeTo(aChildrenToReparent, aMediumLockList); 3915 rc = setError(rc,3916 tr("Failed to construct lock list for a live merge of hard disk '%s'"),3917 aHD->i_getLocationFull().c_str());3891 hrc = setError(hrc, 3892 tr("Failed to construct lock list for a live merge of hard disk '%s'"), 3893 aHD->i_getLocationFull().c_str()); 3918 3894 } 3919 3895 3920 3896 // fix the VM's lock list if anything failed 3921 if (FAILED( rc))3897 if (FAILED(hrc)) 3922 3898 { 3923 3899 lockListVMMABegin = aVMMALockList->GetBegin(); … … 3943 3919 } 3944 3920 } 3945 else if (FAILED( rc))3921 else if (FAILED(hrc)) 3946 3922 { 3947 3923 aSource->i_cancelMergeTo(aChildrenToReparent, aMediumLockList); 3948 rc = setError(rc,3949 tr("Cannot lock hard disk '%s' when deleting a snapshot"),3950 aHD->i_getLocationFull().c_str());3951 } 3952 3953 return rc;3924 hrc = setError(hrc, 3925 tr("Cannot lock hard disk '%s' when deleting a snapshot"), 3926 aHD->i_getLocationFull().c_str()); 3927 } 3928 3929 return hrc; 3954 3930 } 3955 3931 … … 3990 3966 if (!aHDLockToken.isNull()) 3991 3967 { 3992 HRESULT rc = aHDLockToken->Abandon();3993 AssertComRC( rc);3968 HRESULT hrc = aHDLockToken->Abandon(); 3969 AssertComRC(hrc); 3994 3970 } 3995 3971 } 3996 3972 else 3997 3973 { 3998 HRESULT rc = aHD->i_unmarkForDeletion();3999 AssertComRC( rc);3974 HRESULT hrc = aHD->i_unmarkForDeletion(); 3975 AssertComRC(hrc); 4000 3976 } 4001 3977 } … … 4043 4019 { 4044 4020 // reattach the source media to the snapshot 4045 HRESULT rc = aSource->i_addBackReference(aMachineId, aSnapshotId);4046 AssertComRC( rc);4021 HRESULT hrc = aSource->i_addBackReference(aMachineId, aSnapshotId); 4022 AssertComRC(hrc); 4047 4023 } 4048 4024 } … … 4084 4060 NOREF(aChildrenToReparent); 4085 4061 4086 HRESULT rc = S_OK;4062 HRESULT hrc = S_OK; 4087 4063 4088 4064 try … … 4136 4112 // Must not hold any locks here, as this will call back to finish 4137 4113 // updating the medium attachment, chain linking and state. 4138 rc = directControl->OnlineMergeMedium(aMediumAttachment, 4139 uSourceIdx, uTargetIdx, 4140 aProgress); 4141 if (FAILED(rc)) 4142 throw rc; 4143 } 4144 catch (HRESULT hrcXcpt) { rc = hrcXcpt; } 4114 hrc = directControl->OnlineMergeMedium(aMediumAttachment, uSourceIdx, uTargetIdx, aProgress); 4115 if (FAILED(hrc)) 4116 throw hrc; 4117 } 4118 catch (HRESULT hrcXcpt) { hrc = hrcXcpt; } 4145 4119 4146 4120 // The callback mentioned above takes care of update the medium state … … 4149 4123 *pfNeedsMachineSaveSettings = true; 4150 4124 4151 return rc;4125 return hrc; 4152 4126 } 4153 4127 … … 4164 4138 HRESULT SessionMachine::finishOnlineMergeMedium() 4165 4139 { 4166 HRESULT rc = S_OK;4140 HRESULT hrc = S_OK; 4167 4141 MediumDeleteRec *pDeleteRec = (MediumDeleteRec *)mConsoleTaskData.mDeleteSnapshotInfo; 4168 4142 AssertReturn(pDeleteRec, E_FAIL); … … 4183 4157 // first, unregister the target since it may become a base 4184 4158 // hard disk which needs re-registration 4185 rc = mParent->i_unregisterMedium(pDeleteRec->mpTarget);4186 AssertComRC( rc);4159 hrc = mParent->i_unregisterMedium(pDeleteRec->mpTarget); 4160 AssertComRC(hrc); 4187 4161 4188 4162 // then, reparent it and disconnect the deleted branch at … … 4194 4168 4195 4169 // then, register again 4196 rc = mParent->i_registerMedium(pDeleteRec->mpTarget, &pDeleteRec->mpTarget, treeLock);4197 AssertComRC( rc);4170 hrc = mParent->i_registerMedium(pDeleteRec->mpTarget, &pDeleteRec->mpTarget, treeLock); 4171 AssertComRC(hrc); 4198 4172 } 4199 4173 else … … 4242 4216 /* unregister and uninitialize all hard disks removed by the merge */ 4243 4217 MediumLockList *pMediumLockList = NULL; 4244 rc = mData->mSession.mLockedMedia.Get(pDeleteRec->mpOnlineMediumAttachment, pMediumLockList);4218 hrc = mData->mSession.mLockedMedia.Get(pDeleteRec->mpOnlineMediumAttachment, pMediumLockList); 4245 4219 const ComObjPtr<Medium> &pLast = pDeleteRec->mfMergeForward ? pDeleteRec->mpTarget : pDeleteRec->mpSource; 4246 AssertReturn(SUCCEEDED( rc) && pMediumLockList, E_FAIL);4220 AssertReturn(SUCCEEDED(hrc) && pMediumLockList, E_FAIL); 4247 4221 MediumLockList::Base::iterator lockListBegin = 4248 4222 pMediumLockList->GetBegin(); … … 4266 4240 else 4267 4241 { 4268 rc = mParent->i_unregisterMedium(pMedium);4269 AssertComRC( rc);4242 hrc = mParent->i_unregisterMedium(pMedium); 4243 AssertComRC(hrc); 4270 4244 4271 4245 /* now, uninitialize the deleted hard disk (note that … … 4290 4264 * caller added by MergeChain before uninit() and updates the 4291 4265 * iterator to point to the right place. */ 4292 rc = pMediumLockList->RemoveByIterator(it);4293 AssertComRC( rc);4266 hrc = pMediumLockList->RemoveByIterator(it); 4267 AssertComRC(hrc); 4294 4268 4295 4269 treeLock.release(); -
trunk/src/VBox/Main/src-server/StorageControllerImpl.cpp
r98262 r98292 112 112 ULONG maxInstances; 113 113 ChipsetType_T chipsetType; 114 HRESULT rc = aParent->COMGETTER(ChipsetType)(&chipsetType);115 if (FAILED( rc))116 return rc;117 rc = aParent->i_getVirtualBox()->i_getSystemProperties()->114 HRESULT hrc = aParent->COMGETTER(ChipsetType)(&chipsetType); 115 if (FAILED(hrc)) 116 return hrc; 117 hrc = aParent->i_getVirtualBox()->i_getSystemProperties()-> 118 118 GetMaxInstancesOfStorageBus(chipsetType, aStorageBus, &maxInstances); 119 if (FAILED( rc))120 return rc;119 if (FAILED(hrc)) 120 return hrc; 121 121 if (aInstance >= maxInstances) 122 122 return setError(E_INVALIDARG, … … 322 322 { 323 323 ComObjPtr<StorageController> ctrl; 324 HRESULT rc = m->pParent->i_getStorageControllerByName(aName, ctrl, false /* aSetError */);325 if (SUCCEEDED( rc))324 HRESULT hrc = m->pParent->i_getStorageControllerByName(aName, ctrl, false /* aSetError */); 325 if (SUCCEEDED(hrc)) 326 326 return setError(VBOX_E_OBJECT_IN_USE, 327 327 tr("Storage controller named '%s' already exists"), … … 329 329 330 330 Machine::MediumAttachmentList atts; 331 rc = m->pParent->i_getMediumAttachmentsOfController(m->bd->strName, atts);331 hrc = m->pParent->i_getMediumAttachmentsOfController(m->bd->strName, atts); 332 332 for (Machine::MediumAttachmentList::const_iterator 333 333 it = atts.begin(); … … 380 380 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 381 381 382 HRESULT rc = S_OK; 383 382 HRESULT hrc = S_OK; 384 383 switch (m->bd->storageBus) 385 384 { 386 385 case StorageBus_IDE: 387 {388 386 if ( (aControllerType != StorageControllerType_PIIX3) 389 387 && (aControllerType != StorageControllerType_PIIX4) 390 388 && (aControllerType != StorageControllerType_ICH6)) 391 rc = E_INVALIDARG; 392 break; 393 } 389 hrc = E_INVALIDARG; 390 break; 394 391 case StorageBus_SATA: 395 {396 392 if (aControllerType != StorageControllerType_IntelAhci) 397 rc = E_INVALIDARG; 398 break; 399 } 393 hrc = E_INVALIDARG; 394 break; 400 395 case StorageBus_SCSI: 401 {402 396 if ( (aControllerType != StorageControllerType_LsiLogic) 403 397 && (aControllerType != StorageControllerType_BusLogic)) 404 rc = E_INVALIDARG; 405 break; 406 } 398 hrc = E_INVALIDARG; 399 break; 407 400 case StorageBus_Floppy: 408 {409 401 if (aControllerType != StorageControllerType_I82078) 410 rc = E_INVALIDARG; 411 break; 412 } 402 hrc = E_INVALIDARG; 403 break; 413 404 case StorageBus_SAS: 414 {415 405 if (aControllerType != StorageControllerType_LsiLogicSas) 416 rc = E_INVALIDARG; 417 break; 418 } 406 hrc = E_INVALIDARG; 407 break; 419 408 case StorageBus_USB: 420 {421 409 if (aControllerType != StorageControllerType_USB) 422 rc = E_INVALIDARG; 423 break; 424 } 410 hrc = E_INVALIDARG; 411 break; 425 412 case StorageBus_PCIe: 426 {427 413 if (aControllerType != StorageControllerType_NVMe) 428 rc = E_INVALIDARG; 429 break; 430 } 414 hrc = E_INVALIDARG; 415 break; 431 416 case StorageBus_VirtioSCSI: 432 {433 417 if (aControllerType != StorageControllerType_VirtioSCSI) 434 rc = E_INVALIDARG; 435 break; 436 } 418 hrc = E_INVALIDARG; 419 break; 437 420 default: 438 421 AssertMsgFailed(("Invalid controller type %d\n", m->bd->storageBus)); 439 rc = E_INVALIDARG; 440 } 441 442 if (!SUCCEEDED(rc)) 443 return setError(rc, 444 tr("Invalid controller type %d"), 445 aControllerType); 422 hrc = E_INVALIDARG; 423 break; 424 } 425 426 if (!SUCCEEDED(hrc)) 427 return setError(hrc, tr("Invalid controller type %d"), aControllerType); 446 428 447 429 if (m->bd->controllerType != aControllerType) … … 464 446 { 465 447 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 466 467 HRESULT rc = m->pSystemProperties->GetMaxDevicesPerPortForStorageBus(m->bd->storageBus, aMaxDevicesPerPortCount); 468 469 return rc; 448 return m->pSystemProperties->GetMaxDevicesPerPortForStorageBus(m->bd->storageBus, aMaxDevicesPerPortCount); 470 449 } 471 450 … … 473 452 { 474 453 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 475 476 HRESULT rc = m->pSystemProperties->GetMinPortCountForStorageBus(m->bd->storageBus, aMinPortCount); 477 return rc; 454 return m->pSystemProperties->GetMinPortCountForStorageBus(m->bd->storageBus, aMinPortCount); 478 455 } 479 456 … … 481 458 { 482 459 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 483 HRESULT rc = m->pSystemProperties->GetMaxPortCountForStorageBus(m->bd->storageBus, aMaxPortCount); 484 485 return rc; 460 return m->pSystemProperties->GetMaxPortCountForStorageBus(m->bd->storageBus, aMaxPortCount); 486 461 } 487 462 … … 732 707 ULONG portCount = m->bd->ulPortCount; 733 708 ULONG devicesPerPort; 734 HRESULT rc = m->pSystemProperties->GetMaxDevicesPerPortForStorageBus(m->bd->storageBus, &devicesPerPort);735 if (FAILED( rc)) returnrc;709 HRESULT hrc = m->pSystemProperties->GetMaxDevicesPerPortForStorageBus(m->bd->storageBus, &devicesPerPort); 710 if (FAILED(hrc)) return hrc; 736 711 737 712 if ( aControllerPort < 0 -
trunk/src/VBox/Main/src-server/SystemPropertiesImpl.cpp
r98262 r98292 129 129 #endif 130 130 131 HRESULT rc = S_OK;131 HRESULT hrc = S_OK; 132 132 133 133 /* Fetch info of all available hd backends. */ … … 145 145 { 146 146 ComObjPtr<MediumFormat> hdf; 147 rc = hdf.createObject();148 if (FAILED( rc)) break;149 150 rc = hdf->init(&aVDInfo[i]);151 if (FAILED( rc)) break;147 hrc = hdf.createObject(); 148 if (FAILED(hrc)) break; 149 150 hrc = hdf->init(&aVDInfo[i]); 151 if (FAILED(hrc)) break; 152 152 153 153 m_llMediumFormats.push_back(hdf); … … 156 156 157 157 /* Confirm a successful initialization */ 158 if (SUCCEEDED( rc))158 if (SUCCEEDED(hrc)) 159 159 autoInitSpan.setSucceeded(); 160 160 161 return rc;161 return hrc; 162 162 } 163 163 … … 319 319 // VirtualBox::i_saveSettings() needs vbox write lock 320 320 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS); 321 HRESULT rc = mParent->i_saveSettings(); 322 323 return rc; 321 return mParent->i_saveSettings(); 324 322 } 325 323 … … 921 919 { 922 920 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 923 HRESULT rc = i_setDefaultMachineFolder(aDefaultMachineFolder);921 HRESULT hrc = i_setDefaultMachineFolder(aDefaultMachineFolder); 924 922 alock.release(); 925 if (SUCCEEDED( rc))923 if (SUCCEEDED(hrc)) 926 924 { 927 925 // VirtualBox::i_saveSettings() needs vbox write lock 928 926 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS); 929 rc = mParent->i_saveSettings();930 } 931 932 return rc;927 hrc = mParent->i_saveSettings(); 928 } 929 930 return hrc; 933 931 } 934 932 … … 949 947 { 950 948 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 951 HRESULT rc = i_setLoggingLevel(aLoggingLevel);949 HRESULT hrc = i_setLoggingLevel(aLoggingLevel); 952 950 alock.release(); 953 951 954 if (SUCCEEDED( rc))952 if (SUCCEEDED(hrc)) 955 953 { 956 954 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS); 957 rc = mParent->i_saveSettings();955 hrc = mParent->i_saveSettings(); 958 956 } 959 957 else 960 LogRel(("Cannot set passed logging level=%s, or the default one - Error=%Rhrc \n", aLoggingLevel.c_str(), rc));961 962 return rc;958 LogRel(("Cannot set passed logging level=%s, or the default one - Error=%Rhrc \n", aLoggingLevel.c_str(), hrc)); 959 960 return hrc; 963 961 } 964 962 … … 984 982 { 985 983 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 986 HRESULT rc = i_setDefaultHardDiskFormat(aDefaultHardDiskFormat);984 HRESULT hrc = i_setDefaultHardDiskFormat(aDefaultHardDiskFormat); 987 985 alock.release(); 988 if (SUCCEEDED( rc))986 if (SUCCEEDED(hrc)) 989 987 { 990 988 // VirtualBox::i_saveSettings() needs vbox write lock 991 989 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS); 992 rc = mParent->i_saveSettings();993 } 994 995 return rc;990 hrc = mParent->i_saveSettings(); 991 } 992 993 return hrc; 996 994 } 997 995 … … 1052 1050 { 1053 1051 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1054 HRESULT rc = i_setVRDEAuthLibrary(aVRDEAuthLibrary);1052 HRESULT hrc = i_setVRDEAuthLibrary(aVRDEAuthLibrary); 1055 1053 alock.release(); 1056 if (SUCCEEDED( rc))1054 if (SUCCEEDED(hrc)) 1057 1055 { 1058 1056 // VirtualBox::i_saveSettings() needs vbox write lock 1059 1057 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS); 1060 rc = mParent->i_saveSettings();1061 } 1062 1063 return rc;1058 hrc = mParent->i_saveSettings(); 1059 } 1060 1061 return hrc; 1064 1062 } 1065 1063 … … 1076 1074 { 1077 1075 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1078 HRESULT rc = i_setWebServiceAuthLibrary(aWebServiceAuthLibrary);1076 HRESULT hrc = i_setWebServiceAuthLibrary(aWebServiceAuthLibrary); 1079 1077 alock.release(); 1080 1078 1081 if (SUCCEEDED( rc))1079 if (SUCCEEDED(hrc)) 1082 1080 { 1083 1081 // VirtualBox::i_saveSettings() needs vbox write lock 1084 1082 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS); 1085 rc = mParent->i_saveSettings();1086 } 1087 1088 return rc;1083 hrc = mParent->i_saveSettings(); 1084 } 1085 1086 return hrc; 1089 1087 } 1090 1088 … … 1265 1263 // VirtualBox::i_saveSettings() needs vbox write lock 1266 1264 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS); 1267 HRESULT rc = mParent->i_saveSettings(); 1268 1269 return rc; 1265 return mParent->i_saveSettings(); 1270 1266 } 1271 1267 … … 1291 1287 { 1292 1288 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1293 HRESULT rc = i_setAutostartDatabasePath(aAutostartDbPath);1289 HRESULT hrc = i_setAutostartDatabasePath(aAutostartDbPath); 1294 1290 alock.release(); 1295 1291 1296 if (SUCCEEDED( rc))1292 if (SUCCEEDED(hrc)) 1297 1293 { 1298 1294 // VirtualBox::i_saveSettings() needs vbox write lock 1299 1295 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS); 1300 rc = mParent->i_saveSettings();1301 } 1302 1303 return rc;1296 hrc = mParent->i_saveSettings(); 1297 } 1298 1299 return hrc; 1304 1300 } 1305 1301 … … 1316 1312 #if 0 /* not implemented */ 1317 1313 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1318 HRESULT rc = i_setDefaultAdditionsISO(aDefaultAdditionsISO);1314 HRESULT hrc = i_setDefaultAdditionsISO(aDefaultAdditionsISO); 1319 1315 alock.release(); 1320 1316 1321 if (SUCCEEDED( rc))1317 if (SUCCEEDED(hrc)) 1322 1318 { 1323 1319 // VirtualBox::i_saveSettings() needs vbox write lock 1324 1320 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS); 1325 rc = mParent->i_saveSettings();1326 } 1327 1328 return rc;1321 hrc = mParent->i_saveSettings(); 1322 } 1323 1324 return hrc; 1329 1325 #endif 1330 1326 } … … 1342 1338 if (m->strDefaultFrontend == aDefaultFrontend) 1343 1339 return S_OK; 1344 HRESULT rc = i_setDefaultFrontend(aDefaultFrontend);1340 HRESULT hrc = i_setDefaultFrontend(aDefaultFrontend); 1345 1341 alock.release(); 1346 1342 1347 if (SUCCEEDED( rc))1343 if (SUCCEEDED(hrc)) 1348 1344 { 1349 1345 // VirtualBox::i_saveSettings() needs vbox write lock 1350 1346 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS); 1351 rc = mParent->i_saveSettings();1352 } 1353 1354 return rc;1347 hrc = mParent->i_saveSettings(); 1348 } 1349 1350 return hrc; 1355 1351 } 1356 1352 … … 1963 1959 1964 1960 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1965 HRESULT rc = S_OK; 1966 rc = i_setDefaultMachineFolder(data.strDefaultMachineFolder); 1967 if (FAILED(rc)) return rc; 1968 1969 rc = i_setLoggingLevel(data.strLoggingLevel); 1970 if (FAILED(rc)) return rc; 1971 1972 rc = i_setDefaultHardDiskFormat(data.strDefaultHardDiskFormat); 1973 if (FAILED(rc)) return rc; 1974 1975 rc = i_setVRDEAuthLibrary(data.strVRDEAuthLibrary); 1976 if (FAILED(rc)) return rc; 1977 1978 rc = i_setWebServiceAuthLibrary(data.strWebServiceAuthLibrary); 1979 if (FAILED(rc)) return rc; 1980 1981 rc = i_setDefaultVRDEExtPack(data.strDefaultVRDEExtPack); 1982 if (FAILED(rc)) return rc; 1983 1984 rc = i_setDefaultCryptoExtPack(data.strDefaultCryptoExtPack); 1985 if (FAILED(rc)) return rc; 1961 HRESULT hrc = i_setDefaultMachineFolder(data.strDefaultMachineFolder); 1962 if (FAILED(hrc)) return hrc; 1963 1964 hrc = i_setLoggingLevel(data.strLoggingLevel); 1965 if (FAILED(hrc)) return hrc; 1966 1967 hrc = i_setDefaultHardDiskFormat(data.strDefaultHardDiskFormat); 1968 if (FAILED(hrc)) return hrc; 1969 1970 hrc = i_setVRDEAuthLibrary(data.strVRDEAuthLibrary); 1971 if (FAILED(hrc)) return hrc; 1972 1973 hrc = i_setWebServiceAuthLibrary(data.strWebServiceAuthLibrary); 1974 if (FAILED(hrc)) return hrc; 1975 1976 hrc = i_setDefaultVRDEExtPack(data.strDefaultVRDEExtPack); 1977 if (FAILED(hrc)) return hrc; 1978 1979 hrc = i_setDefaultCryptoExtPack(data.strDefaultCryptoExtPack); 1980 if (FAILED(hrc)) return hrc; 1986 1981 1987 1982 m->uLogHistoryCount = data.uLogHistoryCount; … … 1992 1987 m->strLanguageId = data.strLanguageId; 1993 1988 1994 rc = i_setAutostartDatabasePath(data.strAutostartDatabasePath);1995 if (FAILED( rc)) returnrc;1989 hrc = i_setAutostartDatabasePath(data.strAutostartDatabasePath); 1990 if (FAILED(hrc)) return hrc; 1996 1991 1997 1992 { … … 2002 1997 } 2003 1998 2004 rc = i_setDefaultFrontend(data.strDefaultFrontend);2005 if (FAILED( rc)) returnrc;1999 hrc = i_setDefaultFrontend(data.strDefaultFrontend); 2000 if (FAILED(hrc)) return hrc; 2006 2001 2007 2002 return S_OK; … … 2175 2170 { 2176 2171 // new default with VirtualBox 4.0: "$HOME/VirtualBox VMs" 2177 HRESULT rc = i_getUserHomeDirectory(path);2178 if (FAILED( rc)) returnrc;2172 HRESULT hrc = i_getUserHomeDirectory(path); 2173 if (FAILED(hrc)) return hrc; 2179 2174 path += RTPATH_SLASH_STR "VirtualBox VMs"; 2180 2175 } … … 2195 2190 if (useLoggingLevel.isEmpty()) 2196 2191 useLoggingLevel = VBOXSVC_LOG_DEFAULT; 2197 int rc = RTLogGroupSettings(RTLogRelGetDefaultInstance(), useLoggingLevel.c_str());2192 int vrc = RTLogGroupSettings(RTLogRelGetDefaultInstance(), useLoggingLevel.c_str()); 2198 2193 // If failed and not the default logging level - try to use the default logging level. 2199 if (RT_FAILURE( rc))2194 if (RT_FAILURE(vrc)) 2200 2195 { 2201 2196 // If failed write message to the release log. 2202 LogRel(("Cannot set passed logging level=%s Error=%Rrc \n", useLoggingLevel.c_str(), rc));2197 LogRel(("Cannot set passed logging level=%s Error=%Rrc \n", useLoggingLevel.c_str(), vrc)); 2203 2198 // If attempted logging level not the default one then try the default one. 2204 2199 if (!useLoggingLevel.equals(VBOXSVC_LOG_DEFAULT)) 2205 2200 { 2206 rc = RTLogGroupSettings(RTLogRelGetDefaultInstance(), VBOXSVC_LOG_DEFAULT);2201 vrc = RTLogGroupSettings(RTLogRelGetDefaultInstance(), VBOXSVC_LOG_DEFAULT); 2207 2202 // If failed report this to the release log. 2208 if (RT_FAILURE( rc))2209 LogRel(("Cannot set default logging level Error=%Rrc \n", rc));2203 if (RT_FAILURE(vrc)) 2204 LogRel(("Cannot set default logging level Error=%Rrc \n", vrc)); 2210 2205 } 2211 2206 // On any failure - set default level as the one to be stored. … … 2214 2209 // Set to passed value or if default used/attempted (even if error condition) use empty string. 2215 2210 m->strLoggingLevel = (useLoggingLevel.equals(VBOXSVC_LOG_DEFAULT) ? "" : useLoggingLevel); 2216 return RT_SUCCESS( rc) ? S_OK : E_FAIL;2211 return RT_SUCCESS(vrc) ? S_OK : E_FAIL; 2217 2212 } 2218 2213 … … 2263 2258 HRESULT SystemProperties::i_setAutostartDatabasePath(const com::Utf8Str &aPath) 2264 2259 { 2265 HRESULT rc = S_OK;2260 HRESULT hrc = S_OK; 2266 2261 AutostartDb *autostartDb = this->mParent->i_getAutostartDb(); 2267 2262 … … 2273 2268 m->strAutostartDatabasePath = aPath; 2274 2269 else 2275 rc = setErrorBoth(E_FAIL, vrc, 2276 tr("Cannot set the autostart database path (%Rrc)"), 2277 vrc); 2270 hrc = setErrorBoth(E_FAIL, vrc, tr("Cannot set the autostart database path (%Rrc)"), vrc); 2278 2271 } 2279 2272 else … … 2283 2276 m->strAutostartDatabasePath = ""; 2284 2277 else 2285 rc = setErrorBoth(E_FAIL, vrc, 2286 tr("Deleting the autostart database path failed (%Rrc)"), 2287 vrc); 2288 } 2289 2290 return rc; 2278 hrc = setErrorBoth(E_FAIL, vrc, tr("Deleting the autostart database path failed (%Rrc)"), vrc); 2279 } 2280 2281 return hrc; 2291 2282 } 2292 2283 -
trunk/src/VBox/Main/src-server/TokenImpl.cpp
r98103 r98292 187 187 if (m.fWrite) 188 188 { 189 HRESULT rc = m.pMedium->i_unlockWrite(NULL);190 AssertComRC( rc);189 HRESULT hrc = m.pMedium->i_unlockWrite(NULL); 190 AssertComRC(hrc); 191 191 } 192 192 else 193 193 { 194 HRESULT rc = m.pMedium->i_unlockRead(NULL);195 AssertComRC( rc);194 HRESULT hrc = m.pMedium->i_unlockRead(NULL); 195 AssertComRC(hrc); 196 196 } 197 197 m.pMedium.setNull(); -
trunk/src/VBox/Main/src-server/USBControllerImpl.cpp
r98262 r98292 257 257 { 258 258 ComObjPtr<USBController> ctrl; 259 HRESULT rc = m->pParent->i_getUSBControllerByName(aName, ctrl, false /* aSetError */);260 if (SUCCEEDED( rc))259 HRESULT hrc = m->pParent->i_getUSBControllerByName(aName, ctrl, false /* aSetError */); 260 if (SUCCEEDED(hrc)) 261 261 return setError(VBOX_E_OBJECT_IN_USE, 262 262 tr("USB controller named '%s' already exists"), -
trunk/src/VBox/Main/src-server/USBDeviceFilterImpl.cpp
r98262 r98292 244 244 * handling */ 245 245 246 HRESULT rc = S_OK; 247 do 248 { 249 rc = i_usbFilterFieldSetter(USBFILTERIDX_VENDOR_ID, data.strVendorId); 250 if (FAILED(rc)) break; 251 252 rc = i_usbFilterFieldSetter(USBFILTERIDX_PRODUCT_ID, data.strProductId); 253 if (FAILED(rc)) break; 254 255 rc = i_usbFilterFieldSetter(USBFILTERIDX_DEVICE, data.strRevision); 256 if (FAILED(rc)) break; 257 258 rc = i_usbFilterFieldSetter(USBFILTERIDX_MANUFACTURER_STR, data.strManufacturer); 259 if (FAILED(rc)) break; 260 261 rc = i_usbFilterFieldSetter(USBFILTERIDX_PRODUCT_STR, data.strProduct); 262 if (FAILED(rc)) break; 263 264 rc = i_usbFilterFieldSetter(USBFILTERIDX_SERIAL_NUMBER_STR, data.strSerialNumber); 265 if (FAILED(rc)) break; 266 267 rc = i_usbFilterFieldSetter(USBFILTERIDX_PORT, data.strPort); 268 if (FAILED(rc)) break; 269 270 rc = COMSETTER(Remote)(Bstr(data.strRemote).raw()); 271 if (FAILED(rc)) break; 272 273 rc = COMSETTER(MaskedInterfaces)(data.ulMaskedInterfaces); 274 if (FAILED(rc)) break; 275 } 276 while (0); 277 278 /* Confirm successful initialization when it's the case */ 279 if (SUCCEEDED(rc)) 280 autoInitSpan.setSucceeded(); 281 282 return rc; 246 HRESULT hrc = i_usbFilterFieldSetter(USBFILTERIDX_VENDOR_ID, data.strVendorId); 247 if (FAILED(hrc)) return hrc; 248 249 hrc = i_usbFilterFieldSetter(USBFILTERIDX_PRODUCT_ID, data.strProductId); 250 if (FAILED(hrc)) return hrc; 251 252 hrc = i_usbFilterFieldSetter(USBFILTERIDX_DEVICE, data.strRevision); 253 if (FAILED(hrc)) return hrc; 254 255 hrc = i_usbFilterFieldSetter(USBFILTERIDX_MANUFACTURER_STR, data.strManufacturer); 256 if (FAILED(hrc)) return hrc; 257 258 hrc = i_usbFilterFieldSetter(USBFILTERIDX_PRODUCT_STR, data.strProduct); 259 if (FAILED(hrc)) return hrc; 260 261 hrc = i_usbFilterFieldSetter(USBFILTERIDX_SERIAL_NUMBER_STR, data.strSerialNumber); 262 if (FAILED(hrc)) return hrc; 263 264 hrc = i_usbFilterFieldSetter(USBFILTERIDX_PORT, data.strPort); 265 if (FAILED(hrc)) return hrc; 266 267 hrc = COMSETTER(Remote)(Bstr(data.strRemote).raw()); 268 if (FAILED(hrc)) return hrc; 269 270 hrc = COMSETTER(MaskedInterfaces)(data.ulMaskedInterfaces); 271 if (FAILED(hrc)) return hrc; 272 273 /* Confirm successful initialization */ 274 autoInitSpan.setSucceeded(); 275 276 return S_OK; 283 277 } 284 278 … … 812 806 813 807 com::Utf8Str errStr; 814 HRESULT rc = i_usbFilterFieldFromString(&bd->mUSBFilter, aIdx, strNew, errStr);815 if (FAILED( rc))808 HRESULT hrc = i_usbFilterFieldFromString(&bd->mUSBFilter, aIdx, strNew, errStr); 809 if (FAILED(hrc)) 816 810 { 817 811 bd.rollback(); 818 return setError( rc, "%s", errStr.c_str());812 return setError(hrc, "%s", errStr.c_str()); 819 813 } 820 814 … … 898 892 * handling */ 899 893 900 HRESULT rc = S_OK; 901 do 902 { 903 rc = setAction(data.action); 904 if (FAILED(rc)) break; 905 906 rc = i_usbFilterFieldSetter(USBFILTERIDX_VENDOR_ID, data.strVendorId); 907 if (FAILED(rc)) break; 908 909 rc = i_usbFilterFieldSetter(USBFILTERIDX_PRODUCT_ID, data.strProductId); 910 if (FAILED(rc)) break; 911 912 rc = i_usbFilterFieldSetter(USBFILTERIDX_DEVICE, data.strRevision); 913 if (FAILED(rc)) break; 914 915 rc = i_usbFilterFieldSetter(USBFILTERIDX_MANUFACTURER_STR, data.strManufacturer); 916 if (FAILED(rc)) break; 917 918 rc = i_usbFilterFieldSetter(USBFILTERIDX_PRODUCT_ID, data.strProduct); 919 if (FAILED(rc)) break; 920 921 rc = i_usbFilterFieldSetter(USBFILTERIDX_SERIAL_NUMBER_STR, data.strSerialNumber); 922 if (FAILED(rc)) break; 923 924 rc = i_usbFilterFieldSetter(USBFILTERIDX_PORT, data.strPort); 925 if (FAILED(rc)) break; 926 } 927 while (0); 928 929 /* Confirm successful initialization when it's the case */ 930 if (SUCCEEDED(rc)) 931 autoInitSpan.setSucceeded(); 932 933 return rc; 894 HRESULT hrc = setAction(data.action); 895 if (FAILED(hrc)) return hrc; 896 897 hrc = i_usbFilterFieldSetter(USBFILTERIDX_VENDOR_ID, data.strVendorId); 898 if (FAILED(hrc)) return hrc; 899 900 hrc = i_usbFilterFieldSetter(USBFILTERIDX_PRODUCT_ID, data.strProductId); 901 if (FAILED(hrc)) return hrc; 902 903 hrc = i_usbFilterFieldSetter(USBFILTERIDX_DEVICE, data.strRevision); 904 if (FAILED(hrc)) return hrc; 905 906 hrc = i_usbFilterFieldSetter(USBFILTERIDX_MANUFACTURER_STR, data.strManufacturer); 907 if (FAILED(hrc)) return hrc; 908 909 hrc = i_usbFilterFieldSetter(USBFILTERIDX_PRODUCT_ID, data.strProduct); 910 if (FAILED(hrc)) return hrc; 911 912 hrc = i_usbFilterFieldSetter(USBFILTERIDX_SERIAL_NUMBER_STR, data.strSerialNumber); 913 if (FAILED(hrc)) return hrc; 914 915 hrc = i_usbFilterFieldSetter(USBFILTERIDX_PORT, data.strPort); 916 if (FAILED(hrc)) return hrc; 917 918 /* Confirm successful initialization */ 919 autoInitSpan.setSucceeded(); 920 921 return S_OK; 934 922 } 935 923 … … 1269 1257 //bd.backup(); 1270 1258 com::Utf8Str errStr; 1271 HRESULT rc = USBDeviceFilter::i_usbFilterFieldFromString(&bd->mUSBFilter, aIdx, aStr, errStr);1272 if (FAILED( rc))1259 HRESULT hrc = USBDeviceFilter::i_usbFilterFieldFromString(&bd->mUSBFilter, aIdx, aStr, errStr); 1260 if (FAILED(hrc)) 1273 1261 { 1274 1262 //bd.rollback(); 1275 return setError( rc, "%s", errStr.c_str());1263 return setError(hrc, "%s", errStr.c_str()); 1276 1264 } 1277 1265 -
trunk/src/VBox/Main/src-server/USBDeviceFiltersImpl.cpp
r98262 r98292 339 339 ComObjPtr<USBDeviceFilter> pFilter; 340 340 pFilter.createObject(); 341 HRESULT rc = pFilter->init(this, Bstr(aName).raw());342 ComAssertComRCRetRC( rc);343 rc = pFilter.queryInterfaceTo(aFilter.asOutParam());344 AssertComRCReturnRC( rc);341 HRESULT hrc = pFilter->init(this, Bstr(aName).raw()); 342 ComAssertComRCRetRC(hrc); 343 hrc = pFilter.queryInterfaceTo(aFilter.asOutParam()); 344 AssertComRCReturnRC(hrc); 345 345 346 346 return S_OK; … … 516 516 ComObjPtr<USBDeviceFilter> pFilter; 517 517 pFilter.createObject(); 518 HRESULT rc = pFilter->init(this, // parent 519 f); 520 if (FAILED(rc)) return rc; 518 HRESULT hrc = pFilter->init(this /*aParent*/, f); 519 if (FAILED(hrc)) return hrc; 521 520 522 521 m->llDeviceFilters->push_back(pFilter); … … 942 941 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 943 942 944 HRESULT rc = S_OK;945 946 943 /* query fields */ 947 944 USBFILTER dev; … … 949 946 950 947 USHORT vendorId = 0; 951 rc = aUSBDevice->COMGETTER(VendorId)(&vendorId);952 ComAssertComRCRet( rc, false);948 HRESULT hrc = aUSBDevice->COMGETTER(VendorId)(&vendorId); 949 ComAssertComRCRet(hrc, false); 953 950 ComAssertRet(vendorId, false); 954 951 int vrc = USBFilterSetNumExact(&dev, USBFILTERIDX_VENDOR_ID, vendorId, true); AssertRC(vrc); 955 952 956 953 USHORT productId = 0; 957 rc = aUSBDevice->COMGETTER(ProductId)(&productId);958 ComAssertComRCRet( rc, false);954 hrc = aUSBDevice->COMGETTER(ProductId)(&productId); 955 ComAssertComRCRet(hrc, false); 959 956 vrc = USBFilterSetNumExact(&dev, USBFILTERIDX_PRODUCT_ID, productId, true); AssertRC(vrc); 960 957 961 958 USHORT revision; 962 rc = aUSBDevice->COMGETTER(Revision)(&revision);963 ComAssertComRCRet( rc, false);959 hrc = aUSBDevice->COMGETTER(Revision)(&revision); 960 ComAssertComRCRet(hrc, false); 964 961 vrc = USBFilterSetNumExact(&dev, USBFILTERIDX_DEVICE, revision, true); AssertRC(vrc); 965 962 966 963 Bstr manufacturer; 967 rc = aUSBDevice->COMGETTER(Manufacturer)(manufacturer.asOutParam());968 ComAssertComRCRet( rc, false);964 hrc = aUSBDevice->COMGETTER(Manufacturer)(manufacturer.asOutParam()); 965 ComAssertComRCRet(hrc, false); 969 966 if (!manufacturer.isEmpty()) 970 967 USBFilterSetStringExact(&dev, USBFILTERIDX_MANUFACTURER_STR, Utf8Str(manufacturer).c_str(), … … 972 969 973 970 Bstr product; 974 rc = aUSBDevice->COMGETTER(Product)(product.asOutParam());975 ComAssertComRCRet( rc, false);971 hrc = aUSBDevice->COMGETTER(Product)(product.asOutParam()); 972 ComAssertComRCRet(hrc, false); 976 973 if (!product.isEmpty()) 977 974 USBFilterSetStringExact(&dev, USBFILTERIDX_PRODUCT_STR, Utf8Str(product).c_str(), … … 979 976 980 977 Bstr serialNumber; 981 rc = aUSBDevice->COMGETTER(SerialNumber)(serialNumber.asOutParam());982 ComAssertComRCRet( rc, false);978 hrc = aUSBDevice->COMGETTER(SerialNumber)(serialNumber.asOutParam()); 979 ComAssertComRCRet(hrc, false); 983 980 if (!serialNumber.isEmpty()) 984 981 USBFilterSetStringExact(&dev, USBFILTERIDX_SERIAL_NUMBER_STR, Utf8Str(serialNumber).c_str(), … … 986 983 987 984 Bstr address; 988 rc = aUSBDevice->COMGETTER(Address)(address.asOutParam());989 ComAssertComRCRet( rc, false);985 hrc = aUSBDevice->COMGETTER(Address)(address.asOutParam()); 986 ComAssertComRCRet(hrc, false); 990 987 991 988 USHORT port = 0; 992 rc = aUSBDevice->COMGETTER(Port)(&port);993 ComAssertComRCRet( rc, false);989 hrc = aUSBDevice->COMGETTER(Port)(&port); 990 ComAssertComRCRet(hrc, false); 994 991 USBFilterSetNumExact(&dev, USBFILTERIDX_PORT, port, true); 995 992 996 993 BOOL remote = FALSE; 997 rc = aUSBDevice->COMGETTER(Remote)(&remote);998 ComAssertComRCRet( rc, false);994 hrc = aUSBDevice->COMGETTER(Remote)(&remote); 995 ComAssertComRCRet(hrc, false); 999 996 ComAssertRet(remote == TRUE, false); 1000 997 -
trunk/src/VBox/Main/src-server/USBIdDatabaseGenerator.cpp
r98106 r98292 144 144 uint32_t uVal; 145 145 char *pszNext; 146 int rc = RTStrToUInt32Ex(pszLine, &pszNext, 16, &uVal);147 if ( rc == VWRN_TRAILING_CHARS148 || rc == VWRN_TRAILING_SPACES149 || rc == VINF_SUCCESS)146 int vrc = RTStrToUInt32Ex(pszLine, &pszNext, 16, &uVal); 147 if ( vrc == VWRN_TRAILING_CHARS 148 || vrc == VWRN_TRAILING_SPACES 149 || vrc == VINF_SUCCESS) 150 150 { 151 151 /* Skip the whipespace following it and at the end of the line. */ … … 153 153 if (*pszNext != '\0') 154 154 { 155 rc = RTStrValidateEncoding(pszNext);156 if (RT_SUCCESS( rc))155 vrc = RTStrValidateEncoding(pszNext); 156 if (RT_SUCCESS(vrc)) 157 157 { 158 158 size_t cchDesc = strlen(pszNext); … … 167 167 } 168 168 else 169 RTMsgError("Invalid encoding: '%s' ( rc=%Rrc)", pszNext,rc);169 RTMsgError("Invalid encoding: '%s' (vrc=%Rrc)", pszNext, vrc); 170 170 } 171 171 else … … 173 173 } 174 174 else 175 RTMsgError("Error converting number at the start of '%s': %Rrc", pszLine, rc);175 RTMsgError("Error converting number at the start of '%s': %Rrc", pszLine, vrc); 176 176 return ERROR_IN_PARSE_LINE; 177 177 } … … 203 203 { 204 204 char szLine[_4K]; 205 int rc = RTStrmGetLine(pInStrm, szLine, sizeof(szLine));206 if (RT_SUCCESS( rc))205 int vrc = RTStrmGetLine(pInStrm, szLine, sizeof(szLine)); 206 if (RT_SUCCESS(vrc)) 207 207 { 208 208 iLine++; … … 243 243 vendor.vendorID = 0; 244 244 } 245 else if ( rc == VERR_EOF)245 else if (vrc == VERR_EOF) 246 246 return RTEXITCODE_SUCCESS; 247 247 else 248 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTStrmGetLine failed: %Rrc", rc);248 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTStrmGetLine failed: %Rrc", vrc); 249 249 } 250 250 } … … 336 336 * Initialize IPRT and convert argv to UTF-8. 337 337 */ 338 int rc = RTR3InitExe(argc, &argv, 0);339 if (RT_FAILURE( rc))340 return RTMsgInitFailure( rc);338 int vrc = RTR3InitExe(argc, &argv, 0); 339 if (RT_FAILURE(vrc)) 340 return RTMsgInitFailure(vrc); 341 341 342 342 /* … … 368 368 369 369 PRTSTREAM pInStrm; 370 rc = RTStrmOpen(argv[i], "r", &pInStrm);371 if (RT_FAILURE( rc))370 vrc = RTStrmOpen(argv[i], "r", &pInStrm); 371 if (RT_FAILURE(vrc)) 372 372 return RTMsgErrorExit((RTEXITCODE)ERROR_OPEN_FILE, 373 "Failed to open file '%s' for reading: %Rrc", argv[i], rc);374 375 rc = ParseUsbIds(pInStrm, argv[i]);373 "Failed to open file '%s' for reading: %Rrc", argv[i], vrc); 374 375 vrc = ParseUsbIds(pInStrm, argv[i]); 376 376 RTStrmClose(pInStrm); 377 if ( rc != 0)377 if (vrc != 0) 378 378 { 379 379 RTMsgError("Failed parsing USB devices file '%s'", argv[i]); 380 return rc;380 return vrc; 381 381 } 382 382 } -
trunk/src/VBox/Main/src-server/USBProxyBackend.cpp
r98262 r98292 272 272 int USBProxyBackend::start(void) 273 273 { 274 int rc = VINF_SUCCESS;274 int vrc = VINF_SUCCESS; 275 275 if (mThread == NIL_RTTHREAD) 276 276 { … … 278 278 * Force update before starting the poller thread. 279 279 */ 280 rc = wait(0);281 if ( rc == VERR_TIMEOUT || rc == VERR_INTERRUPTED || RT_SUCCESS(rc))280 vrc = wait(0); 281 if (vrc == VERR_TIMEOUT || vrc == VERR_INTERRUPTED || RT_SUCCESS(vrc)) 282 282 { 283 283 PUSBDEVICE pDevices = getDevices(); … … 288 288 */ 289 289 mTerminate = false; 290 rc = RTThreadCreate(&mThread, USBProxyBackend::serviceThread, this,291 0, RTTHREADTYPE_INFREQUENT_POLLER, RTTHREADFLAGS_WAITABLE, "USBPROXY");292 AssertRC( rc);293 if (RT_SUCCESS( rc))290 vrc = RTThreadCreate(&mThread, USBProxyBackend::serviceThread, this, 291 0, RTTHREADTYPE_INFREQUENT_POLLER, RTTHREADFLAGS_WAITABLE, "USBPROXY"); 292 AssertRC(vrc); 293 if (RT_SUCCESS(vrc)) 294 294 LogFlowThisFunc(("started mThread=%RTthrd\n", mThread)); 295 295 else … … 299 299 else 300 300 LogFlowThisFunc(("already running, mThread=%RTthrd\n", mThread)); 301 return rc;301 return vrc; 302 302 } 303 303 … … 310 310 int USBProxyBackend::stop(void) 311 311 { 312 int rc = VINF_SUCCESS;312 int vrc = VINF_SUCCESS; 313 313 if (mThread != NIL_RTTHREAD) 314 314 { … … 317 317 */ 318 318 ASMAtomicXchgSize(&mTerminate, true); 319 rc = interruptWait();320 AssertRC( rc);319 vrc = interruptWait(); 320 AssertRC(vrc); 321 321 322 322 /* 323 323 * Wait for the thread to finish and then update the state. 324 324 */ 325 rc = RTThreadWait(mThread, 60000, NULL);326 if ( rc == VERR_INVALID_HANDLE)327 rc = VINF_SUCCESS;328 if (RT_SUCCESS( rc))325 vrc = RTThreadWait(mThread, 60000, NULL); 326 if (vrc == VERR_INVALID_HANDLE) 327 vrc = VINF_SUCCESS; 328 if (RT_SUCCESS(vrc)) 329 329 { 330 330 LogFlowThisFunc(("stopped mThread=%RTthrd\n", mThread)); … … 333 333 } 334 334 else 335 AssertRC( rc);335 AssertRC(vrc); 336 336 } 337 337 else … … 341 341 updateDeviceList(NULL); 342 342 343 return rc;343 return vrc; 344 344 } 345 345 … … 356 356 LogFlowFunc(("pThis=%p\n", pThis)); 357 357 pThis->serviceThreadInit(); 358 int rc = VINF_SUCCESS;358 int vrc = VINF_SUCCESS; 359 359 360 360 /* … … 363 363 for (;;) 364 364 { 365 rc = pThis->wait(RT_INDEFINITE_WAIT);366 if (RT_FAILURE( rc) && rc != VERR_INTERRUPTED &&rc != VERR_TIMEOUT)365 vrc = pThis->wait(RT_INDEFINITE_WAIT); 366 if (RT_FAILURE(vrc) && vrc != VERR_INTERRUPTED && vrc != VERR_TIMEOUT) 367 367 break; 368 368 if (pThis->mTerminate) … … 374 374 375 375 pThis->serviceThreadTerm(); 376 LogFlowFunc(("returns %Rrc\n", rc));377 return rc;376 LogFlowFunc(("returns %Rrc\n", vrc)); 377 return vrc; 378 378 } 379 379 -
trunk/src/VBox/Main/src-server/USBProxyService.cpp
r98262 r98292 603 603 SessionMachinesList llOpenedMachines; 604 604 mHost->i_parent()->i_getOpenedMachines(llOpenedMachines); 605 HRESULT rc = runAllFiltersOnDevice(aDevice, llOpenedMachines, NULL /* aIgnoreMachine */);606 AssertComRC( rc);605 HRESULT hrc = runAllFiltersOnDevice(aDevice, llOpenedMachines, NULL /* aIgnoreMachine */); 606 AssertComRC(hrc); 607 607 } 608 608 } … … 702 702 SessionMachinesList llOpenedMachines; 703 703 mHost->i_parent()->i_getOpenedMachines(llOpenedMachines); 704 HRESULT rc = runAllFiltersOnDevice(aDevice, llOpenedMachines, aIgnoreMachine);705 AssertComRC( rc);704 HRESULT hrc = runAllFiltersOnDevice(aDevice, llOpenedMachines, aIgnoreMachine); 705 AssertComRC(hrc); 706 706 } 707 707 } … … 959 959 va_list va; 960 960 va_start(va, aText); 961 HRESULT rc = VirtualBoxBase::setErrorInternalV(aResultCode,962 COM_IIDOF(IHost),963 "USBProxyService",964 aText, va,965 false /* aWarning*/,966 true /* aLogIt*/);961 HRESULT hrc = VirtualBoxBase::setErrorInternalV(aResultCode, 962 COM_IIDOF(IHost), 963 "USBProxyService", 964 aText, va, 965 false /* aWarning*/, 966 true /* aLogIt*/); 967 967 va_end(va); 968 return rc;968 return hrc; 969 969 } 970 970 -
trunk/src/VBox/Main/src-server/UnattendedInstaller.cpp
r98103 r98292 1473 1473 HRESULT UnattendedSuseInstaller::setUserData() 1474 1474 { 1475 HRESULT rc = S_OK;1475 HRESULT hrc = S_OK; 1476 1476 //here base class function must be called first 1477 1477 //because user home directory is set after user name 1478 rc = UnattendedInstaller::setUserData();1479 1480 rc = mAlg->setField(USERHOMEDIR_ID, "");1481 if (FAILED( rc))1482 return rc;1483 1484 return rc;1478 hrc = UnattendedInstaller::setUserData(); 1479 1480 hrc = mAlg->setField(USERHOMEDIR_ID, ""); 1481 if (FAILED(hrc)) 1482 return hrc; 1483 1484 return hrc; 1485 1485 } 1486 1486 … … 1504 1504 HRESULT UnattendedSuseInstaller::setupScriptOnAuxiliaryCD(const Utf8Str &path) 1505 1505 { 1506 HRESULT rc = S_OK;1506 HRESULT hrc = S_OK; 1507 1507 1508 1508 GeneralTextScript isoSuseCfgScript(mpParent); 1509 rc = isoSuseCfgScript.read(path);1510 rc = isoSuseCfgScript.parse();1509 hrc = isoSuseCfgScript.read(path); 1510 hrc = isoSuseCfgScript.parse(); 1511 1511 //fix linux core bootable parameters: add path to the preseed script 1512 1512 … … 1540 1540 } 1541 1541 1542 rc = isoSuseCfgScript.save(path, true);1542 hrc = isoSuseCfgScript.save(path, true); 1543 1543 1544 1544 LogRelFunc(("UnattendedSuseInstaller::setupScriptsOnAuxiliaryCD(): The file %s has been changed\n", path.c_str())); 1545 1545 1546 return rc;1546 return hrc; 1547 1547 } 1548 1548 #endif -
trunk/src/VBox/Main/src-server/UpdateAgentImpl.cpp
r98262 r98292 95 95 /** @todo Differentiate tasks once we have more stuff to do (downloading, installing, ++). */ 96 96 97 HRESULT rc = pUpdateAgent->i_checkForUpdateTask(this);97 HRESULT hrc = pUpdateAgent->i_checkForUpdateTask(this); 98 98 99 99 if (!m_pProgress.isNull()) 100 m_pProgress->i_notifyComplete( rc);101 102 LogFlowFunc((" rc=%Rhrc\n", rc)); RT_NOREF(rc);100 m_pProgress->i_notifyComplete(hrc); 101 102 LogFlowFunc(("hrc=%Rhrc\n", hrc)); RT_NOREF(hrc); 103 103 } 104 104 … … 792 792 HRESULT UpdateAgent::i_configureProxy(RTHTTP hHttp) 793 793 { 794 HRESULT rc;795 796 794 ProxyMode_T enmProxyMode; 797 rc = i_getProxyMode(&enmProxyMode); 798 ComAssertComRCRetRC(rc); 795 HRESULT hrc = i_getProxyMode(&enmProxyMode); 796 ComAssertComRCRetRC(hrc); 797 799 798 Utf8Str strProxyUrl; 800 rc = i_getProxyURL(strProxyUrl);801 ComAssertComRCRetRC( rc);799 hrc = i_getProxyURL(strProxyUrl); 800 ComAssertComRCRetRC(hrc); 802 801 803 802 if (enmProxyMode == ProxyMode_Manual) … … 923 922 924 923 ComObjPtr<Progress> pProgress; 925 HRESULT rc = pProgress.createObject();926 if (FAILED( rc))927 return rc;928 929 rc = pProgress->init(m_VirtualBox,930 static_cast<IUpdateAgent*>(this),931 tr("Checking for update for %s ...", this->mData.m_strName.c_str()),932 TRUE /* aCancelable */);933 if (FAILED( rc))934 return rc;924 HRESULT hrc = pProgress.createObject(); 925 if (FAILED(hrc)) 926 return hrc; 927 928 hrc = pProgress->init(m_VirtualBox, 929 static_cast<IUpdateAgent*>(this), 930 tr("Checking for update for %s ...", this->mData.m_strName.c_str()), 931 TRUE /* aCancelable */); 932 if (FAILED(hrc)) 933 return hrc; 935 934 936 935 /* initialize the worker task */ 937 936 UpdateAgentTask *pTask = new UpdateAgentTask(this, pProgress); 938 rc = pTask->createThread();937 hrc = pTask->createThread(); 939 938 pTask = NULL; 940 if (FAILED( rc))941 return rc;939 if (FAILED(hrc)) 940 return hrc; 942 941 943 942 return pProgress.queryInterfaceTo(aProgress.asOutParam()); … … 968 967 // Add platform ID. 969 968 Bstr platform; 970 HRESULT rc = m_VirtualBox->COMGETTER(PackageType)(platform.asOutParam());971 AssertComRCReturn( rc,rc);969 HRESULT hrc = m_VirtualBox->COMGETTER(PackageType)(platform.asOutParam()); 970 AssertComRCReturn(hrc, hrc); 972 971 strUrl.appendPrintf("platform=%ls", platform.raw()); // e.g. SOLARIS_64BITS_GENERIC 973 972 974 973 // Get the complete current version string for the query URL 975 974 Bstr versionNormalized; 976 rc = m_VirtualBox->COMGETTER(VersionNormalized)(versionNormalized.asOutParam());977 AssertComRCReturn( rc,rc);975 hrc = m_VirtualBox->COMGETTER(VersionNormalized)(versionNormalized.asOutParam()); 976 AssertComRCReturn(hrc, hrc); 978 977 strUrl.appendPrintf("&version=%ls", versionNormalized.raw()); // e.g. 6.1.1 979 978 #ifdef DEBUG // Comment out previous line and uncomment this one for testing. … … 982 981 983 982 ULONG revision = 0; 984 rc = m_VirtualBox->COMGETTER(Revision)(&revision);985 AssertComRCReturn( rc,rc);983 hrc = m_VirtualBox->COMGETTER(Revision)(&revision); 984 AssertComRCReturn(hrc, hrc); 986 985 strUrl.appendPrintf("_%u", revision); // e.g. 135618 987 986 … … 998 997 m->uCheckCount++; 999 998 1000 rc = i_commitSettings(alock);1001 AssertComRCReturn( rc,rc);999 hrc = i_commitSettings(alock); 1000 AssertComRCReturn(hrc, hrc); 1002 1001 1003 1002 strUrl.appendPrintf("&count=%RU32", m->uCheckCount); … … 1026 1025 */ 1027 1026 Bstr version; 1028 rc = m_VirtualBox->COMGETTER(Version)(version.asOutParam()); // e.g. 6.1.0_RC11029 AssertComRCReturn( rc,rc);1027 hrc = m_VirtualBox->COMGETTER(Version)(version.asOutParam()); // e.g. 6.1.0_RC1 1028 AssertComRCReturn(hrc, hrc); 1030 1029 1031 1030 Utf8StrFmt const strUserAgent("VirtualBox %ls <%s>", version.raw(), UpdateAgent::i_getPlatformInfo().c_str()); … … 1042 1041 try 1043 1042 { 1044 rc = i_checkForUpdateInner(hHttp, strUrl, strUserAgent);1043 hrc = i_checkForUpdateInner(hHttp, strUrl, strUserAgent); 1045 1044 } 1046 1045 catch (...) 1047 1046 { 1048 1047 AssertFailed(); 1049 rc = E_UNEXPECTED;1048 hrc = E_UNEXPECTED; 1050 1049 } 1051 1050 RTHttpDestroy(hHttp); 1052 1051 } 1053 1052 else 1054 rc = i_reportError(vrc, tr("RTHttpCreate() failed: %Rrc"), vrc);1055 1056 return rc;1053 hrc = i_reportError(vrc, tr("RTHttpCreate() failed: %Rrc"), vrc); 1054 1055 return hrc; 1057 1056 } 1058 1057 … … 1070 1069 * Configure the proxy (if any). 1071 1070 */ 1072 HRESULT rc = i_configureProxy(hHttp);1073 if (FAILED( rc))1074 return rc;1071 HRESULT hrc = i_configureProxy(hHttp); 1072 if (FAILED(hrc)) 1073 return hrc; 1075 1074 1076 1075 /** @todo Are there any other headers needed to be added first via RTHttpSetHeaders()? */ … … 1121 1120 1122 1121 mData.m_enmState = UpdateState_NotAvailable; 1123 rc = S_OK;1122 hrc = S_OK; 1124 1123 1125 1124 alock.release(); /* Release lock before firing off event. */ … … 1137 1136 { 1138 1137 /** @todo Any additional sanity checks we could perform here? */ 1139 rc = mData.m_lastResult.strVer.assignEx(pchWord0, cchWord0);1140 if (SUCCEEDED( rc))1141 rc = mData.m_lastResult.strDownloadUrl.assignEx(pchWord1, cchWord1);1142 1143 if (SUCCEEDED( rc))1138 hrc = mData.m_lastResult.strVer.assignEx(pchWord0, cchWord0); 1139 if (SUCCEEDED(hrc)) 1140 hrc = mData.m_lastResult.strDownloadUrl.assignEx(pchWord1, cchWord1); 1141 1142 if (SUCCEEDED(hrc)) 1144 1143 { 1145 1144 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 1158 1157 } 1159 1158 else 1160 rc = i_reportError(VERR_GENERAL_FAILURE /** @todo Use a betterrc */,1161 tr("Invalid server response [1]: %Rhrc (%.*Rhxs -- %.*Rhxs)"),1162 rc, cchWord0, pchWord0, cchWord1, pchWord1);1159 hrc = i_reportError(VERR_GENERAL_FAILURE /** @todo Use a better hrc */, 1160 tr("Invalid server response [1]: %Rhrc (%.*Rhxs -- %.*Rhxs)"), 1161 hrc, cchWord0, pchWord0, cchWord1, pchWord1); 1163 1162 1164 1163 LogRel2(("Update agent (%s): HTTP server replied: %.*s %.*s\n", … … 1166 1165 } 1167 1166 else 1168 rc = i_reportError(vrc, tr("Invalid server response [2]: %Rrc (%.*Rhxs -- %.*Rhxs)"),1169 vrc, cchWord0, pchWord0, cchWord1, pchWord1);1167 hrc = i_reportError(vrc, tr("Invalid server response [2]: %Rrc (%.*Rhxs -- %.*Rhxs)"), 1168 vrc, cchWord0, pchWord0, cchWord1, pchWord1); 1170 1169 } 1171 1170 1172 1171 RTHttpFreeResponse(pvResponse); 1173 1172 1174 return rc;1175 } 1176 1173 return hrc; 1174 } 1175 -
trunk/src/VBox/Main/src-server/VFSExplorerImpl.cpp
r98289 r98292 212 212 LogFlowFunc(("VFSExplorer %p\n", pVFSExplorer)); 213 213 214 HRESULT rc = S_OK;214 HRESULT hrc = S_OK; 215 215 216 216 switch (this->m_taskType) … … 219 219 { 220 220 if (pVFSExplorer->m->storageType == VFSType_File) 221 rc = pVFSExplorer->i_updateFS(this);221 hrc = pVFSExplorer->i_updateFS(this); 222 222 else if (pVFSExplorer->m->storageType == VFSType_S3) 223 rc = E_NOTIMPL;223 hrc = E_NOTIMPL; 224 224 break; 225 225 } … … 227 227 { 228 228 if (pVFSExplorer->m->storageType == VFSType_File) 229 rc = pVFSExplorer->i_deleteFS(this);229 hrc = pVFSExplorer->i_deleteFS(this); 230 230 else if (pVFSExplorer->m->storageType == VFSType_S3) 231 rc = E_NOTIMPL;231 hrc = E_NOTIMPL; 232 232 break; 233 233 } … … 237 237 } 238 238 239 LogFlowFunc((" rc=%Rhrc\n", rc)); NOREF(rc);239 LogFlowFunc(("hrc=%Rhrc\n", hrc)); NOREF(hrc); 240 240 LogFlowFuncLeave(); 241 241 } … … 285 285 AutoWriteLock appLock(this COMMA_LOCKVAL_SRC_POS); 286 286 287 HRESULT rc = S_OK;287 HRESULT hrc = S_OK; 288 288 289 289 std::list<VFSExplorer::Data::DirEntry> fileList; … … 316 316 catch (HRESULT hrcXcpt) 317 317 { 318 rc = hrcXcpt;318 hrc = hrcXcpt; 319 319 } 320 320 … … 323 323 } 324 324 else 325 rc = setErrorBoth(VBOX_E_FILE_ERROR, vrc, tr ("Can't open directory '%s' (%Rrc)"), m->strPath.c_str(), vrc);325 hrc = setErrorBoth(VBOX_E_FILE_ERROR, vrc, tr ("Can't open directory '%s' (%Rrc)"), m->strPath.c_str(), vrc); 326 326 327 327 if (aTask->m_ptrProgress) … … 329 329 330 330 /* Assign the result on success (this clears the old list) */ 331 if ( rc == S_OK)331 if (hrc == S_OK) 332 332 m->entryList.assign(fileList.begin(), fileList.end()); 333 333 334 aTask->m_rc = rc;334 aTask->m_rc = hrc; 335 335 336 336 if (!aTask->m_ptrProgress.isNull()) 337 aTask->m_ptrProgress->i_notifyComplete( rc);338 339 LogFlowFunc((" rc=%Rhrc\n",rc));337 aTask->m_ptrProgress->i_notifyComplete(hrc); 338 339 LogFlowFunc(("hrc=%Rhrc\n", hrc)); 340 340 LogFlowFuncLeave(); 341 341 … … 352 352 AutoWriteLock appLock(this COMMA_LOCKVAL_SRC_POS); 353 353 354 HRESULT rc = S_OK;354 HRESULT hrc = S_OK; 355 355 356 356 float fPercentStep = 100.0f / (float)aTask->m_lstFilenames.size(); … … 376 376 catch (HRESULT hrcXcpt) 377 377 { 378 rc = hrcXcpt;379 } 380 381 aTask->m_rc = rc;378 hrc = hrcXcpt; 379 } 380 381 aTask->m_rc = hrc; 382 382 383 383 if (aTask->m_ptrProgress.isNotNull()) 384 aTask->m_ptrProgress->i_notifyComplete( rc);385 386 LogFlowFunc((" rc=%Rhrc\n",rc));384 aTask->m_ptrProgress->i_notifyComplete(hrc); 385 386 LogFlowFunc(("hrc=%Rhrc\n", hrc)); 387 387 LogFlowFuncLeave(); 388 388 … … 394 394 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 395 395 396 HRESULT rc = S_OK;396 HRESULT hrc = S_OK; 397 397 398 398 ComObjPtr<Progress> progress; … … 404 404 progress.createObject(); 405 405 406 rc = progress->init(mVirtualBox, 407 static_cast<IVFSExplorer*>(this), 408 progressDesc.raw(), 409 TRUE /* aCancelable */); 410 if (FAILED(rc)) throw rc; 406 hrc = progress->init(mVirtualBox, static_cast<IVFSExplorer*>(this), progressDesc.raw(), TRUE /* aCancelable */); 407 if (FAILED(hrc)) throw hrc; 411 408 412 409 /* Initialize our worker task */ … … 414 411 415 412 //this function delete task in case of exceptions, so there is no need in the call of delete operator 416 rc = pTask->createThreadWithType(RTTHREADTYPE_MAIN_HEAVY_WORKER);413 hrc = pTask->createThreadWithType(RTTHREADTYPE_MAIN_HEAVY_WORKER); 417 414 } 418 415 catch (HRESULT hrcXcpt) 419 416 { 420 rc = hrcXcpt;421 } 422 423 if (SUCCEEDED( rc))417 hrc = hrcXcpt; 418 } 419 420 if (SUCCEEDED(hrc)) 424 421 /* Return progress to the caller */ 425 422 progress.queryInterfaceTo(aProgress.asOutParam()); 426 423 427 return rc;424 return hrc; 428 425 } 429 426 … … 511 508 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 512 509 513 HRESULT rc = S_OK;510 HRESULT hrc = S_OK; 514 511 515 512 ComObjPtr<Progress> progress; … … 519 516 progress.createObject(); 520 517 521 rc = progress->init(mVirtualBox, static_cast<IVFSExplorer*>(this),522 Bstr(tr("Delete files")).raw(),523 TRUE /* aCancelable */);524 if (FAILED( rc)) throwrc;518 hrc = progress->init(mVirtualBox, static_cast<IVFSExplorer*>(this), 519 Bstr(tr("Delete files")).raw(), 520 TRUE /* aCancelable */); 521 if (FAILED(hrc)) throw hrc; 525 522 526 523 /* Initialize our worker task */ … … 532 529 533 530 //this function delete task in case of exceptions, so there is no need in the call of delete operator 534 rc = pTask->createThreadWithType(RTTHREADTYPE_MAIN_HEAVY_WORKER);531 hrc = pTask->createThreadWithType(RTTHREADTYPE_MAIN_HEAVY_WORKER); 535 532 } 536 533 catch (HRESULT hrcXcpt) 537 534 { 538 rc = hrcXcpt;539 } 540 541 if (SUCCEEDED( rc))535 hrc = hrcXcpt; 536 } 537 538 if (SUCCEEDED(hrc)) 542 539 /* Return progress to the caller */ 543 540 progress.queryInterfaceTo(aProgress.asOutParam()); 544 541 545 return rc;546 } 547 542 return hrc; 543 } 544 -
trunk/src/VBox/Main/src-server/VRDEServerImpl.cpp
r98262 r98292 253 253 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 254 254 255 HRESULT rc = S_OK;255 HRESULT hrc = S_OK; 256 256 257 257 if (mData->fEnabled != RT_BOOL(aEnabled)) … … 270 270 adep.release(); 271 271 272 rc = mParent->i_onVRDEServerChange(/* aRestart */ TRUE);273 if (FAILED( rc))272 hrc = mParent->i_onVRDEServerChange(/* aRestart */ TRUE); 273 if (FAILED(hrc)) 274 274 { 275 275 /* Failed to enable/disable the server. Revert the internal state. */ … … 286 286 } 287 287 288 return rc;288 return hrc; 289 289 } 290 290 … … 354 354 355 355 /* A probably valid range. Verify and parse it. */ 356 int rc;356 int vrc; 357 357 if (pszDash) 358 358 { 359 rc = i_portParseNumber(NULL, pszStart, pszDash);360 if (RT_SUCCESS( rc))361 rc = i_portParseNumber(NULL, pszDash + 1, pszEnd);359 vrc = i_portParseNumber(NULL, pszStart, pszDash); 360 if (RT_SUCCESS(vrc)) 361 vrc = i_portParseNumber(NULL, pszDash + 1, pszEnd); 362 362 } 363 363 else 364 rc = i_portParseNumber(NULL, pszStart, pszEnd);365 366 if (RT_FAILURE( rc))367 return rc;364 vrc = i_portParseNumber(NULL, pszStart, pszEnd); 365 366 if (RT_FAILURE(vrc)) 367 return vrc; 368 368 } 369 369 … … 476 476 #endif 477 477 { 478 int rc = VINF_SUCCESS;478 int vrc = VINF_SUCCESS; 479 479 480 480 RTLDRMOD hmod = NIL_RTLDRMOD; … … 483 483 RTErrInfoInitStatic(&ErrInfo); 484 484 if (RTPathHavePath(pszLibraryName)) 485 rc = SUPR3HardenedLdrLoadPlugIn(pszLibraryName, &hmod, &ErrInfo.Core);485 vrc = SUPR3HardenedLdrLoadPlugIn(pszLibraryName, &hmod, &ErrInfo.Core); 486 486 else 487 rc = SUPR3HardenedLdrLoadAppPriv(pszLibraryName, &hmod, RTLDRLOAD_FLAGS_LOCAL, &ErrInfo.Core);488 if (RT_SUCCESS( rc))489 { 490 rc = RTLdrGetSymbol(hmod, "VRDESupportedProperties", (void **)ppfn);491 492 if (RT_FAILURE( rc) &&rc != VERR_SYMBOL_NOT_FOUND)493 LogRel(("VRDE: Error resolving symbol '%s', rc %Rrc.\n", "VRDESupportedProperties",rc));487 vrc = SUPR3HardenedLdrLoadAppPriv(pszLibraryName, &hmod, RTLDRLOAD_FLAGS_LOCAL, &ErrInfo.Core); 488 if (RT_SUCCESS(vrc)) 489 { 490 vrc = RTLdrGetSymbol(hmod, "VRDESupportedProperties", (void **)ppfn); 491 492 if (RT_FAILURE(vrc) && vrc != VERR_SYMBOL_NOT_FOUND) 493 LogRel(("VRDE: Error resolving symbol '%s', vrc %Rrc.\n", "VRDESupportedProperties", vrc)); 494 494 } 495 495 else 496 496 { 497 497 if (RTErrInfoIsSet(&ErrInfo.Core)) 498 LogRel(("VRDE: Error loading the library '%s': %s (%Rrc)\n", pszLibraryName, ErrInfo.Core.pszMsg, rc));498 LogRel(("VRDE: Error loading the library '%s': %s (%Rrc)\n", pszLibraryName, ErrInfo.Core.pszMsg, vrc)); 499 499 else 500 LogRel(("VRDE: Error loading the library '%s' rc = %Rrc.\n", pszLibraryName,rc));500 LogRel(("VRDE: Error loading the library '%s' vrc = %Rrc.\n", pszLibraryName, vrc)); 501 501 502 502 hmod = NIL_RTLDRMOD; 503 503 } 504 504 505 if (RT_SUCCESS(rc)) 506 { 505 if (RT_SUCCESS(vrc)) 507 506 *phmod = hmod; 508 }509 507 else 510 508 { … … 516 514 } 517 515 518 return rc;516 return vrc; 519 517 } 520 518 … … 557 555 #endif 558 556 } 559 Log(("VRDEPROP: library get rc %Rrc\n", vrc));557 Log(("VRDEPROP: library get vrc %Rrc\n", vrc)); 560 558 561 559 if (RT_SUCCESS(vrc)) … … 571 569 vrc = loadVRDELibrary(strVrdeLibrary.c_str(), &hmod, &pfn); 572 570 #endif 573 Log(("VRDEPROP: load library [%s] rc %Rrc\n", strVrdeLibrary.c_str(), vrc));571 Log(("VRDEPROP: load library [%s] vrc %Rrc\n", strVrdeLibrary.c_str(), vrc)); 574 572 if (RT_SUCCESS(vrc)) 575 573 { -
trunk/src/VBox/Main/src-server/generic/USBProxyBackendUsbIp.cpp
r98288 r98292 351 351 { 352 352 RTPollSetRemove(m->hPollSet, USBIP_POLL_ID_PIPE); 353 int rc2 = RTPollSetDestroy(m->hPollSet);354 AssertRC( rc2);353 int vrc2 = RTPollSetDestroy(m->hPollSet); 354 AssertRC(vrc2); 355 355 m->hPollSet = NIL_RTPOLLSET; 356 356 } … … 359 359 if (RT_FAILURE(vrc)) 360 360 { 361 int rc2 = RTPipeClose(m->hWakeupPipeR);362 AssertRC( rc2);363 rc2 = RTPipeClose(m->hWakeupPipeW);364 AssertRC( rc2);361 int vrc2 = RTPipeClose(m->hWakeupPipeR); 362 AssertRC(vrc2); 363 vrc2 = RTPipeClose(m->hWakeupPipeW); 364 AssertRC(vrc2); 365 365 m->hWakeupPipeR = m->hWakeupPipeW = NIL_RTPIPE; 366 366 } -
trunk/src/VBox/Main/src-server/linux/HostHardwareLinux.cpp
r98288 r98292 151 151 if (RT_SUCCESS(vrc)) 152 152 { 153 int rcIoCtl;154 vrc = RTFileIoCtl(File, FDGETDRVTYP, pszName, 0, & rcIoCtl);153 int iRcIoCtl; 154 vrc = RTFileIoCtl(File, FDGETDRVTYP, pszName, 0, &iRcIoCtl); 155 155 RTFileClose(File); 156 if (RT_SUCCESS(vrc) && rcIoCtl >= 0)156 if (RT_SUCCESS(vrc) && iRcIoCtl >= 0) 157 157 return true; 158 158 } … … 313 313 if (RT_SUCCESS(vrc)) 314 314 { 315 int rcIoCtl= 0;315 int iRcIoCtl = 0; 316 316 unsigned char auchResponse[96] = { 0 }; 317 317 struct cdrom_generic_command CdromCommandReq; … … 323 323 CdromCommandReq.data_direction = CGC_DATA_READ; 324 324 CdromCommandReq.timeout = 5000; /* ms */ 325 vrc = RTFileIoCtl(hFile, CDROM_SEND_PACKET, &CdromCommandReq, 0, & rcIoCtl);326 if (RT_SUCCESS(vrc) && rcIoCtl < 0)325 vrc = RTFileIoCtl(hFile, CDROM_SEND_PACKET, &CdromCommandReq, 0, &iRcIoCtl); 326 if (RT_SUCCESS(vrc) && iRcIoCtl < 0) 327 327 vrc = RTErrConvertFromErrno(-CdromCommandReq.stat); 328 328 RTFileClose(hFile); … … 435 435 if (RT_SUCCESS(vrc)) 436 436 { 437 int rcIoCtl;438 vrc = RTFileIoCtl(File, NVME_IOCTL_ID, NULL, 0, & rcIoCtl);437 int iRcIoCtl; 438 vrc = RTFileIoCtl(File, NVME_IOCTL_ID, NULL, 0, &iRcIoCtl); 439 439 RTFileClose(File); 440 if (RT_SUCCESS(vrc) && rcIoCtl >= 0)440 if (RT_SUCCESS(vrc) && iRcIoCtl >= 0) 441 441 return true; 442 442 } -
trunk/src/VBox/Main/src-server/linux/USBGetDevices.cpp
r98288 r98292 1584 1584 bool s_fTestDevicesAccessible; 1585 1585 /** The result of the usbfs/inotify-specific init */ 1586 int s_ rcTestMethodInitResult;1586 int s_vrcTestMethodInitResult; 1587 1587 /** The value of the VBOX_USB environment variable. */ 1588 1588 const char *s_pszTestEnvUsb; … … 1596 1596 void TestUSBSetupInit(const char *pszUsbfsRoot, bool fUsbfsAccessible, 1597 1597 const char *pszDevicesRoot, bool fDevicesAccessible, 1598 int rcMethodInitResult)1598 int vrcMethodInitResult) 1599 1599 { 1600 1600 s_pszTestUsbfsRoot = pszUsbfsRoot; … … 1602 1602 s_pszTestDevicesRoot = pszDevicesRoot; 1603 1603 s_fTestDevicesAccessible = fDevicesAccessible; 1604 s_ rcTestMethodInitResult =rcMethodInitResult;1604 s_vrcTestMethodInitResult = vrcMethodInitResult; 1605 1605 } 1606 1606 -
trunk/src/VBox/Main/src-server/os2/USBProxyBackendOs2.cpp
r98103 r98292 59 59 * Try initialize the usbcalls stuff. 60 60 */ 61 intrc = DosCreateEventSem(NULL, &mhev, 0, FALSE);62 rc = RTErrConvertFromOS2(rc);63 if (RT_SUCCESS( rc))61 APIRET orc = DosCreateEventSem(NULL, &mhev, 0, FALSE); 62 int vrc = RTErrConvertFromOS2(orc); 63 if (RT_SUCCESS(vrc)) 64 64 { 65 rc = DosLoadModule(NULL, 0, (PCSZ)"usbcalls", &mhmod);66 rc = RTErrConvertFromOS2(rc);67 if (RT_SUCCESS( rc))65 orc = DosLoadModule(NULL, 0, (PCSZ)"usbcalls", &mhmod); 66 vrc = RTErrConvertFromOS2(orc); 67 if (RT_SUCCESS(vrc)) 68 68 { 69 if ( ( rc = DosQueryProcAddr(mhmod, 0, (PCSZ)"UsbQueryNumberDevices", (PPFN)&mpfnUsbQueryNumberDevices)) == NO_ERROR70 && ( rc = DosQueryProcAddr(mhmod, 0, (PCSZ)"UsbQueryDeviceReport", (PPFN)&mpfnUsbQueryDeviceReport)) == NO_ERROR71 && ( rc = DosQueryProcAddr(mhmod, 0, (PCSZ)"UsbRegisterChangeNotification", (PPFN)&mpfnUsbRegisterChangeNotification)) == NO_ERROR72 && ( rc = DosQueryProcAddr(mhmod, 0, (PCSZ)"UsbDeregisterNotification", (PPFN)&mpfnUsbDeregisterNotification)) == NO_ERROR69 if ( (orc = DosQueryProcAddr(mhmod, 0, (PCSZ)"UsbQueryNumberDevices", (PPFN)&mpfnUsbQueryNumberDevices)) == NO_ERROR 70 && (orc = DosQueryProcAddr(mhmod, 0, (PCSZ)"UsbQueryDeviceReport", (PPFN)&mpfnUsbQueryDeviceReport)) == NO_ERROR 71 && (orc = DosQueryProcAddr(mhmod, 0, (PCSZ)"UsbRegisterChangeNotification", (PPFN)&mpfnUsbRegisterChangeNotification)) == NO_ERROR 72 && (orc = DosQueryProcAddr(mhmod, 0, (PCSZ)"UsbDeregisterNotification", (PPFN)&mpfnUsbDeregisterNotification)) == NO_ERROR 73 73 ) 74 74 { 75 rc = mpfnUsbRegisterChangeNotification(&mNotifyId, mhev, mhev);76 if (! rc)75 orc = mpfnUsbRegisterChangeNotification(&mNotifyId, mhev, mhev); 76 if (!orc) 77 77 { 78 78 /* 79 79 * Start the poller thread. 80 80 */ 81 rc = start();82 if (RT_SUCCESS( rc))81 vrc = start(); 82 if (RT_SUCCESS(vrc)) 83 83 { 84 84 LogFlowThisFunc(("returns successfully - mNotifyId=%d\n", mNotifyId)); … … 86 86 return; 87 87 } 88 LogRel(("USBProxyBackendOs2: failed to start poller thread, vrc=%Rrc\n", vrc)); 88 89 } 89 90 LogRel(("USBProxyBackendOs2: failed to register change notification, rc=%d\n", rc)); 90 else 91 { 92 LogRel(("USBProxyBackendOs2: failed to register change notification, orc=%d\n", orc)); 93 vrc = RTErrConvertFromOS2(orc); 94 } 91 95 } 92 96 else 97 { 93 98 LogRel(("USBProxyBackendOs2: failed to load usbcalls\n")); 99 vrc = RTErrConvertFromOS2(orc); 100 } 94 101 95 102 DosFreeModule(mhmod); 96 103 } 97 104 else 98 LogRel(("USBProxyBackendOs2: failed to load usbcalls, rc=%d\n",rc));105 LogRel(("USBProxyBackendOs2: failed to load usbcalls, vrc=%d\n", vrc)); 99 106 mhmod = NULLHANDLE; 100 107 } … … 102 109 mhev = NULLHANDLE; 103 110 104 mLastError = rc;105 LogFlowThisFunc(("returns failure!!! ( rc=%Rrc)\n",rc));111 mLastError = vrc; 112 LogFlowThisFunc(("returns failure!!! (vrc=%Rrc)\n", vrc)); 106 113 } 107 114 … … 191 198 int USBProxyBackendOs2::wait(RTMSINTERVAL aMillies) 192 199 { 193 int rc = DosWaitEventSem(mhev, aMillies);194 return RTErrConvertFromOS2( rc);200 int orc = DosWaitEventSem(mhev, aMillies); 201 return RTErrConvertFromOS2(orc); 195 202 } 196 203 … … 198 205 int USBProxyBackendOs2::interruptWait(void) 199 206 { 200 int rc = DosPostEventSem(mhev);201 return rc == NO_ERROR ||rc == ERROR_ALREADY_POSTED207 int orc = DosPostEventSem(mhev); 208 return orc == NO_ERROR || orc == ERROR_ALREADY_POSTED 202 209 ? VINF_SUCCESS 203 : RTErrConvertFromOS2( rc);210 : RTErrConvertFromOS2(orc); 204 211 } 205 212 … … 212 219 */ 213 220 ULONG cDevices = 0; 214 int rc = mpfnUsbQueryNumberDevices((PULONG)&cDevices); /* Thanks to com/xpcom, PULONG and ULONG * aren't the same. */215 if ( rc)221 int orc = mpfnUsbQueryNumberDevices((PULONG)&cDevices); /* Thanks to com/xpcom, PULONG and ULONG * aren't the same. */ 222 if (orc) 216 223 return NULL; 217 224 … … 228 235 uint8_t abBuf[1024]; 229 236 ULONG cb = sizeof(abBuf); 230 rc = mpfnUsbQueryDeviceReport(i + 1, (PULONG)&cb, &abBuf[0]); /* see above (PULONG) */231 if ( rc)237 orc = mpfnUsbQueryDeviceReport(i + 1, (PULONG)&cb, &abBuf[0]); /* see above (PULONG) */ 238 if (orc) 232 239 continue; 233 240 PUSBDEVICEDESC pDevDesc = (PUSBDEVICEDESC)&abBuf[0]; -
trunk/src/VBox/Main/src-server/solaris/DynLoadLibSolaris.cpp
r98103 r98292 62 62 return g_hLibDlpi != NIL_RTLDRMOD; 63 63 g_fCheckedForLibDlpi = true; 64 int rc = RTLdrLoad(LIB_DLPI, &hLibDlpi);65 if (RT_SUCCESS( rc))64 int vrc = RTLdrLoad(LIB_DLPI, &hLibDlpi); 65 if (RT_SUCCESS(vrc)) 66 66 { 67 67 /* … … 69 69 * open the VNIC/link which requires root permissions :/ 70 70 */ 71 rc = RTLdrGetSymbol(hLibDlpi, "dlpi_walk", (void **)&g_pfnLibDlpiWalk);72 rc |= RTLdrGetSymbol(hLibDlpi, "dlpi_close", (void **)&g_pfnLibDlpiClose);73 rc |= RTLdrGetSymbol(hLibDlpi, "dlpi_open", (void **)&g_pfnLibDlpiOpen);74 if (RT_SUCCESS( rc))71 vrc = RTLdrGetSymbol(hLibDlpi, "dlpi_walk", (void **)&g_pfnLibDlpiWalk); 72 vrc |= RTLdrGetSymbol(hLibDlpi, "dlpi_close", (void **)&g_pfnLibDlpiClose); 73 vrc |= RTLdrGetSymbol(hLibDlpi, "dlpi_open", (void **)&g_pfnLibDlpiOpen); 74 if (RT_SUCCESS(vrc)) 75 75 { 76 76 g_hLibDlpi = hLibDlpi; -
trunk/src/VBox/Main/src-server/solaris/NetIf-solaris.cpp
r98103 r98292 461 461 RT_ZERO(IfNum); 462 462 IfNum.lifn_family = AF_INET; 463 int rc = ioctl(Sock, SIOCGLIFNUM, &IfNum);464 if (! rc)463 int iRc = ioctl(Sock, SIOCGLIFNUM, &IfNum); 464 if (!iRc) 465 465 { 466 466 int cIfaces = RT_MIN(1024, IfNum.lifn_count); /* sane limit */ … … 474 474 IfConfig.lifc_len = (int)cbIfaces; 475 475 IfConfig.lifc_buf = (caddr_t)paIfaces; 476 rc = ioctl(Sock, SIOCGLIFCONF, &IfConfig);477 if (! rc)476 iRc = ioctl(Sock, SIOCGLIFCONF, &IfConfig); 477 if (!iRc) 478 478 { 479 479 for (int i = 0; i < cIfaces; i++) … … 486 486 487 487 #if 0 488 rc = ioctl(Sock, SIOCGLIFADDR, &(paIfaces[i]));489 if ( rc >= 0)488 iRc = ioctl(Sock, SIOCGLIFADDR, &(paIfaces[i])); 489 if (iRc >= 0) 490 490 { 491 491 memcpy(Info.IPAddress.au8, ((struct sockaddr *)&paIfaces[i].lifr_addr)->sa_data, … … 501 501 * address this way, so we just use all zeros there. 502 502 */ 503 rc = ioctl(Sock, SIOCGARP, &ArpReq);504 if ( rc >= 0)503 iRc = ioctl(Sock, SIOCGARP, &ArpReq); 504 if (iRc >= 0) 505 505 memcpy(&Info.MACAddress, ArpReq.arp_ha.sa_data, sizeof(Info.MACAddress)); 506 506 -
trunk/src/VBox/Main/src-server/solaris/PerformanceSolaris.cpp
r98103 r98292 181 181 182 182 uint64_t cb; 183 int rc = RTSystemQueryTotalRam(&cb);184 if (RT_FAILURE( rc))183 int vrc = RTSystemQueryTotalRam(&cb); 184 if (RT_FAILURE(vrc)) 185 185 totalRAM = 0; 186 186 else … … 201 201 int CollectorSolaris::getRawHostCpuLoad(uint64_t *user, uint64_t *kernel, uint64_t *idle) 202 202 { 203 int rc = VINF_SUCCESS;204 203 kstat_t *ksp; 205 204 uint64_t tmpUser, tmpKernel, tmpIdle; … … 237 236 if (idle) *idle = tmpIdle; 238 237 239 return rc;238 return VINF_SUCCESS; 240 239 } 241 240 242 241 int CollectorSolaris::getRawProcessCpuLoad(RTPROCESS process, uint64_t *user, uint64_t *kernel, uint64_t *total) 243 242 { 244 int rc = VINF_SUCCESS;243 int vrc = VINF_SUCCESS; 245 244 char *pszName; 246 245 prusage_t prusage; … … 275 274 { 276 275 Log(("read() -> %d\n", errno)); 277 rc = VERR_FILE_IO_ERROR;276 vrc = VERR_FILE_IO_ERROR; 278 277 } 279 278 close(h); … … 282 281 { 283 282 Log(("open() -> %d\n", errno)); 284 rc = VERR_ACCESS_DENIED;285 } 286 287 return rc;283 vrc = VERR_ACCESS_DENIED; 284 } 285 286 return vrc; 288 287 } 289 288 … … 292 291 AssertReturn(totalRAM, VERR_INTERNAL_ERROR); 293 292 uint64_t cb; 294 int rc = RTSystemQueryAvailableRam(&cb);295 if (RT_SUCCESS( rc))293 int vrc = RTSystemQueryAvailableRam(&cb); 294 if (RT_SUCCESS(vrc)) 296 295 { 297 296 *total = totalRAM; … … 299 298 *used = *total - *available; 300 299 } 301 return rc;300 return vrc; 302 301 } 303 302 304 303 int CollectorSolaris::getProcessMemoryUsage(RTPROCESS process, ULONG *used) 305 304 { 306 int rc = VINF_SUCCESS;305 int vrc = VINF_SUCCESS; 307 306 char *pszName = NULL; 308 307 psinfo_t psinfo; … … 327 326 { 328 327 Log(("read() -> %d\n", errno)); 329 rc = VERR_FILE_IO_ERROR;328 vrc = VERR_FILE_IO_ERROR; 330 329 } 331 330 close(h); … … 334 333 { 335 334 Log(("open() -> %d\n", errno)); 336 rc = VERR_ACCESS_DENIED;337 } 338 339 return rc;335 vrc = VERR_ACCESS_DENIED; 336 } 337 338 return vrc; 340 339 } 341 340 … … 471 470 int CollectorSolaris::getRawHostDiskLoad(const char *name, uint64_t *disk_ms, uint64_t *total_ms) 472 471 { 473 int rc = VINF_SUCCESS;472 int vrc = VINF_SUCCESS; 474 473 AssertReturn(strlen(name) < KSTAT_STRLEN, VERR_INVALID_PARAMETER); 475 474 LogFlowThisFunc(("n=%s\n", name)); … … 480 479 { 481 480 LogRel(("kstat_read(%s) -> %d\n", name, errno)); 482 rc = VERR_INTERNAL_ERROR;481 vrc = VERR_INTERNAL_ERROR; 483 482 } 484 483 else … … 496 495 { 497 496 LogRel(("kstat_lookup(%s) -> %d\n", name, errno)); 498 rc = VERR_INTERNAL_ERROR;499 } 500 501 return rc;497 vrc = VERR_INTERNAL_ERROR; 498 } 499 500 return vrc; 502 501 } 503 502 … … 568 567 int CollectorSolaris::getHostDiskSize(const char *name, uint64_t *size) 569 568 { 570 int rc = VINF_SUCCESS;569 int vrc = VINF_SUCCESS; 571 570 AssertReturn(strlen(name) + 5 < KSTAT_STRLEN, VERR_INVALID_PARAMETER); 572 571 LogFlowThisFunc(("n=%s\n", name)); … … 580 579 { 581 580 LogRel(("kstat_read(%s) -> %d\n", name, errno)); 582 rc = VERR_INTERNAL_ERROR;581 vrc = VERR_INTERNAL_ERROR; 583 582 } 584 583 else … … 596 595 { 597 596 LogRel(("kstat_lookup(%s) -> %d\n", szName, errno)); 598 rc = VERR_INTERNAL_ERROR;599 } 600 601 602 return rc;597 vrc = VERR_INTERNAL_ERROR; 598 } 599 600 601 return vrc; 603 602 } 604 603 … … 731 730 { 732 731 struct mnttab Entry; 733 int rc = 0;732 int iRc = 0; 734 733 resetmnttab(fp); 735 while (( rc = getmntent(fp, &Entry)) == 0)734 while ((iRc = getmntent(fp, &Entry)) == 0) 736 735 mFsMap[Entry.mnt_mountp] = Entry.mnt_special; 737 736 fclose(fp); 738 if ( rc != -1)739 LogRel(("Error while reading mnttab: %d\n", rc));740 } 741 } 742 743 } 737 if (iRc != -1) 738 LogRel(("Error while reading mnttab: %d\n", iRc)); 739 } 740 } 741 742 } -
trunk/src/VBox/Main/src-server/solaris/USBProxyBackendSolaris.cpp
r98103 r98292 91 91 * Create semaphore. 92 92 */ 93 int rc = RTSemEventCreate(&mNotifyEventSem);94 if (RT_FAILURE( rc))95 return rc;93 int vrc = RTSemEventCreate(&mNotifyEventSem); 94 if (RT_FAILURE(vrc)) 95 return vrc; 96 96 97 97 /* 98 98 * Initialize the USB library. 99 99 */ 100 rc = USBLibInit();101 if (RT_FAILURE( rc))100 vrc = USBLibInit(); 101 if (RT_FAILURE(vrc)) 102 102 { 103 103 /* mNotifyEventSem will be destroyed in uninit */ 104 return rc;104 return vrc; 105 105 } 106 106 … … 209 209 int *pInt = NULL; 210 210 char *pStr = NULL; 211 int rc = DI_WALK_CONTINUE;211 int iRc = DI_WALK_CONTINUE; 212 212 if (di_prop_lookup_ints(DDI_DEV_T_ANY, Node, "interface", &pInt) < 0) 213 213 { … … 337 337 pList->pTail = pList->pHead = pCur; 338 338 339 rc = DI_WALK_CONTINUE;339 iRc = DI_WALK_CONTINUE; 340 340 } while (0); 341 341 … … 344 344 solarisFreeUSBDevice(pCur); 345 345 } 346 return rc;346 return iRc; 347 347 } 348 348 … … 393 393 394 394 PUSBDEVICE pDev = aDevice->i_getUsbData(); 395 int rc = USBLibResetDevice(pDev->pszDevicePath, true);396 if (RT_SUCCESS( rc))395 int vrc = USBLibResetDevice(pDev->pszDevicePath, true); 396 if (RT_SUCCESS(vrc)) 397 397 aDevice->i_setBackendUserData(pvId); 398 398 else … … 401 401 pvId = NULL; 402 402 } 403 LogFlowThisFunc(("returns %Rrc pvId=%p\n", rc, pvId));404 return rc;403 LogFlowThisFunc(("returns %Rrc pvId=%p\n", vrc, pvId)); 404 return vrc; 405 405 } 406 406 … … 449 449 450 450 PUSBDEVICE pDev = aDevice->i_getUsbData(); 451 int rc = USBLibResetDevice(pDev->pszDevicePath, true /* Re-attach */);452 if (RT_SUCCESS( rc))451 int vrc = USBLibResetDevice(pDev->pszDevicePath, true /* Re-attach */); 452 if (RT_SUCCESS(vrc)) 453 453 aDevice->i_setBackendUserData(pvId); 454 454 else … … 457 457 pvId = NULL; 458 458 } 459 LogFlowThisFunc(("returns %Rrc pvId=%p\n", rc, pvId));460 return rc;459 LogFlowThisFunc(("returns %Rrc pvId=%p\n", vrc, pvId)); 460 return vrc; 461 461 } 462 462 -
trunk/src/VBox/Main/src-server/win/HostDnsServiceWin.cpp
r98103 r98292 191 191 AssertPtr(m); 192 192 SetEvent(m->haDataEvent[DATA_SHUTDOWN_EVENT]); 193 /** @todo r=andy Wait for thread? Check rc here. Timeouts? */193 /** @todo r=andy Wait for thread? Check vrc here. Timeouts? */ 194 194 195 195 return VINF_SUCCESS; … … 267 267 HostDnsInformation info; 268 268 269 LONG lrc;270 int rc;271 272 269 std::string strDomain; 273 270 std::string strSearchList; /* NB: comma separated, no spaces */ … … 280 277 * is what ipconfig.exe seems to do). 281 278 */ 282 for (DWORD regIndex = 0; /**/; ++regIndex) { 279 for (DWORD regIndex = 0; /**/; ++regIndex) 280 { 283 281 char keyName[256]; 284 282 DWORD cbKeyName = sizeof(keyName); … … 287 285 DWORD cbKeyData = sizeof(keyData); 288 286 289 lrc = RegEnumValueA(m->hKeyTcpipParameters, regIndex, 290 keyName, &cbKeyName, 0, 291 &keyType, (LPBYTE)keyData, &cbKeyData); 287 /** @todo use unicode API. This isn't UTF-8 clean! */ 288 LSTATUS lrc = RegEnumValueA(m->hKeyTcpipParameters, regIndex, 289 keyName, &cbKeyName, 0, 290 &keyType, (LPBYTE)keyData, &cbKeyData); 292 291 293 292 if (lrc == ERROR_NO_MORE_ITEMS) … … 444 443 { 445 444 LogRel2(("HostDnsServiceWin: %ls (status %u) ...\n", 446 pAdp->FriendlyName ? pAdp->FriendlyName : L"(null)", 447 pAdp->OperStatus)); 445 pAdp->FriendlyName ? pAdp->FriendlyName : L"(null)", pAdp->OperStatus)); 448 446 449 447 if (pAdp->OperStatus != IfOperStatusUp) … … 454 452 455 453 char *pszDnsSuffix = NULL; 456 rc = RTUtf16ToUtf8Ex(pAdp->DnsSuffix, RTSTR_MAX, 457 &pszDnsSuffix, 0, /* allocate */ 458 NULL); 459 if (RT_FAILURE(rc)) 460 { 461 LogRel2(("HostDnsServiceWin: failed to convert DNS suffix \"%ls\": %Rrc\n", 462 pAdp->DnsSuffix, rc)); 454 int vrc = RTUtf16ToUtf8Ex(pAdp->DnsSuffix, RTSTR_MAX, &pszDnsSuffix, 0, /* allocate */ NULL); 455 if (RT_FAILURE(vrc)) 456 { 457 LogRel2(("HostDnsServiceWin: failed to convert DNS suffix \"%ls\": %Rrc\n", pAdp->DnsSuffix, vrc)); 463 458 continue; 464 459 } -
trunk/src/VBox/Main/src-server/win/HostPowerWin.cpp
r98103 r98292 54 54 mHwnd = 0; 55 55 56 int rc = RTThreadCreate(&mThread, HostPowerServiceWin::NotificationThread, this, 65536,57 RTTHREADTYPE_GUI, RTTHREADFLAGS_WAITABLE, "MainPower");58 59 if (RT_FAILURE( rc))60 { 61 Log(("HostPowerServiceWin::HostPowerServiceWin: RTThreadCreate failed with %Rrc\n", rc));56 int vrc = RTThreadCreate(&mThread, HostPowerServiceWin::NotificationThread, this, 65536, 57 RTTHREADTYPE_GUI, RTTHREADFLAGS_WAITABLE, "MainPower"); 58 59 if (RT_FAILURE(vrc)) 60 { 61 Log(("HostPowerServiceWin::HostPowerServiceWin: RTThreadCreate failed with %Rrc\n", vrc)); 62 62 return; 63 63 } … … 86 86 87 87 /* Create a window and make it a power event notification handler. */ 88 int rc = VINF_SUCCESS;88 int vrc = VINF_SUCCESS; 89 89 90 90 HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(NULL); … … 108 108 if (atomWindowClass == 0) 109 109 { 110 rc = VERR_NOT_SUPPORTED;110 vrc = VERR_NOT_SUPPORTED; 111 111 Log(("HostPowerServiceWin::NotificationThread: RegisterClassA failed with %x\n", GetLastError())); 112 112 } … … 122 122 { 123 123 Log(("HostPowerServiceWin::NotificationThread: CreateWindowExA failed with %x\n", GetLastError())); 124 rc = VERR_NOT_SUPPORTED;124 vrc = VERR_NOT_SUPPORTED; 125 125 } 126 126 else … … 192 192 if (SystemPowerStatus.BatteryFlag == 2 /* low > 33% */) 193 193 { 194 LONG rc;195 194 SYSTEM_BATTERY_STATE BatteryState; 196 197 rc = CallNtPowerInformation(SystemBatteryState, NULL, 0, (PVOID)&BatteryState, 198 sizeof(BatteryState)); 195 LONG lrc = CallNtPowerInformation(SystemBatteryState, NULL, 0, (PVOID)&BatteryState, 196 sizeof(BatteryState)); 199 197 #ifdef LOG_ENABLED 200 if ( rc == 0 /* STATUS_SUCCESS */)198 if (lrc == 0 /* STATUS_SUCCESS */) 201 199 Log(("CallNtPowerInformation claims %d seconds of power left\n", 202 200 BatteryState.EstimatedTime)); 203 201 #endif 204 if ( rc == 0 /* STATUS_SUCCESS */202 if ( lrc == 0 /* STATUS_SUCCESS */ 205 203 && BatteryState.EstimatedTime < 60*5) 206 204 { -
trunk/src/VBox/Main/src-server/win/NetIf-win.cpp
r98103 r98292 302 302 } 303 303 304 HRESULT rc = S_OK;304 HRESULT hrc = S_OK; 305 305 int vrc = VINF_SUCCESS; 306 306 … … 343 343 /* initialize the object returned to the caller by 344 344 * CreateHostOnlyNetworkInterface() */ 345 rc = d->iface->init(Bstr(name), Bstr(name), guid, HostNetworkInterfaceType_HostOnly);346 if (SUCCEEDED( rc))345 hrc = d->iface->init(Bstr(name), Bstr(name), guid, HostNetworkInterfaceType_HostOnly); 346 if (SUCCEEDED(hrc)) 347 347 { 348 rc = d->iface->i_setVirtualBox(d->ptrVBox);349 if (SUCCEEDED( rc))348 hrc = d->iface->i_setVirtualBox(d->ptrVBox); 349 if (SUCCEEDED(hrc)) 350 350 { 351 rc = d->iface->updateConfig();352 if (SUCCEEDED( rc))353 rc = d->iface->i_updatePersistentConfig();351 hrc = d->iface->updateConfig(); 352 if (SUCCEEDED(hrc)) 353 hrc = d->iface->i_updatePersistentConfig(); 354 354 } 355 355 } … … 364 364 if (RT_FAILURE(vrc)) break; 365 365 366 rc = E_FAIL;366 hrc = E_FAIL; 367 367 d->iface->setError(E_FAIL, errMsg.c_str()); 368 368 endLoop = true; … … 372 372 { 373 373 endLoop = true; 374 rc = E_FAIL;/// @todo ComAssertMsgFailedBreak((374 hrc = E_FAIL;/// @todo ComAssertMsgFailedBreak(( 375 375 //"Invalid message code %d (%08lX)\n", 376 376 //reply, reply), 377 // rc = E_FAIL);377 //hrc = E_FAIL); 378 378 } 379 379 } … … 407 407 { 408 408 /* no parameters */ 409 rc = S_OK;409 hrc = S_OK; 410 410 endLoop = true; 411 411 break; … … 418 418 if (RT_FAILURE(vrc)) break; 419 419 420 rc = E_FAIL;420 hrc = E_FAIL; 421 421 d->iface->setError(E_FAIL, errMsg.c_str()); 422 422 endLoop = true; … … 426 426 { 427 427 endLoop = true; 428 rc = E_FAIL; /// @todo ComAssertMsgFailedBreak((428 hrc = E_FAIL; /// @todo ComAssertMsgFailedBreak(( 429 429 //"Invalid message code %d (%08lX)\n", 430 430 //reply, reply), 431 // rc = E_FAIL);431 //hrc = E_FAIL); 432 432 } 433 433 } … … 461 461 { 462 462 /* no parameters */ 463 rc = d->iface->updateConfig();463 hrc = d->iface->updateConfig(); 464 464 endLoop = true; 465 465 break; … … 472 472 if (RT_FAILURE(vrc)) break; 473 473 474 rc = E_FAIL;474 hrc = E_FAIL; 475 475 d->iface->setError(E_FAIL, errMsg.c_str()); 476 476 endLoop = true; … … 480 480 { 481 481 endLoop = true; 482 rc = E_FAIL; /// @todo ComAssertMsgFailedBreak((482 hrc = E_FAIL; /// @todo ComAssertMsgFailedBreak(( 483 483 //"Invalid message code %d (%08lX)\n", 484 484 //reply, reply), 485 // rc = E_FAIL);485 //hrc = E_FAIL); 486 486 } 487 487 } … … 519 519 { 520 520 /* no parameters */ 521 rc = d->iface->updateConfig();521 hrc = d->iface->updateConfig(); 522 522 endLoop = true; 523 523 break; … … 530 530 if (RT_FAILURE(vrc)) break; 531 531 532 rc = E_FAIL;532 hrc = E_FAIL; 533 533 d->iface->setError(E_FAIL, errMsg.c_str()); 534 534 endLoop = true; … … 538 538 { 539 539 endLoop = true; 540 rc = E_FAIL; /// @todo ComAssertMsgFailedBreak((540 hrc = E_FAIL; /// @todo ComAssertMsgFailedBreak(( 541 541 //"Invalid message code %d (%08lX)\n", 542 542 //reply, reply), 543 // rc = E_FAIL);543 //hrc = E_FAIL); 544 544 } 545 545 } … … 577 577 { 578 578 /* no parameters */ 579 rc = d->iface->updateConfig();579 hrc = d->iface->updateConfig(); 580 580 endLoop = true; 581 581 break; … … 588 588 if (RT_FAILURE(vrc)) break; 589 589 590 rc = E_FAIL;590 hrc = E_FAIL; 591 591 d->iface->setError(E_FAIL, errMsg.c_str()); 592 592 endLoop = true; … … 596 596 { 597 597 endLoop = true; 598 rc = E_FAIL; /// @todo ComAssertMsgFailedBreak((598 hrc = E_FAIL; /// @todo ComAssertMsgFailedBreak(( 599 599 //"Invalid message code %d (%08lX)\n", 600 600 //reply, reply), 601 // rc = E_FAIL);601 //hrc = E_FAIL); 602 602 } 603 603 } … … 631 631 { 632 632 /* no parameters */ 633 rc = d->iface->updateConfig();633 hrc = d->iface->updateConfig(); 634 634 endLoop = true; 635 635 break; … … 642 642 if (RT_FAILURE(vrc)) break; 643 643 644 rc = E_FAIL;644 hrc = E_FAIL; 645 645 d->iface->setError(E_FAIL, errMsg.c_str()); 646 646 endLoop = true; … … 650 650 { 651 651 endLoop = true; 652 rc = E_FAIL; /// @todo ComAssertMsgFailedBreak((652 hrc = E_FAIL; /// @todo ComAssertMsgFailedBreak(( 653 653 //"Invalid message code %d (%08lX)\n", 654 654 //reply, reply), 655 // rc = E_FAIL);655 //hrc = E_FAIL); 656 656 } 657 657 } … … 661 661 } 662 662 default: 663 rc = E_FAIL; /// @todo ComAssertMsgFailedBreak((663 hrc = E_FAIL; /// @todo ComAssertMsgFailedBreak(( 664 664 // "Invalid message code %d (%08lX)\n", 665 665 // d->msgCode, d->msgCode), 666 // rc = E_FAIL);666 // hrc = E_FAIL); 667 667 } 668 668 … … 670 670 *aVrc = vrc; 671 671 672 LogFlowFunc((" rc=0x%08X, vrc=%Rrc\n",rc, vrc));672 LogFlowFunc(("hrc=0x%08X, vrc=%Rrc\n", hrc, vrc)); 673 673 LogFlowFuncLeave(); 674 return rc;674 return hrc; 675 675 } 676 676 … … 940 940 static BOOL IsUACEnabled() 941 941 { 942 LONG rc = 0;943 944 942 OSVERSIONINFOEX info; 945 943 ZeroMemory(&info, sizeof(OSVERSIONINFOEX)); 946 944 info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); 947 rc = GetVersionEx((OSVERSIONINFO *) &info); 948 AssertReturn(rc != 0, FALSE); 949 950 LogFlowFunc(("dwMajorVersion=%d, dwMinorVersion=%d\n", 951 info.dwMajorVersion, info.dwMinorVersion)); 945 BOOL frc = GetVersionEx((OSVERSIONINFO *) &info); 946 AssertReturn(frc != FALSE, FALSE); 947 948 LogFlowFunc(("dwMajorVersion=%d, dwMinorVersion=%d\n", info.dwMajorVersion, info.dwMinorVersion)); 952 949 953 950 /* we are interested only in Vista (and newer versions...). In all … … 960 957 961 958 HKEY hKey; 962 rc = RegOpenKeyExA(HKEY_LOCAL_MACHINE, 963 "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", 964 0, KEY_QUERY_VALUE, &hKey); 965 966 Assert(rc == ERROR_SUCCESS || rc == ERROR_PATH_NOT_FOUND); 967 if (rc == ERROR_SUCCESS) 959 LSTATUS lrc = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", 960 0, KEY_QUERY_VALUE, &hKey); 961 962 Assert(lrc == ERROR_SUCCESS || lrc == ERROR_PATH_NOT_FOUND); 963 if (lrc == ERROR_SUCCESS) 968 964 { 969 965 970 966 DWORD cbEnableLUA = sizeof(dwEnableLUA); 971 rc = RegQueryValueExA(hKey, "EnableLUA", NULL, NULL, 972 (LPBYTE) &dwEnableLUA, &cbEnableLUA); 967 lrc = RegQueryValueExA(hKey, "EnableLUA", NULL, NULL, (LPBYTE) &dwEnableLUA, &cbEnableLUA); 973 968 974 969 RegCloseKey(hKey); 975 970 976 Assert( rc == ERROR_SUCCESS ||rc == ERROR_FILE_NOT_FOUND);977 } 978 979 LogFlowFunc((" rc=%d, dwEnableLUA=%d\n",rc, dwEnableLUA));971 Assert(lrc == ERROR_SUCCESS || lrc == ERROR_FILE_NOT_FOUND); 972 } 973 974 LogFlowFunc(("lrc=%d, dwEnableLUA=%d\n", lrc, dwEnableLUA)); 980 975 981 976 return dwEnableLUA == 1; … … 991 986 GUID IfGuid; 992 987 HRESULT hr; 993 int rc = VERR_GENERAL_FAILURE;988 int vrc = VERR_GENERAL_FAILURE; 994 989 995 990 hr = pncc->GetDisplayName(&lpszName); … … 1007 1002 RT_ZERO(Info); 1008 1003 Info.Uuid = *guidIfCopy.raw(); 1009 rc = collectNetIfInfo(name, guidIfCopy, &Info, iDefaultInterface);1010 if (RT_FAILURE( rc))1011 LogRelFunc(("collectNetIfInfo() -> %Rrc\n", rc));1004 vrc = collectNetIfInfo(name, guidIfCopy, &Info, iDefaultInterface); 1005 if (RT_FAILURE(vrc)) 1006 LogRelFunc(("collectNetIfInfo() -> %Rrc\n", vrc)); 1012 1007 LogFunc(("adding %ls\n", lpszName)); 1013 1008 /* create a new object and add it to the list */ … … 1015 1010 iface.createObject(); 1016 1011 /* remove the curly bracket at the end */ 1017 rc = iface->init(name, enmType, &Info);1018 if (SUCCEEDED( rc))1012 vrc = iface->init(name, enmType, &Info); 1013 if (SUCCEEDED(vrc)) 1019 1014 { 1020 1015 if (Info.fIsDefault) … … 1025 1020 else 1026 1021 { 1027 LogRelFunc(("HostNetworkInterface::init() -> %Rrc\n", rc));1028 AssertComRC( rc);1022 LogRelFunc(("HostNetworkInterface::init() -> %Rrc\n", vrc)); 1023 AssertComRC(vrc); 1029 1024 } 1030 1025 } … … 1036 1031 LogRelFunc(("failed to get device display name (0x%x)\n", hr)); 1037 1032 1038 return rc;1033 return vrc; 1039 1034 } 1040 1035 … … 1256 1251 #else 1257 1252 Bstr guid; 1258 HRESULT rc = pIf->COMGETTER(Id)(guid.asOutParam());1259 if (SUCCEEDED( rc))1253 HRESULT hrc = pIf->COMGETTER(Id)(guid.asOutParam()); 1254 if (SUCCEEDED(hrc)) 1260 1255 { 1261 1256 // ComPtr<VirtualBox> pVBox; 1262 // rc = pIf->getVirtualBox(pVBox.asOutParam());1263 // if (SUCCEEDED( rc))1257 // hrc = pIf->getVirtualBox(pVBox.asOutParam()); 1258 // if (SUCCEEDED(hrc)) 1264 1259 { 1265 1260 /* create a progress object */ … … 1267 1262 progress.createObject(); 1268 1263 // ComPtr<IHost> host; 1269 // HRESULT rc = pVBox->COMGETTER(Host)(host.asOutParam());1270 // if (SUCCEEDED( rc))1271 { 1272 rc = progress->init(pVBox, (IHostNetworkInterface*)pIf,1273 Bstr(NetIfWin::tr("Enabling Dynamic Ip Configuration")).raw(),1274 FALSE /* aCancelable */);1275 if (SUCCEEDED( rc))1276 { 1277 if (FAILED( rc)) returnrc;1264 // HRESULT hrc = pVBox->COMGETTER(Host)(host.asOutParam()); 1265 // if (SUCCEEDED(hrc)) 1266 { 1267 hrc = progress->init(pVBox, (IHostNetworkInterface*)pIf, 1268 Bstr(NetIfWin::tr("Enabling Dynamic Ip Configuration")).raw(), 1269 FALSE /* aCancelable */); 1270 if (SUCCEEDED(hrc)) 1271 { 1272 if (FAILED(hrc)) return hrc; 1278 1273 // progress.queryInterfaceTo(aProgress); 1279 1274 … … 1287 1282 d->u.StaticIP.IPNetMask = mask; 1288 1283 1289 rc = pVBox->i_startSVCHelperClient(IsUACEnabled() == TRUE /* aPrivileged */,1290 netIfNetworkInterfaceHelperClient,1291 static_cast<void *>(d),1292 progress);1284 hrc = pVBox->i_startSVCHelperClient(IsUACEnabled() == TRUE /* aPrivileged */, 1285 netIfNetworkInterfaceHelperClient, 1286 static_cast<void *>(d), 1287 progress); 1293 1288 /* d is now owned by netIfNetworkInterfaceHelperClient(), no need to delete one here */ 1294 1289 1295 if (SUCCEEDED( rc))1290 if (SUCCEEDED(hrc)) 1296 1291 { 1297 1292 progress->WaitForCompletion(-1); … … 1302 1297 } 1303 1298 1304 return SUCCEEDED( rc) ? VINF_SUCCESS : VERR_GENERAL_FAILURE;1299 return SUCCEEDED(hrc) ? VINF_SUCCESS : VERR_GENERAL_FAILURE; 1305 1300 #endif 1306 1301 } … … 1314 1309 #else 1315 1310 Bstr guid; 1316 HRESULT rc = pIf->COMGETTER(Id)(guid.asOutParam());1317 if (SUCCEEDED( rc))1311 HRESULT hrc = pIf->COMGETTER(Id)(guid.asOutParam()); 1312 if (SUCCEEDED(hrc)) 1318 1313 { 1319 1314 // ComPtr<VirtualBox> pVBox; 1320 // rc = pIf->getVirtualBox(pVBox.asOutParam());1321 // if (SUCCEEDED( rc))1315 // hrc = pIf->getVirtualBox(pVBox.asOutParam()); 1316 // if (SUCCEEDED(hrc)) 1322 1317 { 1323 1318 /* create a progress object */ … … 1325 1320 progress.createObject(); 1326 1321 // ComPtr<IHost> host; 1327 // HRESULT rc = pVBox->COMGETTER(Host)(host.asOutParam());1328 // if (SUCCEEDED( rc))1329 { 1330 rc = progress->init(pVBox, (IHostNetworkInterface*)pIf,1331 Bstr(NetIfWin::tr("Enabling Dynamic Ip Configuration")).raw(),1332 FALSE /* aCancelable */);1333 if (SUCCEEDED( rc))1334 { 1335 if (FAILED( rc)) returnrc;1322 // HRESULT hrc = pVBox->COMGETTER(Host)(host.asOutParam()); 1323 // if (SUCCEEDED(hrc)) 1324 { 1325 hrc = progress->init(pVBox, (IHostNetworkInterface*)pIf, 1326 Bstr(NetIfWin::tr("Enabling Dynamic Ip Configuration")).raw(), 1327 FALSE /* aCancelable */); 1328 if (SUCCEEDED(hrc)) 1329 { 1330 if (FAILED(hrc)) return hrc; 1336 1331 // progress.queryInterfaceTo(aProgress); 1337 1332 … … 1345 1340 d->u.StaticIPV6.IPV6NetMaskLength = aIPV6MaskPrefixLength; 1346 1341 1347 rc = pVBox->i_startSVCHelperClient(IsUACEnabled() == TRUE /* aPrivileged */,1348 netIfNetworkInterfaceHelperClient,1349 static_cast<void *>(d),1350 progress);1342 hrc = pVBox->i_startSVCHelperClient(IsUACEnabled() == TRUE /* aPrivileged */, 1343 netIfNetworkInterfaceHelperClient, 1344 static_cast<void *>(d), 1345 progress); 1351 1346 /* d is now owned by netIfNetworkInterfaceHelperClient(), no need to delete one here */ 1352 1347 1353 if (SUCCEEDED( rc))1348 if (SUCCEEDED(hrc)) 1354 1349 { 1355 1350 progress->WaitForCompletion(-1); … … 1360 1355 } 1361 1356 1362 return SUCCEEDED( rc) ? VINF_SUCCESS : VERR_GENERAL_FAILURE;1357 return SUCCEEDED(hrc) ? VINF_SUCCESS : VERR_GENERAL_FAILURE; 1363 1358 #endif 1364 1359 } … … 1369 1364 return VERR_NOT_IMPLEMENTED; 1370 1365 #else 1371 HRESULT rc;1366 HRESULT hrc; 1372 1367 Bstr guid; 1373 rc = pIf->COMGETTER(Id)(guid.asOutParam());1374 if (SUCCEEDED( rc))1368 hrc = pIf->COMGETTER(Id)(guid.asOutParam()); 1369 if (SUCCEEDED(hrc)) 1375 1370 { 1376 1371 // ComPtr<VirtualBox> pVBox; 1377 // rc = pIf->getVirtualBox(pVBox.asOutParam());1378 // if (SUCCEEDED( rc))1372 // hrc = pIf->getVirtualBox(pVBox.asOutParam()); 1373 // if (SUCCEEDED(hrc)) 1379 1374 { 1380 1375 /* create a progress object */ … … 1382 1377 progress.createObject(); 1383 1378 // ComPtr<IHost> host; 1384 // HRESULT rc = pVBox->COMGETTER(Host)(host.asOutParam());1385 // if (SUCCEEDED( rc))1386 { 1387 rc = progress->init(pVBox, (IHostNetworkInterface*)pIf,1388 Bstr(NetIfWin::tr("Enabling Dynamic Ip Configuration")).raw(),1389 FALSE /* aCancelable */);1390 if (SUCCEEDED( rc))1391 { 1392 if (FAILED( rc)) returnrc;1379 // HRESULT hrc = pVBox->COMGETTER(Host)(host.asOutParam()); 1380 // if (SUCCEEDED(hrc)) 1381 { 1382 hrc = progress->init(pVBox, (IHostNetworkInterface*)pIf, 1383 Bstr(NetIfWin::tr("Enabling Dynamic Ip Configuration")).raw(), 1384 FALSE /* aCancelable */); 1385 if (SUCCEEDED(hrc)) 1386 { 1387 if (FAILED(hrc)) return hrc; 1393 1388 // progress.queryInterfaceTo(aProgress); 1394 1389 … … 1400 1395 d->iface = pIf; 1401 1396 1402 rc = pVBox->i_startSVCHelperClient(IsUACEnabled() == TRUE /* aPrivileged */,1403 netIfNetworkInterfaceHelperClient,1404 static_cast<void *>(d),1405 progress);1397 hrc = pVBox->i_startSVCHelperClient(IsUACEnabled() == TRUE /* aPrivileged */, 1398 netIfNetworkInterfaceHelperClient, 1399 static_cast<void *>(d), 1400 progress); 1406 1401 /* d is now owned by netIfNetworkInterfaceHelperClient(), no need to delete one here */ 1407 1402 1408 if (SUCCEEDED( rc))1403 if (SUCCEEDED(hrc)) 1409 1404 { 1410 1405 progress->WaitForCompletion(-1); … … 1415 1410 } 1416 1411 1417 return SUCCEEDED( rc) ? VINF_SUCCESS : VERR_GENERAL_FAILURE;1412 return SUCCEEDED(hrc) ? VINF_SUCCESS : VERR_GENERAL_FAILURE; 1418 1413 #endif 1419 1414 } … … 1424 1419 return VERR_NOT_IMPLEMENTED; 1425 1420 #else 1426 HRESULT rc;1421 HRESULT hrc; 1427 1422 Bstr guid; 1428 rc = pIf->COMGETTER(Id)(guid.asOutParam());1429 if (SUCCEEDED( rc))1423 hrc = pIf->COMGETTER(Id)(guid.asOutParam()); 1424 if (SUCCEEDED(hrc)) 1430 1425 { 1431 1426 // ComPtr<VirtualBox> pVBox; 1432 // rc = pIf->getVirtualBox(pVBox.asOutParam());1433 // if (SUCCEEDED( rc))1427 // hrc = pIf->getVirtualBox(pVBox.asOutParam()); 1428 // if (SUCCEEDED(hrc)) 1434 1429 { 1435 1430 /* create a progress object */ … … 1437 1432 progress.createObject(); 1438 1433 // ComPtr<IHost> host; 1439 // HRESULT rc = pVBox->COMGETTER(Host)(host.asOutParam());1440 // if (SUCCEEDED( rc))1441 { 1442 rc = progress->init(pVBox, (IHostNetworkInterface*)pIf,1443 Bstr(NetIfWin::tr("Enabling Dynamic Ip Configuration")).raw(),1444 FALSE /* aCancelable */);1445 if (SUCCEEDED( rc))1446 { 1447 if (FAILED( rc)) returnrc;1434 // HRESULT hrc = pVBox->COMGETTER(Host)(host.asOutParam()); 1435 // if (SUCCEEDED(hrc)) 1436 { 1437 hrc = progress->init(pVBox, (IHostNetworkInterface*)pIf, 1438 Bstr(NetIfWin::tr("Enabling Dynamic Ip Configuration")).raw(), 1439 FALSE /* aCancelable */); 1440 if (SUCCEEDED(hrc)) 1441 { 1442 if (FAILED(hrc)) return hrc; 1448 1443 // progress.queryInterfaceTo(aProgress); 1449 1444 … … 1455 1450 d->iface = pIf; 1456 1451 1457 rc = pVBox->i_startSVCHelperClient(IsUACEnabled() == TRUE /* aPrivileged */,1458 netIfNetworkInterfaceHelperClient,1459 static_cast<void *>(d),1460 progress);1452 hrc = pVBox->i_startSVCHelperClient(IsUACEnabled() == TRUE /* aPrivileged */, 1453 netIfNetworkInterfaceHelperClient, 1454 static_cast<void *>(d), 1455 progress); 1461 1456 /* d is now owned by netIfNetworkInterfaceHelperClient(), no need to delete one here */ 1462 1457 1463 if (SUCCEEDED( rc))1458 if (SUCCEEDED(hrc)) 1464 1459 { 1465 1460 progress->WaitForCompletion(-1); … … 1470 1465 } 1471 1466 1472 return SUCCEEDED( rc) ? VINF_SUCCESS : VERR_GENERAL_FAILURE;1467 return SUCCEEDED(hrc) ? VINF_SUCCESS : VERR_GENERAL_FAILURE; 1473 1468 #endif 1474 1469 } … … 1989 1984 ComObjPtr<HostNetworkInterface> iface; 1990 1985 iface.createObject(); 1991 HostNetworkInterfaceType enmType = 1992 _wcsnicmp((*it).pHwId, L"sun_VBoxNetAdp", sizeof(L"sun_VBoxNetAdp")/2) ? 1993 HostNetworkInterfaceType_Bridged : HostNetworkInterfaceType_HostOnly; 1986 HostNetworkInterfaceType enmType = _wcsnicmp((*it).pHwId, L"sun_VBoxNetAdp", sizeof(L"sun_VBoxNetAdp") / 2) 1987 ? HostNetworkInterfaceType_Bridged : HostNetworkInterfaceType_HostOnly; 1994 1988 netIfLog(("Adding %ls as %s\n", (*it).pName, 1995 1989 enmType == HostNetworkInterfaceType_Bridged ? "bridged" : 1996 1990 enmType == HostNetworkInterfaceType_HostOnly ? "host-only" : "unknown")); 1997 intrc = iface->init((*it).pName, enmType, &info);1998 if (FAILED( rc))1999 LogRelFunc(("HostNetworkInterface::init() -> %Rrc\n", rc));1991 HRESULT hrc = iface->init((*it).pName, enmType, &info); 1992 if (FAILED(hrc)) 1993 LogRelFunc(("HostNetworkInterface::init() -> %Rrc\n", hrc)); 2000 1994 else 2001 1995 { -
trunk/src/VBox/Main/src-server/win/PerformanceWin.cpp
r98103 r98292 120 120 121 121 uint64_t cb; 122 int rc = RTSystemQueryTotalRam(&cb);123 if (RT_FAILURE( rc))122 int vrc = RTSystemQueryTotalRam(&cb); 123 if (RT_FAILURE(vrc)) 124 124 totalRAM = 0; 125 125 else … … 138 138 139 139 uint64_t user, kernel, idle, total; 140 int rc = getRawHostCpuLoad(&user, &kernel, &idle);141 if (RT_FAILURE( rc))142 return rc;140 int vrc = getRawHostCpuLoad(&user, &kernel, &idle); 141 if (RT_FAILURE(vrc)) 142 return vrc; 143 143 total = user + kernel + idle; 144 144 … … 149 149 mProcessStats.clear(); 150 150 151 for (it = processes.begin(); it != processes.end() && RT_SUCCESS( rc); ++it)151 for (it = processes.begin(); it != processes.end() && RT_SUCCESS(vrc); ++it) 152 152 { 153 153 RTPROCESS process = it->first; 154 HANDLE h = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 155 FALSE, process); 154 HANDLE h = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, process); 156 155 157 156 if (!h) … … 159 158 dwError = GetLastError(); 160 159 Log (("OpenProcess() -> 0x%x\n", dwError)); 161 rc = RTErrConvertFromWin32(dwError);160 vrc = RTErrConvertFromWin32(dwError); 162 161 break; 163 162 } … … 172 171 dwError = GetLastError(); 173 172 Log (("GetProcessTimes() -> 0x%x\n", dwError)); 174 rc = RTErrConvertFromWin32(dwError);173 vrc = RTErrConvertFromWin32(dwError); 175 174 } 176 175 else … … 181 180 } 182 181 } 183 if (RT_SUCCESS( rc) && (it->second & COLLECT_RAM_USAGE) != 0)182 if (RT_SUCCESS(vrc) && (it->second & COLLECT_RAM_USAGE) != 0) 184 183 { 185 184 PROCESS_MEMORY_COUNTERS pmc; … … 188 187 dwError = GetLastError(); 189 188 Log (("GetProcessMemoryInfo() -> 0x%x\n", dwError)); 190 rc = RTErrConvertFromWin32(dwError);189 vrc = RTErrConvertFromWin32(dwError); 191 190 } 192 191 else … … 199 198 LogFlowThisFuncLeave(); 200 199 201 return rc;200 return vrc; 202 201 } 203 202 … … 311 310 AssertReturn(totalRAM, VERR_INTERNAL_ERROR); 312 311 uint64_t cb; 313 int rc = RTSystemQueryAvailableRam(&cb);314 if (RT_SUCCESS( rc))312 int vrc = RTSystemQueryAvailableRam(&cb); 313 if (RT_SUCCESS(vrc)) 315 314 { 316 315 *total = totalRAM; … … 318 317 *used = *total - *available; 319 318 } 320 return rc;319 return vrc; 321 320 } 322 321 -
trunk/src/VBox/Main/src-server/win/USBProxyBackendWindows.cpp
r98103 r98292 80 80 * Initialize the USB lib and stuff. 81 81 */ 82 int rc = USBLibInit();83 if (RT_SUCCESS( rc))82 int vrc = USBLibInit(); 83 if (RT_SUCCESS(vrc)) 84 84 { 85 85 /* 86 86 * Start the poller thread. 87 87 */ 88 rc = start();89 if (RT_SUCCESS( rc))88 vrc = start(); 89 if (RT_SUCCESS(vrc)) 90 90 { 91 91 LogFlowThisFunc(("returns successfully\n")); … … 99 99 mhEventInterrupt = INVALID_HANDLE_VALUE; 100 100 101 LogFlowThisFunc(("returns failure!!! ( rc=%Rrc)\n",rc));102 return rc;101 LogFlowThisFunc(("returns failure!!! (vrc=%Rrc)\n", vrc)); 102 return vrc; 103 103 } 104 104 … … 124 124 * Terminate the library... 125 125 */ 126 int rc = USBLibTerm();127 AssertRC( rc);126 int vrc = USBLibTerm(); 127 AssertRC(vrc); 128 128 USBProxyBackend::uninit(); 129 129 } … … 184 184 } 185 185 186 int rc = USBLibRunFilters();187 if (!RT_SUCCESS( rc))186 int vrc = USBLibRunFilters(); 187 if (!RT_SUCCESS(vrc)) 188 188 { 189 189 AssertMsgFailed(("Run Filters failed\n")); 190 190 USBLibRemoveFilter(pvId); 191 return rc;191 return vrc; 192 192 } 193 193 … … 226 226 } 227 227 228 int rc = USBLibRunFilters();229 if (!RT_SUCCESS( rc))228 int vrc = USBLibRunFilters(); 229 if (!RT_SUCCESS(vrc)) 230 230 { 231 231 AssertMsgFailed(("Run Filters failed\n")); 232 232 USBLibRemoveFilter(pvId); 233 return rc;233 return vrc; 234 234 } 235 235 -
trunk/src/VBox/Main/src-server/win/svcmain.cpp
r98103 r98292 168 168 { 169 169 char szDest[1024]; 170 int rc = RTLogQueryDestinations(pReleaseLogger, szDest, sizeof(szDest));171 if (RT_SUCCESS( rc))170 int vrc = RTLogQueryDestinations(pReleaseLogger, szDest, sizeof(szDest)); 171 if (RT_SUCCESS(vrc)) 172 172 { 173 rc = RTStrCat(szDest, sizeof(szDest), " nohistory");174 if (RT_SUCCESS( rc))173 vrc = RTStrCat(szDest, sizeof(szDest), " nohistory"); 174 if (RT_SUCCESS(vrc)) 175 175 { 176 rc = RTLogDestinations(pReleaseLogger, szDest);177 AssertRC( rc);176 vrc = RTLogDestinations(pReleaseLogger, szDest); 177 AssertRC(vrc); 178 178 } 179 179 } … … 738 738 static int CreateMainWindow() 739 739 { 740 int rc = VINF_SUCCESS;740 int vrc = VINF_SUCCESS; 741 741 Assert(g_hMainWindow == NULL); 742 742 … … 759 759 { 760 760 LogRel(("Failed to register window class for session monitoring\n")); 761 rc = VERR_NOT_SUPPORTED;761 vrc = VERR_NOT_SUPPORTED; 762 762 } 763 763 else … … 769 769 { 770 770 LogRel(("Failed to create window for session monitoring\n")); 771 rc = VERR_NOT_SUPPORTED;772 } 773 } 774 return rc;771 vrc = VERR_NOT_SUPPORTED; 772 } 773 } 774 return vrc; 775 775 } 776 776 … … 811 811 const char *signame; 812 812 char namebuf[48]; 813 // int rc;813 // int vrc; 814 814 815 815 if (dwCtrlType < RT_ELEMENTS(ctrl_event_names)) … … 1065 1065 vrc = RTPathAppend(szLogFile, sizeof(szLogFile), "VBoxSVC.log"); 1066 1066 if (RT_FAILURE(vrc)) 1067 return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to construct release log filename, rc=%Rrc", vrc);1067 return RTMsgErrorExit(RTEXITCODE_FAILURE, "failed to construct release log filename, vrc=%Rrc", vrc); 1068 1068 pszLogFile = szLogFile; 1069 1069 }
Note:
See TracChangeset
for help on using the changeset viewer.