- Timestamp:
- Oct 26, 2009 1:02:06 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r24024 r24074 2566 2566 tr("Setting passthrough rejected as the device attached to device slot %d on port %d of controller '%ls' is not a DVD"), 2567 2567 aDevice, aControllerPort, aControllerName); 2568 pAttach->updatePassthrough( aPassthrough);2568 pAttach->updatePassthrough(!!aPassthrough); 2569 2569 2570 2570 return S_OK; … … 3771 3771 3772 3772 /* may not be busy */ 3773 AssertReturn(!Global::IsOnlineOrTransient 3773 AssertReturn(!Global::IsOnlineOrTransient(mData->mMachineState), E_FAIL); 3774 3774 3775 3775 /* get the session PID */ 3776 3776 RTPROCESS pid = NIL_RTPROCESS; 3777 AssertCompile (sizeof (ULONG) == sizeof(RTPROCESS));3778 aControl->GetPID 3779 Assert 3777 AssertCompile(sizeof(ULONG) == sizeof(RTPROCESS)); 3778 aControl->GetPID((ULONG *) &pid); 3779 Assert(pid != NIL_RTPROCESS); 3780 3780 3781 3781 if (mData->mSession.mState == SessionState_Spawning) … … 3800 3800 ComObjPtr<SessionMachine> sessionMachine; 3801 3801 sessionMachine.createObject(); 3802 HRESULT rc = sessionMachine->init 3803 AssertComRC 3802 HRESULT rc = sessionMachine->init(this); 3803 AssertComRC(rc); 3804 3804 3805 3805 /* NOTE: doing return from this function after this point but … … 3812 3812 { 3813 3813 #ifdef VBOX_WITH_RESOURCE_USAGE_API 3814 registerMetrics 3814 registerMetrics(mParent->performanceCollector(), this, pid); 3815 3815 #endif /* VBOX_WITH_RESOURCE_USAGE_API */ 3816 3816 … … 3836 3836 3837 3837 LogFlowThisFunc(("Calling AssignMachine()...\n")); 3838 rc = aControl->AssignMachine 3838 rc = aControl->AssignMachine(sessionMachine); 3839 3839 LogFlowThisFunc(("AssignMachine() returned %08X\n", rc)); 3840 3840 3841 3841 /* The failure may occur w/o any error info (from RPC), so provide one */ 3842 if (FAILED 3843 setError 3844 tr 3842 if (FAILED(rc)) 3843 setError(VBOX_E_VM_ERROR, 3844 tr("Failed to assign the machine to the session (%Rrc)"), rc); 3845 3845 3846 3846 if (SUCCEEDED(rc) && origState == SessionState_Spawning) … … 3850 3850 /* get the console from the direct session */ 3851 3851 ComPtr<IConsole> console; 3852 rc = aControl->GetRemoteConsole 3853 ComAssertComRC 3852 rc = aControl->GetRemoteConsole(console.asOutParam()); 3853 ComAssertComRC(rc); 3854 3854 3855 3855 if (SUCCEEDED(rc) && !console) 3856 3856 { 3857 ComAssert 3857 ComAssert(!!console); 3858 3858 rc = E_FAIL; 3859 3859 } … … 3868 3868 LogFlowThisFunc(("Calling AssignRemoteMachine()...\n")); 3869 3869 rc = mData->mSession.mRemoteControls.front()-> 3870 AssignRemoteMachine 3870 AssignRemoteMachine(sessionMachine, console); 3871 3871 LogFlowThisFunc(("AssignRemoteMachine() returned %08X\n", rc)); 3872 3872 … … 3932 3932 * at least on XPCOM) */ 3933 3933 ComPtr<IUnknown> unk = mData->mSession.mDirectControl; 3934 NOREF 3934 NOREF(unk); 3935 3935 } 3936 3936 … … 3938 3938 { 3939 3939 /* finalize the progress after setting the state, for consistency */ 3940 mData->mSession.mProgress->notifyComplete 3940 mData->mSession.mProgress->notifyComplete(rc); 3941 3941 mData->mSession.mProgress.setNull(); 3942 3942 } … … 4407 4407 4408 4408 /* VirtualBox::addProcessToReap() needs a write lock */ 4409 AutoMultiWriteLock2 alock 4409 AutoMultiWriteLock2 alock(mParent, this); 4410 4410 4411 4411 if (mData->mSession.mState != SessionState_Spawning) … … 4418 4418 HRESULT rc = S_OK; 4419 4419 4420 #if defined (RT_OS_WINDOWS) || defined(RT_OS_OS2)4420 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 4421 4421 4422 4422 /* the process was already unexpectedly terminated, we just need to set an … … 4427 4427 #else 4428 4428 4429 /* PID not yet initialized, skip check. */ 4430 if (mData->mSession.mPid == NIL_RTPROCESS) 4431 return false; 4432 4429 4433 RTPROCSTATUS status; 4430 int vrc = ::RTProcWait 4431 4434 int vrc = ::RTProcWait(mData->mSession.mPid, RTPROCWAIT_FLAGS_NOBLOCK, 4435 &status); 4432 4436 4433 4437 if (vrc != VERR_PROCESS_RUNNING) … … 4443 4447 * the relevant part in checkForSpawnFailure()). */ 4444 4448 4445 Assert 4449 Assert(mData->mSession.mRemoteControls.size() == 1); 4446 4450 if (mData->mSession.mRemoteControls.size() == 1) 4447 4451 { … … 4454 4458 4455 4459 /* finalize the progress after setting the state, for consistency */ 4456 mData->mSession.mProgress->notifyComplete (rc); 4457 mData->mSession.mProgress.setNull(); 4458 4459 mParent->addProcessToReap (mData->mSession.mPid); 4460 if (!mData->mSession.mProgress.isNull()) 4461 { 4462 mData->mSession.mProgress->notifyComplete(rc); 4463 mData->mSession.mProgress.setNull(); 4464 } 4465 4466 mParent->addProcessToReap(mData->mSession.mPid); 4460 4467 mData->mSession.mPid = NIL_RTPROCESS; 4461 4468 4462 mParent->onSessionStateChange 4469 mParent->onSessionStateChange(mData->mUuid, SessionState_Closed); 4463 4470 return true; 4464 4471 }
Note:
See TracChangeset
for help on using the changeset viewer.