Changeset 94912 in vbox for trunk/src/VBox/Main/src-all
- Timestamp:
- May 8, 2022 7:05:31 PM (3 years ago)
- Location:
- trunk/src/VBox/Main/src-all
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-all/AuthLibrary.cpp
r93115 r94912 75 75 /* Use a separate thread because external modules might need a lot of stack space. */ 76 76 RTTHREAD thread = NIL_RTTHREAD; 77 int rc = RTThreadCreate(&thread, authThread, pCtx, 512*_1K,78 RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, "VRDEAuth");79 LogFlowFunc(("RTThreadCreate %Rrc\n", rc));80 81 if (RT_SUCCESS( rc))82 { 83 rc = RTThreadWait(thread, RT_INDEFINITE_WAIT, NULL);84 LogFlowFunc(("RTThreadWait %Rrc\n", rc));85 } 86 87 if (RT_SUCCESS( rc))77 int vrc = RTThreadCreate(&thread, authThread, pCtx, 512*_1K, 78 RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, "VRDEAuth"); 79 LogFlowFunc(("RTThreadCreate %Rrc\n", vrc)); 80 81 if (RT_SUCCESS(vrc)) 82 { 83 vrc = RTThreadWait(thread, RT_INDEFINITE_WAIT, NULL); 84 LogFlowFunc(("RTThreadWait %Rrc\n", vrc)); 85 } 86 87 if (RT_SUCCESS(vrc)) 88 88 { 89 89 /* Only update the result if the thread finished without errors. */ … … 92 92 else 93 93 { 94 LogRel(("AUTH: Unable to execute the auth thread %Rrc\n", rc));94 LogRel(("AUTH: Unable to execute the auth thread %Rrc\n", vrc)); 95 95 } 96 96 … … 105 105 LogRel(("AUTH: Loading external authentication library '%s'\n", pszLibrary)); 106 106 107 int rc;107 int vrc; 108 108 if (RTPathHavePath(pszLibrary)) 109 rc = RTLdrLoad(pszLibrary, &pAuthLibCtx->hAuthLibrary);109 vrc = RTLdrLoad(pszLibrary, &pAuthLibCtx->hAuthLibrary); 110 110 else 111 111 { 112 rc = RTLdrLoadAppPriv(pszLibrary, &pAuthLibCtx->hAuthLibrary);113 if (RT_FAILURE( rc))112 vrc = RTLdrLoadAppPriv(pszLibrary, &pAuthLibCtx->hAuthLibrary); 113 if (RT_FAILURE(vrc)) 114 114 { 115 115 /* Backward compatibility with old default 'VRDPAuth' name. … … 119 119 { 120 120 LogRel(("AUTH: Loading external authentication library 'VBoxAuth'\n")); 121 rc = RTLdrLoadAppPriv("VBoxAuth", &pAuthLibCtx->hAuthLibrary);121 vrc = RTLdrLoadAppPriv("VBoxAuth", &pAuthLibCtx->hAuthLibrary); 122 122 } 123 123 } 124 124 } 125 125 126 if (RT_FAILURE( rc))127 { 128 LogRel(("AUTH: Failed to load external authentication library: %Rrc\n", rc));126 if (RT_FAILURE(vrc)) 127 { 128 LogRel(("AUTH: Failed to load external authentication library: %Rrc\n", vrc)); 129 129 pAuthLibCtx->hAuthLibrary = NIL_RTLDRMOD; 130 130 } 131 131 132 if (RT_SUCCESS( rc))132 if (RT_SUCCESS(vrc)) 133 133 { 134 134 typedef struct AuthEntryInfoStruct … … 152 152 *pEntryInfo->ppvAddress = NULL; 153 153 154 int rc2 = RTLdrGetSymbol(pAuthLibCtx->hAuthLibrary, pEntryInfo->pszName, pEntryInfo->ppvAddress);155 if (RT_SUCCESS( rc2))154 int vrc2 = RTLdrGetSymbol(pAuthLibCtx->hAuthLibrary, pEntryInfo->pszName, pEntryInfo->ppvAddress); 155 if (RT_SUCCESS(vrc2)) 156 156 { 157 157 /* Found an entry point. */ 158 158 LogRel(("AUTH: Using entry point '%s'\n", pEntryInfo->pszName)); 159 rc = VINF_SUCCESS;159 vrc = VINF_SUCCESS; 160 160 break; 161 161 } 162 162 163 if ( rc2 != VERR_SYMBOL_NOT_FOUND)164 LogRel(("AUTH: Could not resolve import '%s': %Rrc\n", pEntryInfo->pszName, rc2));165 166 rc =rc2;163 if (vrc2 != VERR_SYMBOL_NOT_FOUND) 164 LogRel(("AUTH: Could not resolve import '%s': %Rrc\n", pEntryInfo->pszName, vrc2)); 165 166 vrc = vrc2; 167 167 168 168 pEntryInfo++; … … 170 170 } 171 171 172 if (RT_FAILURE( rc))172 if (RT_FAILURE(vrc)) 173 173 AuthLibUnload(pAuthLibCtx); 174 174 175 return rc;175 return vrc; 176 176 } 177 177 -
trunk/src/VBox/Main/src-all/AutoCaller.cpp
r93115 r94912 134 134 AutoWriteLock stateLock(mStateLock COMMA_LOCKVAL_SRC_POS); 135 135 136 HRESULT rc = E_ACCESSDENIED;136 HRESULT hrc = E_ACCESSDENIED; 137 137 138 138 if (mState == Ready || (aLimited && mState == Limited)) … … 140 140 /* if Ready or allows Limited, increase the number of callers */ 141 141 ++mCallers; 142 rc = S_OK;142 hrc = S_OK; 143 143 } 144 144 else … … 149 149 /* Called from the same thread that is doing AutoInitSpan or 150 150 * AutoUninitSpan, just succeed */ 151 rc = S_OK;151 hrc = S_OK; 152 152 } 153 153 else if (mState == InInit) … … 188 188 189 189 if (mState == Ready || (aLimited && mState == Limited)) 190 rc = S_OK;190 hrc = S_OK; 191 191 else 192 192 { … … 202 202 } 203 203 204 if (FAILED( rc))204 if (FAILED(hrc)) 205 205 { 206 206 if (mState == Limited) 207 rc = mObj->setError(rc, AutoCallerCtx::tr("The object functionality is limited"));207 hrc = mObj->setError(hrc, AutoCallerCtx::tr("The object functionality is limited")); 208 208 else if (FAILED(mFailedRC) && mFailedRC != E_ACCESSDENIED) 209 209 { … … 211 211 if (mpFailedEI) 212 212 ErrorInfoKeeper eik(*mpFailedEI); 213 rc = mFailedRC;213 hrc = mFailedRC; 214 214 } 215 215 else 216 rc = mObj->setError(rc, AutoCallerCtx::tr("The object is not ready"));217 } 218 219 return rc;216 hrc = mObj->setError(hrc, AutoCallerCtx::tr("The object is not ready")); 217 } 218 219 return hrc; 220 220 } 221 221 -
trunk/src/VBox/Main/src-all/CryptoUtils.cpp
r94793 r94912 141 141 142 142 #ifdef VBOX_COM_INPROC 143 int rc = m_pVMM->pfnSSMR3Open(strFilename.c_str(), NULL /*pStreamOps*/, NULL /*pvStreamOps*/,144 0 /*fFlags*/, &m_pSsm);145 #else 146 int rc = SSMR3Open(strFilename.c_str(), NULL /*pStreamOps*/, NULL /*pvStreamOps*/,147 0 /*fFlags*/, &m_pSsm);148 #endif 149 if ( RT_SUCCESS( rc)143 int vrc = m_pVMM->pfnSSMR3Open(strFilename.c_str(), NULL /*pStreamOps*/, NULL /*pvStreamOps*/, 144 0 /*fFlags*/, &m_pSsm); 145 #else 146 int vrc = SSMR3Open(strFilename.c_str(), NULL /*pStreamOps*/, NULL /*pvStreamOps*/, 147 0 /*fFlags*/, &m_pSsm); 148 #endif 149 if ( RT_SUCCESS(vrc) 150 150 && ppSsmHandle) 151 151 *ppSsmHandle = m_pSsm; 152 152 153 return rc;154 } 155 156 int rc = VINF_SUCCESS;153 return vrc; 154 } 155 156 int vrc = VINF_SUCCESS; 157 157 if (!m_pCryptoIf) 158 158 { 159 159 #ifdef VBOX_COM_INPROC 160 rc = m_pParent->i_retainCryptoIf(&m_pCryptoIf);161 if (RT_FAILURE( rc))162 return rc;160 vrc = m_pParent->i_retainCryptoIf(&m_pCryptoIf); 161 if (RT_FAILURE(vrc)) 162 return vrc; 163 163 #else 164 164 HRESULT hrc = m_pParent->i_retainCryptoIf(&m_pCryptoIf); … … 169 169 170 170 SecretKey *pKey; 171 rc = m_pKeyStore->retainSecretKey(m_strKeyId, &pKey);172 if (RT_SUCCESS( rc))171 vrc = m_pKeyStore->retainSecretKey(m_strKeyId, &pKey); 172 if (RT_SUCCESS(vrc)) 173 173 { 174 174 RTVFSFILE hVfsFileSsm = NIL_RTVFSFILE; … … 177 177 : RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE; 178 178 179 rc = RTVfsFileOpenNormal(strFilename.c_str(), fOpen, &hVfsFileSsm);180 if (RT_SUCCESS( rc))179 vrc = RTVfsFileOpenNormal(strFilename.c_str(), fOpen, &hVfsFileSsm); 180 if (RT_SUCCESS(vrc)) 181 181 { 182 182 const char *pszPassword = (const char *)pKey->getKeyBuffer(); 183 183 184 rc = m_pCryptoIf->pfnCryptoFileFromVfsFile(hVfsFileSsm, m_strKeyStore.c_str(), pszPassword, &m_hVfsFile);185 if (RT_SUCCESS( rc))184 vrc = m_pCryptoIf->pfnCryptoFileFromVfsFile(hVfsFileSsm, m_strKeyStore.c_str(), pszPassword, &m_hVfsFile); 185 if (RT_SUCCESS(vrc)) 186 186 { 187 187 #ifdef VBOX_COM_INPROC 188 rc = m_pVMM->pfnSSMR3Open(NULL /*pszFilename*/, &m_StrmOps, this, 0 /*fFlags*/, &m_pSsm);189 #else 190 rc = SSMR3Open(NULL /*pszFilename*/, &m_StrmOps, this, 0 /*fFlags*/, &m_pSsm);191 #endif 192 if ( RT_SUCCESS( rc)188 vrc = m_pVMM->pfnSSMR3Open(NULL /*pszFilename*/, &m_StrmOps, this, 0 /*fFlags*/, &m_pSsm); 189 #else 190 vrc = SSMR3Open(NULL /*pszFilename*/, &m_StrmOps, this, 0 /*fFlags*/, &m_pSsm); 191 #endif 192 if ( RT_SUCCESS(vrc) 193 193 && ppSsmHandle) 194 194 *ppSsmHandle = m_pSsm; 195 195 196 if (RT_FAILURE( rc))196 if (RT_FAILURE(vrc)) 197 197 { 198 198 RTVfsFileRelease(m_hVfsFile); … … 208 208 } 209 209 210 return rc;210 return vrc; 211 211 } 212 212 … … 218 218 uint32_t fOpen = RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE; 219 219 220 int rc = RTVfsFileOpenNormal(strFilename.c_str(), fOpen, &hVfsFileSsm);221 if (RT_SUCCESS( rc))220 int vrc = RTVfsFileOpenNormal(strFilename.c_str(), fOpen, &hVfsFileSsm); 221 if (RT_SUCCESS(vrc)) 222 222 { 223 223 if (m_strKeyId.isNotEmpty()) … … 225 225 /* File is encrypted, set up machinery. */ 226 226 if (!m_pCryptoIf) 227 rc = m_pParent->i_retainCryptoIf(&m_pCryptoIf);228 229 if (RT_SUCCESS( rc))227 vrc = m_pParent->i_retainCryptoIf(&m_pCryptoIf); 228 229 if (RT_SUCCESS(vrc)) 230 230 { 231 231 SecretKey *pKey; 232 rc = m_pKeyStore->retainSecretKey(m_strKeyId, &pKey);233 if (RT_SUCCESS( rc))232 vrc = m_pKeyStore->retainSecretKey(m_strKeyId, &pKey); 233 if (RT_SUCCESS(vrc)) 234 234 { 235 235 const char *pszPassword = (const char *)pKey->getKeyBuffer(); 236 236 237 rc = m_pCryptoIf->pfnCryptoFileFromVfsFile(hVfsFileSsm, m_strKeyStore.c_str(), pszPassword, &m_hVfsFile);237 vrc = m_pCryptoIf->pfnCryptoFileFromVfsFile(hVfsFileSsm, m_strKeyStore.c_str(), pszPassword, &m_hVfsFile); 238 238 pKey->release(); 239 239 } … … 247 247 } 248 248 249 return rc;249 return vrc; 250 250 #else 251 251 RT_NOREF(strFilename); … … 261 261 uint32_t fOpen = RTFILE_O_READWRITE | RTFILE_O_CREATE_REPLACE | RTFILE_O_DENY_WRITE; 262 262 263 int rc = RTVfsFileOpenNormal(strFilename.c_str(), fOpen, &hVfsFileSsm);264 if (RT_SUCCESS( rc))263 int vrc = RTVfsFileOpenNormal(strFilename.c_str(), fOpen, &hVfsFileSsm); 264 if (RT_SUCCESS(vrc)) 265 265 { 266 266 if (m_strKeyId.isNotEmpty()) … … 268 268 /* File is encrypted, set up machinery. */ 269 269 if (!m_pCryptoIf) 270 rc = m_pParent->i_retainCryptoIf(&m_pCryptoIf);271 272 if (RT_SUCCESS( rc))270 vrc = m_pParent->i_retainCryptoIf(&m_pCryptoIf); 271 272 if (RT_SUCCESS(vrc)) 273 273 { 274 274 SecretKey *pKey; 275 rc = m_pKeyStore->retainSecretKey(m_strKeyId, &pKey);276 if (RT_SUCCESS( rc))275 vrc = m_pKeyStore->retainSecretKey(m_strKeyId, &pKey); 276 if (RT_SUCCESS(vrc)) 277 277 { 278 278 const char *pszPassword = (const char *)pKey->getKeyBuffer(); 279 279 280 rc = m_pCryptoIf->pfnCryptoFileFromVfsFile(hVfsFileSsm, m_strKeyStore.c_str(), pszPassword, &m_hVfsFile);280 vrc = m_pCryptoIf->pfnCryptoFileFromVfsFile(hVfsFileSsm, m_strKeyStore.c_str(), pszPassword, &m_hVfsFile); 281 281 pKey->release(); 282 282 } … … 284 284 /* Also release in success case because the encrypted file handle retained a new reference to it. */ 285 285 RTVfsFileRelease(hVfsFileSsm); 286 if (RT_FAILURE( rc))286 if (RT_FAILURE(vrc)) 287 287 RTFileDelete(strFilename.c_str()); 288 288 } … … 292 292 } 293 293 294 return rc;294 return vrc; 295 295 #else 296 296 RT_NOREF(strFilename); … … 315 315 { 316 316 #ifdef VBOX_COM_INPROC 317 int rc = m_pVMM->pfnSSMR3Close(m_pSsm);318 #else 319 int rc = SSMR3Close(m_pSsm);320 #endif 321 AssertRCReturn( rc,rc);317 int vrc = m_pVMM->pfnSSMR3Close(m_pSsm); 318 #else 319 int vrc = SSMR3Close(m_pSsm); 320 #endif 321 AssertRCReturn(vrc, vrc); 322 322 } 323 323 -
trunk/src/VBox/Main/src-all/DisplayPNGUtil.cpp
r93115 r94912 30 30 uint32_t cbPNG; 31 31 uint32_t cbAllocated; 32 int rc;32 int vrc; 33 33 } PNGWriteCtx; 34 34 … … 38 38 LogFlowFunc(("png_ptr %p, p %p, cb %d, pCtx %p\n", png_ptr, p, cb, pCtx)); 39 39 40 if (pCtx && RT_SUCCESS(pCtx-> rc))40 if (pCtx && RT_SUCCESS(pCtx->vrc)) 41 41 { 42 42 if (pCtx->cbAllocated - pCtx->cbPNG < cb) 43 43 { 44 44 uint32_t cbNew = pCtx->cbPNG + (uint32_t)cb; 45 AssertReturnVoidStmt(cbNew > pCtx->cbPNG && cbNew <= _1G, pCtx-> rc = VERR_TOO_MUCH_DATA);45 AssertReturnVoidStmt(cbNew > pCtx->cbPNG && cbNew <= _1G, pCtx->vrc = VERR_TOO_MUCH_DATA); 46 46 cbNew = RT_ALIGN_32(cbNew, 4096) + 4096; 47 47 … … 49 49 if (!pNew) 50 50 { 51 pCtx-> rc = VERR_NO_MEMORY;51 pCtx->vrc = VERR_NO_MEMORY; 52 52 return; 53 53 } … … 72 72 uint8_t fLimitSize) 73 73 { 74 int rc = VINF_SUCCESS;74 int vrc = VINF_SUCCESS; 75 75 76 76 uint8_t * volatile pu8Bitmap = NULL; /* gcc setjmp warning */ … … 115 115 else 116 116 { 117 rc = VERR_NO_MEMORY;117 vrc = VERR_NO_MEMORY; 118 118 } 119 119 } … … 121 121 LogFlowFunc(("%dx%d -> %dx%d\n", cx, cy, cxBitmap, cyBitmap)); 122 122 123 if (RT_SUCCESS( rc))123 if (RT_SUCCESS(vrc)) 124 124 { 125 125 png_bytep *row_pointers = (png_bytep *)RTMemAlloc(cyBitmap * sizeof(png_bytep)); … … 148 148 ctx.cbPNG = 0; 149 149 ctx.cbAllocated = 0; 150 ctx. rc = VINF_SUCCESS;150 ctx.vrc = VINF_SUCCESS; 151 151 152 152 png_set_write_fn(png_ptr, … … 177 177 png_write_end(png_ptr, info_ptr); 178 178 179 rc = ctx.rc;180 181 if (RT_SUCCESS( rc))179 vrc = ctx.vrc; 180 181 if (RT_SUCCESS(vrc)) 182 182 { 183 183 *ppu8PNG = ctx.pu8PNG; … … 190 190 else 191 191 { 192 rc = VERR_GENERAL_FAILURE; /* Something within libpng. */192 vrc = VERR_GENERAL_FAILURE; /* Something within libpng. */ 193 193 } 194 194 } 195 195 else 196 196 { 197 rc = VERR_NO_MEMORY;197 vrc = VERR_NO_MEMORY; 198 198 } 199 199 … … 203 203 else 204 204 { 205 rc = VERR_NO_MEMORY;205 vrc = VERR_NO_MEMORY; 206 206 } 207 207 … … 210 210 else 211 211 { 212 rc = VERR_NO_MEMORY;212 vrc = VERR_NO_MEMORY; 213 213 } 214 214 } … … 219 219 } 220 220 221 return rc;221 return vrc; 222 222 223 223 } -
trunk/src/VBox/Main/src-all/EventImpl.cpp
r93188 r94912 107 107 HRESULT VBoxEvent::init(IEventSource *aSource, VBoxEventType_T aType, BOOL aWaitable) 108 108 { 109 HRESULT rc = S_OK;110 111 109 AssertReturn(aSource != NULL, E_INVALIDARG); 112 110 … … 137 135 autoInitSpan.setSucceeded(); 138 136 139 return rc;137 return S_OK; 140 138 } 141 139 … … 259 257 { 260 258 m = new Data; 261 HRESULT rc = m->mEvent.createObject();259 HRESULT hrc = m->mEvent.createObject(); 262 260 BaseFinalConstruct(); 263 return rc;261 return hrc; 264 262 } 265 263 … … 279 277 HRESULT VBoxVetoEvent::init(IEventSource *aSource, VBoxEventType_T aType) 280 278 { 281 HRESULT rc = S_OK;282 279 // all veto events are waitable 283 rc = m->mEvent->init(aSource, aType, TRUE);284 if (FAILED( rc))285 return rc;280 HRESULT hrc = m->mEvent->init(aSource, aType, TRUE); 281 if (FAILED(hrc)) 282 return hrc; 286 283 287 284 AutoInitSpan autoInitSpan(this); … … 842 839 * We release lock here to allow modifying ops on EventSource inside callback. 843 840 */ 844 HRESULT rc = S_OK;841 HRESULT hrc = S_OK; 845 842 if (mListener) 846 843 { 847 844 aAlock.release(); 848 rc = mListener->HandleEvent(aEvent);845 hrc = mListener->HandleEvent(aEvent); 849 846 #ifdef RT_OS_WINDOWS 850 Assert( rc != RPC_E_WRONG_THREAD);847 Assert(hrc != RPC_E_WRONG_THREAD); 851 848 #endif 852 849 aAlock.acquire(); … … 854 851 if (aWaitable) 855 852 eventProcessed(aEvent, pit); 856 return rc;853 return hrc; 857 854 } 858 855 return enqueue(aEvent); … … 1024 1021 HRESULT EventSource::init() 1025 1022 { 1026 HRESULT rc = S_OK;1027 1028 1023 AutoInitSpan autoInitSpan(this); 1029 1024 AssertReturn(autoInitSpan.isOk(), E_FAIL); … … 1031 1026 /* Confirm a successful initialization */ 1032 1027 autoInitSpan.setSucceeded(); 1033 return rc;1028 return S_OK; 1034 1029 } 1035 1030 … … 1090 1085 HRESULT EventSource::unregisterListener(const ComPtr<IEventListener> &aListener) 1091 1086 { 1092 HRESULT rc = S_OK;;1087 HRESULT hrc = S_OK;; 1093 1088 1094 1089 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 1102 1097 // destructor removes refs from the event map 1103 1098 ::FireEventSourceChangedEvent(this, (IEventListener *)aListener, FALSE /*add*/); 1104 rc = S_OK;1099 hrc = S_OK; 1105 1100 } 1106 1101 else 1107 rc = setError(VBOX_E_OBJECT_NOT_FOUND,1108 tr("Listener was never registered"));1109 1110 return rc;1102 hrc = setError(VBOX_E_OBJECT_NOT_FOUND, 1103 tr("Listener was never registered")); 1104 1105 return hrc; 1111 1106 } 1112 1107 … … 1234 1229 1235 1230 Listeners::iterator it = m->mListeners.find(aListener); 1236 HRESULT rc = S_OK;1231 HRESULT hrc = S_OK; 1237 1232 1238 1233 if (it != m->mListeners.end()) 1239 rc = it->second.obj()->dequeue(aEvent.asOutParam(), aTimeout, alock);1234 hrc = it->second.obj()->dequeue(aEvent.asOutParam(), aTimeout, alock); 1240 1235 else 1241 rc = setError(VBOX_E_OBJECT_NOT_FOUND,1242 tr("Listener was never registered"));1243 1244 if ( rc == VBOX_E_INVALID_OBJECT_STATE)1245 return setError( rc, tr("Listener must be passive"));1246 1247 return rc;1236 hrc = setError(VBOX_E_OBJECT_NOT_FOUND, 1237 tr("Listener was never registered")); 1238 1239 if (hrc == VBOX_E_INVALID_OBJECT_STATE) 1240 return setError(hrc, tr("Listener must be passive")); 1241 1242 return hrc; 1248 1243 } 1249 1244 … … 1482 1477 ComObjPtr<PassiveEventListener> listener; 1483 1478 1484 HRESULT rc = listener.createObject();1485 ComAssertMsgRet(SUCCEEDED( rc), (tr("Could not create wrapper object (%Rhrc)"),rc),1479 HRESULT hrc = listener.createObject(); 1480 ComAssertMsgRet(SUCCEEDED(hrc), (tr("Could not create wrapper object (%Rhrc)"), hrc), 1486 1481 E_FAIL); 1487 1482 listener.queryInterfaceTo(aListener.asOutParam()); … … 1494 1489 ComObjPtr<EventSourceAggregator> agg; 1495 1490 1496 HRESULT rc = agg.createObject();1497 ComAssertMsgRet(SUCCEEDED( rc), (tr("Could not create aggregator (%Rhrc)"),rc),1491 HRESULT hrc = agg.createObject(); 1492 ComAssertMsgRet(SUCCEEDED(hrc), (tr("Could not create aggregator (%Rhrc)"), hrc), 1498 1493 E_FAIL); 1499 1494 1500 rc = agg->init(aSubordinates);1501 if (FAILED( rc))1502 return rc;1495 hrc = agg->init(aSubordinates); 1496 if (FAILED(hrc)) 1497 return hrc; 1503 1498 1504 1499 agg.queryInterfaceTo(aResult.asOutParam()); … … 1508 1503 HRESULT EventSourceAggregator::init(const std::vector<ComPtr<IEventSource> > aSourcesIn) 1509 1504 { 1510 HRESULT rc;1511 1512 1505 AutoInitSpan autoInitSpan(this); 1513 1506 AssertReturn(autoInitSpan.isOk(), E_FAIL); 1514 1507 1515 rc = mSource.createObject();1516 ComAssertMsgRet(SUCCEEDED( rc), (tr("Could not create source (%Rhrc)"),rc),1508 HRESULT hrc = mSource.createObject(); 1509 ComAssertMsgRet(SUCCEEDED(hrc), (tr("Could not create source (%Rhrc)"), hrc), 1517 1510 E_FAIL); 1518 rc = mSource->init();1519 ComAssertMsgRet(SUCCEEDED( rc), (tr("Could not init source (%Rhrc)"),rc),1511 hrc = mSource->init(); 1512 ComAssertMsgRet(SUCCEEDED(hrc), (tr("Could not init source (%Rhrc)"), hrc), 1520 1513 E_FAIL); 1521 1514 … … 1529 1522 autoInitSpan.setSucceeded(); 1530 1523 1531 return rc;1524 return hrc; 1532 1525 } 1533 1526 … … 1554 1547 return autoCaller.rc(); 1555 1548 1556 HRESULT rc;1557 1558 1549 ComPtr<IEventListener> proxy; 1559 rc = createProxyListener(aListener, proxy.asOutParam());1560 if (FAILED( rc))1561 return rc;1550 HRESULT hrc = createProxyListener(aListener, proxy.asOutParam()); 1551 if (FAILED(hrc)) 1552 return hrc; 1562 1553 1563 1554 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 1567 1558 ComPtr<IEventSource> es = *it; 1568 1559 /* Register active proxy listener on real event source */ 1569 rc = es->RegisterListener(proxy, ComSafeArrayInArg(aInterested), TRUE);1560 hrc = es->RegisterListener(proxy, ComSafeArrayInArg(aInterested), TRUE); 1570 1561 } 1571 1562 /* And add real listener on our event source */ 1572 rc = mSource->RegisterListener(aListener, ComSafeArrayInArg(aInterested), aActive); 1573 1574 rc = S_OK; 1575 1576 return rc; 1563 hrc = mSource->RegisterListener(aListener, ComSafeArrayInArg(aInterested), aActive); 1564 1565 return S_OK; 1577 1566 } 1578 1567 … … 1585 1574 return autoCaller.rc(); 1586 1575 1587 HRESULT rc = S_OK;1588 1589 1576 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1590 1577 1591 1578 ComPtr<IEventListener> proxy; 1592 rc = getProxyListener(aListener, proxy.asOutParam());1593 if (FAILED( rc))1594 return rc;1579 HRESULT hrc = getProxyListener(aListener, proxy.asOutParam()); 1580 if (FAILED(hrc)) 1581 return hrc; 1595 1582 1596 1583 for (EventSourceList::const_iterator it = mEventSources.begin(); it != mEventSources.end(); … … 1598 1585 { 1599 1586 ComPtr<IEventSource> es = *it; 1600 rc = es->UnregisterListener(proxy);1601 } 1602 rc = mSource->UnregisterListener(aListener);1587 hrc = es->UnregisterListener(proxy); 1588 } 1589 hrc = mSource->UnregisterListener(aListener); 1603 1590 1604 1591 return removeProxyListener(aListener); … … 1617 1604 return autoCaller.rc(); 1618 1605 1619 HRESULT rc = S_OK;1620 1606 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1621 1607 /* Aggregator event source shall not have direct event firing, but we may … … 1625 1611 { 1626 1612 ComPtr<IEventSource> es = *it; 1627 rc = es->FireEvent(aEvent, aTimeout, aProcessed);1613 HRESULT hrc = es->FireEvent(aEvent, aTimeout, aProcessed); 1628 1614 /* Current behavior is that aggregator's FireEvent() always succeeds, 1629 1615 so that multiple event sources don't affect each other. */ 1630 NOREF( rc);1616 NOREF(hrc); 1631 1617 } 1632 1618 … … 1652 1638 ComObjPtr<ProxyEventListener> proxy; 1653 1639 1654 HRESULT rc = proxy.createObject();1655 ComAssertMsgRet(SUCCEEDED( rc), (tr("Could not create proxy (%Rhrc)"),rc),1640 HRESULT hrc = proxy.createObject(); 1641 ComAssertMsgRet(SUCCEEDED(hrc), (tr("Could not create proxy (%Rhrc)"), hrc), 1656 1642 E_FAIL); 1657 1643 1658 rc = proxy->init(mSource);1659 if (FAILED( rc))1660 return rc;1644 hrc = proxy->init(mSource); 1645 if (FAILED(hrc)) 1646 return hrc; 1661 1647 1662 1648 ProxyListenerMap::const_iterator it = mListenerProxies.find(aListener); -
trunk/src/VBox/Main/src-all/ExtPackManagerImpl.cpp
r94720 r94912 815 815 * Make sure the SUPR3Hardened API works (ignoring errors for now). 816 816 */ 817 int rc = SUPR3HardenedVerifyInit();818 if (RT_FAILURE( rc))819 LogRel(("SUPR3HardenedVerifyInit failed: %Rrc\n", rc));817 int vrc = SUPR3HardenedVerifyInit(); 818 if (RT_FAILURE(vrc)) 819 LogRel(("SUPR3HardenedVerifyInit failed: %Rrc\n", vrc)); 820 820 821 821 /* … … 829 829 { 830 830 char szPath[RTPATH_MAX]; 831 rc = RTPathJoin(szPath, sizeof(szPath), a_pszDir, "nls");832 if (RT_SUCCESS( rc))833 { 834 rc = RTPathAppend(szPath, sizeof(szPath), m->pReg->pszNlsBaseName);835 if (RT_SUCCESS( rc))831 vrc = RTPathJoin(szPath, sizeof(szPath), a_pszDir, "nls"); 832 if (RT_SUCCESS(vrc)) 833 { 834 vrc = RTPathAppend(szPath, sizeof(szPath), m->pReg->pszNlsBaseName); 835 if (RT_SUCCESS(vrc)) 836 836 { 837 rc = VirtualBoxTranslator::registerTranslation(szPath, false, &m->pTrComponent);838 if (RT_FAILURE( rc))837 vrc = VirtualBoxTranslator::registerTranslation(szPath, false, &m->pTrComponent); 838 if (RT_FAILURE(vrc)) 839 839 m->pTrComponent = NULL; 840 840 } … … 2341 2341 */ 2342 2342 char szBaseDir[RTPATH_MAX]; 2343 int rc = RTPathAppPrivateArchTop(szBaseDir, sizeof(szBaseDir));2344 AssertLogRelRCReturn( rc, E_FAIL);2345 rc = RTPathAppend(szBaseDir, sizeof(szBaseDir), VBOX_EXTPACK_INSTALL_DIR);2346 AssertLogRelRCReturn( rc, E_FAIL);2343 int vrc = RTPathAppPrivateArchTop(szBaseDir, sizeof(szBaseDir)); 2344 AssertLogRelRCReturn(vrc, E_FAIL); 2345 vrc = RTPathAppend(szBaseDir, sizeof(szBaseDir), VBOX_EXTPACK_INSTALL_DIR); 2346 AssertLogRelRCReturn(vrc, E_FAIL); 2347 2347 2348 2348 char szCertificatDir[RTPATH_MAX]; 2349 rc = RTPathAppPrivateNoArch(szCertificatDir, sizeof(szCertificatDir));2350 AssertLogRelRCReturn( rc, E_FAIL);2351 rc = RTPathAppend(szCertificatDir, sizeof(szCertificatDir), VBOX_EXTPACK_CERT_DIR);2352 AssertLogRelRCReturn( rc, E_FAIL);2349 vrc = RTPathAppPrivateNoArch(szCertificatDir, sizeof(szCertificatDir)); 2350 AssertLogRelRCReturn(vrc, E_FAIL); 2351 vrc = RTPathAppend(szCertificatDir, sizeof(szCertificatDir), VBOX_EXTPACK_CERT_DIR); 2352 AssertLogRelRCReturn(vrc, E_FAIL); 2353 2353 2354 2354 /* … … 2374 2374 HRESULT hrc = S_OK; 2375 2375 RTDIR hDir; 2376 intvrc = RTDirOpen(&hDir, szBaseDir);2376 vrc = RTDirOpen(&hDir, szBaseDir); 2377 2377 if (RT_SUCCESS(vrc)) 2378 2378 { -
trunk/src/VBox/Main/src-all/ExtPackUtil.cpp
r94714 r94912 341 341 */ 342 342 RTFSOBJINFO ObjInfo; 343 int rc = RTVfsFileQueryInfo(hVfsFile, &ObjInfo, RTFSOBJATTRADD_UNIX);344 if (RT_FAILURE( rc))345 return &(new RTCString)->printf(ExtPackUtil::tr("RTVfsFileQueryInfo failed: %Rrc"), rc);343 int vrc = RTVfsFileQueryInfo(hVfsFile, &ObjInfo, RTFSOBJATTRADD_UNIX); 344 if (RT_FAILURE(vrc)) 345 return &(new RTCString)->printf(ExtPackUtil::tr("RTVfsFileQueryInfo failed: %Rrc"), vrc); 346 346 if (a_pObjInfo) 347 347 *a_pObjInfo = ObjInfo; … … 359 359 360 360 /* Rewind to the start of the file. */ 361 rc = RTVfsFileSeek(hVfsFile, 0, RTFILE_SEEK_BEGIN, NULL);362 if (RT_FAILURE( rc))363 return &(new RTCString)->printf(ExtPackUtil::tr("RTVfsFileSeek(,0,BEGIN) failed: %Rrc"), rc);361 vrc = RTVfsFileSeek(hVfsFile, 0, RTFILE_SEEK_BEGIN, NULL); 362 if (RT_FAILURE(vrc)) 363 return &(new RTCString)->printf(ExtPackUtil::tr("RTVfsFileSeek(,0,BEGIN) failed: %Rrc"), vrc); 364 364 365 365 /* Allocate memory and read the file content into it. */ … … 369 369 370 370 RTCString *pstrErr = NULL; 371 rc = RTVfsFileRead(hVfsFile, pvFile, cbFile, NULL);372 if (RT_FAILURE( rc))373 pstrErr = &(new RTCString)->printf(ExtPackUtil::tr("RTVfsFileRead failed: %Rrc"), rc);371 vrc = RTVfsFileRead(hVfsFile, pvFile, cbFile, NULL); 372 if (RT_FAILURE(vrc)) 373 pstrErr = &(new RTCString)->printf(ExtPackUtil::tr("RTVfsFileRead failed: %Rrc"), vrc); 374 374 375 375 /* … … 377 377 */ 378 378 xml::Document Doc; 379 if (RT_SUCCESS( rc))379 if (RT_SUCCESS(vrc)) 380 380 { 381 381 xml::XmlMemParser Parser; … … 388 388 { 389 389 pstrErr = new RTCString(rErr.what()); 390 rc = VERR_PARSE_ERROR;390 vrc = VERR_PARSE_ERROR; 391 391 } 392 392 } … … 396 396 * Hand the xml doc over to the common code. 397 397 */ 398 if (RT_SUCCESS( rc))398 if (RT_SUCCESS(vrc)) 399 399 try 400 400 { … … 650 650 { 651 651 /** @todo Should probably restrict this to known build types (alpha, 652 * beta, r c, ++). */652 * beta, release candidate, ++). */ 653 653 do 654 654 pszVersion++; … … 708 708 * RTStrPrintfv wrapper. 709 709 * 710 * @returns @a rc711 * @param rcThe status code to return.710 * @returns @a vrc 711 * @param vrc The status code to return. 712 712 * @param pszError The error buffer. 713 713 * @param cbError The size of the buffer. … … 715 715 * @param ... Format arguments. 716 716 */ 717 static int vboxExtPackReturnError(int rc, char *pszError, size_t cbError, const char *pszFormat, ...)717 static int vboxExtPackReturnError(int vrc, char *pszError, size_t cbError, const char *pszFormat, ...) 718 718 { 719 719 va_list va; … … 721 721 RTStrPrintfV(pszError, cbError, pszFormat, va); 722 722 va_end(va); 723 return rc;723 return vrc; 724 724 } 725 725 … … 769 769 /** @todo drop this restriction after the old install interface is 770 770 * dropped. */ 771 int rc = VINF_SUCCESS;771 int vrc = VINF_SUCCESS; 772 772 if ( pszExtPackName 773 773 && !ExtPackDesc.strName.equalsIgnoreCase(pszExtPackName)) 774 rc = vboxExtPackReturnError(VERR_NOT_EQUAL, pszError, cbError,775 ExtPackUtil::tr("The name of the downloaded file and the name stored inside the extension pack does not match"776 " (xml='%s' file='%s')"), ExtPackDesc.strName.c_str(), pszExtPackName);777 return rc;774 vrc = vboxExtPackReturnError(VERR_NOT_EQUAL, pszError, cbError, 775 ExtPackUtil::tr("The name of the downloaded file and the name stored inside the extension pack does not match" 776 " (xml='%s' file='%s')"), ExtPackDesc.strName.c_str(), pszExtPackName); 777 return vrc; 778 778 } 779 779 … … 794 794 * Read the manifest from the extension pack. 795 795 */ 796 int rc = RTVfsFileSeek(hManifestFile, 0, RTFILE_SEEK_BEGIN, NULL);797 if (RT_FAILURE( rc))798 return vboxExtPackReturnError( rc, pszError, cbError, ExtPackUtil::tr("RTVfsFileSeek failed: %Rrc"),rc);796 int vrc = RTVfsFileSeek(hManifestFile, 0, RTFILE_SEEK_BEGIN, NULL); 797 if (RT_FAILURE(vrc)) 798 return vboxExtPackReturnError(vrc, pszError, cbError, ExtPackUtil::tr("RTVfsFileSeek failed: %Rrc"), vrc); 799 799 800 800 RTMANIFEST hTheirManifest; 801 rc = RTManifestCreate(0 /*fFlags*/, &hTheirManifest);802 if (RT_FAILURE( rc))803 return vboxExtPackReturnError( rc, pszError, cbError, ExtPackUtil::tr("RTManifestCreate failed: %Rrc"),rc);801 vrc = RTManifestCreate(0 /*fFlags*/, &hTheirManifest); 802 if (RT_FAILURE(vrc)) 803 return vboxExtPackReturnError(vrc, pszError, cbError, ExtPackUtil::tr("RTManifestCreate failed: %Rrc"), vrc); 804 804 805 805 RTVFSIOSTREAM hVfsIos = RTVfsFileToIoStream(hManifestFile); 806 rc = RTManifestReadStandard(hTheirManifest, hVfsIos);806 vrc = RTManifestReadStandard(hTheirManifest, hVfsIos); 807 807 RTVfsIoStrmRelease(hVfsIos); 808 if (RT_SUCCESS( rc))808 if (RT_SUCCESS(vrc)) 809 809 { 810 810 /* … … 820 820 }; 821 821 char szError[RTPATH_MAX]; 822 rc = RTManifestEqualsEx(hOurManifest, hTheirManifest, &s_apszIgnoreEntries[0], NULL,823 RTMANIFEST_EQUALS_IGN_MISSING_ATTRS /*fFlags*/,824 szError, sizeof(szError));825 if (RT_SUCCESS( rc))822 vrc = RTManifestEqualsEx(hOurManifest, hTheirManifest, &s_apszIgnoreEntries[0], NULL, 823 RTMANIFEST_EQUALS_IGN_MISSING_ATTRS /*fFlags*/, 824 szError, sizeof(szError)); 825 if (RT_SUCCESS(vrc)) 826 826 { 827 827 /* … … 832 832 833 833 } 834 else if ( rc == VERR_NOT_EQUAL && szError[0])834 else if (vrc == VERR_NOT_EQUAL && szError[0]) 835 835 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("Manifest mismatch: %s"), szError); 836 836 else 837 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("RTManifestEqualsEx failed: %Rrc"), rc);837 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("RTManifestEqualsEx failed: %Rrc"), vrc); 838 838 #if 0 839 839 RTVFSIOSTREAM hVfsIosStdOut = NIL_RTVFSIOSTREAM; … … 846 846 } 847 847 else 848 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("Error parsing '%s': %Rrc"), VBOX_EXTPACK_MANIFEST_NAME, rc);848 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("Error parsing '%s': %Rrc"), VBOX_EXTPACK_MANIFEST_NAME, vrc); 849 849 850 850 RTManifestRelease(hTheirManifest); 851 return rc;851 return vrc; 852 852 } 853 853 … … 871 871 */ 872 872 char szCalculatedDigest[RTSHA256_DIGEST_LEN + 1]; 873 int rc = RTManifestEntryQueryAttr(hFileManifest, "extpack", NULL /*no name*/, RTMANIFEST_ATTR_SHA256,874 szCalculatedDigest, sizeof(szCalculatedDigest), NULL);875 if (RT_SUCCESS( rc))873 int vrc = RTManifestEntryQueryAttr(hFileManifest, "extpack", NULL /*no name*/, RTMANIFEST_ATTR_SHA256, 874 szCalculatedDigest, sizeof(szCalculatedDigest), NULL); 875 if (RT_SUCCESS(vrc)) 876 876 { 877 877 /* … … 881 881 */ 882 882 uint8_t abCalculatedHash[RTSHA256_HASH_SIZE]; 883 rc = RTSha256FromString(szCalculatedDigest, abCalculatedHash);884 if (RT_SUCCESS( rc))883 vrc = RTSha256FromString(szCalculatedDigest, abCalculatedHash); 884 if (RT_SUCCESS(vrc)) 885 885 { 886 886 if ( pszFileDigest … … 888 888 { 889 889 uint8_t abFileHash[RTSHA256_HASH_SIZE]; 890 rc = RTSha256FromString(pszFileDigest, abFileHash);891 if (RT_SUCCESS( rc))890 vrc = RTSha256FromString(pszFileDigest, abFileHash); 891 if (RT_SUCCESS(vrc)) 892 892 { 893 893 if (memcmp(abFileHash, abCalculatedHash, sizeof(abFileHash))) … … 895 895 vboxExtPackSetError(pszError, cbError, 896 896 ExtPackUtil::tr("The extension pack file has changed (SHA-256 mismatch)")); 897 rc = VERR_NOT_EQUAL;897 vrc = VERR_NOT_EQUAL; 898 898 } 899 899 } 900 900 else 901 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("Bad SHA-256 '%s': %Rrc"), szCalculatedDigest, rc);901 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("Bad SHA-256 '%s': %Rrc"), szCalculatedDigest, vrc); 902 902 } 903 903 … … 905 905 * Set the output hash on success. 906 906 */ 907 if (pStrDigest && RT_SUCCESS( rc))907 if (pStrDigest && RT_SUCCESS(vrc)) 908 908 { 909 909 try … … 913 913 catch (std::bad_alloc &) 914 914 { 915 rc = VERR_NO_MEMORY;915 vrc = VERR_NO_MEMORY; 916 916 } 917 917 } 918 918 } 919 919 else 920 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("Bad SHA-256 '%s': %Rrc"), szCalculatedDigest, rc);920 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("Bad SHA-256 '%s': %Rrc"), szCalculatedDigest, vrc); 921 921 } 922 922 else 923 vboxExtPackSetError(pszError, cbError, "RTManifestEntryGetAttr: %Rrc", rc);924 return rc;923 vboxExtPackSetError(pszError, cbError, "RTManifestEntryGetAttr: %Rrc", vrc); 924 return vrc; 925 925 } 926 926 … … 945 945 PRTVFSOBJ phVfsObj, PRTVFSFILE phVfsFile, char *pszError, size_t cbError) 946 946 { 947 int rc;947 int vrc; 948 948 949 949 /* … … 951 951 */ 952 952 if (phVfsFile && *phVfsFile != NIL_RTVFSFILE) 953 rc = vboxExtPackReturnError(VERR_DUPLICATE, pszError, cbError,954 ExtPackUtil::tr("There can only be one '%s'"), pszAdjName);953 vrc = vboxExtPackReturnError(VERR_DUPLICATE, pszError, cbError, 954 ExtPackUtil::tr("There can only be one '%s'"), pszAdjName); 955 955 else if (enmType != RTVFSOBJTYPE_IO_STREAM && enmType != RTVFSOBJTYPE_FILE) 956 rc = vboxExtPackReturnError(VERR_NOT_A_FILE, pszError, cbError,957 ExtPackUtil::tr("Standard member '%s' is not a file"), pszAdjName);956 vrc = vboxExtPackReturnError(VERR_NOT_A_FILE, pszError, cbError, 957 ExtPackUtil::tr("Standard member '%s' is not a file"), pszAdjName); 958 958 else 959 959 { 960 960 RTFSOBJINFO ObjInfo; 961 rc = RTVfsObjQueryInfo(*phVfsObj, &ObjInfo, RTFSOBJATTRADD_NOTHING);962 if (RT_SUCCESS( rc))961 vrc = RTVfsObjQueryInfo(*phVfsObj, &ObjInfo, RTFSOBJATTRADD_NOTHING); 962 if (RT_SUCCESS(vrc)) 963 963 { 964 964 if (!RTFS_IS_FILE(ObjInfo.Attr.fMode)) 965 rc = vboxExtPackReturnError(VERR_NOT_A_FILE, pszError, cbError,966 ExtPackUtil::tr("Standard member '%s' is not a file"), pszAdjName);965 vrc = vboxExtPackReturnError(VERR_NOT_A_FILE, pszError, cbError, 966 ExtPackUtil::tr("Standard member '%s' is not a file"), pszAdjName); 967 967 else if (ObjInfo.cbObject >= _1M) 968 rc = vboxExtPackReturnError(VERR_OUT_OF_RANGE, pszError, cbError,969 ExtPackUtil::tr("Standard member '%s' is too large: %'RU64 bytes (max 1 MB)", "",970 (size_t)ObjInfo.cbObject),971 pszAdjName, (uint64_t)ObjInfo.cbObject);968 vrc = vboxExtPackReturnError(VERR_OUT_OF_RANGE, pszError, cbError, 969 ExtPackUtil::tr("Standard member '%s' is too large: %'RU64 bytes (max 1 MB)", "", 970 (size_t)ObjInfo.cbObject), 971 pszAdjName, (uint64_t)ObjInfo.cbObject); 972 972 else 973 973 { … … 978 978 RTVFSIOSTREAM hVfsIos = RTVfsObjToIoStream(*phVfsObj); 979 979 RTVFSFILE hVfsFile; 980 rc = RTVfsMemorizeIoStreamAsFile(hVfsIos, RTFILE_O_READ, &hVfsFile);981 if (RT_SUCCESS( rc))980 vrc = RTVfsMemorizeIoStreamAsFile(hVfsIos, RTFILE_O_READ, &hVfsFile); 981 if (RT_SUCCESS(vrc)) 982 982 { 983 rc = RTVfsIoStrmValidateUtf8Encoding(hVfsIos,984 RTVFS_VALIDATE_UTF8_BY_RTC_3629 | RTVFS_VALIDATE_UTF8_NO_NULL,985 NULL);986 if (RT_SUCCESS( rc))983 vrc = RTVfsIoStrmValidateUtf8Encoding(hVfsIos, 984 RTVFS_VALIDATE_UTF8_BY_RTC_3629 | RTVFS_VALIDATE_UTF8_NO_NULL, 985 NULL); 986 if (RT_SUCCESS(vrc)) 987 987 { 988 988 /* 989 989 * Replace *phVfsObj with the memorized file. 990 990 */ 991 rc = RTVfsFileSeek(hVfsFile, 0, RTFILE_SEEK_BEGIN, NULL);992 if (RT_SUCCESS( rc))991 vrc = RTVfsFileSeek(hVfsFile, 0, RTFILE_SEEK_BEGIN, NULL); 992 if (RT_SUCCESS(vrc)) 993 993 { 994 994 RTVfsObjRelease(*phVfsObj); … … 997 997 else 998 998 vboxExtPackSetError(pszError, cbError, 999 ExtPackUtil::tr("RTVfsFileSeek failed on '%s': %Rrc"), pszAdjName, rc);999 ExtPackUtil::tr("RTVfsFileSeek failed on '%s': %Rrc"), pszAdjName, vrc); 1000 1000 } 1001 1001 1002 if (phVfsFile && RT_SUCCESS( rc))1002 if (phVfsFile && RT_SUCCESS(vrc)) 1003 1003 *phVfsFile = hVfsFile; 1004 1004 else … … 1007 1007 else 1008 1008 vboxExtPackSetError(pszError, cbError, 1009 ExtPackUtil::tr("RTVfsMemorizeIoStreamAsFile failed on '%s': %Rrc"), pszAdjName, rc);1009 ExtPackUtil::tr("RTVfsMemorizeIoStreamAsFile failed on '%s': %Rrc"), pszAdjName, vrc); 1010 1010 RTVfsIoStrmRelease(hVfsIos); 1011 1011 } 1012 1012 } 1013 1013 else 1014 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("RTVfsObjQueryInfo failed on '%s': %Rrc"), pszAdjName, rc);1015 } 1016 return rc;1014 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("RTVfsObjQueryInfo failed on '%s': %Rrc"), pszAdjName, vrc); 1015 } 1016 return vrc; 1017 1017 } 1018 1018 … … 1100 1100 static int vboxExtPackValidateMemberFile(const char *pszName, RTVFSOBJ hVfsObj, char *pszError, size_t cbError) 1101 1101 { 1102 int rc = vboxExtPackValidateMemberName(pszName, pszError, cbError);1103 if (RT_SUCCESS( rc))1102 int vrc = vboxExtPackValidateMemberName(pszName, pszError, cbError); 1103 if (RT_SUCCESS(vrc)) 1104 1104 { 1105 1105 RTFSOBJINFO ObjInfo; 1106 rc = RTVfsObjQueryInfo(hVfsObj, &ObjInfo, RTFSOBJATTRADD_NOTHING);1107 if (RT_SUCCESS( rc))1106 vrc = RTVfsObjQueryInfo(hVfsObj, &ObjInfo, RTFSOBJATTRADD_NOTHING); 1107 if (RT_SUCCESS(vrc)) 1108 1108 { 1109 1109 if (ObjInfo.cbObject >= 9*_1G64) 1110 rc = vboxExtPackReturnError(VERR_OUT_OF_RANGE, pszError, cbError,1111 ExtPackUtil::tr("'%s': too large (%'RU64 bytes)", "", (size_t)ObjInfo.cbObject),1112 pszName, (uint64_t)ObjInfo.cbObject);1110 vrc = vboxExtPackReturnError(VERR_OUT_OF_RANGE, pszError, cbError, 1111 ExtPackUtil::tr("'%s': too large (%'RU64 bytes)", "", (size_t)ObjInfo.cbObject), 1112 pszName, (uint64_t)ObjInfo.cbObject); 1113 1113 if (!RTFS_IS_FILE(ObjInfo.Attr.fMode)) 1114 rc = vboxExtPackReturnError(VERR_NOT_A_FILE, pszError, cbError,1115 ExtPackUtil::tr("The alleged file '%s' has a mode mask stating otherwise (%RTfmode)"),1116 pszName, ObjInfo.Attr.fMode);1114 vrc = vboxExtPackReturnError(VERR_NOT_A_FILE, pszError, cbError, 1115 ExtPackUtil::tr("The alleged file '%s' has a mode mask stating otherwise (%RTfmode)"), 1116 pszName, ObjInfo.Attr.fMode); 1117 1117 } 1118 1118 else 1119 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("RTVfsObjQueryInfo failed on '%s': %Rrc"), pszName, rc);1120 } 1121 return rc;1119 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("RTVfsObjQueryInfo failed on '%s': %Rrc"), pszName, vrc); 1120 } 1121 return vrc; 1122 1122 } 1123 1123 … … 1134 1134 static int vboxExtPackValidateMemberDir(const char *pszName, RTVFSOBJ hVfsObj, char *pszError, size_t cbError) 1135 1135 { 1136 int rc = vboxExtPackValidateMemberName(pszName, pszError, cbError);1137 if (RT_SUCCESS( rc))1136 int vrc = vboxExtPackValidateMemberName(pszName, pszError, cbError); 1137 if (RT_SUCCESS(vrc)) 1138 1138 { 1139 1139 RTFSOBJINFO ObjInfo; 1140 rc = RTVfsObjQueryInfo(hVfsObj, &ObjInfo, RTFSOBJATTRADD_NOTHING);1141 if (RT_SUCCESS( rc))1140 vrc = RTVfsObjQueryInfo(hVfsObj, &ObjInfo, RTFSOBJATTRADD_NOTHING); 1141 if (RT_SUCCESS(vrc)) 1142 1142 { 1143 1143 if (!RTFS_IS_DIRECTORY(ObjInfo.Attr.fMode)) 1144 rc = vboxExtPackReturnError(VERR_NOT_A_DIRECTORY, pszError, cbError,1145 ExtPackUtil::tr("The alleged directory '%s' has a mode mask saying differently (%RTfmode)"),1146 pszName, ObjInfo.Attr.fMode);1144 vrc = vboxExtPackReturnError(VERR_NOT_A_DIRECTORY, pszError, cbError, 1145 ExtPackUtil::tr("The alleged directory '%s' has a mode mask saying differently (%RTfmode)"), 1146 pszName, ObjInfo.Attr.fMode); 1147 1147 } 1148 1148 else 1149 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("RTVfsObjQueryInfo failed on '%s': %Rrc"), pszName, rc);1150 } 1151 return rc;1149 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("RTVfsObjQueryInfo failed on '%s': %Rrc"), pszName, vrc); 1150 } 1151 return vrc; 1152 1152 } 1153 1153 … … 1167 1167 *pszError = '\0'; 1168 1168 1169 int rc;1169 int vrc; 1170 1170 if ( enmType == RTVFSOBJTYPE_FILE 1171 1171 || enmType == RTVFSOBJTYPE_IO_STREAM) 1172 rc = vboxExtPackValidateMemberFile(pszName, hVfsObj, pszError, cbError);1172 vrc = vboxExtPackValidateMemberFile(pszName, hVfsObj, pszError, cbError); 1173 1173 else if ( enmType == RTVFSOBJTYPE_DIR 1174 1174 || enmType == RTVFSOBJTYPE_BASE) 1175 rc = vboxExtPackValidateMemberDir(pszName, hVfsObj, pszError, cbError);1175 vrc = vboxExtPackValidateMemberDir(pszName, hVfsObj, pszError, cbError); 1176 1176 else 1177 rc = vboxExtPackReturnError(VERR_UNEXPECTED_FS_OBJ_TYPE, pszError, cbError,1178 ExtPackUtil::tr("'%s' is not a file or directory (enmType=%d)"), pszName, enmType);1179 return rc;1177 vrc = vboxExtPackReturnError(VERR_UNEXPECTED_FS_OBJ_TYPE, pszError, cbError, 1178 ExtPackUtil::tr("'%s' is not a file or directory (enmType=%d)"), pszName, enmType); 1179 return vrc; 1180 1180 } 1181 1181 … … 1205 1205 * Rewind the file and set up a VFS chain for it. 1206 1206 */ 1207 int rc = RTFileSeek(hTarballFile, 0, RTFILE_SEEK_BEGIN, NULL);1208 if (RT_FAILURE( rc))1209 return vboxExtPackReturnError( rc, pszError, cbError,1210 ExtPackUtil::tr("Failed seeking to the start of the tarball: %Rrc"), rc);1207 int vrc = RTFileSeek(hTarballFile, 0, RTFILE_SEEK_BEGIN, NULL); 1208 if (RT_FAILURE(vrc)) 1209 return vboxExtPackReturnError(vrc, pszError, cbError, 1210 ExtPackUtil::tr("Failed seeking to the start of the tarball: %Rrc"), vrc); 1211 1211 1212 1212 RTVFSIOSTREAM hTarballIos; 1213 rc = RTVfsIoStrmFromRTFile(hTarballFile, RTFILE_O_READ | RTFILE_O_DENY_WRITE | RTFILE_O_OPEN, true /*fLeaveOpen*/,1214 &hTarballIos);1215 if (RT_FAILURE( rc))1216 return vboxExtPackReturnError( rc, pszError, cbError, ExtPackUtil::tr("RTVfsIoStrmFromRTFile failed: %Rrc"),rc);1213 vrc = RTVfsIoStrmFromRTFile(hTarballFile, RTFILE_O_READ | RTFILE_O_DENY_WRITE | RTFILE_O_OPEN, true /*fLeaveOpen*/, 1214 &hTarballIos); 1215 if (RT_FAILURE(vrc)) 1216 return vboxExtPackReturnError(vrc, pszError, cbError, ExtPackUtil::tr("RTVfsIoStrmFromRTFile failed: %Rrc"), vrc); 1217 1217 1218 1218 RTMANIFEST hFileManifest = NIL_RTMANIFEST; 1219 rc = RTManifestCreate(0 /*fFlags*/, &hFileManifest);1220 if (RT_SUCCESS( rc))1219 vrc = RTManifestCreate(0 /*fFlags*/, &hFileManifest); 1220 if (RT_SUCCESS(vrc)) 1221 1221 { 1222 1222 RTVFSIOSTREAM hPtIos; 1223 rc = RTManifestEntryAddPassthruIoStream(hFileManifest, hTarballIos, "extpack", RTMANIFEST_ATTR_SHA256,1224 true /*read*/, &hPtIos);1225 if (RT_SUCCESS( rc))1223 vrc = RTManifestEntryAddPassthruIoStream(hFileManifest, hTarballIos, "extpack", RTMANIFEST_ATTR_SHA256, 1224 true /*read*/, &hPtIos); 1225 if (RT_SUCCESS(vrc)) 1226 1226 { 1227 1227 RTVFSIOSTREAM hGunzipIos; 1228 rc = RTZipGzipDecompressIoStream(hPtIos, 0 /*fFlags*/, &hGunzipIos);1229 if (RT_SUCCESS( rc))1228 vrc = RTZipGzipDecompressIoStream(hPtIos, 0 /*fFlags*/, &hGunzipIos); 1229 if (RT_SUCCESS(vrc)) 1230 1230 { 1231 1231 RTVFSFSSTREAM hTarFss; 1232 rc = RTZipTarFsStreamFromIoStream(hGunzipIos, 0 /*fFlags*/, &hTarFss);1233 if (RT_SUCCESS( rc))1232 vrc = RTZipTarFsStreamFromIoStream(hGunzipIos, 0 /*fFlags*/, &hTarFss); 1233 if (RT_SUCCESS(vrc)) 1234 1234 { 1235 1235 RTVfsIoStrmRelease(hPtIos); … … 1244 1244 } 1245 1245 1246 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("RTZipTarFsStreamFromIoStream failed: %Rrc"), rc);1246 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("RTZipTarFsStreamFromIoStream failed: %Rrc"), vrc); 1247 1247 RTVfsIoStrmRelease(hGunzipIos); 1248 1248 } 1249 1249 else 1250 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("RTZipGzipDecompressIoStream failed: %Rrc"), rc);1250 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("RTZipGzipDecompressIoStream failed: %Rrc"), vrc); 1251 1251 RTVfsIoStrmRelease(hPtIos); 1252 1252 } 1253 1253 else 1254 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("RTManifestEntryAddPassthruIoStream failed: %Rrc"), rc);1254 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("RTManifestEntryAddPassthruIoStream failed: %Rrc"), vrc); 1255 1255 RTManifestRelease(hFileManifest); 1256 1256 } 1257 1257 else 1258 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("RTManifestCreate failed: %Rrc"), rc);1258 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("RTManifestCreate failed: %Rrc"), vrc); 1259 1259 1260 1260 RTVfsIoStrmRelease(hTarballIos); 1261 return rc;1261 return vrc; 1262 1262 } 1263 1263 … … 1311 1311 RTMANIFEST hFileManifest; 1312 1312 RTVFSFSSTREAM hTarFss; 1313 int rc = VBoxExtPackOpenTarFss(hTarballFile, pszError, cbError, &hTarFss, &hFileManifest);1314 if (RT_FAILURE( rc))1315 return rc;1313 int vrc = VBoxExtPackOpenTarFss(hTarballFile, pszError, cbError, &hTarFss, &hFileManifest); 1314 if (RT_FAILURE(vrc)) 1315 return vrc; 1316 1316 1317 1317 RTMANIFEST hOurManifest; 1318 rc = RTManifestCreate(0 /*fFlags*/, &hOurManifest);1319 if (RT_SUCCESS( rc))1318 vrc = RTManifestCreate(0 /*fFlags*/, &hOurManifest); 1319 if (RT_SUCCESS(vrc)) 1320 1320 { 1321 1321 /* … … 1333 1333 RTVFSOBJ hVfsObj; 1334 1334 RTVFSOBJTYPE enmType; 1335 rc = RTVfsFsStrmNext(hTarFss, &pszName, &enmType, &hVfsObj);1336 if (RT_FAILURE( rc))1335 vrc = RTVfsFsStrmNext(hTarFss, &pszName, &enmType, &hVfsObj); 1336 if (RT_FAILURE(vrc)) 1337 1337 { 1338 if ( rc != VERR_EOF)1339 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("RTVfsFsStrmNext failed: %Rrc"), rc);1338 if (vrc != VERR_EOF) 1339 vboxExtPackSetError(pszError, cbError, ExtPackUtil::tr("RTVfsFsStrmNext failed: %Rrc"), vrc); 1340 1340 else 1341 rc = VINF_SUCCESS;1341 vrc = VINF_SUCCESS; 1342 1342 break; 1343 1343 } … … 1351 1351 * failure - cleanup reasons. 1352 1352 */ 1353 rc = VBoxExtPackValidateMember(pszName, enmType, hVfsObj, pszError, cbError);1354 if (RT_SUCCESS( rc))1353 vrc = VBoxExtPackValidateMember(pszName, enmType, hVfsObj, pszError, cbError); 1354 if (RT_SUCCESS(vrc)) 1355 1355 { 1356 1356 PRTVFSFILE phVfsFile = NULL; … … 1362 1362 phVfsFile = &hSignatureFile; 1363 1363 else if (!strncmp(pszAdjName, VBOX_EXTPACK_LICENSE_NAME_PREFIX, sizeof(VBOX_EXTPACK_LICENSE_NAME_PREFIX) - 1)) 1364 rc = VBoxExtPackValidateStandardFile(pszAdjName, enmType, &hVfsObj, NULL, pszError, cbError);1364 vrc = VBoxExtPackValidateStandardFile(pszAdjName, enmType, &hVfsObj, NULL, pszError, cbError); 1365 1365 if (phVfsFile) 1366 rc = VBoxExtPackValidateStandardFile(pszAdjName, enmType, &hVfsObj, phVfsFile, pszError, cbError);1366 vrc = VBoxExtPackValidateStandardFile(pszAdjName, enmType, &hVfsObj, phVfsFile, pszError, cbError); 1367 1367 } 1368 1368 … … 1370 1370 * Add any I/O stream to the manifest 1371 1371 */ 1372 if ( RT_SUCCESS( rc)1372 if ( RT_SUCCESS(vrc) 1373 1373 && ( enmType == RTVFSOBJTYPE_FILE 1374 1374 || enmType == RTVFSOBJTYPE_IO_STREAM)) 1375 1375 { 1376 1376 RTVFSIOSTREAM hVfsIos = RTVfsObjToIoStream(hVfsObj); 1377 rc = RTManifestEntryAddIoStream(hOurManifest, hVfsIos, pszAdjName, RTMANIFEST_ATTR_SIZE | RTMANIFEST_ATTR_SHA256);1378 if (RT_FAILURE( rc))1377 vrc = RTManifestEntryAddIoStream(hOurManifest, hVfsIos, pszAdjName, RTMANIFEST_ATTR_SIZE | RTMANIFEST_ATTR_SHA256); 1378 if (RT_FAILURE(vrc)) 1379 1379 vboxExtPackSetError(pszError, cbError, 1380 ExtPackUtil::tr("RTManifestEntryAddIoStream failed on '%s': %Rrc"), pszAdjName, rc);1380 ExtPackUtil::tr("RTManifestEntryAddIoStream failed on '%s': %Rrc"), pszAdjName, vrc); 1381 1381 RTVfsIoStrmRelease(hVfsIos); 1382 1382 } … … 1387 1387 RTVfsObjRelease(hVfsObj); 1388 1388 RTStrFree(pszName); 1389 if (RT_FAILURE( rc))1389 if (RT_FAILURE(vrc)) 1390 1390 break; 1391 1391 } … … 1394 1394 * Check the integrity of the tarball file. 1395 1395 */ 1396 if (RT_SUCCESS( rc))1396 if (RT_SUCCESS(vrc)) 1397 1397 { 1398 1398 RTVfsFsStrmRelease(hTarFss); 1399 1399 hTarFss = NIL_RTVFSFSSTREAM; 1400 rc = vboxExtPackVerifyFileDigest(hFileManifest, pszTarballDigest, pStrDigest, pszError, cbError);1400 vrc = vboxExtPackVerifyFileDigest(hFileManifest, pszTarballDigest, pStrDigest, pszError, cbError); 1401 1401 } 1402 1402 … … 1405 1405 * mandatory files are present. 1406 1406 */ 1407 if (RT_SUCCESS( rc))1407 if (RT_SUCCESS(vrc)) 1408 1408 { 1409 1409 if (hXmlFile == NIL_RTVFSFILE) 1410 rc = vboxExtPackReturnError(VERR_MISSING, pszError, cbError, ExtPackUtil::tr("Mandator file '%s' is missing"),1411 VBOX_EXTPACK_DESCRIPTION_NAME);1410 vrc = vboxExtPackReturnError(VERR_MISSING, pszError, cbError, ExtPackUtil::tr("Mandator file '%s' is missing"), 1411 VBOX_EXTPACK_DESCRIPTION_NAME); 1412 1412 if (hManifestFile == NIL_RTVFSFILE) 1413 rc = vboxExtPackReturnError(VERR_MISSING, pszError, cbError, ExtPackUtil::tr("Mandator file '%s' is missing"),1414 VBOX_EXTPACK_MANIFEST_NAME);1413 vrc = vboxExtPackReturnError(VERR_MISSING, pszError, cbError, ExtPackUtil::tr("Mandator file '%s' is missing"), 1414 VBOX_EXTPACK_MANIFEST_NAME); 1415 1415 if (hSignatureFile == NIL_RTVFSFILE) 1416 rc = vboxExtPackReturnError(VERR_MISSING, pszError, cbError, ExtPackUtil::tr("Mandator file '%s' is missing"),1417 VBOX_EXTPACK_SIGNATURE_NAME);1416 vrc = vboxExtPackReturnError(VERR_MISSING, pszError, cbError, ExtPackUtil::tr("Mandator file '%s' is missing"), 1417 VBOX_EXTPACK_SIGNATURE_NAME); 1418 1418 } 1419 1419 … … 1421 1421 * Check the manifest and it's signature. 1422 1422 */ 1423 if (RT_SUCCESS( rc))1424 rc = vboxExtPackVerifyManifestAndSignature(hOurManifest, hManifestFile, hSignatureFile, pszError, cbError);1423 if (RT_SUCCESS(vrc)) 1424 vrc = vboxExtPackVerifyManifestAndSignature(hOurManifest, hManifestFile, hSignatureFile, pszError, cbError); 1425 1425 1426 1426 /* 1427 1427 * Check the XML. 1428 1428 */ 1429 if (RT_SUCCESS( rc))1430 rc = vboxExtPackVerifyXml(hXmlFile, pszExtPackName, pszError, cbError);1429 if (RT_SUCCESS(vrc)) 1430 vrc = vboxExtPackVerifyXml(hXmlFile, pszExtPackName, pszError, cbError); 1431 1431 1432 1432 /* 1433 1433 * Returns objects. 1434 1434 */ 1435 if (RT_SUCCESS( rc))1435 if (RT_SUCCESS(vrc)) 1436 1436 { 1437 1437 if (phValidManifest) … … 1456 1456 } 1457 1457 else 1458 vboxExtPackSetError(pszError, cbError, "RTManifestCreate failed: %Rrc", rc);1458 vboxExtPackSetError(pszError, cbError, "RTManifestCreate failed: %Rrc", vrc); 1459 1459 RTVfsFsStrmRelease(hTarFss); 1460 1460 RTManifestRelease(hFileManifest); 1461 1461 1462 return rc;1463 } 1464 1462 return vrc; 1463 } 1464 -
trunk/src/VBox/Main/src-all/HashedPw.cpp
r93115 r94912 65 65 /* hash */ 66 66 uint8_t abHash[RTSHA512_HASH_SIZE]; 67 int rc = RTSha512FromString(pszSaltEnd + 1, abHash);68 return RT_SUCCESS( rc);67 int vrc = RTSha512FromString(pszSaltEnd + 1, abHash); 68 return RT_SUCCESS(vrc); 69 69 } 70 70 … … 96 96 uint8_t abHash[RTSHA512_HASH_SIZE]; 97 97 RTSha512(a_pstrPassword->c_str(), a_pstrPassword->length(), abHash); 98 int rc = RTSha512ToString(abHash, pszHashedPw, sizeof(szHashedPw) - (size_t)(pszHashedPw - &szHashedPw[0]));99 AssertReleaseRC( rc);98 int vrc = RTSha512ToString(abHash, pszHashedPw, sizeof(szHashedPw) - (size_t)(pszHashedPw - &szHashedPw[0])); 99 AssertReleaseRC(vrc); 100 100 } 101 101 -
trunk/src/VBox/Main/src-all/NvramStoreImpl.cpp
r94819 r94912 523 523 { 524 524 AutoCaller autoCaller(this); 525 Assert ComRCReturn(autoCaller.rc(), Utf8Str::Empty);525 AssertReturn(autoCaller.isOk(), Utf8Str::Empty); 526 526 527 527 Utf8Str strTmp; … … 539 539 int NvramStore::i_loadStoreFromTar(RTVFSFSSTREAM hVfsFssTar) 540 540 { 541 int rc = VINF_SUCCESS;541 int vrc = VINF_SUCCESS; 542 542 543 543 /* … … 551 551 char *pszName; 552 552 RTVFSOBJ hVfsObj; 553 rc = RTVfsFsStrmNext(hVfsFssTar, &pszName, NULL, &hVfsObj);554 if (RT_FAILURE( rc))555 { 556 if ( rc == VERR_EOF)557 rc = VINF_SUCCESS;553 vrc = RTVfsFsStrmNext(hVfsFssTar, &pszName, NULL, &hVfsObj); 554 if (RT_FAILURE(vrc)) 555 { 556 if (vrc == VERR_EOF) 557 vrc = VINF_SUCCESS; 558 558 break; 559 559 } 560 560 561 561 RTFSOBJINFO UnixInfo; 562 rc = RTVfsObjQueryInfo(hVfsObj, &UnixInfo, RTFSOBJATTRADD_UNIX);563 if (RT_SUCCESS( rc))562 vrc = RTVfsObjQueryInfo(hVfsObj, &UnixInfo, RTFSOBJATTRADD_UNIX); 563 if (RT_SUCCESS(vrc)) 564 564 { 565 565 switch (UnixInfo.Attr.fMode & RTFS_TYPE_MASK) … … 572 572 573 573 RTVFSFILE hVfsFileEntry; 574 rc = RTVfsMemorizeIoStreamAsFile(hVfsIosEntry, RTFILE_O_READ | RTFILE_O_WRITE, &hVfsFileEntry);575 if (RT_FAILURE( rc))574 vrc = RTVfsMemorizeIoStreamAsFile(hVfsIosEntry, RTFILE_O_READ | RTFILE_O_WRITE, &hVfsFileEntry); 575 if (RT_FAILURE(vrc)) 576 576 break; 577 577 RTVfsIoStrmRelease(hVfsIosEntry); … … 583 583 break; 584 584 default: 585 rc = VERR_NOT_SUPPORTED;585 vrc = VERR_NOT_SUPPORTED; 586 586 break; 587 587 } … … 594 594 RTStrFree(pszName); 595 595 596 if (RT_FAILURE( rc))596 if (RT_FAILURE(vrc)) 597 597 break; 598 598 } 599 599 600 return rc;600 return vrc; 601 601 } 602 602 … … 619 619 PRTVFSIOSTREAM phVfsIos) 620 620 { 621 int rc = VINF_SUCCESS;621 int vrc = VINF_SUCCESS; 622 622 PCVBOXCRYPTOIF pCryptoIf = NULL; 623 623 SecretKey *pKey = NULL; 624 624 const char *pszPassword = NULL; 625 625 626 rc = i_retainCryptoIf(&pCryptoIf);627 if (RT_SUCCESS( rc))628 { 629 rc = m->mpKeyStore->retainSecretKey(m->bd->strKeyId, &pKey);630 if (RT_SUCCESS( rc))626 vrc = i_retainCryptoIf(&pCryptoIf); 627 if (RT_SUCCESS(vrc)) 628 { 629 vrc = m->mpKeyStore->retainSecretKey(m->bd->strKeyId, &pKey); 630 if (RT_SUCCESS(vrc)) 631 631 { 632 632 pszPassword = (const char *)pKey->getKeyBuffer(); 633 633 if (fEncrypt) 634 rc = pCryptoIf->pfnCryptoIoStrmFromVfsIoStrmEncrypt(hVfsIosInOut, m->bd->strKeyStore.c_str(), pszPassword,635 phVfsIos);634 vrc = pCryptoIf->pfnCryptoIoStrmFromVfsIoStrmEncrypt(hVfsIosInOut, m->bd->strKeyStore.c_str(), pszPassword, 635 phVfsIos); 636 636 else 637 rc = pCryptoIf->pfnCryptoIoStrmFromVfsIoStrmDecrypt(hVfsIosInOut, m->bd->strKeyStore.c_str(), pszPassword,638 phVfsIos);639 if (RT_SUCCESS( rc))637 vrc = pCryptoIf->pfnCryptoIoStrmFromVfsIoStrmDecrypt(hVfsIosInOut, m->bd->strKeyStore.c_str(), pszPassword, 638 phVfsIos); 639 if (RT_SUCCESS(vrc)) 640 640 { 641 641 *ppCryptoIf = pCryptoIf; … … 645 645 else 646 646 LogRelMax(10, ("Failed to decrypt the NVRAM store using secret key ID '%s' with %Rrc\n", 647 m->bd->strKeyId.c_str(), rc));647 m->bd->strKeyId.c_str(), vrc)); 648 648 649 649 m->mpKeyStore->releaseSecretKey(m->bd->strKeyId); … … 651 651 else 652 652 LogRelMax(10, ("Failed to retain the secret key ID '%s' with %Rrc\n", 653 m->bd->strKeyId.c_str(), rc));653 m->bd->strKeyId.c_str(), vrc)); 654 654 655 655 i_releaseCryptoIf(pCryptoIf); 656 656 } 657 657 else 658 LogRelMax(10, ("Failed to retain the cryptographic interface with %Rrc\n", rc));659 660 return rc;658 LogRelMax(10, ("Failed to retain the cryptographic interface with %Rrc\n", vrc)); 659 660 return vrc; 661 661 } 662 662 … … 691 691 { 692 692 uint64_t cbStore = 0; 693 int rc = RTFileQuerySizeByPath(pszPath, &cbStore);694 if (RT_SUCCESS( rc))693 int vrc = RTFileQuerySizeByPath(pszPath, &cbStore); 694 if (RT_SUCCESS(vrc)) 695 695 { 696 696 if (cbStore <= _1M) /* Arbitrary limit to fend off bogus files because the file will be read into memory completely. */ … … 706 706 */ 707 707 RTVFSIOSTREAM hVfsIosNvram; 708 rc = RTVfsIoStrmOpenNormal(pszPath, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_NONE,709 &hVfsIosNvram);710 if (RT_SUCCESS( rc))708 vrc = RTVfsIoStrmOpenNormal(pszPath, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_NONE, 709 &hVfsIosNvram); 710 if (RT_SUCCESS(vrc)) 711 711 { 712 712 RTVFSIOSTREAM hVfsIosDecrypted = NIL_RTVFSIOSTREAM; … … 718 718 if ( m->bd->strKeyId.isNotEmpty() 719 719 && m->bd->strKeyStore.isNotEmpty()) 720 rc = i_setupEncryptionOrDecryption(hVfsIosNvram, false /*fEncrypt*/,721 &pCryptoIf, &pKey, &hVfsIosDecrypted);722 #endif 723 if (RT_SUCCESS( rc))720 vrc = i_setupEncryptionOrDecryption(hVfsIosNvram, false /*fEncrypt*/, 721 &pCryptoIf, &pKey, &hVfsIosDecrypted); 722 #endif 723 if (RT_SUCCESS(vrc)) 724 724 { 725 725 /* Read the content. */ 726 726 RTVFSFILE hVfsFileNvram; 727 rc = RTVfsMemorizeIoStreamAsFile( hVfsIosDecrypted != NIL_RTVFSIOSTREAM728 ? hVfsIosDecrypted729 : hVfsIosNvram,730 RTFILE_O_READ, &hVfsFileNvram);731 if (RT_SUCCESS( rc))727 vrc = RTVfsMemorizeIoStreamAsFile( hVfsIosDecrypted != NIL_RTVFSIOSTREAM 728 ? hVfsIosDecrypted 729 : hVfsIosNvram, 730 RTFILE_O_READ, &hVfsFileNvram); 731 if (RT_SUCCESS(vrc)) 732 732 { 733 if (RT_SUCCESS( rc))733 if (RT_SUCCESS(vrc)) 734 734 { 735 735 /* Try to parse it as an EFI variable store. */ 736 736 RTVFS hVfsEfiVarStore; 737 rc = RTEfiVarStoreOpenAsVfs(hVfsFileNvram, RTVFSMNT_F_READ_ONLY, 0 /*fVarStoreFlags*/, &hVfsEfiVarStore,738 NULL /*pErrInfo*/);739 if (RT_SUCCESS( rc))737 vrc = RTEfiVarStoreOpenAsVfs(hVfsFileNvram, RTVFSMNT_F_READ_ONLY, 0 /*fVarStoreFlags*/, &hVfsEfiVarStore, 738 NULL /*pErrInfo*/); 739 if (RT_SUCCESS(vrc)) 740 740 { 741 rc = RTVfsFileSeek(hVfsFileNvram, 0 /*offSeek*/, RTFILE_SEEK_BEGIN, NULL /*poffActual*/);742 AssertRC( rc);741 vrc = RTVfsFileSeek(hVfsFileNvram, 0 /*offSeek*/, RTFILE_SEEK_BEGIN, NULL /*poffActual*/); 742 AssertRC(vrc); 743 743 744 744 RTVfsFileRetain(hVfsFileNvram); /* Retain a new reference for the map. */ … … 747 747 RTVfsRelease(hVfsEfiVarStore); 748 748 } 749 else if ( rc == VERR_VFS_UNKNOWN_FORMAT)749 else if (vrc == VERR_VFS_UNKNOWN_FORMAT) 750 750 { 751 751 /* Check for the new style tar archive. */ 752 rc = RTVfsFileSeek(hVfsFileNvram, 0 /*offSeek*/, RTFILE_SEEK_BEGIN, NULL /*poffActual*/);753 AssertRC( rc);752 vrc = RTVfsFileSeek(hVfsFileNvram, 0 /*offSeek*/, RTFILE_SEEK_BEGIN, NULL /*poffActual*/); 753 AssertRC(vrc); 754 754 755 755 RTVFSIOSTREAM hVfsIosTar = RTVfsFileToIoStream(hVfsFileNvram); … … 757 757 758 758 RTVFSFSSTREAM hVfsFssTar; 759 rc = RTZipTarFsStreamFromIoStream(hVfsIosTar, 0 /*fFlags*/, &hVfsFssTar);759 vrc = RTZipTarFsStreamFromIoStream(hVfsIosTar, 0 /*fFlags*/, &hVfsFssTar); 760 760 RTVfsIoStrmRelease(hVfsIosTar); 761 if (RT_SUCCESS( rc))761 if (RT_SUCCESS(vrc)) 762 762 { 763 rc = i_loadStoreFromTar(hVfsFssTar);763 vrc = i_loadStoreFromTar(hVfsFssTar); 764 764 RTVfsFsStrmRelease(hVfsFssTar); 765 765 } 766 766 else 767 LogRel(("The given NVRAM file is neither a raw UEFI variable store nor a tar archive (opening failed with %Rrc)\n", rc));767 LogRel(("The given NVRAM file is neither a raw UEFI variable store nor a tar archive (opening failed with %Rrc)\n", vrc)); 768 768 } 769 769 else 770 LogRel(("Opening the UEFI variable store '%s' failed with %Rrc\n", pszPath, rc));770 LogRel(("Opening the UEFI variable store '%s' failed with %Rrc\n", pszPath, vrc)); 771 771 772 772 RTVfsFileRelease(hVfsFileNvram); 773 773 } 774 774 else 775 LogRel(("Failed to memorize NVRAM store '%s' with %Rrc\n", pszPath, rc));775 LogRel(("Failed to memorize NVRAM store '%s' with %Rrc\n", pszPath, vrc)); 776 776 } 777 777 } … … 785 785 } 786 786 else 787 LogRelMax(10, ("NVRAM store '%s' couldn't be opened with %Rrc\n", pszPath, rc));787 LogRelMax(10, ("NVRAM store '%s' couldn't be opened with %Rrc\n", pszPath, vrc)); 788 788 } 789 789 else … … 791 791 pszPath, _1M, cbStore)); 792 792 } 793 else if ( rc == VERR_FILE_NOT_FOUND) /* Valid for the first run where no NVRAM file is there. */794 rc = VINF_SUCCESS;795 796 return rc;793 else if (vrc == VERR_FILE_NOT_FOUND) /* Valid for the first run where no NVRAM file is there. */ 794 vrc = VINF_SUCCESS; 795 796 return vrc; 797 797 } 798 798 … … 807 807 RTVFSIOSTREAM hVfsIos; 808 808 809 int rc = RTVfsChainOpenIoStream(pszPath, RTFILE_O_WRITE | RTFILE_O_DENY_WRITE | RTFILE_O_CREATE_REPLACE,810 &hVfsIos, &offError, RTErrInfoInitStatic(&ErrInfo));811 if (RT_SUCCESS( rc))809 int vrc = RTVfsChainOpenIoStream(pszPath, RTFILE_O_WRITE | RTFILE_O_DENY_WRITE | RTFILE_O_CREATE_REPLACE, 810 &hVfsIos, &offError, RTErrInfoInitStatic(&ErrInfo)); 811 if (RT_SUCCESS(vrc)) 812 812 { 813 813 RTVFSIOSTREAM hVfsIosEncrypted = NIL_RTVFSIOSTREAM; … … 819 819 if ( m->bd->strKeyId.isNotEmpty() 820 820 && m->bd->strKeyStore.isNotEmpty()) 821 rc = i_setupEncryptionOrDecryption(hVfsIos, true /*fEncrypt*/,822 &pCryptoIf, &pKey, &hVfsIosEncrypted);823 #endif 824 825 if (RT_SUCCESS( rc))821 vrc = i_setupEncryptionOrDecryption(hVfsIos, true /*fEncrypt*/, 822 &pCryptoIf, &pKey, &hVfsIosEncrypted); 823 #endif 824 825 if (RT_SUCCESS(vrc)) 826 826 { 827 827 RTVFSFSSTREAM hVfsFss; 828 rc = RTZipTarFsStreamToIoStream( hVfsIosEncrypted != NIL_RTVFSIOSTREAM829 ? hVfsIosEncrypted830 : hVfsIos,831 RTZIPTARFORMAT_GNU, 0 /*fFlags*/, &hVfsFss);832 if (RT_SUCCESS( rc))828 vrc = RTZipTarFsStreamToIoStream( hVfsIosEncrypted != NIL_RTVFSIOSTREAM 829 ? hVfsIosEncrypted 830 : hVfsIos, 831 RTZIPTARFORMAT_GNU, 0 /*fFlags*/, &hVfsFss); 832 if (RT_SUCCESS(vrc)) 833 833 { 834 834 NvramStoreIter it = m->bd->mapNvram.begin(); … … 838 838 RTVFSFILE hVfsFile = it->second; 839 839 840 rc = RTVfsFileSeek(hVfsFile, 0 /*offSeek*/, RTFILE_SEEK_BEGIN, NULL /*poffActual*/);841 AssertRC( rc);840 vrc = RTVfsFileSeek(hVfsFile, 0 /*offSeek*/, RTFILE_SEEK_BEGIN, NULL /*poffActual*/); 841 AssertRC(vrc); 842 842 843 843 RTVFSOBJ hVfsObj = RTVfsObjFromFile(hVfsFile); 844 rc = RTVfsFsStrmAdd(hVfsFss, it->first.c_str(), hVfsObj, 0 /*fFlags*/);844 vrc = RTVfsFsStrmAdd(hVfsFss, it->first.c_str(), hVfsObj, 0 /*fFlags*/); 845 845 RTVfsObjRelease(hVfsObj); 846 if (RT_FAILURE( rc))846 if (RT_FAILURE(vrc)) 847 847 break; 848 848 … … 862 862 } 863 863 864 return rc;864 return vrc; 865 865 } 866 866 … … 901 901 int NvramStore::i_saveStore(void) 902 902 { 903 int rc = VINF_SUCCESS;903 int vrc = VINF_SUCCESS; 904 904 905 905 Utf8Str strTmp; … … 924 924 RTVFSFILE hVfsFileNvram = m->bd->mapNvram[Utf8Str("efi/nvram")]; 925 925 926 rc = RTVfsFileSeek(hVfsFileNvram, 0 /*offSeek*/, RTFILE_SEEK_BEGIN, NULL /*poffActual*/);927 AssertRC( rc); RT_NOREF(rc);926 vrc = RTVfsFileSeek(hVfsFileNvram, 0 /*offSeek*/, RTFILE_SEEK_BEGIN, NULL /*poffActual*/); 927 AssertRC(vrc); RT_NOREF(vrc); 928 928 929 929 RTVFSIOSTREAM hVfsIosDst; 930 rc = RTVfsIoStrmOpenNormal(strTmp.c_str(), RTFILE_O_CREATE_REPLACE | RTFILE_O_WRITE | RTFILE_O_DENY_NONE,931 &hVfsIosDst);932 if (RT_SUCCESS( rc))930 vrc = RTVfsIoStrmOpenNormal(strTmp.c_str(), RTFILE_O_CREATE_REPLACE | RTFILE_O_WRITE | RTFILE_O_DENY_NONE, 931 &hVfsIosDst); 932 if (RT_SUCCESS(vrc)) 933 933 { 934 934 RTVFSIOSTREAM hVfsIosSrc = RTVfsFileToIoStream(hVfsFileNvram); … … 943 943 if ( m->bd->strKeyId.isNotEmpty() 944 944 && m->bd->strKeyStore.isNotEmpty()) 945 rc = i_setupEncryptionOrDecryption(hVfsIosDst, true /*fEncrypt*/,946 &pCryptoIf, &pKey, &hVfsIosEncrypted);947 #endif 948 949 rc = RTVfsUtilPumpIoStreams(hVfsIosSrc,950 hVfsIosEncrypted != NIL_RTVFSIOSTREAM951 ? hVfsIosEncrypted952 : hVfsIosDst953 , 0 /*cbBufHint*/);945 vrc = i_setupEncryptionOrDecryption(hVfsIosDst, true /*fEncrypt*/, 946 &pCryptoIf, &pKey, &hVfsIosEncrypted); 947 #endif 948 949 vrc = RTVfsUtilPumpIoStreams(hVfsIosSrc, 950 hVfsIosEncrypted != NIL_RTVFSIOSTREAM 951 ? hVfsIosEncrypted 952 : hVfsIosDst 953 , 0 /*cbBufHint*/); 954 954 955 955 #ifdef VBOX_WITH_FULL_VM_ENCRYPTION … … 963 963 } 964 964 else if (m->bd->mapNvram.size()) 965 rc = i_saveStoreAsTar(strTmp.c_str());965 vrc = i_saveStoreAsTar(strTmp.c_str()); 966 966 /* else: No NVRAM content to store so we are done here. */ 967 967 } 968 968 969 return rc;969 return vrc; 970 970 } 971 971 … … 1159 1159 /* sanity */ 1160 1160 AutoCaller autoCaller(this); 1161 Assert ComRCReturnVoid(autoCaller.rc());1161 AssertReturnVoid(autoCaller.isOk()); 1162 1162 1163 1163 /* sanity too */ 1164 1164 AutoCaller peerCaller(m->pPeer); 1165 Assert ComRCReturnVoid(peerCaller.rc());1165 AssertReturnVoid(peerCaller.isOk()); 1166 1166 1167 1167 /* lock both for writing since we modify both (mPeer is "master" so locked … … 1187 1187 /* sanity */ 1188 1188 AutoCaller autoCaller(this); 1189 Assert ComRCReturnVoid(autoCaller.rc());1189 AssertReturnVoid(autoCaller.isOk()); 1190 1190 1191 1191 /* sanity too */ 1192 1192 AutoCaller thatCaller(aThat); 1193 Assert ComRCReturnVoid(thatCaller.rc());1193 AssertReturnVoid(thatCaller.isOk()); 1194 1194 1195 1195 /* peer is not modified, lock it for reading (aThat is "master" so locked … … 1285 1285 RTVFSFILE hVfsFile = it->second; 1286 1286 1287 int rc = RTVfsFileSeek(hVfsFile, 0 /*offSeek*/, RTFILE_SEEK_BEGIN, NULL /*poffActual*/);1288 AssertRC( rc); RT_NOREF(rc);1287 int vrc = RTVfsFileSeek(hVfsFile, 0 /*offSeek*/, RTFILE_SEEK_BEGIN, NULL /*poffActual*/); 1288 AssertRC(vrc); RT_NOREF(vrc); 1289 1289 1290 1290 return RTVfsFileRead(hVfsFile, pvBuf, cbRead, NULL /*pcbRead*/); … … 1303 1303 AutoWriteLock wlock(pThis->pNvramStore COMMA_LOCKVAL_SRC_POS); 1304 1304 1305 int rc = VINF_SUCCESS;1305 int vrc = VINF_SUCCESS; 1306 1306 NvramStoreIter it = pThis->pNvramStore->m->bd->mapNvram.find(Utf8StrFmt("%s/%s", pszNamespace, pszPath)); 1307 1307 if (it != pThis->pNvramStore->m->bd->mapNvram.end()) … … 1309 1309 RTVFSFILE hVfsFile = it->second; 1310 1310 1311 rc = RTVfsFileSeek(hVfsFile, 0 /*offSeek*/, RTFILE_SEEK_BEGIN, NULL /*poffActual*/);1312 AssertRC( rc);1313 rc = RTVfsFileSetSize(hVfsFile, cbWrite, RTVFSFILE_SIZE_F_NORMAL);1314 if (RT_SUCCESS( rc))1315 rc = RTVfsFileWrite(hVfsFile, pvBuf, cbWrite, NULL /*pcbWritten*/);1311 vrc = RTVfsFileSeek(hVfsFile, 0 /*offSeek*/, RTFILE_SEEK_BEGIN, NULL /*poffActual*/); 1312 AssertRC(vrc); 1313 vrc = RTVfsFileSetSize(hVfsFile, cbWrite, RTVFSFILE_SIZE_F_NORMAL); 1314 if (RT_SUCCESS(vrc)) 1315 vrc = RTVfsFileWrite(hVfsFile, pvBuf, cbWrite, NULL /*pcbWritten*/); 1316 1316 } 1317 1317 else … … 1319 1319 /* Create a new entry. */ 1320 1320 RTVFSFILE hVfsFile = NIL_RTVFSFILE; 1321 rc = RTVfsFileFromBuffer(RTFILE_O_READ | RTFILE_O_WRITE, pvBuf, cbWrite, &hVfsFile);1322 if (RT_SUCCESS( rc))1321 vrc = RTVfsFileFromBuffer(RTFILE_O_READ | RTFILE_O_WRITE, pvBuf, cbWrite, &hVfsFile); 1322 if (RT_SUCCESS(vrc)) 1323 1323 pThis->pNvramStore->m->bd->mapNvram[Utf8StrFmt("%s/%s", pszNamespace, pszPath)] = hVfsFile; 1324 1324 } 1325 1325 1326 return rc;1326 return vrc; 1327 1327 } 1328 1328 … … 1369 1369 uint64_t cbFile; 1370 1370 1371 int rc = RTVfsFileQuerySize(hVfsFile, &cbFile);1372 AssertRCReturn( rc,rc);1371 int vrc = RTVfsFileQuerySize(hVfsFile, &cbFile); 1372 AssertRCReturn(vrc, vrc); 1373 1373 AssertReturn(cbFile < _1M, VERR_OUT_OF_RANGE); 1374 1374 … … 1380 1380 } 1381 1381 1382 rc = RTVfsFileReadAt(hVfsFile, 0 /*off*/, pvData, cbFile, NULL /*pcbRead*/);1383 AssertRCReturn( rc,rc);1382 vrc = RTVfsFileReadAt(hVfsFile, 0 /*off*/, pvData, cbFile, NULL /*pcbRead*/); 1383 AssertRCReturn(vrc, vrc); 1384 1384 1385 1385 pHlp->pfnSSMPutStrZ(pSSM, it->first.c_str()); … … 1422 1422 1423 1423 uint32_t cEntries = 0; 1424 int rc = pHlp->pfnSSMGetU32(pSSM, &cEntries);1425 AssertRCReturn( rc,rc);1424 int vrc = pHlp->pfnSSMGetU32(pSSM, &cEntries); 1425 AssertRCReturn(vrc, vrc); 1426 1426 AssertReturn(cEntries < 32, VERR_OUT_OF_RANGE); 1427 1427 … … 1433 1433 uint64_t cbFile = 0; 1434 1434 1435 rc = pHlp->pfnSSMGetStrZ(pSSM, &szId[0], sizeof(szId));1436 AssertRCReturn( rc,rc);1437 1438 rc = pHlp->pfnSSMGetU64(pSSM, &cbFile);1439 AssertRCReturn( rc,rc);1435 vrc = pHlp->pfnSSMGetStrZ(pSSM, &szId[0], sizeof(szId)); 1436 AssertRCReturn(vrc, vrc); 1437 1438 vrc = pHlp->pfnSSMGetU64(pSSM, &cbFile); 1439 AssertRCReturn(vrc, vrc); 1440 1440 AssertReturn(cbFile < _1M, VERR_OUT_OF_RANGE); 1441 1441 … … 1447 1447 } 1448 1448 1449 rc = pHlp->pfnSSMGetMem(pSSM, pvData, cbFile);1450 AssertRCReturn( rc,rc);1449 vrc = pHlp->pfnSSMGetMem(pSSM, pvData, cbFile); 1450 AssertRCReturn(vrc, vrc); 1451 1451 1452 1452 RTVFSFILE hVfsFile; 1453 rc = RTVfsFileFromBuffer(RTFILE_O_READWRITE, pvData, cbFile, &hVfsFile);1454 AssertRCReturn( rc,rc);1453 vrc = RTVfsFileFromBuffer(RTFILE_O_READWRITE, pvData, cbFile, &hVfsFile); 1454 AssertRCReturn(vrc, vrc); 1455 1455 1456 1456 pThis->pNvramStore->m->bd->mapNvram[Utf8Str(szId)] = hVfsFile; … … 1462 1462 /* The marker. */ 1463 1463 uint32_t u32; 1464 rc = pHlp->pfnSSMGetU32(pSSM, &u32);1465 AssertRCReturn( rc,rc);1464 vrc = pHlp->pfnSSMGetU32(pSSM, &u32); 1465 AssertRCReturn(vrc, vrc); 1466 1466 AssertMsgReturn(u32 == UINT32_MAX, ("%#x\n", u32), VERR_SSM_DATA_UNIT_FORMAT_CHANGED); 1467 1467 } … … 1503 1503 && !pThis->pNvramStore->m->fSsmSaved) 1504 1504 { 1505 int rc = pThis->pNvramStore->i_saveStore();1506 AssertRC( rc); /** @todo Disk full error? */1505 int vrc = pThis->pNvramStore->i_saveStore(); 1506 AssertRC(vrc); /** @todo Disk full error? */ 1507 1507 } 1508 1508 } … … 1557 1557 if (pDrvIns->iInstance == 0) 1558 1558 { 1559 int rc = PDMDrvHlpSSMRegister(pDrvIns, NVRAM_STORE_SAVED_STATE_VERSION, 0 /*cbGuess*/,1560 NvramStore::i_SsmSaveExec, NvramStore::i_SsmLoadExec);1561 if (RT_FAILURE( rc))1562 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,1559 int vrc = PDMDrvHlpSSMRegister(pDrvIns, NVRAM_STORE_SAVED_STATE_VERSION, 0 /*cbGuess*/, 1560 NvramStore::i_SsmSaveExec, NvramStore::i_SsmLoadExec); 1561 if (RT_FAILURE(vrc)) 1562 return PDMDrvHlpVMSetError(pDrvIns, vrc, RT_SRC_POS, 1563 1563 N_("Failed to register the saved state unit for the NVRAM store")); 1564 1564 } … … 1567 1567 if (cRefs == 1) 1568 1568 { 1569 int rc = pThis->pNvramStore->i_loadStore(pThis->pNvramStore->m->bd->strNvramPath.c_str());1570 if (RT_FAILURE( rc))1569 int vrc = pThis->pNvramStore->i_loadStore(pThis->pNvramStore->m->bd->strNvramPath.c_str()); 1570 if (RT_FAILURE(vrc)) 1571 1571 { 1572 1572 ASMAtomicDecU32(&pThis->pNvramStore->m->cRefs); 1573 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,1573 return PDMDrvHlpVMSetError(pDrvIns, vrc, RT_SRC_POS, 1574 1574 N_("Failed to load the NVRAM store from the file")); 1575 1575 } -
trunk/src/VBox/Main/src-all/QMTranslatorImpl.cpp
r93115 r94912 98 98 result.reserve(size * 2 + 1); 99 99 char *pszStr = result.mutableRaw(); 100 int rc = RTUtf16BigToUtf8Ex((PCRTUTF16)m_iter, size >> 1, &pszStr, result.capacity(), NULL);101 if (RT_SUCCESS( rc))100 int vrc = RTUtf16BigToUtf8Ex((PCRTUTF16)m_iter, size >> 1, &pszStr, result.capacity(), NULL); 101 if (RT_SUCCESS(vrc)) 102 102 result.jolt(); 103 103 else … … 625 625 uint8_t *data; 626 626 size_t cbSize; 627 int rc;627 int vrc; 628 628 FileLoader(const char *pszFname) 629 629 { 630 rc = RTFileReadAll(pszFname, (void**) &data, &cbSize);630 vrc = RTFileReadAll(pszFname, (void**) &data, &cbSize); 631 631 } 632 632 … … 636 636 RTFileReadAllFree(data, cbSize); 637 637 } 638 bool isSuccess() { return RT_SUCCESS( rc); }638 bool isSuccess() { return RT_SUCCESS(vrc); } 639 639 }; 640 640 … … 647 647 m_impl->load(stream, hStrCache); 648 648 } 649 return loader. rc;649 return loader.vrc; 650 650 } 651 651 catch(std::exception &e) -
trunk/src/VBox/Main/src-all/SecretKeyStore.cpp
r93115 r94912 31 31 m_cbKey = cbKey; 32 32 33 int rc = RTMemSaferAllocZEx((void **)&this->m_pbKey, cbKey,34 fKeyBufNonPageable ? RTMEMSAFER_F_REQUIRE_NOT_PAGABLE : 0);35 if (RT_SUCCESS( rc))33 int vrc = RTMemSaferAllocZEx((void **)&this->m_pbKey, cbKey, 34 fKeyBufNonPageable ? RTMEMSAFER_F_REQUIRE_NOT_PAGABLE : 0); 35 if (RT_SUCCESS(vrc)) 36 36 { 37 37 memcpy(this->m_pbKey, pbKey, cbKey); 38 38 39 39 /* Scramble content to make retrieving the key more difficult. */ 40 rc = RTMemSaferScramble(this->m_pbKey, cbKey);40 vrc = RTMemSaferScramble(this->m_pbKey, cbKey); 41 41 } 42 42 else 43 throw rc;43 throw vrc; 44 44 } 45 45 … … 61 61 if (cRefs == 1) 62 62 { 63 int rc = RTMemSaferUnscramble(m_pbKey, m_cbKey);64 AssertRC( rc);63 int vrc = RTMemSaferUnscramble(m_pbKey, m_cbKey); 64 AssertRC(vrc); 65 65 } 66 66 … … 73 73 if (!cRefs) 74 74 { 75 int rc = RTMemSaferScramble(m_pbKey, m_cbKey);76 AssertRC( rc);75 int vrc = RTMemSaferScramble(m_pbKey, m_cbKey); 76 AssertRC(vrc); 77 77 } 78 78 … … 125 125 SecretKeyStore::~SecretKeyStore() 126 126 { 127 int rc = deleteAllSecretKeys(false /* fSuspend */, true /* fForce */);128 AssertRC( rc);127 int vrc = deleteAllSecretKeys(false /* fSuspend */, true /* fForce */); 128 AssertRC(vrc); 129 129 } 130 130 … … 143 143 m_mapSecretKeys.insert(std::make_pair(strKeyId, pKey)); 144 144 } 145 catch (int rc)146 { 147 return rc;145 catch (int vrc) 146 { 147 return vrc; 148 148 } 149 149 catch (std::bad_alloc &) -
trunk/src/VBox/Main/src-all/SharedFolderImpl.cpp
r93115 r94912 114 114 unconst(mMachine) = aMachine; 115 115 116 HRESULT rc = i_protectedInit(aMachine, aName, aHostPath, aWritable, aAutoMount, aAutoMountPoint, fFailOnError);116 HRESULT hrc = i_protectedInit(aMachine, aName, aHostPath, aWritable, aAutoMount, aAutoMountPoint, fFailOnError); 117 117 118 118 /* Confirm a successful initialization when it's the case */ 119 if (SUCCEEDED( rc))119 if (SUCCEEDED(hrc)) 120 120 autoInitSpan.setSucceeded(); 121 121 122 return rc;122 return hrc; 123 123 } 124 124 … … 143 143 unconst(mMachine) = aMachine; 144 144 145 HRESULT rc = i_protectedInit(aMachine,146 aThat->m->strName,147 aThat->m->strHostPath,148 aThat->m->fWritable,149 aThat->m->fAutoMount,150 aThat->m->strAutoMountPoint,151 false /* fFailOnError */ );145 HRESULT hrc = i_protectedInit(aMachine, 146 aThat->m->strName, 147 aThat->m->strHostPath, 148 aThat->m->fWritable, 149 aThat->m->fAutoMount, 150 aThat->m->strAutoMountPoint, 151 false /* fFailOnError */ ); 152 152 153 153 /* Confirm a successful initialization when it's the case */ 154 if (SUCCEEDED( rc))154 if (SUCCEEDED(hrc)) 155 155 autoInitSpan.setSucceeded(); 156 156 157 return rc;157 return hrc; 158 158 } 159 159 … … 188 188 unconst(mVirtualBox) = aVirtualBox; 189 189 190 HRESULT rc = protectedInit(aVirtualBox, aName, aHostPath, aWritable, aAutoMount, aAutoMountPoint, fFailOnError);190 HRESULT hrc = protectedInit(aVirtualBox, aName, aHostPath, aWritable, aAutoMount, aAutoMountPoint, fFailOnError); 191 191 192 192 /* Confirm a successful initialization when it's the case */ 193 if (SUCCEEDED( rc))193 if (SUCCEEDED(hrc)) 194 194 autoInitSpan.setSucceeded(); 195 195 196 return rc;196 return hrc; 197 197 } 198 198 … … 229 229 unconst(mConsole) = aConsole; 230 230 231 HRESULT rc = i_protectedInit(aConsole, aName, aHostPath, aWritable, aAutoMount, aAutoMountPoint, fFailOnError);231 HRESULT hrc = i_protectedInit(aConsole, aName, aHostPath, aWritable, aAutoMount, aAutoMountPoint, fFailOnError); 232 232 233 233 /* Confirm a successful initialization when it's the case */ 234 if (SUCCEEDED( rc))234 if (SUCCEEDED(hrc)) 235 235 autoInitSpan.setSucceeded(); 236 236 237 return rc;237 return hrc; 238 238 } 239 239 #endif -
trunk/src/VBox/Main/src-all/VirtualBoxBase.cpp
r94703 r94912 210 210 catch (...) 211 211 { 212 rc = VirtualBox::handleUnexpectedExceptions(this, RT_SRC_POS);212 hrc = VirtualBox::handleUnexpectedExceptions(this, RT_SRC_POS); 213 213 } 214 214 * @endcode … … 339 339 aResultCode &= ~0x80000000; 340 340 341 HRESULT rc = S_OK;341 HRESULT hrc = S_OK; 342 342 343 343 if (aText == NULL || aText[0] == '\0') … … 382 382 { 383 383 ComObjPtr<VirtualBoxErrorInfo> info; 384 rc = info.createObject();385 if (FAILED( rc)) break;384 hrc = info.createObject(); 385 if (FAILED(hrc)) break; 386 386 387 387 #if !defined(VBOX_WITH_XPCOM) … … 392 392 /* get the current error info if any */ 393 393 ComPtr<IErrorInfo> err; 394 rc = ::GetErrorInfo(0, err.asOutParam());395 if (FAILED( rc)) break;396 rc = err.queryInterfaceTo(curInfo.asOutParam());397 if (FAILED( rc))394 hrc = ::GetErrorInfo(0, err.asOutParam()); 395 if (FAILED(hrc)) break; 396 hrc = err.queryInterfaceTo(curInfo.asOutParam()); 397 if (FAILED(hrc)) 398 398 { 399 399 /* create a IVirtualBoxErrorInfo wrapper for the native 400 400 * IErrorInfo object */ 401 401 ComObjPtr<VirtualBoxErrorInfo> wrapper; 402 rc = wrapper.createObject();403 if (SUCCEEDED( rc))402 hrc = wrapper.createObject(); 403 if (SUCCEEDED(hrc)) 404 404 { 405 rc = wrapper->init(err);406 if (SUCCEEDED( rc))405 hrc = wrapper->init(err); 406 if (SUCCEEDED(hrc)) 407 407 curInfo = wrapper; 408 408 } … … 410 410 } 411 411 /* On failure, curInfo will stay null */ 412 Assert(SUCCEEDED( rc) || curInfo.isNull());412 Assert(SUCCEEDED(hrc) || curInfo.isNull()); 413 413 414 414 /* set the current error info and preserve the previous one if any */ 415 rc = info->initEx(aResultCode, aResultDetail, aIID, aComponent, strText, curInfo);416 if (FAILED( rc)) break;415 hrc = info->initEx(aResultCode, aResultDetail, aIID, aComponent, strText, curInfo); 416 if (FAILED(hrc)) break; 417 417 418 418 ComPtr<IErrorInfo> err; 419 rc = info.queryInterfaceTo(err.asOutParam());420 if (SUCCEEDED( rc))421 rc = ::SetErrorInfo(0, err);419 hrc = info.queryInterfaceTo(err.asOutParam()); 420 if (SUCCEEDED(hrc)) 421 hrc = ::SetErrorInfo(0, err); 422 422 423 423 #else // !defined(VBOX_WITH_XPCOM) 424 424 425 425 nsCOMPtr <nsIExceptionService> es; 426 es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, & rc);427 if (NS_SUCCEEDED( rc))426 es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, &hrc); 427 if (NS_SUCCEEDED(hrc)) 428 428 { 429 429 nsCOMPtr <nsIExceptionManager> em; 430 rc = es->GetCurrentExceptionManager(getter_AddRefs(em));431 if (FAILED( rc)) break;430 hrc = es->GetCurrentExceptionManager(getter_AddRefs(em)); 431 if (FAILED(hrc)) break; 432 432 433 433 ComPtr<IVirtualBoxErrorInfo> curInfo; … … 436 436 /* get the current error info if any */ 437 437 ComPtr<nsIException> ex; 438 rc = em->GetCurrentException(ex.asOutParam());439 if (FAILED( rc)) break;440 rc = ex.queryInterfaceTo(curInfo.asOutParam());441 if (FAILED( rc))438 hrc = em->GetCurrentException(ex.asOutParam()); 439 if (FAILED(hrc)) break; 440 hrc = ex.queryInterfaceTo(curInfo.asOutParam()); 441 if (FAILED(hrc)) 442 442 { 443 443 /* create a IVirtualBoxErrorInfo wrapper for the native 444 444 * nsIException object */ 445 445 ComObjPtr<VirtualBoxErrorInfo> wrapper; 446 rc = wrapper.createObject();447 if (SUCCEEDED( rc))446 hrc = wrapper.createObject(); 447 if (SUCCEEDED(hrc)) 448 448 { 449 rc = wrapper->init(ex);450 if (SUCCEEDED( rc))449 hrc = wrapper->init(ex); 450 if (SUCCEEDED(hrc)) 451 451 curInfo = wrapper; 452 452 } … … 454 454 } 455 455 /* On failure, curInfo will stay null */ 456 Assert(SUCCEEDED( rc) || curInfo.isNull());456 Assert(SUCCEEDED(hrc) || curInfo.isNull()); 457 457 458 458 /* set the current error info and preserve the previous one if any */ 459 rc = info->initEx(aResultCode, aResultDetail, aIID, aComponent, Bstr(strText), curInfo);460 if (FAILED( rc)) break;459 hrc = info->initEx(aResultCode, aResultDetail, aIID, aComponent, Bstr(strText), curInfo); 460 if (FAILED(hrc)) break; 461 461 462 462 ComPtr<nsIException> ex; 463 rc = info.queryInterfaceTo(ex.asOutParam());464 if (SUCCEEDED( rc))465 rc = em->SetCurrentException(ex);466 } 467 else if ( rc == NS_ERROR_UNEXPECTED)463 hrc = info.queryInterfaceTo(ex.asOutParam()); 464 if (SUCCEEDED(hrc)) 465 hrc = em->SetCurrentException(ex); 466 } 467 else if (hrc == NS_ERROR_UNEXPECTED) 468 468 { 469 469 /* … … 477 477 */ 478 478 Log1WarningFunc(("Will not set an exception because nsIExceptionService is not available (NS_ERROR_UNEXPECTED). XPCOM is being shutdown?\n")); 479 rc = NS_OK;479 hrc = NS_OK; 480 480 } 481 481 … … 484 484 while (0); 485 485 486 AssertComRC( rc);487 488 return SUCCEEDED( rc) ? aResultCode :rc;486 AssertComRC(hrc); 487 488 return SUCCEEDED(hrc) ? aResultCode : hrc; 489 489 } 490 490 … … 521 521 va_list args; 522 522 va_start(args, pcsz); 523 HRESULT rc = setErrorInternalV(aResultCode,524 this->getClassIID(),525 this->getComponentName(),526 pcsz, args,527 false /* aWarning */,528 true /* aLogIt */);523 HRESULT hrc = setErrorInternalV(aResultCode, 524 this->getClassIID(), 525 this->getComponentName(), 526 pcsz, args, 527 false /* aWarning */, 528 true /* aLogIt */); 529 529 va_end(args); 530 return rc;530 return hrc; 531 531 } 532 532 … … 544 544 bool preserve = MultiResult::isMultiEnabled(); 545 545 546 HRESULT rc = S_OK;546 HRESULT hrc = S_OK; 547 547 548 548 do 549 549 { 550 550 ComObjPtr<VirtualBoxErrorInfo> info; 551 rc = info.createObject();552 if (FAILED( rc)) break;551 hrc = info.createObject(); 552 if (FAILED(hrc)) break; 553 553 554 554 #if !defined(VBOX_WITH_XPCOM) … … 559 559 /* get the current error info if any */ 560 560 ComPtr<IErrorInfo> err; 561 rc = ::GetErrorInfo(0, err.asOutParam());562 if (FAILED( rc)) break;563 rc = err.queryInterfaceTo(curInfo.asOutParam());564 if (FAILED( rc))561 hrc = ::GetErrorInfo(0, err.asOutParam()); 562 if (FAILED(hrc)) break; 563 hrc = err.queryInterfaceTo(curInfo.asOutParam()); 564 if (FAILED(hrc)) 565 565 { 566 566 /* create a IVirtualBoxErrorInfo wrapper for the native 567 567 * IErrorInfo object */ 568 568 ComObjPtr<VirtualBoxErrorInfo> wrapper; 569 rc = wrapper.createObject();570 if (SUCCEEDED( rc))569 hrc = wrapper.createObject(); 570 if (SUCCEEDED(hrc)) 571 571 { 572 rc = wrapper->init(err);573 if (SUCCEEDED( rc))572 hrc = wrapper->init(err); 573 if (SUCCEEDED(hrc)) 574 574 curInfo = wrapper; 575 575 } … … 577 577 } 578 578 /* On failure, curInfo will stay null */ 579 Assert(SUCCEEDED( rc) || curInfo.isNull());579 Assert(SUCCEEDED(hrc) || curInfo.isNull()); 580 580 581 581 /* set the current error info and preserve the previous one if any */ 582 rc = info->init(ei, curInfo);583 if (FAILED( rc)) break;582 hrc = info->init(ei, curInfo); 583 if (FAILED(hrc)) break; 584 584 585 585 ComPtr<IErrorInfo> err; 586 rc = info.queryInterfaceTo(err.asOutParam());587 if (SUCCEEDED( rc))588 rc = ::SetErrorInfo(0, err);586 hrc = info.queryInterfaceTo(err.asOutParam()); 587 if (SUCCEEDED(hrc)) 588 hrc = ::SetErrorInfo(0, err); 589 589 590 590 #else // !defined(VBOX_WITH_XPCOM) 591 591 592 592 nsCOMPtr <nsIExceptionService> es; 593 es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, & rc);594 if (NS_SUCCEEDED( rc))593 es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, &hrc); 594 if (NS_SUCCEEDED(hrc)) 595 595 { 596 596 nsCOMPtr <nsIExceptionManager> em; 597 rc = es->GetCurrentExceptionManager(getter_AddRefs(em));598 if (FAILED( rc)) break;597 hrc = es->GetCurrentExceptionManager(getter_AddRefs(em)); 598 if (FAILED(hrc)) break; 599 599 600 600 ComPtr<IVirtualBoxErrorInfo> curInfo; … … 603 603 /* get the current error info if any */ 604 604 ComPtr<nsIException> ex; 605 rc = em->GetCurrentException(ex.asOutParam());606 if (FAILED( rc)) break;607 rc = ex.queryInterfaceTo(curInfo.asOutParam());608 if (FAILED( rc))605 hrc = em->GetCurrentException(ex.asOutParam()); 606 if (FAILED(hrc)) break; 607 hrc = ex.queryInterfaceTo(curInfo.asOutParam()); 608 if (FAILED(hrc)) 609 609 { 610 610 /* create a IVirtualBoxErrorInfo wrapper for the native 611 611 * nsIException object */ 612 612 ComObjPtr<VirtualBoxErrorInfo> wrapper; 613 rc = wrapper.createObject();614 if (SUCCEEDED( rc))613 hrc = wrapper.createObject(); 614 if (SUCCEEDED(hrc)) 615 615 { 616 rc = wrapper->init(ex);617 if (SUCCEEDED( rc))616 hrc = wrapper->init(ex); 617 if (SUCCEEDED(hrc)) 618 618 curInfo = wrapper; 619 619 } … … 621 621 } 622 622 /* On failure, curInfo will stay null */ 623 Assert(SUCCEEDED( rc) || curInfo.isNull());623 Assert(SUCCEEDED(hrc) || curInfo.isNull()); 624 624 625 625 /* set the current error info and preserve the previous one if any */ 626 rc = info->init(ei, curInfo);627 if (FAILED( rc)) break;626 hrc = info->init(ei, curInfo); 627 if (FAILED(hrc)) break; 628 628 629 629 ComPtr<nsIException> ex; 630 rc = info.queryInterfaceTo(ex.asOutParam());631 if (SUCCEEDED( rc))632 rc = em->SetCurrentException(ex);633 } 634 else if ( rc == NS_ERROR_UNEXPECTED)630 hrc = info.queryInterfaceTo(ex.asOutParam()); 631 if (SUCCEEDED(hrc)) 632 hrc = em->SetCurrentException(ex); 633 } 634 else if (hrc == NS_ERROR_UNEXPECTED) 635 635 { 636 636 /* … … 644 644 */ 645 645 Log1WarningFunc(("Will not set an exception because nsIExceptionService is not available (NS_ERROR_UNEXPECTED). XPCOM is being shutdown?\n")); 646 rc = NS_OK;646 hrc = NS_OK; 647 647 } 648 648 … … 651 651 while (0); 652 652 653 AssertComRC( rc);654 655 return SUCCEEDED( rc) ? ei.getResultCode() :rc;653 AssertComRC(hrc); 654 655 return SUCCEEDED(hrc) ? ei.getResultCode() : hrc; 656 656 } 657 657 … … 780 780 va_list args; 781 781 va_start(args, pcsz); 782 HRESULT rc = setErrorInternalV(aResultCode,783 this->getClassIID(),784 this->getComponentName(),785 pcsz, args,786 true /* aWarning */,787 true /* aLogIt */);782 HRESULT hrc = setErrorInternalV(aResultCode, 783 this->getClassIID(), 784 this->getComponentName(), 785 pcsz, args, 786 true /* aWarning */, 787 true /* aLogIt */); 788 788 va_end(args); 789 return rc;789 return hrc; 790 790 } 791 791 … … 800 800 va_list args; 801 801 va_start(args, pcsz); 802 HRESULT rc = setErrorInternalV(aResultCode,803 this->getClassIID(),804 this->getComponentName(),805 pcsz, args,806 false /* aWarning */,807 false /* aLogIt */);802 HRESULT hrc = setErrorInternalV(aResultCode, 803 this->getClassIID(), 804 this->getComponentName(), 805 pcsz, args, 806 false /* aWarning */, 807 false /* aLogIt */); 808 808 va_end(args); 809 return rc;809 return hrc; 810 810 } 811 811 … … 819 819 ::SetErrorInfo(0, NULL); 820 820 #else 821 HRESULT rc = S_OK;821 HRESULT hrc = S_OK; 822 822 nsCOMPtr <nsIExceptionService> es; 823 es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, & rc);824 if (NS_SUCCEEDED( rc))823 es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, &hrc); 824 if (NS_SUCCEEDED(hrc)) 825 825 { 826 826 nsCOMPtr <nsIExceptionManager> em; 827 rc = es->GetCurrentExceptionManager(getter_AddRefs(em));828 if (SUCCEEDED( rc))827 hrc = es->GetCurrentExceptionManager(getter_AddRefs(em)); 828 if (SUCCEEDED(hrc)) 829 829 em->SetCurrentException(NULL); 830 830 } -
trunk/src/VBox/Main/src-all/VirtualBoxErrorInfoImpl.cpp
r93909 r94912 47 47 IVirtualBoxErrorInfo *aNext) 48 48 { 49 HRESULT hr = init(aResultCode, aIID, pcszComponent, strText, aNext);49 HRESULT hrc = init(aResultCode, aIID, pcszComponent, strText, aNext); 50 50 m_resultDetail = aResultDetail; 51 51 52 return hr ;52 return hrc; 53 53 } 54 54 … … 67 67 { 68 68 ComObjPtr<VirtualBoxErrorInfo> nextEI; 69 HRESULT rc = nextEI.createObject();70 if (FAILED( rc)) returnrc;71 rc = nextEI->init(*pInfo, aNext);72 if (FAILED( rc)) returnrc;69 HRESULT hrc = nextEI.createObject(); 70 if (FAILED(hrc)) return hrc; 71 hrc = nextEI->init(*pInfo, aNext); 72 if (FAILED(hrc)) return hrc; 73 73 mNext = nextEI; 74 74 } … … 140 140 AssertReturn(aInfo, E_FAIL); 141 141 142 HRESULT rc = S_OK;143 144 142 /* We don't return a failure if talking to IErrorInfo fails below to 145 143 * protect ourselves from bad IErrorInfo implementations (the … … 148 146 m_resultCode = S_OK; 149 147 m_resultDetail = 0; 150 rc = aInfo->GetGUID(m_IID.asOutParam());151 AssertComRC( rc);148 HRESULT hrc = aInfo->GetGUID(m_IID.asOutParam()); 149 AssertComRC(hrc); 152 150 Bstr bstrComponent; 153 rc = aInfo->GetSource(bstrComponent.asOutParam());154 AssertComRC( rc);151 hrc = aInfo->GetSource(bstrComponent.asOutParam()); 152 AssertComRC(hrc); 155 153 m_strComponent = bstrComponent; 156 154 Bstr bstrText; 157 rc = aInfo->GetDescription(bstrText.asOutParam());158 AssertComRC( rc);155 hrc = aInfo->GetDescription(bstrText.asOutParam()); 156 AssertComRC(hrc); 159 157 m_strText = bstrText; 160 158 … … 173 171 { 174 172 Bstr iid; 175 HRESULT rc = COMGETTER(InterfaceID)(iid.asOutParam());176 if (SUCCEEDED( rc))173 HRESULT hrc = COMGETTER(InterfaceID)(iid.asOutParam()); 174 if (SUCCEEDED(hrc)) 177 175 *guid = Guid(iid).ref(); 178 return rc;176 return hrc; 179 177 } 180 178 … … 206 204 AssertReturn(aInfo, E_FAIL); 207 205 208 HRESULT rc = S_OK;209 210 206 /* We don't return a failure if talking to nsIException fails below to 211 207 * protect ourselves from bad nsIException implementations (the 212 208 * corresponding fields will simply remain null in this case). */ 213 209 214 rc = aInfo->GetResult(&m_resultCode);215 AssertComRC( rc);210 HRESULT hrc = aInfo->GetResult(&m_resultCode); 211 AssertComRC(hrc); 216 212 m_resultDetail = 0; /* Not being used. */ 217 213 218 214 char *pszMsg; /* No Utf8Str.asOutParam, different allocator! */ 219 rc = aInfo->GetMessage(&pszMsg);220 AssertComRC( rc);221 if (NS_SUCCEEDED( rc))215 hrc = aInfo->GetMessage(&pszMsg); 216 AssertComRC(hrc); 217 if (NS_SUCCEEDED(hrc)) 222 218 { 223 219 m_strText = pszMsg; … … 248 244 249 245 PRInt32 lrc; 250 nsresult rc = COMGETTER(ResultCode)(&lrc);251 if (SUCCEEDED( rc))246 nsresult hrc = COMGETTER(ResultCode)(&lrc); 247 if (SUCCEEDED(hrc)) 252 248 *aResult = (nsresult)lrc; 253 return rc;249 return hrc; 254 250 } 255 251 -
trunk/src/VBox/Main/src-all/VirtualBoxTranslator.cpp
r93637 r94912 145 145 g_idxTlsTr = RTTlsAlloc(); 146 146 g_idxTlsSrc = RTTlsAlloc(); 147 int rc = RTStrCacheCreate(&m_hStrCache, "API Translation");148 m_rcCache = rc;149 if (RT_FAILURE( rc))147 int vrc = RTStrCacheCreate(&m_hStrCache, "API Translation"); 148 m_rcCache = vrc; 149 if (RT_FAILURE(vrc)) 150 150 m_hStrCache = NIL_RTSTRCACHE; /* (loadLanguage will fail) */ 151 151 LogFlowFunc(("m_rcCache=%Rrc g_idxTlsTr=%#x g_idxTlsSrc=%#x\n", m_rcCache, g_idxTlsTr, g_idxTlsSrc)); … … 195 195 VirtualBoxTranslator *VirtualBoxTranslator::instance() 196 196 { 197 int rc = RTOnce(&g_Once, initLock, NULL);198 if (RT_SUCCESS( rc))197 int vrc = RTOnce(&g_Once, initLock, NULL); 198 if (RT_SUCCESS(vrc)) 199 199 { 200 200 RTCritSectRwEnterShared(&s_instanceRwLock); … … 225 225 VirtualBoxTranslator *VirtualBoxTranslator::tryInstance() RT_NOEXCEPT 226 226 { 227 int rc = RTOnce(&g_Once, initLock, NULL);228 if (RT_SUCCESS( rc))227 int vrc = RTOnce(&g_Once, initLock, NULL); 228 if (RT_SUCCESS(vrc)) 229 229 { 230 230 RTCritSectRwEnterShared(&s_instanceRwLock); … … 304 304 { 305 305 LogFlowFunc(("pszLang=%s\n", pszLang)); 306 int rc = VINF_SUCCESS;306 int vrc = VINF_SUCCESS; 307 307 char szLocale[256]; 308 308 if (pszLang == NULL || *pszLang == '\0') 309 309 { 310 rc = vboxGetDefaultUserLanguage(szLocale, sizeof(szLocale));311 if (RT_SUCCESS( rc))310 vrc = vboxGetDefaultUserLanguage(szLocale, sizeof(szLocale)); 311 if (RT_SUCCESS(vrc)) 312 312 pszLang = szLocale; 313 313 } … … 319 319 && !(cbLang == 2 && RT_C_IS_LOWER(pszLang[0]) && RT_C_IS_LOWER(pszLang[1])) 320 320 && !(cbLang == 5 && RTLOCALE_IS_LANGUAGE2_UNDERSCORE_COUNTRY2(pszLang))) 321 rc = VERR_INVALID_PARAMETER;322 } 323 if (RT_SUCCESS( rc))321 vrc = VERR_INVALID_PARAMETER; 322 } 323 if (RT_SUCCESS(vrc)) 324 324 { 325 325 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 335 335 } 336 336 } 337 return rc;337 return vrc; 338 338 } 339 339 … … 344 344 LogFlow(("aComponent=%s aLang=%s\n", aComponent->strPath.c_str(), aLang)); 345 345 346 int rc;346 int vrc; 347 347 if (strcmp(aLang, "C") != 0) 348 348 { … … 354 354 aComponent->strPath.c_str(), aLang); 355 355 if (cchOkay > 0) 356 rc = i_setLanguageFile(aComponent, szNlsPath);356 vrc = i_setLanguageFile(aComponent, szNlsPath); 357 357 else 358 rc = VERR_FILENAME_TOO_LONG;359 if (RT_FAILURE( rc))358 vrc = VERR_FILENAME_TOO_LONG; 359 if (RT_FAILURE(vrc)) 360 360 { 361 361 /* No luck, drop the country part, i.e. 'VirtualBoxAPI_de.qm' or 'VirtualBoxAPI_en.qm': */ … … 366 366 aComponent->strPath.c_str(), pszDash - aLang, aLang); 367 367 if (cchOkay > 0) 368 rc = i_setLanguageFile(aComponent, szNlsPath);368 vrc = i_setLanguageFile(aComponent, szNlsPath); 369 369 } 370 370 } … … 375 375 delete aComponent->pTranslator; 376 376 aComponent->pTranslator = NULL; 377 rc = VINF_SUCCESS;378 } 379 return rc;377 vrc = VINF_SUCCESS; 378 } 379 return vrc; 380 380 } 381 381 … … 385 385 AssertReturn(aComponent, VERR_INVALID_PARAMETER); 386 386 387 int rc = m_rcCache;387 int vrc = m_rcCache; 388 388 if (m_hStrCache != NIL_RTSTRCACHE) 389 389 { … … 393 393 if (pNewTranslator) 394 394 { 395 rc = pNewTranslator->load(aFileName, m_hStrCache);396 if (RT_SUCCESS( rc))395 vrc = pNewTranslator->load(aFileName, m_hStrCache); 396 if (RT_SUCCESS(vrc)) 397 397 { 398 398 if (aComponent->pTranslator) … … 404 404 } 405 405 else 406 rc = VERR_NO_MEMORY;406 vrc = VERR_NO_MEMORY; 407 407 } 408 408 else 409 Assert(RT_FAILURE_NP( rc));410 return rc;409 Assert(RT_FAILURE_NP(vrc)); 410 return vrc; 411 411 } 412 412 … … 417 417 { 418 418 VirtualBoxTranslator *pCurrInstance = VirtualBoxTranslator::tryInstance(); 419 int rc = VERR_GENERAL_FAILURE;419 int vrc = VERR_GENERAL_FAILURE; 420 420 if (pCurrInstance != NULL) 421 421 { 422 rc = pCurrInstance->i_registerTranslation(aTranslationPath, aDefault, aComponent);422 vrc = pCurrInstance->i_registerTranslation(aTranslationPath, aDefault, aComponent); 423 423 pCurrInstance->release(); 424 424 } 425 return rc;425 return vrc; 426 426 } 427 427 … … 470 470 int VirtualBoxTranslator::unregisterTranslation(PTRCOMPONENT aComponent) 471 471 { 472 int rc;472 int vrc; 473 473 if (aComponent != NULL) 474 474 { … … 476 476 if (pCurrInstance != NULL) 477 477 { 478 rc = pCurrInstance->i_unregisterTranslation(aComponent);478 vrc = pCurrInstance->i_unregisterTranslation(aComponent); 479 479 pCurrInstance->release(); 480 480 } 481 481 else 482 rc = VERR_GENERAL_FAILURE;482 vrc = VERR_GENERAL_FAILURE; 483 483 } 484 484 else 485 rc = VWRN_NOT_FOUND;486 return rc;485 vrc = VWRN_NOT_FOUND; 486 return vrc; 487 487 } 488 488
Note:
See TracChangeset
for help on using the changeset viewer.