Changeset 77582 in vbox
- Timestamp:
- Mar 6, 2019 2:18:39 PM (6 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/GuestSessionImpl.h
r77068 r77582 307 307 ULONG i_getId(void) { return mData.mSession.mID; } 308 308 static Utf8Str i_guestErrorToString(int guestRc); 309 HRESULT i_isReadyExternal(void); 309 bool i_isStarted(void) const; 310 HRESULT i_isStartedExternal(void); 311 bool i_isTerminated(void) const; 310 312 int i_onRemove(void); 311 313 int i_onSessionStatusChange(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData); -
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r77527 r77582 542 542 HRESULT GuestSession::getUserHome(com::Utf8Str &aUserHome) 543 543 { 544 HRESULT hr = i_is ReadyExternal();544 HRESULT hr = i_isStartedExternal(); 545 545 if (FAILED(hr)) 546 546 return hr; … … 580 580 HRESULT GuestSession::getUserDocuments(com::Utf8Str &aUserDocuments) 581 581 { 582 HRESULT hr = i_is ReadyExternal();582 HRESULT hr = i_isStartedExternal(); 583 583 if (FAILED(hr)) 584 584 return hr; … … 741 741 const com::Utf8Str &strDestination, ComPtr<IProgress> &pProgress) 742 742 { 743 HRESULT hrc = i_is ReadyExternal();743 HRESULT hrc = i_isStartedExternal(); 744 744 if (FAILED(hrc)) 745 745 return hrc; … … 812 812 const com::Utf8Str &strDestination, ComPtr<IProgress> &pProgress) 813 813 { 814 HRESULT hrc = i_is ReadyExternal();814 HRESULT hrc = i_isStartedExternal(); 815 815 if (FAILED(hrc)) 816 816 return hrc; … … 1733 1733 1734 1734 /** 1735 * Returns whether the session is in a started state or not. 1736 * 1737 * @returns \c true if in a started state, or \c false if not. 1738 */ 1739 bool GuestSession::i_isStarted(void) const 1740 { 1741 return (mData.mStatus == GuestSessionStatus_Started); 1742 } 1743 1744 /** 1735 1745 * Checks if this session is ready state where it can handle 1736 1746 * all session-bound actions (like guest processes, guest files). … … 1738 1748 * error when not ready. 1739 1749 */ 1740 HRESULT GuestSession::i_is ReadyExternal(void)1750 HRESULT GuestSession::i_isStartedExternal(void) 1741 1751 { 1742 1752 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1743 1753 1744 1754 /** @todo Be a bit more informative. */ 1745 if ( mData.mStatus != GuestSessionStatus_Started)1755 if (!i_isStarted()) 1746 1756 return setError(E_UNEXPECTED, tr("Session is not in started state")); 1747 1757 1748 1758 return S_OK; 1759 } 1760 1761 /** 1762 * Returns whether the session is in a terminated state or not. 1763 * 1764 * @returns \c true if in a terminated state, or \c false if not. 1765 */ 1766 bool GuestSession::i_isTerminated(void) const 1767 { 1768 switch (mData.mStatus) 1769 { 1770 case GuestSessionStatus_Undefined: 1771 RT_FALL_THROUGH(); 1772 case GuestSessionStatus_Starting: 1773 RT_FALL_THROUGH(); 1774 case GuestSessionStatus_Started: 1775 RT_FALL_THROUGH(); 1776 case GuestSessionStatus_Terminating: 1777 RT_FALL_THROUGH(); 1778 case GuestSessionStatus_32BitHack: 1779 break; 1780 1781 case GuestSessionStatus_Terminated: 1782 case GuestSessionStatus_TimedOutKilled: 1783 case GuestSessionStatus_TimedOutAbnormally: 1784 case GuestSessionStatus_Down: 1785 case GuestSessionStatus_Error: 1786 return true; 1787 1788 default: 1789 break; 1790 } 1791 1792 return false; 1749 1793 } 1750 1794 … … 3140 3184 } 3141 3185 3142 HRESULT hrc = i_is ReadyExternal();3186 HRESULT hrc = i_isStartedExternal(); 3143 3187 if (FAILED(hrc)) 3144 3188 return hrc; … … 3188 3232 return setError(E_INVALIDARG, tr("No directory name specified")); 3189 3233 3190 HRESULT hrc = i_is ReadyExternal();3234 HRESULT hrc = i_isStartedExternal(); 3191 3235 if (FAILED(hrc)) 3192 3236 return hrc; … … 3222 3266 return setError(E_INVALIDARG, tr("No directory to check existence for specified")); 3223 3267 3224 HRESULT hrc = i_is ReadyExternal();3268 HRESULT hrc = i_isStartedExternal(); 3225 3269 if (FAILED(hrc)) 3226 3270 return hrc; … … 3282 3326 } 3283 3327 3284 HRESULT hrc = i_is ReadyExternal();3328 HRESULT hrc = i_isStartedExternal(); 3285 3329 if (FAILED(hrc)) 3286 3330 return hrc; … … 3330 3374 return setError(E_INVALIDARG, tr("No directory to remove specified")); 3331 3375 3332 HRESULT hrc = i_is ReadyExternal();3376 HRESULT hrc = i_isStartedExternal(); 3333 3377 if (FAILED(hrc)) 3334 3378 return hrc; … … 3395 3439 } 3396 3440 3397 HRESULT hrc = i_is ReadyExternal();3441 HRESULT hrc = i_isStartedExternal(); 3398 3442 if (FAILED(hrc)) 3399 3443 return hrc; … … 3594 3638 return S_OK; 3595 3639 3596 HRESULT hrc = i_is ReadyExternal();3640 HRESULT hrc = i_isStartedExternal(); 3597 3641 if (FAILED(hrc)) 3598 3642 return hrc; … … 3658 3702 return setError(E_INVALIDARG, tr("No file to open specified")); 3659 3703 3660 HRESULT hrc = i_is ReadyExternal();3704 HRESULT hrc = i_isStartedExternal(); 3661 3705 if (FAILED(hrc)) 3662 3706 return hrc; … … 3768 3812 return setError(E_INVALIDARG, tr("No path specified")); 3769 3813 3770 HRESULT hrc = i_is ReadyExternal();3814 HRESULT hrc = i_isStartedExternal(); 3771 3815 if (FAILED(hrc)) 3772 3816 return hrc; … … 3797 3841 return setError(E_INVALIDARG, tr("No path specified")); 3798 3842 3799 HRESULT hrc = i_is ReadyExternal();3843 HRESULT hrc = i_isStartedExternal(); 3800 3844 if (FAILED(hrc)) 3801 3845 return hrc; … … 3841 3885 return setError(E_INVALIDARG, tr("No path specified")); 3842 3886 3843 HRESULT hrc = i_is ReadyExternal();3887 HRESULT hrc = i_isStartedExternal(); 3844 3888 if (FAILED(hrc)) 3845 3889 return hrc; … … 3881 3925 return setError(E_INVALIDARG, tr("No path specified")); 3882 3926 3883 HRESULT hrc = i_is ReadyExternal();3927 HRESULT hrc = i_isStartedExternal(); 3884 3928 if (FAILED(hrc)) 3885 3929 return hrc; … … 3923 3967 return setError(E_INVALIDARG, tr("No destination path specified")); 3924 3968 3925 HRESULT hrc = i_is ReadyExternal();3969 HRESULT hrc = i_isStartedExternal(); 3926 3970 if (FAILED(hrc)) 3927 3971 return hrc; … … 4023 4067 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 4024 4068 4025 HRESULT hr = i_is ReadyExternal();4069 HRESULT hr = i_isStartedExternal(); 4026 4070 if (FAILED(hr)) 4027 4071 return hr;
Note:
See TracChangeset
for help on using the changeset viewer.