Changeset 94949 in vbox
- Timestamp:
- May 9, 2022 11:45:03 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/SessionImpl.cpp
r93444 r94949 58 58 LogFlowThisFunc(("\n")); 59 59 60 HRESULT rc = init();60 HRESULT hrc = init(); 61 61 62 62 BaseFinalConstruct(); 63 63 64 return rc;64 return hrc; 65 65 } 66 66 … … 127 127 mState == SessionState_Spawning); 128 128 129 HRESULT rc = i_unlockMachine(true /* aFinalRelease */, false /* aFromServer */, alock);130 AssertComRC( rc);129 HRESULT hrc = i_unlockMachine(true /* aFinalRelease */, false /* aFromServer */, alock); 130 AssertComRC(hrc); 131 131 } 132 132 … … 181 181 CHECK_OPEN(); 182 182 183 HRESULT rc;183 HRESULT hrc; 184 184 #ifndef VBOX_COM_INPROC_API_CLIENT 185 185 if (mConsole) 186 rc = mConsole->i_machine().queryInterfaceTo(aMachine.asOutParam());186 hrc = mConsole->i_machine().queryInterfaceTo(aMachine.asOutParam()); 187 187 else 188 188 #endif 189 rc = mRemoteMachine.queryInterfaceTo(aMachine.asOutParam());190 if (FAILED( rc))189 hrc = mRemoteMachine.queryInterfaceTo(aMachine.asOutParam()); 190 if (FAILED(hrc)) 191 191 { 192 192 #ifndef VBOX_COM_INPROC_API_CLIENT 193 193 if (mConsole) 194 setError( rc, tr("Failed to query the session machine"));194 setError(hrc, tr("Failed to query the session machine")); 195 195 else 196 196 #endif 197 if (FAILED_DEAD_INTERFACE( rc))198 setError( rc, tr("Peer process crashed"));197 if (FAILED_DEAD_INTERFACE(hrc)) 198 setError(hrc, tr("Peer process crashed")); 199 199 else 200 setError( rc, tr("Failed to query the remote session machine"));201 } 202 203 return rc;200 setError(hrc, tr("Failed to query the remote session machine")); 201 } 202 203 return hrc; 204 204 } 205 205 … … 210 210 CHECK_OPEN(); 211 211 212 HRESULT rc = S_OK;212 HRESULT hrc = S_OK; 213 213 #ifndef VBOX_COM_INPROC_API_CLIENT 214 214 if (mConsole) 215 rc = mConsole.queryInterfaceTo(aConsole.asOutParam());215 hrc = mConsole.queryInterfaceTo(aConsole.asOutParam()); 216 216 else 217 217 #endif 218 rc = mRemoteConsole.queryInterfaceTo(aConsole.asOutParam());219 220 if (FAILED( rc))218 hrc = mRemoteConsole.queryInterfaceTo(aConsole.asOutParam()); 219 220 if (FAILED(hrc)) 221 221 { 222 222 #ifndef VBOX_COM_INPROC_API_CLIENT 223 223 if (mConsole) 224 setError( rc, tr("Failed to query the console"));224 setError(hrc, tr("Failed to query the console")); 225 225 else 226 226 #endif 227 if (FAILED_DEAD_INTERFACE( rc))228 setError( rc, tr("Peer process crashed"));227 if (FAILED_DEAD_INTERFACE(hrc)) 228 setError(hrc, tr("Peer process crashed")); 229 229 else 230 setError( rc, tr("Failed to query the remote console"));231 } 232 233 return rc;230 setError(hrc, tr("Failed to query the remote console")); 231 } 232 233 return hrc; 234 234 } 235 235 … … 336 336 AssertReturn(!!mControl, E_FAIL); 337 337 338 HRESULT rc = S_OK;338 HRESULT hrc = S_OK; 339 339 #ifndef VBOX_COM_INPROC_API_CLIENT 340 340 if (aLockType == LockType_VM) … … 342 342 /* This is what is special about VM processes: they have a Console 343 343 * object which is the root of all VM related activity. */ 344 rc = mConsole.createObject();345 AssertComRCReturn( rc,rc);346 347 rc = mConsole->initWithMachine(aMachine, mControl, aLockType);348 AssertComRCReturn( rc,rc);344 hrc = mConsole.createObject(); 345 AssertComRCReturn(hrc, hrc); 346 347 hrc = mConsole->initWithMachine(aMachine, mControl, aLockType); 348 AssertComRCReturn(hrc, hrc); 349 349 } 350 350 else … … 373 373 delete mClientTokenHolder; 374 374 mClientTokenHolder = NULL; 375 rc = E_FAIL;375 hrc = E_FAIL; 376 376 } 377 377 } 378 378 catch (std::bad_alloc &) 379 379 { 380 rc = E_OUTOFMEMORY;380 hrc = E_OUTOFMEMORY; 381 381 } 382 382 … … 385 385 * until the session is closed 386 386 */ 387 if (SUCCEEDED( rc))388 rc = aMachine->COMGETTER(Parent)(mVirtualBox.asOutParam());389 390 if (SUCCEEDED( rc))387 if (SUCCEEDED(hrc)) 388 hrc = aMachine->COMGETTER(Parent)(mVirtualBox.asOutParam()); 389 390 if (SUCCEEDED(hrc)) 391 391 { 392 392 mType = SessionType_WriteLock; … … 406 406 } 407 407 408 return rc;408 return hrc; 409 409 } 410 410 … … 420 420 mState == SessionState_Spawning, VBOX_E_INVALID_VM_STATE); 421 421 422 HRESULT rc = E_FAIL;422 HRESULT hrc = E_FAIL; 423 423 424 424 /* query IInternalMachineControl interface */ … … 449 449 * until the session is closed 450 450 */ 451 rc = aMachine->COMGETTER(Parent)(mVirtualBox.asOutParam());452 453 if (SUCCEEDED( rc))451 hrc = aMachine->COMGETTER(Parent)(mVirtualBox.asOutParam()); 452 453 if (SUCCEEDED(hrc)) 454 454 { 455 455 /* … … 472 472 } 473 473 474 LogFlowThisFunc((" rc=%08X\n",rc));474 LogFlowThisFunc(("hrc=%08X\n", hrc)); 475 475 LogFlowThisFuncLeave(); 476 476 477 return rc;477 return hrc; 478 478 } 479 479 … … 519 519 AutoCaller autoCaller(this); 520 520 521 HRESULT rc = S_OK;521 HRESULT hrc = S_OK; 522 522 523 523 if (getObjectState().getState() == ObjectState::Ready) … … 547 547 548 548 /* close ourselves */ 549 rc = i_unlockMachine(false /* aFinalRelease */, true /* aFromServer */, alock);549 hrc = i_unlockMachine(false /* aFinalRelease */, true /* aFromServer */, alock); 550 550 } 551 551 else if (getObjectState().getState() == ObjectState::InUninit) … … 560 560 { 561 561 Log1WarningThisFunc(("UNEXPECTED uninitialization!\n")); 562 rc = autoCaller.rc();563 } 564 565 LogFlowThisFunc((" rc=%08X\n",rc));562 hrc = autoCaller.rc(); 563 } 564 565 LogFlowThisFunc(("hrc=%08X\n", hrc)); 566 566 LogFlowThisFuncLeave(); 567 567 568 return rc;568 return hrc; 569 569 } 570 570 … … 1117 1117 1118 1118 bool fLeftPaused = false; 1119 HRESULT rc = mConsole->i_saveState(aReason, aProgress, aSnapshot, aStateFilePath, !!aPauseVM, fLeftPaused);1119 HRESULT hrc = mConsole->i_saveState(aReason, aProgress, aSnapshot, aStateFilePath, !!aPauseVM, fLeftPaused); 1120 1120 if (aLeftPaused) 1121 1121 *aLeftPaused = fLeftPaused; 1122 return rc;1122 return hrc; 1123 1123 #else 1124 1124 RT_NOREF(aReason, aProgress, aSnapshot, aStateFilePath, aPauseVM, aLeftPaused); … … 1238 1238 1239 1239 LogFlowThisFunc(("Calling mControl->OnSessionEnd()...\n")); 1240 HRESULT rc = mControl->OnSessionEnd(this, progress.asOutParam());1241 LogFlowThisFunc(("mControl->OnSessionEnd()=%08X\n", rc));1240 HRESULT hrc = mControl->OnSessionEnd(this, progress.asOutParam()); 1241 LogFlowThisFunc(("mControl->OnSessionEnd()=%08X\n", hrc)); 1242 1242 1243 1243 aLockW.acquire(); … … 1250 1250 * ObjectState::addCaller. 1251 1251 */ 1252 if (mType != SessionType_WriteLock && ( rc == E_UNEXPECTED ||rc == E_ACCESSDENIED))1253 rc = S_OK;1252 if (mType != SessionType_WriteLock && (hrc == E_UNEXPECTED || hrc == E_ACCESSDENIED)) 1253 hrc = S_OK; 1254 1254 1255 1255 #if !defined(DEBUG_bird) && !defined(DEBUG_andy) /* I don't want clients crashing on me just because VBoxSVC went belly up. */ 1256 AssertComRC( rc);1256 AssertComRC(hrc); 1257 1257 #endif 1258 1258 }
Note:
See TracChangeset
for help on using the changeset viewer.