Changeset 55800 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- May 11, 2015 2:09:09 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r55769 r55800 2674 2674 HRESULT Machine::getSessionState(SessionState_T *aSessionState) 2675 2675 { 2676 2677 2676 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 2678 2677 … … 2682 2681 } 2683 2682 2684 HRESULT Machine::getSession Type(com::Utf8Str &aSessionType)2683 HRESULT Machine::getSessionName(com::Utf8Str &aSessionName) 2685 2684 { 2686 2685 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 2687 2686 2688 aSession Type = mData->mSession.mType;2687 aSessionName = mData->mSession.mName; 2689 2688 2690 2689 return S_OK; … … 3223 3222 E_INVALIDARG); 3224 3223 3224 // session name (only used in some code paths) 3225 Utf8Str strSessionName; 3226 3225 3227 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 3226 3228 … … 3437 3439 tr("Failed to assign the machine to the session (%Rhrc)"), rc); 3438 3440 3441 // get session name, either to remember or to compare against 3442 // the already known session name. 3443 { 3444 Bstr bstrSessionName; 3445 HRESULT rc2 = aSession->COMGETTER(Name)(bstrSessionName.asOutParam()); 3446 if (SUCCEEDED(rc2)) 3447 strSessionName = bstrSessionName; 3448 } 3449 3439 3450 if ( SUCCEEDED(rc) 3440 3451 && fLaunchingVMProcess … … 3485 3496 if (fLaunchingVMProcess) 3486 3497 { 3498 Assert(mData->mSession.mName == strSessionName); 3487 3499 /* Note that the progress object is finalized later */ 3488 3500 /** @todo Consider checking mData->mSession.mProgress for cancellation … … 3522 3534 mData->mSession.mDirectControl = pSessionControl; 3523 3535 mData->mSession.mState = SessionState_Locked; 3536 if (!fLaunchingVMProcess) 3537 mData->mSession.mName = strSessionName; 3524 3538 /* associate the SessionMachine with this Machine */ 3525 3539 mData->mSession.mMachine = sessionMachine; … … 3561 3575 */ 3562 3576 HRESULT Machine::launchVMProcess(const ComPtr<ISession> &aSession, 3563 const com::Utf8Str &a Type,3577 const com::Utf8Str &aName, 3564 3578 const com::Utf8Str &aEnvironment, 3565 3579 ComPtr<IProgress> &aProgress) 3566 3580 { 3567 Utf8Str strFrontend(a Type);3581 Utf8Str strFrontend(aName); 3568 3582 /* "emergencystop" doesn't need the session, so skip the checks/interface 3569 3583 * retrieval. This code doesn't quite fit in here, but introducing a … … 7430 7444 if (fSeparate) 7431 7445 { 7432 if (mData->mSession.mState != SessionState_Unlocked && mData->mSession.m Type.compare("headless", Utf8Str::CaseInsensitive))7446 if (mData->mSession.mState != SessionState_Unlocked && mData->mSession.mName == "headless") 7433 7447 return setError(VBOX_E_INVALID_OBJECT_STATE, 7434 7448 tr("The machine '%s' is in a state which is incompatible with launching a separate UI process"), … … 7531 7545 #endif 7532 7546 7547 Utf8Str strCanonicalName; 7533 7548 7534 7549 #ifdef VBOX_WITH_QTGUI … … 7539 7554 || !strFrontend.compare("GUI/Qt/separate", Utf8Str::CaseInsensitive)) 7540 7555 { 7556 strCanonicalName = "GUI/Qt"; 7541 7557 # ifdef RT_OS_DARWIN /* Avoid Launch Services confusing this with the selector by using a helper app. */ 7542 7558 /* Modify the base path so that we don't need to use ".." below. */ … … 7607 7623 || !strFrontend.compare("GUI/SDL/separate", Utf8Str::CaseInsensitive)) 7608 7624 { 7625 strCanonicalName = "GUI/SDL"; 7609 7626 static const char s_szVBoxSDL_exe[] = "VBoxSDL" HOSTSUFF_EXE; 7610 7627 Assert(cchBufLeft >= sizeof(s_szVBoxSDL_exe)); … … 7641 7658 ) 7642 7659 { 7660 strCanonicalName = "headless"; 7643 7661 /* On pre-4.0 the "headless" type was used for passing "--vrdp off" to VBoxHeadless to let it work in OSE, 7644 7662 * which did not contain VRDP server. In VBox 4.0 the remote desktop server (VRDE) is optional, … … 7732 7750 mData->mSession.mPID = pid; 7733 7751 mData->mSession.mState = SessionState_Spawning; 7734 mData->mSession.mType = strFrontend; 7752 Assert(strCanonicalName.isNotEmpty()); 7753 mData->mSession.mName = strCanonicalName; 7735 7754 } 7736 7755 else … … 12654 12673 mData->mSession.mMachine.setNull(); 12655 12674 mData->mSession.mState = SessionState_Unlocked; 12656 mData->mSession.m Type.setNull();12675 mData->mSession.mName.setNull(); 12657 12676 12658 12677 /* destroy the machine client token before leaving the exclusive lock */
Note:
See TracChangeset
for help on using the changeset viewer.