VirtualBox

Changeset 58329 in vbox for trunk/include/VBox/HostServices


Ignore:
Timestamp:
Oct 20, 2015 10:05:12 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
103528
Message:

DnD: Updates/bugfixes:

  • Added separate VBOXDNDDISCONNECTMSG message for letting Main know about client disconnects.
  • Various cleanups and bugfixes.
Location:
trunk/include/VBox/HostServices
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/HostServices/DragAndDropSvc.h

    r58257 r58329  
    3232 * Protocol changelog:
    3333 *
    34  *     Protocol v1 (VBox < 5.0):
    35  *         - Initial implementation which only implemented host to guest transfers.
    36  *         - For file transfers all file information such as the file name and file size were
     34 *     Protocol v1 (VBox < 5.0, deprecated):
     35 *         | Initial implementation which only implemented host to guest transfers.
     36 *         | For file transfers all file information such as the file name and file size were
    3737 *           transferred with every file data chunk being sent.
    3838 *
    39  *     Protocol v2 (VBox 5.0):
    40  *         - Added support for guest to host transfers.
    41  *         - Added protocol version support through VBOXDNDCONNECTMSG. The host takes the installed
     39 *     Protocol v2 (VBox 5.0 - VBox 5.0.8, deprecated):
     40 *         + Added support for guest to host transfers.
     41 *         + Added protocol version support through VBOXDNDCONNECTMSG. The host takes the installed
    4242 *           Guest Additions version as indicator which protocol to use for communicating with the guest.
    4343 *           The guest itself uses VBOXDNDCONNECTMSG to report its supported protocol version to the DnD service.
    4444 *
    45  *     Protocol v3 (VBox 5.0+):
    46              Added context IDs for every HGCM message. Not used yet and must be 0.
    47  *         - Added VBOXDNDSNDDATAHDR and VBOXDNDCBSNDDATAHDRDATA to support (simple) accounting of objects
     45 *     Protocol v3 (VBox 5.0.10 and up, current):
     46 *         + Added VBOXDNDDISCONNECTMSG for being able to track client disconnects on host side (Main).
     47 *         + Added context IDs for every HGCM message. Not used yet and must be 0.
     48 *         + Added VBOXDNDSNDDATAHDR and VBOXDNDCBSNDDATAHDRDATA to support (simple) accounting of objects
    4849 *           being transferred, along with supplying separate meta data size (which is part of the total size being sent).
    49  *         - Added new HOST_DND_HG_SND_DATA_HDR + GUEST_DND_GH_SND_DATA_HDR commands which now allow specifying an optional
     50 *         + Added new HOST_DND_HG_SND_DATA_HDR + GUEST_DND_GH_SND_DATA_HDR commands which now allow specifying an optional
    5051 *           compression type and defining a checksum for the overall data transfer.
    51  *         - Enhannced VBOXDNDGHSENDDATAMSG to support (rolling) checksums for the supplied data block.
    52  *         - VBOXDNDHGSENDFILEDATAMSG and VBOXDNDGHSENDFILEDATAMSG are now sharing the same HGCM mesasge.
    53  *         - VBOXDNDHGSENDDATAMSG and VBOXDNDGHSENDDATAMSG can now contain an optional checksum for the current data block.
     52 *         + Enhannced VBOXDNDGHSENDDATAMSG to support (rolling) checksums for the supplied data block.
     53 *         + VBOXDNDHGSENDDATAMSG and VBOXDNDGHSENDDATAMSG can now contain an optional checksum for the current data block.
     54 *         | VBOXDNDHGSENDFILEDATAMSG and VBOXDNDGHSENDFILEDATAMSG are now sharing the same HGCM mesasge.
    5455 *         - Removed unused HOST_DND_GH_RECV_DIR, HOST_DND_GH_RECV_FILE_DATA and HOST_DND_GH_RECV_FILE_HDR commands.
    5556 */
     
    184185enum eGuestFn
    185186{
    186     /* Guest sends a connection request to the HGCM service.
     187    /* Guest sends a connection request to the HGCM service,
     188     * along with some additional information like supported
     189     * protocol version and flags.
    187190     * Note: New since protocol version 2. */
    188191    GUEST_DND_CONNECT                  = 10,
     192
     193    /* Sent when a guest client disconnected from the HGCM service. */
     194    GUEST_DND_DISCONNECT               = 11,
    189195
    190196    /**
     
    287293            HGCMFunctionParameter uAllActions;  /* OUT uint32_t */
    288294            HGCMFunctionParameter pvFormats;    /* OUT ptr */
    289             HGCMFunctionParameter cFormats;     /* OUT uint32_t */
     295            HGCMFunctionParameter cbFormats;    /* OUT uint32_t */
    290296        } v1;
    291297        struct
     
    299305            HGCMFunctionParameter uAllActions;  /* OUT uint32_t */
    300306            HGCMFunctionParameter pvFormats;    /* OUT ptr */
    301             HGCMFunctionParameter cFormats;     /* OUT uint32_t */
     307            HGCMFunctionParameter cbFormats;    /* OUT uint32_t */
    302308        } v3;
    303309    } u;
     
    680686
    681687/**
    682  * HG Acknowledge Operation event.
     688 * Acknowledges a host operation along with the allowed
     689 * action(s) on the guest.
    683690 *
    684691 * Used by:
     
    923930    uint32_t                    uFlags;
    924931} VBOXDNDCBCONNECTMSGDATA, *PVBOXDNDCBCONNECTMSGDATA;
     932
     933typedef struct VBOXDNDCBDISCONNECTMSGDATA
     934{
     935    /** Callback data header. */
     936    VBOXDNDCBHEADERDATA         hdr;
     937} VBOXDNDCBDISCONNECTMSGDATA, *PVBOXDNDCBDISCONNECTMSGDATA;
    925938
    926939typedef struct VBOXDNDCBHGGETNEXTHOSTMSG
  • trunk/include/VBox/HostServices/Service.h

    r58106 r58329  
    300300    }
    301301
    302 private:
     302protected:
    303303
    304304    uint32_t m_uClientId;
     
    310310    PVBOXHGCMSVCPARM m_paParms;
    311311};
     312
     313/**
     314 * Structure for keeping a HGCM service context.
     315 */
     316typedef struct VBOXHGCMSVCTX
     317{
     318    /** HGCM helper functions. */
     319    PVBOXHGCMSVCHELPERS pHelpers;
     320    /*
     321     * Callback function supplied by the host for notification of updates
     322     * to properties.
     323     */
     324    PFNHGCMSVCEXT       pfnHostCallback;
     325    /** User data pointer to be supplied to the host callback function. */
     326    void               *pvHostData;
     327} VBOXHGCMSVCTX, *PVBOXHGCMSVCTX;
    312328
    313329template <class T>
     
    383399protected:
    384400    explicit AbstractService(PVBOXHGCMSVCHELPERS pHelpers)
    385         : m_pHelpers(pHelpers)
    386         , m_pfnHostCallback(NULL)
    387         , m_pvHostData(NULL)
    388     {}
     401    {
     402        RT_ZERO(m_SvcCtx);
     403        m_SvcCtx.pHelpers = pHelpers;
     404    }
    389405    virtual int  init(VBOXHGCMSVCFNTABLE *ptable) { return VINF_SUCCESS; }
    390406    virtual int  uninit() { return VINF_SUCCESS; }
     
    396412    /** Type definition for use in callback functions. */
    397413    typedef AbstractService SELF;
    398     /** HGCM helper functions. */
    399     PVBOXHGCMSVCHELPERS m_pHelpers;
    400     /*
    401      * Callback function supplied by the host for notification of updates
    402      * to properties.
    403      */
    404     PFNHGCMSVCEXT m_pfnHostCallback;
    405     /** User data pointer to be supplied to the host callback function. */
    406     void *m_pvHostData;
     414    /** The HGCM service context this service is bound to. */
     415    VBOXHGCMSVCTX m_SvcCtx;
    407416
    408417    /**
     
    500509        LogFlowFunc(("pvService=%p, pfnExtension=%p, pvExtention=%p\n", pvService, pfnExtension, pvExtension));
    501510        SELF *pSelf = reinterpret_cast<SELF *>(pvService);
    502         pSelf->m_pfnHostCallback = pfnExtension;
    503         pSelf->m_pvHostData = pvExtension;
     511        pSelf->m_SvcCtx.pfnHostCallback = pfnExtension;
     512        pSelf->m_SvcCtx.pvHostData      = pvExtension;
    504513        return VINF_SUCCESS;
    505514    }
Note: See TracChangeset for help on using the changeset viewer.

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