VirtualBox

Changeset 66902 in vbox for trunk/src/VBox/Main/include


Ignore:
Timestamp:
May 15, 2017 11:21:57 PM (8 years ago)
Author:
vboxsync
Message:

VBox/Main: ​bugref:3300: VBoxSVC from terminal server session is not 'visible' - added client token to track client lifetime

Location:
trunk/src/VBox/Main/include
Files:
2 edited

Legend:

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

    r66629 r66902  
    9494
    9595        ComPtr<IVirtualBox> m_pVirtualBox;
     96        ComPtr<IToken> m_pToken;
    9697        const ComObjPtr<EventSource> m_pEventSource;
    9798
  • trunk/src/VBox/Main/include/VirtualBoxSDSImpl.h

    r66279 r66902  
    2020
    2121#include "VirtualBoxSDSWrap.h"
     22#include "TokenWrap.h"
    2223
    2324#ifdef RT_OS_WINDOWS
    2425# include "win/resource.h"
    2526#endif
     27
     28 /**
     29 * The MediumLockToken class automates cleanup of a Medium lock.
     30 */
     31class ATL_NO_VTABLE VirtualBoxToken :
     32    public TokenWrap
     33{
     34public:
     35
     36    DECLARE_EMPTY_CTOR_DTOR(VirtualBoxToken)
     37
     38    HRESULT FinalConstruct();
     39    void FinalRelease();
     40
     41    // public initializer/uninitializer for internal purposes only
     42    HRESULT init(const std::wstring& wstrUserName);
     43    void uninit();
     44
     45    /**
     46    * Fabrique method to create and initialize COM token object.
     47    *
     48    * @param aToken         Pointer to result Token COM object.
     49    * @param wstrUserName   User name of client for that we create the token
     50    */
     51    static HRESULT CreateToken(ComPtr<IToken>& aToken, const std::wstring& wstrUserName);
     52
     53    // Trace COM reference counting in debug mode
     54#ifdef RT_STRICT
     55    virtual ULONG InternalAddRef();
     56    virtual ULONG InternalRelease();
     57#endif
     58   
     59private:
     60
     61    // wrapped IToken methods
     62    HRESULT abandon(AutoCaller &aAutoCaller);
     63    HRESULT dummy();
     64
     65    // data
     66    struct Data
     67    {
     68        std::wstring wstrUserName;
     69    };
     70
     71    Data m;
     72};
    2673
    2774class ATL_NO_VTABLE VirtualBoxSDS :
     
    61108    *    either from cahce or makes new one.
    62109    */
    63     HRESULT getVirtualBox(ComPtr<IVirtualBox> &aVirtualBox);
    64 
    65     /**
    66     *  Should be called by client to deregister it from VBoxSDS when client beign finished
    67     */
    68     HRESULT releaseVirtualBox();
     110    HRESULT getVirtualBox(ComPtr<IVirtualBox> &aVirtualBox, ComPtr<IToken> &aToken);
    69111
    70112    // Wrapped IVirtualBoxSDS methods
     
    92134    class VirtualBoxCache;
    93135    static VirtualBoxCache m_cache;
     136    friend VirtualBoxToken;
    94137};
    95138
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