VirtualBox

Ignore:
Timestamp:
Apr 8, 2013 9:40:42 PM (12 years ago)
Author:
vboxsync
Message:

GuestCtrl: Implemented using (public) VirtualBox events instead of own callback mechanisms. Bugfixes for testcases (still work in progress).

File:
1 edited

Legend:

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

    r45010 r45415  
    2121
    2222#include "VirtualBoxBase.h"
     23#include "EventImpl.h"
    2324
    2425#include "GuestCtrlImplPrivate.h"
     
    238239class ATL_NO_VTABLE GuestSession :
    239240    public VirtualBoxBase,
     241    public GuestBase,
    240242    VBOX_SCRIPTABLE_IMPL(IGuestSession)
    241243{
     
    271273    STDMETHOD(COMGETTER(Directories))(ComSafeArrayOut(IGuestDirectory *, aDirectories));
    272274    STDMETHOD(COMGETTER(Files))(ComSafeArrayOut(IGuestFile *, aFiles));
     275    STDMETHOD(COMGETTER(EventSource))(IEventSource ** aEventSource);
    273276    /** @}  */
    274277
     
    345348    const GuestCredentials &getCredentials(void);
    346349    const GuestEnvironment &getEnvironment(void);
     350    EventSource            *getEventSource(void) { return mEventSource; }
    347351    Utf8Str                 getName(void);
    348352    ULONG                   getId(void) { return mData.mSession.mID; }
    349353    static Utf8Str          guestErrorToString(int guestRc);
    350     int                     onSessionStatusChange(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, GuestCtrlCallback *pCallback, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData);
     354    HRESULT                 isReadyExternal(void);
     355    int                     onSessionStatusChange(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData);
    351356    int                     startSessionIntenal(int *pGuestRc);
    352357    int                     startSessionAsync(void);
    353358    static DECLCALLBACK(int)
    354359                            startSessionThread(RTTHREAD Thread, void *pvUser);
    355     Guest                  *getParent(void) { return mData.mParent; }
     360    Guest                  *getParent(void) { return mParent; }
    356361    uint32_t                getProtocolVersion(void) { return mData.mProtocolVersion; }
    357362    int                     processRemoveFromList(GuestProcess *pProcess);
     
    361366    int                     sendCommand(uint32_t uFunction, uint32_t uParms, PVBOXHGCMSVCPARM paParms);
    362367    static HRESULT          setErrorExternal(VirtualBoxBase *pInterface, int guestRc);
     368    int                     setSessionStatus(GuestSessionStatus_T sessionStatus, int sessionRc);
     369    int                     signalWaiters(GuestSessionWaitResult_T enmWaitResult, int rc /*= VINF_SUCCESS */);
    363370    int                     startTaskAsync(const Utf8Str &strTaskDesc, GuestSessionTask *pTask, ComObjPtr<Progress> &pProgress);
    364371    int                     queryInfo(void);
    365372    int                     waitFor(uint32_t fWaitFlags, ULONG uTimeoutMS, GuestSessionWaitResult_T &waitResult, int *pGuestRc);
     373    int                     waitForStateChange(uint32_t fWaitFlags, uint32_t uTimeoutMS, GuestSessionStatus_T *pSessionStatus, int *pGuestRc);
    366374    /** @}  */
    367375
    368376private:
     377
     378    /** Pointer to the parent (Guest). */
     379    Guest                          *mParent;
     380    /**
     381     * This can safely be used without holding any locks.
     382     * An AutoCaller suffices to prevent it being destroy while in use and
     383     * internally there is a lock providing the necessary serialization.
     384     */
     385    const ComObjPtr<EventSource>    mEventSource;
    369386
    370387    struct Data
    371388    {
    372         /** Pointer to the parent (Guest). */
    373         Guest                      *mParent;
    374389        /** The session credentials. */
    375390        GuestCredentials            mCredentials;
     
    381396         *  overwritten/extended by ProcessCreate(Ex). */
    382397        GuestEnvironment            mEnvironment;
    383         /** The session callback, needed for communicating
    384          *  with the guest. */
    385         GuestCtrlCallback           mCallback;
    386398        /** Directory objects bound to this session. */
    387399        SessionDirectories          mDirectories;
     
    402414         *  returned from the guest side. */
    403415        int                         mRC;
    404         /** How many waiters? At the moment there can only
    405          *  be one. */
    406         uint32_t                    mWaitCount;
    407         /** The actual session event for doing the waits.
    408          *  At the moment we only support one wait a time. */
    409         GuestSessionWaitEvent      *mWaitEvent;
    410416    } mData;
    411417};
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