Changeset 98297 in vbox for trunk/src/VBox/Main/glue
- Timestamp:
- Jan 25, 2023 1:59:25 AM (2 years ago)
- Location:
- trunk/src/VBox/Main/glue
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/glue/ErrorInfo.cpp
r98103 r98297 56 56 HRESULT ErrorInfo::getVirtualBoxErrorInfo(ComPtr<IVirtualBoxErrorInfo> &pVirtualBoxErrorInfo) 57 57 { 58 HRESULT rc = S_OK;58 HRESULT hrc = S_OK; 59 59 if (mErrorInfo) 60 rc = mErrorInfo.queryInterfaceTo(pVirtualBoxErrorInfo.asOutParam());60 hrc = mErrorInfo.queryInterfaceTo(pVirtualBoxErrorInfo.asOutParam()); 61 61 else 62 62 pVirtualBoxErrorInfo.setNull(); 63 return rc;63 return hrc; 64 64 } 65 65 … … 111 111 void ErrorInfo::init(bool aKeepObj /* = false */) 112 112 { 113 HRESULT rc = E_FAIL;113 HRESULT hrc = E_FAIL; 114 114 115 115 #if !defined(VBOX_WITH_XPCOM) 116 116 117 117 ComPtr<IErrorInfo> err; 118 rc = ::GetErrorInfo(0, err.asOutParam());119 if ( rc == S_OK && err)118 hrc = ::GetErrorInfo(0, err.asOutParam()); 119 if (hrc == S_OK && err) 120 120 { 121 121 if (aKeepObj) … … 123 123 124 124 ComPtr<IVirtualBoxErrorInfo> info; 125 rc = err.queryInterfaceTo(info.asOutParam());126 if (SUCCEEDED( rc) && info)125 hrc = err.queryInterfaceTo(info.asOutParam()); 126 if (SUCCEEDED(hrc) && info) 127 127 init(info); 128 128 … … 131 131 bool gotSomething = false; 132 132 133 rc = err->GetGUID(mInterfaceID.asOutParam());134 gotSomething |= SUCCEEDED( rc);135 if (SUCCEEDED( rc))133 hrc = err->GetGUID(mInterfaceID.asOutParam()); 134 gotSomething |= SUCCEEDED(hrc); 135 if (SUCCEEDED(hrc)) 136 136 GetInterfaceNameByIID(mInterfaceID.ref(), mInterfaceName.asOutParam()); 137 137 138 rc = err->GetSource(mComponent.asOutParam());139 gotSomething |= SUCCEEDED( rc);140 141 rc = err->GetDescription(mText.asOutParam());142 gotSomething |= SUCCEEDED( rc);138 hrc = err->GetSource(mComponent.asOutParam()); 139 gotSomething |= SUCCEEDED(hrc); 140 141 hrc = err->GetDescription(mText.asOutParam()); 142 gotSomething |= SUCCEEDED(hrc); 143 143 144 144 if (gotSomething) … … 152 152 153 153 nsCOMPtr<nsIExceptionService> es; 154 es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, & rc);155 if (NS_SUCCEEDED( rc))154 es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, &hrc); 155 if (NS_SUCCEEDED(hrc)) 156 156 { 157 157 nsCOMPtr<nsIExceptionManager> em; 158 rc = es->GetCurrentExceptionManager(getter_AddRefs(em));159 if (NS_SUCCEEDED( rc))158 hrc = es->GetCurrentExceptionManager(getter_AddRefs(em)); 159 if (NS_SUCCEEDED(hrc)) 160 160 { 161 161 ComPtr<nsIException> ex; 162 rc = em->GetCurrentException(ex.asOutParam());163 if (NS_SUCCEEDED( rc) && ex)162 hrc = em->GetCurrentException(ex.asOutParam()); 163 if (NS_SUCCEEDED(hrc) && ex) 164 164 { 165 165 if (aKeepObj) … … 167 167 168 168 ComPtr<IVirtualBoxErrorInfo> info; 169 rc = ex.queryInterfaceTo(info.asOutParam());170 if (NS_SUCCEEDED( rc) && info)169 hrc = ex.queryInterfaceTo(info.asOutParam()); 170 if (NS_SUCCEEDED(hrc) && info) 171 171 init(info); 172 172 … … 175 175 bool gotSomething = false; 176 176 177 rc = ex->GetResult(&mResultCode);178 gotSomething |= NS_SUCCEEDED( rc);177 hrc = ex->GetResult(&mResultCode); 178 gotSomething |= NS_SUCCEEDED(hrc); 179 179 180 180 char *pszMsg; 181 rc = ex->GetMessage(&pszMsg);182 gotSomething |= NS_SUCCEEDED( rc);183 if (NS_SUCCEEDED( rc))181 hrc = ex->GetMessage(&pszMsg); 182 gotSomething |= NS_SUCCEEDED(hrc); 183 if (NS_SUCCEEDED(hrc)) 184 184 { 185 185 mText = Bstr(pszMsg); … … 196 196 em->SetCurrentException(NULL); 197 197 198 rc = NS_OK;198 hrc = NS_OK; 199 199 } 200 200 } 201 201 } 202 202 /* Ignore failure when called after nsComponentManagerImpl::Shutdown(). */ 203 else if ( rc == NS_ERROR_UNEXPECTED)204 rc = NS_OK;205 206 AssertComRC( rc);203 else if (hrc == NS_ERROR_UNEXPECTED) 204 hrc = NS_OK; 205 206 AssertComRC(hrc); 207 207 208 208 #endif // defined(VBOX_WITH_XPCOM) … … 219 219 ComPtr<IUnknown> iface = aI; 220 220 ComPtr<ISupportErrorInfo> serr; 221 HRESULT rc = iface.queryInterfaceTo(serr.asOutParam());222 if (SUCCEEDED( rc))223 { 224 rc = serr->InterfaceSupportsErrorInfo(aIID);225 if (SUCCEEDED( rc))221 HRESULT hrc = iface.queryInterfaceTo(serr.asOutParam()); 222 if (SUCCEEDED(hrc)) 223 { 224 hrc = serr->InterfaceSupportsErrorInfo(aIID); 225 if (SUCCEEDED(hrc)) 226 226 init(aKeepObj); 227 227 } … … 244 244 AssertReturnVoid(info); 245 245 246 HRESULT rc = E_FAIL;246 HRESULT hrc = E_FAIL; 247 247 bool gotSomething = false; 248 248 bool gotAll = true; 249 249 LONG lrc, lrd; 250 250 251 rc = info->COMGETTER(ResultCode)(&lrc); mResultCode = lrc;252 gotSomething |= SUCCEEDED( rc);253 gotAll &= SUCCEEDED( rc);254 255 rc = info->COMGETTER(ResultDetail)(&lrd); mResultDetail = lrd;256 gotSomething |= SUCCEEDED( rc);257 gotAll &= SUCCEEDED( rc);251 hrc = info->COMGETTER(ResultCode)(&lrc); mResultCode = lrc; 252 gotSomething |= SUCCEEDED(hrc); 253 gotAll &= SUCCEEDED(hrc); 254 255 hrc = info->COMGETTER(ResultDetail)(&lrd); mResultDetail = lrd; 256 gotSomething |= SUCCEEDED(hrc); 257 gotAll &= SUCCEEDED(hrc); 258 258 259 259 Bstr iid; 260 rc = info->COMGETTER(InterfaceID)(iid.asOutParam());261 gotSomething |= SUCCEEDED( rc);262 gotAll &= SUCCEEDED( rc);263 if (SUCCEEDED( rc))260 hrc = info->COMGETTER(InterfaceID)(iid.asOutParam()); 261 gotSomething |= SUCCEEDED(hrc); 262 gotAll &= SUCCEEDED(hrc); 263 if (SUCCEEDED(hrc)) 264 264 { 265 265 mInterfaceID = iid; … … 267 267 } 268 268 269 rc = info->COMGETTER(Component)(mComponent.asOutParam());270 gotSomething |= SUCCEEDED( rc);271 gotAll &= SUCCEEDED( rc);272 273 rc = info->COMGETTER(Text)(mText.asOutParam());274 gotSomething |= SUCCEEDED( rc);275 gotAll &= SUCCEEDED( rc);269 hrc = info->COMGETTER(Component)(mComponent.asOutParam()); 270 gotSomething |= SUCCEEDED(hrc); 271 gotAll &= SUCCEEDED(hrc); 272 273 hrc = info->COMGETTER(Text)(mText.asOutParam()); 274 gotSomething |= SUCCEEDED(hrc); 275 gotAll &= SUCCEEDED(hrc); 276 276 277 277 m_pNext = NULL; 278 278 279 279 ComPtr<IVirtualBoxErrorInfo> next; 280 rc = info->COMGETTER(Next)(next.asOutParam());281 if (SUCCEEDED( rc) && !next.isNull())280 hrc = info->COMGETTER(Next)(next.asOutParam()); 281 if (SUCCEEDED(hrc) && !next.isNull()) 282 282 { 283 283 m_pNext = new ErrorInfo(next); 284 284 Assert(m_pNext != NULL); 285 285 if (!m_pNext) 286 rc = E_OUTOFMEMORY;287 } 288 289 gotSomething |= SUCCEEDED( rc);290 gotAll &= SUCCEEDED( rc);286 hrc = E_OUTOFMEMORY; 287 } 288 289 gotSomething |= SUCCEEDED(hrc); 290 gotAll &= SUCCEEDED(hrc); 291 291 292 292 mIsBasicAvailable = gotSomething; … … 312 312 313 313 ComPtr<IVirtualBoxErrorInfo> info; 314 HRESULT rc = progress->COMGETTER(ErrorInfo)(info.asOutParam());315 if (SUCCEEDED( rc) && info)314 HRESULT hrc = progress->COMGETTER(ErrorInfo)(info.asOutParam()); 315 if (SUCCEEDED(hrc) && info) 316 316 init(info); 317 317 } … … 328 328 return S_OK; 329 329 330 HRESULT rc = S_OK;330 HRESULT hrc = S_OK; 331 331 332 332 #if !defined(VBOX_WITH_XPCOM) … … 335 335 if (!mErrorInfo.isNull()) 336 336 { 337 rc = mErrorInfo.queryInterfaceTo(err.asOutParam());338 AssertComRC( rc);339 } 340 rc = ::SetErrorInfo(0, err);337 hrc = mErrorInfo.queryInterfaceTo(err.asOutParam()); 338 AssertComRC(hrc); 339 } 340 hrc = ::SetErrorInfo(0, err); 341 341 342 342 #else // defined(VBOX_WITH_XPCOM) 343 343 344 344 nsCOMPtr <nsIExceptionService> es; 345 es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, & rc);346 if (NS_SUCCEEDED( rc))345 es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, &hrc); 346 if (NS_SUCCEEDED(hrc)) 347 347 { 348 348 nsCOMPtr <nsIExceptionManager> em; 349 rc = es->GetCurrentExceptionManager(getter_AddRefs(em));350 if (NS_SUCCEEDED( rc))349 hrc = es->GetCurrentExceptionManager(getter_AddRefs(em)); 350 if (NS_SUCCEEDED(hrc)) 351 351 { 352 352 ComPtr<nsIException> ex; 353 353 if (!mErrorInfo.isNull()) 354 354 { 355 rc = mErrorInfo.queryInterfaceTo(ex.asOutParam());356 AssertComRC( rc);355 hrc = mErrorInfo.queryInterfaceTo(ex.asOutParam()); 356 AssertComRC(hrc); 357 357 } 358 rc = em->SetCurrentException(ex);358 hrc = em->SetCurrentException(ex); 359 359 } 360 360 } … … 362 362 #endif // defined(VBOX_WITH_XPCOM) 363 363 364 if (SUCCEEDED( rc))364 if (SUCCEEDED(hrc)) 365 365 { 366 366 mErrorInfo.setNull(); … … 368 368 } 369 369 370 return rc;370 return hrc; 371 371 } 372 372 -
trunk/src/VBox/Main/glue/EventQueue.cpp
r98103 r98297 49 49 mShutdown(false) 50 50 { 51 int rc = RTCritSectInit(&mCritSect);52 AssertRC( rc);53 54 rc = RTSemEventCreate(&mSemEvent);55 AssertRC( rc);51 int vrc = RTCritSectInit(&mCritSect); 52 AssertRC(vrc); 53 54 vrc = RTSemEventCreate(&mSemEvent); 55 AssertRC(vrc); 56 56 } 57 57 58 58 EventQueue::~EventQueue(void) 59 59 { 60 int rc = RTCritSectDelete(&mCritSect);61 AssertRC( rc);62 63 rc = RTSemEventDestroy(mSemEvent);64 AssertRC( rc);60 int vrc = RTCritSectDelete(&mCritSect); 61 AssertRC(vrc); 62 63 vrc = RTSemEventDestroy(mSemEvent); 64 AssertRC(vrc); 65 65 66 66 EventQueueListIterator it = mEvents.begin(); … … 98 98 { 99 99 size_t cNumEvents; 100 int rc = RTCritSectEnter(&mCritSect);101 if (RT_SUCCESS( rc))100 int vrc = RTCritSectEnter(&mCritSect); 101 if (RT_SUCCESS(vrc)) 102 102 { 103 103 if (mUserCnt == 0) /* No concurrent access allowed. */ … … 108 108 if (!cNumEvents) 109 109 { 110 int rc2 = RTCritSectLeave(&mCritSect);111 AssertRC( rc2);112 113 rc = RTSemEventWaitNoResume(mSemEvent, cMsTimeout);114 115 rc2 = RTCritSectEnter(&mCritSect);116 AssertRC( rc2);117 118 if (RT_SUCCESS( rc))110 int vrc2 = RTCritSectLeave(&mCritSect); 111 AssertRC(vrc2); 112 113 vrc = RTSemEventWaitNoResume(mSemEvent, cMsTimeout); 114 115 vrc2 = RTCritSectEnter(&mCritSect); 116 AssertRC(vrc2); 117 118 if (RT_SUCCESS(vrc)) 119 119 { 120 120 if (mShutdown) 121 rc = VERR_INTERRUPTED;121 vrc = VERR_INTERRUPTED; 122 122 cNumEvents = mEvents.size(); 123 123 } 124 124 } 125 125 126 if (RT_SUCCESS( rc))127 rc = processPendingEvents(cNumEvents);126 if (RT_SUCCESS(vrc)) 127 vrc = processPendingEvents(cNumEvents); 128 128 129 129 Assert(mUserCnt); … … 131 131 } 132 132 else 133 rc = VERR_WRONG_ORDER;134 135 int rc2 = RTCritSectLeave(&mCritSect);136 if (RT_SUCCESS( rc))137 rc =rc2;138 } 139 140 Assert( rc != VERR_TIMEOUT || cMsTimeout != RT_INDEFINITE_WAIT);141 return rc;133 vrc = VERR_WRONG_ORDER; 134 135 int vrc2 = RTCritSectLeave(&mCritSect); 136 if (RT_SUCCESS(vrc)) 137 vrc = vrc2; 138 } 139 140 Assert(vrc != VERR_TIMEOUT || cMsTimeout != RT_INDEFINITE_WAIT); 141 return vrc; 142 142 } 143 143 … … 154 154 return VINF_SUCCESS; 155 155 156 int rc = VINF_SUCCESS;156 int vrc = VINF_SUCCESS; 157 157 158 158 EventQueueListIterator it = mEvents.begin(); … … 166 166 mEvents.erase(it); 167 167 168 int rc2 = RTCritSectLeave(&mCritSect);169 AssertRC( rc2);168 int vrc2 = RTCritSectLeave(&mCritSect); 169 AssertRC(vrc2); 170 170 171 171 pEvent->handler(); 172 172 pEvent->Release(); 173 173 174 rc2 = RTCritSectEnter(&mCritSect);175 AssertRC( rc2);174 vrc2 = RTCritSectEnter(&mCritSect); 175 AssertRC(vrc2); 176 176 177 177 it = mEvents.begin(); 178 178 if (mShutdown) 179 179 { 180 rc = VERR_INTERRUPTED;180 vrc = VERR_INTERRUPTED; 181 181 break; 182 182 } 183 183 } 184 184 185 return rc;185 return vrc; 186 186 } 187 187 … … 208 208 BOOL EventQueue::postEvent(Event *pEvent) 209 209 { 210 int rc = RTCritSectEnter(&mCritSect);211 if (RT_SUCCESS( rc))210 int vrc = RTCritSectEnter(&mCritSect); 211 if (RT_SUCCESS(vrc)) 212 212 { 213 213 try … … 231 231 232 232 /* Leave critical section before signalling event. */ 233 rc = RTCritSectLeave(&mCritSect);234 if (RT_SUCCESS( rc))235 { 236 int rc2 = RTSemEventSignal(mSemEvent);237 AssertRC( rc2);233 vrc = RTCritSectLeave(&mCritSect); 234 if (RT_SUCCESS(vrc)) 235 { 236 int vrc2 = RTSemEventSignal(mSemEvent); 237 AssertRC(vrc2); 238 238 } 239 239 } … … 241 241 { 242 242 NOREF(ba); 243 rc = VERR_NO_MEMORY;244 } 245 246 if (RT_FAILURE( rc))247 { 248 int rc2 = RTCritSectLeave(&mCritSect);249 AssertRC( rc2);250 } 251 } 252 253 return RT_SUCCESS( rc) ? TRUE : FALSE;243 vrc = VERR_NO_MEMORY; 244 } 245 246 if (RT_FAILURE(vrc)) 247 { 248 int vrc2 = RTCritSectLeave(&mCritSect); 249 AssertRC(vrc2); 250 } 251 } 252 253 return RT_SUCCESS(vrc) ? TRUE : FALSE; 254 254 } 255 255 -
trunk/src/VBox/Main/glue/NativeEventQueue.cpp
r98103 r98297 163 163 // NULL to the event thread (because it stopped accepting events). 164 164 165 nsresult rc = NS_GetEventQueueService(getter_AddRefs(mEventQService)); 166 167 if (NS_SUCCEEDED(rc)) 168 { 169 rc = mEventQService->GetThreadEventQueue(NS_CURRENT_THREAD, 170 getter_AddRefs(mEventQ)); 171 if (rc == NS_ERROR_NOT_AVAILABLE) 165 nsresult hrc = NS_GetEventQueueService(getter_AddRefs(mEventQService)); 166 167 if (NS_SUCCEEDED(hrc)) 168 { 169 hrc = mEventQService->GetThreadEventQueue(NS_CURRENT_THREAD, getter_AddRefs(mEventQ)); 170 if (hrc == NS_ERROR_NOT_AVAILABLE) 172 171 { 173 rc = mEventQService->CreateThreadEventQueue();174 if (NS_SUCCEEDED( rc))172 hrc = mEventQService->CreateThreadEventQueue(); 173 if (NS_SUCCEEDED(hrc)) 175 174 { 176 175 mEQCreated = true; 177 rc = mEventQService->GetThreadEventQueue(NS_CURRENT_THREAD, 178 getter_AddRefs(mEventQ)); 176 hrc = mEventQService->GetThreadEventQueue(NS_CURRENT_THREAD, getter_AddRefs(mEventQ)); 179 177 } 180 178 } 181 179 } 182 AssertComRC( rc);180 AssertComRC(hrc); 183 181 184 182 #endif // VBOX_WITH_XPCOM … … 356 354 } 357 355 358 int rc = select(fd + 1, &fdsetR, NULL, &fdsetE, ptv); 359 if (rc > 0) 360 rc = VINF_SUCCESS; 361 else if (rc == 0) 362 rc = VERR_TIMEOUT; 356 int iRc = select(fd + 1, &fdsetR, NULL, &fdsetE, ptv); 357 int vrc; 358 if (iRc > 0) 359 vrc = VINF_SUCCESS; 360 else if (iRc == 0) 361 vrc = VERR_TIMEOUT; 363 362 else if (errno == EINTR) 364 rc = VINF_INTERRUPTED;363 vrc = VINF_INTERRUPTED; 365 364 else 366 365 { … … 368 367 if (s_ErrorCount < 500) 369 368 { 370 LogRel(("waitForEventsOnXPCOM rc=%d errno=%d\n", rc, errno));369 LogRel(("waitForEventsOnXPCOM iRc=%d errno=%d\n", iRc, errno)); 371 370 ++s_ErrorCount; 372 371 } 373 372 374 AssertMsgFailed((" rc=%d errno=%d\n", rc, errno));375 rc = VERR_INTERNAL_ERROR_4;376 } 377 return rc;373 AssertMsgFailed(("iRc=%d errno=%d\n", iRc, errno)); 374 vrc = VERR_INTERNAL_ERROR_4; 375 } 376 return vrc; 378 377 } 379 378 … … 388 387 * This will pick out our events and handle them specially. 389 388 * 390 * @returns @a rc or VERR_INTERRUPTED (WM_QUIT or NULL msg).389 * @returns @a vrc or VERR_INTERRUPTED (WM_QUIT or NULL msg). 391 390 * @param pMsg The message to dispatch. 392 * @param rcThe current status code.391 * @param vrc The current status code. 393 392 */ 394 393 /*static*/ 395 int NativeEventQueue::dispatchMessageOnWindows(MSG const *pMsg, int rc)394 int NativeEventQueue::dispatchMessageOnWindows(MSG const *pMsg, int vrc) 396 395 { 397 396 /* … … 410 409 } 411 410 else 412 rc = VERR_INTERRUPTED;413 return rc;411 vrc = VERR_INTERRUPTED; 412 return vrc; 414 413 } 415 414 AssertMsgFailed(("lParam=%p wParam=%p\n", pMsg->lParam, pMsg->wParam)); … … 420 419 */ 421 420 if (pMsg->message == WM_QUIT) 422 rc = VERR_INTERRUPTED;421 vrc = VERR_INTERRUPTED; 423 422 TranslateMessage(pMsg); 424 423 DispatchMessage(pMsg); 425 424 426 return rc;425 return vrc; 427 426 } 428 427 … … 437 436 static int processPendingEvents(void) 438 437 { 439 int rc = VERR_TIMEOUT;438 int vrc = VERR_TIMEOUT; 440 439 MSG Msg; 441 440 if (PeekMessage(&Msg, NULL /*hWnd*/, 0 /*wMsgFilterMin*/, 0 /*wMsgFilterMax*/, PM_REMOVE)) 442 441 { 443 rc = VINF_SUCCESS;442 vrc = VINF_SUCCESS; 444 443 do 445 rc = NativeEventQueue::dispatchMessageOnWindows(&Msg,rc);444 vrc = NativeEventQueue::dispatchMessageOnWindows(&Msg, vrc); 446 445 while (PeekMessage(&Msg, NULL /*hWnd*/, 0 /*wMsgFilterMin*/, 0 /*wMsgFilterMax*/, PM_REMOVE)); 447 446 } 448 return rc;447 return vrc; 449 448 } 450 449 … … 463 462 /* ProcessPendingEvents doesn't report back what it did, so check here. */ 464 463 PRBool fHasEvents = PR_FALSE; 465 nsresult hr = pQueue->PendingEvents(&fHasEvents);466 if (NS_FAILED(hr ))464 nsresult hrc = pQueue->PendingEvents(&fHasEvents); 465 if (NS_FAILED(hrc)) 467 466 return VERR_INTERNAL_ERROR_2; 468 467 469 468 /* Process pending events. */ 470 int rc = VINF_SUCCESS;469 int vrc = VINF_SUCCESS; 471 470 if (fHasEvents) 472 471 pQueue->ProcessPendingEvents(); 473 472 else 474 rc = VERR_TIMEOUT;473 vrc = VERR_TIMEOUT; 475 474 476 475 # ifdef RT_OS_DARWIN 477 476 /* Process pending native events. */ 478 int rc2 = waitForEventsOnDarwin(0);479 if ( rc == VERR_TIMEOUT ||rc2 == VERR_INTERRUPTED)480 rc =rc2;477 int vrc2 = waitForEventsOnDarwin(0); 478 if (vrc == VERR_TIMEOUT || vrc2 == VERR_INTERRUPTED) 479 vrc = vrc2; 481 480 # endif 482 481 483 return rc;482 return vrc; 484 483 } 485 484 … … 514 513 int NativeEventQueue::processEventQueue(RTMSINTERVAL cMsTimeout) 515 514 { 516 int rc;515 int vrc; 517 516 CHECK_THREAD_RET(VERR_INVALID_CONTEXT); 518 517 … … 527 526 * while select() is. So we cannot use it for indefinite waits. 528 527 */ 529 rc = processPendingEvents(mEventQ);530 if ( rc == VERR_TIMEOUT528 vrc = processPendingEvents(mEventQ); 529 if ( vrc == VERR_TIMEOUT 531 530 && cMsTimeout > 0) 532 531 { … … 538 537 * Ctrl-C handling is important, signal needs to be handled on 539 538 * a different thread or something. */ 540 rc = waitForEventsOnDarwin(cMsTimeout);539 vrc = waitForEventsOnDarwin(cMsTimeout); 541 540 # else // !RT_OS_DARWIN 542 rc = waitForEventsOnXPCOM(mEventQ, cMsTimeout);541 vrc = waitForEventsOnXPCOM(mEventQ, cMsTimeout); 543 542 # endif // !RT_OS_DARWIN 544 if ( RT_SUCCESS( rc)545 || rc == VERR_TIMEOUT)543 if ( RT_SUCCESS(vrc) 544 || vrc == VERR_TIMEOUT) 546 545 { 547 int rc2 = processPendingEvents(mEventQ);546 int vrc2 = processPendingEvents(mEventQ); 548 547 /* If the wait was successful don't fail the whole operation. */ 549 if (RT_FAILURE( rc) && RT_FAILURE(rc2))550 rc =rc2;548 if (RT_FAILURE(vrc) && RT_FAILURE(vrc2)) 549 vrc = vrc2; 551 550 } 552 551 } 553 552 554 if ( ( RT_SUCCESS( rc)555 || rc == VERR_INTERRUPTED556 || rc == VERR_TIMEOUT)553 if ( ( RT_SUCCESS(vrc) 554 || vrc == VERR_INTERRUPTED 555 || vrc == VERR_TIMEOUT) 557 556 && mInterrupted) 558 557 { 559 558 mInterrupted = false; 560 rc = VERR_INTERRUPTED;559 vrc = VERR_INTERRUPTED; 561 560 } 562 561 … … 566 565 BOOL fRet = 0; /* Shut up MSC */ 567 566 MSG Msg; 568 rc = VINF_SUCCESS;569 while ( rc != VERR_INTERRUPTED567 vrc = VINF_SUCCESS; 568 while ( vrc != VERR_INTERRUPTED 570 569 && (fRet = GetMessage(&Msg, NULL /*hWnd*/, WM_USER, WM_USER)) 571 570 && fRet != -1) 572 rc = NativeEventQueue::dispatchMessageOnWindows(&Msg,rc);571 vrc = NativeEventQueue::dispatchMessageOnWindows(&Msg, vrc); 573 572 if (fRet == 0) 574 rc = VERR_INTERRUPTED;573 vrc = VERR_INTERRUPTED; 575 574 else if (fRet == -1) 576 rc = RTErrConvertFromWin32(GetLastError());575 vrc = RTErrConvertFromWin32(GetLastError()); 577 576 } 578 577 else 579 578 { 580 rc = processPendingEvents();581 if ( rc == VERR_TIMEOUT579 vrc = processPendingEvents(); 580 if ( vrc == VERR_TIMEOUT 582 581 && cMsTimeout != 0) 583 582 { … … 590 589 ("%d\n", rcW), 591 590 VERR_INTERNAL_ERROR_4); 592 rc = processPendingEvents();591 vrc = processPendingEvents(); 593 592 } 594 593 } 595 594 #endif // !VBOX_WITH_XPCOM 596 595 597 Assert( rc != VERR_TIMEOUT || cMsTimeout != RT_INDEFINITE_WAIT);598 return rc;596 Assert(vrc != VERR_TIMEOUT || cMsTimeout != RT_INDEFINITE_WAIT); 597 return vrc; 599 598 } 600 599 … … 646 645 mEventQ->InitEvent(pMyEvent, this, com::NativeEventQueue::plEventHandler, 647 646 com::NativeEventQueue::plEventDestructor); 648 HRESULT rc = mEventQ->PostEvent(pMyEvent);649 return NS_SUCCEEDED( rc);647 HRESULT hrc = mEventQ->PostEvent(pMyEvent); 648 return NS_SUCCEEDED(hrc); 650 649 } 651 650 catch (std::bad_alloc &ba) -
trunk/src/VBox/Main/glue/com.cpp
r98103 r98297 78 78 #if !defined(VBOX_WITH_XPCOM) 79 79 80 LONG rc;81 80 LPOLESTR iidStr = NULL; 82 81 if (StringFromIID(aIID, &iidStr) == S_OK) 83 82 { 84 83 HKEY ifaceKey; 85 rc = RegOpenKeyExW(HKEY_CLASSES_ROOT, L"Interface", 86 0, KEY_QUERY_VALUE, &ifaceKey); 87 if (rc == ERROR_SUCCESS) 84 LSTATUS lrc = RegOpenKeyExW(HKEY_CLASSES_ROOT, L"Interface", 0, KEY_QUERY_VALUE, &ifaceKey); 85 if (lrc == ERROR_SUCCESS) 88 86 { 89 87 HKEY iidKey; 90 rc = RegOpenKeyExW(ifaceKey, iidStr, 0, KEY_QUERY_VALUE, &iidKey);91 if ( rc == ERROR_SUCCESS)88 lrc = RegOpenKeyExW(ifaceKey, iidStr, 0, KEY_QUERY_VALUE, &iidKey); 89 if (lrc == ERROR_SUCCESS) 92 90 { 93 91 /* determine the size and type */ 94 92 DWORD sz, type; 95 rc = RegQueryValueExW(iidKey, NULL, NULL, &type, NULL, &sz);96 if ( rc == ERROR_SUCCESS && type == REG_SZ)93 lrc = RegQueryValueExW(iidKey, NULL, NULL, &type, NULL, &sz); 94 if (lrc == ERROR_SUCCESS && type == REG_SZ) 97 95 { 98 96 /* query the value to BSTR */ 99 97 *aName = SysAllocStringLen(NULL, (sz + 1) / sizeof(TCHAR) + 1); 100 rc = RegQueryValueExW(iidKey, NULL, NULL, NULL, (LPBYTE) *aName, &sz);101 if ( rc != ERROR_SUCCESS)98 lrc = RegQueryValueExW(iidKey, NULL, NULL, NULL, (LPBYTE) *aName, &sz); 99 if (lrc != ERROR_SUCCESS) 102 100 { 103 101 SysFreeString(*aName); … … 149 147 void** ppobj) 150 148 { 151 HRESULT rc;152 nsCOMPtr<ipcIService> ipcServ = do_GetService(IPC_SERVICE_CONTRACTID, & rc);153 if (SUCCEEDED( rc))149 HRESULT hrc = E_UNEXPECTED; 150 nsCOMPtr<ipcIService> ipcServ = do_GetService(IPC_SERVICE_CONTRACTID, &hrc); 151 if (SUCCEEDED(hrc)) 154 152 { 155 153 PRUint32 serverID = 0; 156 rc = ipcServ->ResolveClientName(serverName, &serverID);157 if (SUCCEEDED ( rc))154 hrc = ipcServ->ResolveClientName(serverName, &serverID); 155 if (SUCCEEDED (hrc)) 158 156 { 159 nsCOMPtr<ipcIDConnectService> dconServ = do_GetService(IPC_DCONNECTSERVICE_CONTRACTID, & rc);160 if (SUCCEEDED( rc))161 rc = dconServ->CreateInstance(serverID,162 clsid,163 id,164 ppobj);157 nsCOMPtr<ipcIDConnectService> dconServ = do_GetService(IPC_DCONNECTSERVICE_CONTRACTID, &hrc); 158 if (SUCCEEDED(hrc)) 159 hrc = dconServ->CreateInstance(serverID, 160 clsid, 161 id, 162 ppobj); 165 163 } 166 164 } 167 return rc;165 return hrc; 168 166 } 169 167 … … 173 171 { 174 172 nsCOMPtr<nsIComponentManager> manager; 175 HRESULT rc = NS_GetComponentManager(getter_AddRefs(manager));176 if (SUCCEEDED( rc))177 rc = manager->CreateInstance(clsid,178 nsnull,179 id,180 ppobj);181 return rc;173 HRESULT hrc = NS_GetComponentManager(getter_AddRefs(manager)); 174 if (SUCCEEDED(hrc)) 175 hrc = manager->CreateInstance(clsid, 176 nsnull, 177 id, 178 ppobj); 179 return hrc; 182 180 } 183 181 -
trunk/src/VBox/Main/glue/errorprint.cpp
r98103 r98297 57 57 try 58 58 { 59 HRESULT rc = S_OK;59 HRESULT hrc = S_OK; 60 60 Utf8Str str; 61 61 RTCList<Utf8Str> comp; … … 67 67 if (haveResultCode) 68 68 { 69 rc = info.getResultCode();70 comp.append(Utf8StrFmt("code %Rhrc (0x%RX32)", rc,rc));69 hrc = info.getResultCode(); 70 comp.append(Utf8StrFmt("code %Rhrc (0x%RX32)", hrc, hrc)); 71 71 } 72 72 if (haveComponent) … … 90 90 91 91 // print and log 92 if (FAILED( rc))92 if (FAILED(hrc)) 93 93 { 94 94 RTMsgError("%s", str.c_str()); … … 126 126 } 127 127 128 void GluePrintRCMessage(HRESULT rc)128 void GluePrintRCMessage(HRESULT hrc) 129 129 { 130 130 // print and log 131 if (FAILED( rc))132 { 133 RTMsgError("Code %Rhra (extended info not available)\n", rc);134 Log(("ERROR: Code %Rhra (extended info not available)\n", rc));131 if (FAILED(hrc)) 132 { 133 RTMsgError("Code %Rhra (extended info not available)\n", hrc); 134 Log(("ERROR: Code %Rhra (extended info not available)\n", hrc)); 135 135 } 136 136 else 137 137 { 138 RTMsgWarning("Code %Rhra (extended info not available)\n", rc);139 Log(("WARNING: Code %Rhra (extended info not available)\n", rc));138 RTMsgWarning("Code %Rhra (extended info not available)\n", hrc); 139 Log(("WARNING: Code %Rhra (extended info not available)\n", hrc)); 140 140 } 141 141 } … … 143 143 static void glueHandleComErrorInternal(com::ErrorInfo &info, 144 144 const char *pcszContext, 145 HRESULT rc,145 HRESULT hrc, 146 146 const char *pcszSourceFile, 147 147 uint32_t ulLine) … … 154 154 GluePrintErrorInfo(*pInfo); 155 155 156 /* Use rc for figuring out if there were just warnings. */157 HRESULT rc2 = pInfo->getResultCode();158 if ( (SUCCEEDED_WARNING( rc) && FAILED(rc2))159 || (SUCCEEDED( rc) && (FAILED(rc2) || SUCCEEDED_WARNING(rc2))))160 rc =rc2;156 /* Use hrc for figuring out if there were just warnings. */ 157 HRESULT hrc2 = pInfo->getResultCode(); 158 if ( (SUCCEEDED_WARNING(hrc) && FAILED(hrc2)) 159 || (SUCCEEDED(hrc) && (FAILED(hrc2) || SUCCEEDED_WARNING(hrc2)))) 160 hrc = hrc2; 161 161 162 162 pInfo = pInfo->getNext(); … … 171 171 RTMsgError("--------\n"); 172 172 } 173 } 174 while (pInfo); 173 } while (pInfo); 175 174 } 176 175 else 177 GluePrintRCMessage( rc);176 GluePrintRCMessage(hrc); 178 177 179 178 if (pcszContext != NULL || pcszSourceFile != NULL) 180 GluePrintErrorContext(pcszContext, pcszSourceFile, ulLine, SUCCEEDED_WARNING( rc));179 GluePrintErrorContext(pcszContext, pcszSourceFile, ulLine, SUCCEEDED_WARNING(hrc)); 181 180 } 182 181 183 182 void GlueHandleComError(ComPtr<IUnknown> iface, 184 183 const char *pcszContext, 185 HRESULT rc,184 HRESULT hrc, 186 185 const char *pcszSourceFile, 187 186 uint32_t ulLine) … … 193 192 glueHandleComErrorInternal(info, 194 193 pcszContext, 195 rc,194 hrc, 196 195 pcszSourceFile, 197 196 ulLine); … … 199 198 } 200 199 201 void GlueHandleComErrorNoCtx(ComPtr<IUnknown> iface, HRESULT rc)202 { 203 GlueHandleComError(iface, NULL, rc, NULL, 0);200 void GlueHandleComErrorNoCtx(ComPtr<IUnknown> iface, HRESULT hrc) 201 { 202 GlueHandleComError(iface, NULL, hrc, NULL, 0); 204 203 } 205 204 206 205 void GlueHandleComErrorProgress(ComPtr<IProgress> progress, 207 206 const char *pcszContext, 208 HRESULT rc,207 HRESULT hrc, 209 208 const char *pcszSourceFile, 210 209 uint32_t ulLine) … … 215 214 glueHandleComErrorInternal(ei, 216 215 pcszContext, 217 rc,216 hrc, 218 217 pcszSourceFile, 219 218 ulLine); -
trunk/src/VBox/Main/glue/initterm.cpp
r98103 r98297 443 443 HRESULT Initialize(uint32_t fInitFlags /*=VBOX_COM_INIT_F_DEFAULT*/) 444 444 { 445 HRESULT rc = E_FAIL;445 HRESULT hrc = E_FAIL; 446 446 447 447 #if !defined(VBOX_WITH_XPCOM) … … 511 511 | COINIT_SPEED_OVER_MEMORY; 512 512 513 rc = CoInitializeEx(NULL, flags);513 hrc = CoInitializeEx(NULL, flags); 514 514 515 515 /* the overall result must be either S_OK or S_FALSE (S_FALSE means 516 516 * "already initialized using the same apartment model") */ 517 AssertMsg( rc == S_OK || rc == S_FALSE, ("rc=%08X\n",rc));517 AssertMsg(hrc == S_OK || hrc == S_FALSE, ("hrc=%08X\n", hrc)); 518 518 519 519 #if defined(VBOX_WITH_SDS) 520 520 // Setup COM Security to enable impersonation 521 HRESULT hr GUICoInitializeSecurity = CoInitializeSecurity(NULL,522 -1,523 NULL,524 NULL,525 RPC_C_AUTHN_LEVEL_DEFAULT,526 RPC_C_IMP_LEVEL_IMPERSONATE,527 NULL,528 EOAC_NONE,529 NULL);530 NOREF(hr GUICoInitializeSecurity);531 Assert(SUCCEEDED(hr GUICoInitializeSecurity) || hrGUICoInitializeSecurity == RPC_E_TOO_LATE);521 HRESULT hrcGUICoInitializeSecurity = CoInitializeSecurity(NULL, 522 -1, 523 NULL, 524 NULL, 525 RPC_C_AUTHN_LEVEL_DEFAULT, 526 RPC_C_IMP_LEVEL_IMPERSONATE, 527 NULL, 528 EOAC_NONE, 529 NULL); 530 NOREF(hrcGUICoInitializeSecurity); 531 Assert(SUCCEEDED(hrcGUICoInitializeSecurity) || hrcGUICoInitializeSecurity == RPC_E_TOO_LATE); 532 532 #endif 533 533 … … 556 556 { 557 557 if ( gCOMMainThread == hSelf 558 && SUCCEEDED( rc))558 && SUCCEEDED(hrc)) 559 559 gCOMMainInitCount++; 560 560 561 AssertComRC( rc);562 return rc;561 AssertComRC(hrc); 562 return hrc; 563 563 } 564 564 Assert(RTThreadIsMain(hSelf)); … … 566 566 /* this is the first main thread initialization */ 567 567 Assert(gCOMMainInitCount == 0); 568 if (SUCCEEDED( rc))568 if (SUCCEEDED(hrc)) 569 569 gCOMMainInitCount = 1; 570 570 … … 583 583 584 584 nsCOMPtr<nsIEventQueue> eventQ; 585 rc = NS_GetMainEventQ(getter_AddRefs(eventQ));586 587 if (NS_SUCCEEDED( rc))585 hrc = NS_GetMainEventQ(getter_AddRefs(eventQ)); 586 587 if (NS_SUCCEEDED(hrc)) 588 588 { 589 589 PRBool isOnMainThread = PR_FALSE; 590 rc = eventQ->IsOnCurrentThread(&isOnMainThread);591 if (NS_SUCCEEDED( rc) && isOnMainThread)590 hrc = eventQ->IsOnCurrentThread(&isOnMainThread); 591 if (NS_SUCCEEDED(hrc) && isOnMainThread) 592 592 ++gXPCOMInitCount; 593 593 } 594 594 595 AssertComRC( rc);596 return rc;595 AssertComRC(hrc); 596 return hrc; 597 597 } 598 598 Assert(RTThreadIsMain(RTThreadSelf())); … … 682 682 if (RT_FAILURE(vrc)) 683 683 { 684 rc = NS_ERROR_FAILURE;684 hrc = NS_ERROR_FAILURE; 685 685 continue; 686 686 } … … 689 689 if (RT_FAILURE(vrc)) 690 690 { 691 rc = NS_ERROR_FAILURE;691 hrc = NS_ERROR_FAILURE; 692 692 continue; 693 693 } … … 695 695 if (RT_FAILURE(vrc)) 696 696 { 697 rc = NS_ERROR_FAILURE;697 hrc = NS_ERROR_FAILURE; 698 698 continue; 699 699 } … … 703 703 dsProv = new DirectoryServiceProvider(); 704 704 if (dsProv) 705 rc = dsProv->init(szCompReg, szXptiDat, szCompDir, szAppHomeDir);705 hrc = dsProv->init(szCompReg, szXptiDat, szCompDir, szAppHomeDir); 706 706 else 707 rc = NS_ERROR_OUT_OF_MEMORY;708 if (NS_FAILED( rc))707 hrc = NS_ERROR_OUT_OF_MEMORY; 708 if (NS_FAILED(hrc)) 709 709 break; 710 710 … … 721 721 { 722 722 nsCOMPtr<nsILocalFile> file; 723 rc = NS_NewNativeLocalFile(nsEmbedCString(appDirCP), 724 PR_FALSE, getter_AddRefs(file)); 725 if (NS_SUCCEEDED(rc)) 726 appDir = do_QueryInterface(file, &rc); 723 hrc = NS_NewNativeLocalFile(nsEmbedCString(appDirCP), PR_FALSE, getter_AddRefs(file)); 724 if (NS_SUCCEEDED(hrc)) 725 appDir = do_QueryInterface(file, &hrc); 727 726 728 727 RTStrFree(appDirCP); 729 728 } 730 729 else 731 rc = NS_ERROR_FAILURE;732 } 733 if (NS_FAILED( rc))730 hrc = NS_ERROR_FAILURE; 731 } 732 if (NS_FAILED(hrc)) 734 733 break; 735 734 … … 742 741 { 743 742 nsCOMPtr<nsIServiceManager> serviceManager; 744 rc = NS_InitXPCOM2(getter_AddRefs(serviceManager), appDir, dsProv);745 if (NS_SUCCEEDED( rc))743 hrc = NS_InitXPCOM2(getter_AddRefs(serviceManager), appDir, dsProv); 744 if (NS_SUCCEEDED(hrc)) 746 745 { 747 nsCOMPtr<nsIComponentRegistrar> registrar = 748 do_QueryInterface(serviceManager, &rc); 749 if (NS_SUCCEEDED(rc)) 746 nsCOMPtr<nsIComponentRegistrar> registrar = do_QueryInterface(serviceManager, &hrc); 747 if (NS_SUCCEEDED(hrc)) 750 748 { 751 rc = registrar->AutoRegister(nsnull);752 if (NS_SUCCEEDED( rc))749 hrc = registrar->AutoRegister(nsnull); 750 if (NS_SUCCEEDED(hrc)) 753 751 { 754 752 /* We succeeded, stop probing paths */ … … 761 759 762 760 /* clean up before the new try */ 763 HRESULT rc2 = NS_ShutdownXPCOM(nsnull);764 if (SUCCEEDED( rc))765 rc =rc2;761 HRESULT hrc2 = NS_ShutdownXPCOM(nsnull); 762 if (SUCCEEDED(hrc)) 763 hrc = hrc2; 766 764 767 765 if (i == 0) … … 774 772 #endif /* !defined(VBOX_WITH_XPCOM) */ 775 773 776 AssertComRCReturnRC( rc);774 AssertComRCReturnRC(hrc); 777 775 778 776 // for both COM and XPCOM, we only get here if this is the main thread; … … 784 782 * Init the main event queue (ASSUMES it cannot fail). 785 783 */ 786 if (SUCCEEDED( rc))784 if (SUCCEEDED(hrc)) 787 785 NativeEventQueue::init(); 788 786 789 return rc;787 return hrc; 790 788 } 791 789 792 790 HRESULT Shutdown() 793 791 { 794 HRESULT rc = S_OK;792 HRESULT hrc = S_OK; 795 793 796 794 #if !defined(VBOX_WITH_XPCOM) … … 813 811 814 812 nsCOMPtr<nsIEventQueue> eventQ; 815 rc = NS_GetMainEventQ(getter_AddRefs(eventQ));816 817 if (NS_SUCCEEDED( rc) ||rc == NS_ERROR_NOT_AVAILABLE)813 hrc = NS_GetMainEventQ(getter_AddRefs(eventQ)); 814 815 if (NS_SUCCEEDED(hrc) || hrc == NS_ERROR_NOT_AVAILABLE) 818 816 { 819 817 /* NS_ERROR_NOT_AVAILABLE seems to mean that … … 825 823 826 824 PRBool isOnMainThread = PR_FALSE; 827 if (NS_SUCCEEDED( rc))828 { 829 rc = eventQ->IsOnCurrentThread(&isOnMainThread);825 if (NS_SUCCEEDED(hrc)) 826 { 827 hrc = eventQ->IsOnCurrentThread(&isOnMainThread); 830 828 eventQ = nsnull; /* early release before shutdown */ 831 829 } … … 833 831 { 834 832 isOnMainThread = RTThreadIsMain(RTThreadSelf()); 835 rc = NS_OK;836 } 837 838 if (NS_SUCCEEDED( rc) && isOnMainThread)833 hrc = NS_OK; 834 } 835 836 if (NS_SUCCEEDED(hrc) && isOnMainThread) 839 837 { 840 838 /* only the main thread needs to uninitialize XPCOM and only if … … 843 841 { 844 842 NativeEventQueue::uninit(); 845 rc = NS_ShutdownXPCOM(nsnull);843 hrc = NS_ShutdownXPCOM(nsnull); 846 844 847 845 /* This is a thread initialized XPCOM and set gIsXPCOMInitialized to … … 856 854 #endif /* !defined(VBOX_WITH_XPCOM) */ 857 855 858 AssertComRC( rc);859 860 return rc;856 AssertComRC(hrc); 857 858 return hrc; 861 859 } 862 860 -
trunk/src/VBox/Main/glue/string.cpp
r98103 r98297 112 112 { 113 113 size_t cwcAppend; 114 int rc = ::RTStrCalcUtf16LenEx(pachChars, cbChars, &cwcAppend);115 AssertRCReturnStmt( rc, pArgs->hrc = E_UNEXPECTED, 0);114 int vrc = ::RTStrCalcUtf16LenEx(pachChars, cbChars, &cwcAppend); 115 AssertRCReturnStmt(vrc, pArgs->hrc = E_UNEXPECTED, 0); 116 116 117 117 /* … … 143 143 PRTUTF16 pwszDst = pThis->m_bstr + pArgs->offDst; 144 144 Assert(pArgs->cwcAlloc > pArgs->offDst); 145 rc = ::RTStrToUtf16Ex(pachChars, cbChars, &pwszDst, pArgs->cwcAlloc - pArgs->offDst, &cwcAppend);146 AssertRCReturnStmt( rc, pArgs->hrc = E_UNEXPECTED, 0);145 vrc = ::RTStrToUtf16Ex(pachChars, cbChars, &pwszDst, pArgs->cwcAlloc - pArgs->offDst, &cwcAppend); 146 AssertRCReturnStmt(vrc, pArgs->hrc = E_UNEXPECTED, 0); 147 147 pArgs->offDst += cwcAppend; 148 148 } … … 269 269 { 270 270 RTUNICP ucLeft; 271 int rc = RTUtf16GetCpEx(&pwszLeft, &ucLeft);272 AssertRCReturn( rc, 1);271 int vrc = RTUtf16GetCpEx(&pwszLeft, &ucLeft); 272 AssertRCReturn(vrc, 1); 273 273 274 274 RTUNICP ucRight; 275 rc = RTStrGetCpEx(&a_pszRight, &ucRight);276 AssertRCReturn( rc, -1);275 vrc = RTStrGetCpEx(&a_pszRight, &ucRight); 276 AssertRCReturn(vrc, -1); 277 277 if (ucLeft == ucRight) 278 278 { … … 577 577 { 578 578 size_t cwcSrc; 579 int rc = RTStrCalcUtf16LenEx(pszSrc, cchSrc, &cwcSrc);579 int vrc = RTStrCalcUtf16LenEx(pszSrc, cchSrc, &cwcSrc); 580 580 #ifdef RT_EXCEPTIONS_ENABLED 581 AssertRCStmt( rc, throw std::bad_alloc());581 AssertRCStmt(vrc, throw std::bad_alloc()); 582 582 #else 583 AssertRCReturn( rc, *this);583 AssertRCReturn(vrc, *this); 584 584 #endif 585 585 … … 590 590 { 591 591 PRTUTF16 pwszDst = &m_bstr[cwcOld]; 592 rc = RTStrToUtf16Ex(pszSrc, cchSrc, &pwszDst, cwcSrc + 1, NULL);592 vrc = RTStrToUtf16Ex(pszSrc, cchSrc, &pwszDst, cwcSrc + 1, NULL); 593 593 #ifdef RT_EXCEPTIONS_ENABLED 594 AssertRCStmt( rc, throw std::bad_alloc());594 AssertRCStmt(vrc, throw std::bad_alloc()); 595 595 #else 596 AssertRC( rc);596 AssertRC(vrc); 597 597 #endif 598 598 } … … 605 605 { 606 606 size_t cwcSrc; 607 int rc = RTStrCalcUtf16LenEx(pszSrc, cchSrc, &cwcSrc);608 AssertRCStmt( rc, E_INVALIDARG);607 int vrc = RTStrCalcUtf16LenEx(pszSrc, cchSrc, &cwcSrc); 608 AssertRCStmt(vrc, E_INVALIDARG); 609 609 610 610 size_t cwcOld = length(); … … 615 615 { 616 616 PRTUTF16 pwszDst = &m_bstr[cwcOld]; 617 rc = RTStrToUtf16Ex(pszSrc, cchSrc, &pwszDst, cwcSrc + 1, NULL);618 AssertRCStmt( rc, E_INVALIDARG);617 vrc = RTStrToUtf16Ex(pszSrc, cchSrc, &pwszDst, cwcSrc + 1, NULL); 618 AssertRCStmt(vrc, E_INVALIDARG); 619 619 } 620 620 m_bstr[cwcTotal] = '\0';
Note:
See TracChangeset
for help on using the changeset viewer.