VirtualBox

Changeset 57134 in vbox


Ignore:
Timestamp:
Jul 30, 2015 5:56:59 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
101875
Message:

Main/Machine: fix session state checking helpers (properly distinguishing "only VM sessions" from "all sessions"), to hopefully fix the Windows session crash detection

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/MachineImpl.h

    r56820 r57134  
    566566    bool i_isSessionOpen(ComObjPtr<SessionMachine> &aMachine,
    567567                         ComPtr<IInternalSessionControl> *aControl = NULL,
     568                         bool aRequireVM = false,
    568569                         bool aAllowClosing = false);
    569570    bool i_isSessionSpawning();
     
    571572    bool i_isSessionOpenOrClosing(ComObjPtr<SessionMachine> &aMachine,
    572573                                  ComPtr<IInternalSessionControl> *aControl = NULL)
    573     { return i_isSessionOpen(aMachine, aControl, true /* aAllowClosing */); }
     574    { return i_isSessionOpen(aMachine, aControl, false /* aRequireVM */, true /* aAllowClosing */); }
     575
     576    bool i_isSessionOpenVM(ComObjPtr<SessionMachine> &aMachine,
     577                           ComPtr<IInternalSessionControl> *aControl = NULL)
     578    { return i_isSessionOpen(aMachine, aControl, true /* aRequireVM */, false /* aAllowClosing */); }
    574579
    575580    bool i_checkForSpawnFailure();
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r56994 r57134  
    77477747 * @param aMachine      Session machine object.
    77487748 * @param aControl      Direct session control object (optional).
     7749 * @param aRequireVM    If true then only allow VM sessions.
    77497750 * @param aAllowClosing If true then additionally a session which is currently
    77507751 *                      being closed will also be allowed.
     
    77547755bool Machine::i_isSessionOpen(ComObjPtr<SessionMachine> &aMachine,
    77557756                              ComPtr<IInternalSessionControl> *aControl /*= NULL*/,
     7757                              bool aRequireVM /*= false*/,
    77567758                              bool aAllowClosing /*= false*/)
    77577759{
     
    77667768
    77677769    if (    (   mData->mSession.mState == SessionState_Locked
    7768              && mData->mSession.mLockType == LockType_VM)
     7770             && (!aRequireVM || mData->mSession.mLockType == LockType_VM))
    77697771         || (aAllowClosing && mData->mSession.mState == SessionState_Unlocking)
    77707772       )
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r56398 r57134  
    30363036
    30373037/**
    3038  * Returns the list of opened machines (machines having direct sessions opened
    3039  * by client processes) and optionally the list of direct session controls.
     3038 * Returns the list of opened machines (machines having VM sessions opened,
     3039 * ignoring other sessions) and optionally the list of direct session controls.
    30403040 *
    30413041 * @param aMachines     Where to put opened machines (will be empty if none).
     
    30693069        ComObjPtr<SessionMachine> sm;
    30703070        ComPtr<IInternalSessionControl> ctl;
    3071         if ((*it)->i_isSessionOpen(sm, &ctl))
     3071        if ((*it)->i_isSessionOpenVM(sm, &ctl))
    30723072        {
    30733073            aMachines.push_back(sm);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette