VirtualBox

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


Ignore:
Timestamp:
Oct 13, 2015 11:49:33 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
103344
Message:

DnD: Updates.

  • Introduced protocol changelog in DragAndDropSvc.h.
  • Implemented protocol v3 with HOST_DND_HG_SND_DATA_HDR message for doing proper object accounting, among other parameters like checksumming and compression flags.
  • Encapsulated a lot of functionality in class hierarchies.
  • Renamed a lot of functions to make the usage more clear.
  • Various other bugfixes.
File:
1 edited

Legend:

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

    r57500 r58212  
    2222 * You may elect to license modified versions of this file under the
    2323 * terms and conditions of either the GPL or the CDDL or both.
     24 */
     25
     26/**
     27 * Protocol handling and notes:
     28 *     All client/server components should be backwards compatible.
     29 *
     30 ******************************************************************************
     31 *
     32 * Protocol changelog:
     33 *
     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
     37 *           transferred with every file data chunk being sent.
     38 *
     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
     42 *           Guest Additions version as indicator which protocol to use for communicating with the guest.
     43 *           The guest itself uses VBOXDNDCONNECTMSG to report its supported protocol version to the DnD service.
     44 *
     45 *     Protocol v3 (VBox 5.0+):
     46 *         - Added VBOXDNDSNDDATAHDR and VBOXDNDCBSNDDATAHDRDATA to support (simple) accounting of objects
     47 *           being transferred, along with supplying separate meta data size (which is part of the total size being sent).
     48 *         - Added new HOST_DND_HG_SND_DATA_HDR + GUEST_DND_GH_SND_DATA_HDR commands which now allow specifying an optional
     49 *           compression type and defining a checksum for the overall data transfer.
     50 *         - Enhannced VBOXDNDGHSENDDATAMSG to support (rolling) checksums for the supplied data block.
     51 *         - VBOXDNDHGSENDFILEDATAMSG and VBOXDNDGHSENDFILEDATAMSG are now sharing the same HGCM mesasge.
     52 *         - VBOXDNDHGSENDDATAMSG and VBOXDNDGHSENDDATAMSG can now contain an optional checksum for the current data block.
     53 *         - Removed unused HOST_DND_GH_RECV_DIR, HOST_DND_GH_RECV_FILE_DATA and HOST_DND_GH_RECV_FILE_HDR commands.
    2454 */
    2555
     
    106136    /** The host requested to cancel the current DnD operation. */
    107137    HOST_DND_HG_EVT_CANCEL             = 204,
    108     /** Gets the actual MIME data, based on
    109      *  the format(s) specified by HOST_DND_HG_EVT_ENTER. If the guest
    110      *  supplied buffer too small to send the actual data, the host
    111      *  will send a HOST_DND_HG_SND_MORE_DATA message as follow-up. */
     138    /** Sends the data header at the beginning of a (new)
     139     *  data transfer. */
     140    HOST_DND_HG_SND_DATA_HDR           = 210,
     141    /**
     142     * Sends the actual meta data, based on
     143     * the format(s) specified by HOST_DND_HG_EVT_ENTER.
     144     *
     145     * Protocol v1/v2: If the guest supplied buffer too small to send
     146     *                 the actual data, the host will send a HOST_DND_HG_SND_MORE_DATA
     147     *                 message as follow-up.
     148     * Protocol v3+:   The incoming meta data size is specified upfront in the
     149     *                 HOST_DND_HG_SND_DATA_HDR message and must be handled accordingly.
     150     */
    112151    HOST_DND_HG_SND_DATA               = 205,
    113     /** Sent when the actual buffer for HOST_DND_HG_SND_DATA
    114      *  was too small, issued by the DnD host service. */
     152    /** Sent when the actual buffer for HOST_DND_HG_SND_DATA was too small. */
     153    /** @todo Deprecated function; do not use anymore. */
    115154    HOST_DND_HG_SND_MORE_DATA          = 206,
    116155    /** Directory entry to be sent to the guest. */
     
    133172     *  a specific MIME type. */
    134173    HOST_DND_GH_EVT_DROPPED            = 601,
    135     /** Creates a directory on the guest. */
    136     HOST_DND_GH_RECV_DIR               = 650,
    137     /** Retrieves file data from the guest. */
    138     HOST_DND_GH_RECV_FILE_DATA         = 670,
    139     /** Retrieves a file header from the guest.
    140      *  Note: Only for protocol version 2 and up (>= VBox 5.0). */
    141     HOST_DND_GH_RECV_FILE_HDR          = 671,
    142174    /** Blow the type up to 32-bit. */
    143175    HOST_DND_32BIT_HACK                = 0x7fffffff
     
    185217     */
    186218    GUEST_DND_GH_ACK_PENDING           = 500,
     219    /** Sends the data header at the beginning of a (new)
     220     *  data transfer. */
     221    GUEST_DND_GH_SND_DATA_HDR          = 503,
    187222    /**
    188223     * Sends data of the requested format to the host. There can
     
    227262 */
    228263
     264/**
     265 * Action message for telling the guest about the currently ongoing
     266 * drag and drop action when entering the guest's area, moving around in it
     267 * and dropping content into it from the host.
     268 *
     269 * Used by:
     270 * HOST_DND_HG_EVT_ENTER
     271 * HOST_DND_HG_EVT_MOVE
     272 * HOST_DND_HG_EVT_DROPPED
     273 */
    229274typedef struct VBOXDNDHGACTIONMSG
    230275{
    231276    VBoxGuestHGCMCallInfo hdr;
    232277
    233     /**
    234      * HG Action event.
    235      *
    236      * Used by:
    237      * HOST_DND_HG_EVT_ENTER
    238      * HOST_DND_HG_EVT_MOVE
    239      * HOST_DND_HG_EVT_DROPPED
    240      */
    241278    HGCMFunctionParameter uScreenId;    /* OUT uint32_t */
    242279    HGCMFunctionParameter uX;           /* OUT uint32_t */
     
    248285} VBOXDNDHGACTIONMSG;
    249286
     287/**
     288 * Tells the guest that the host has left its drag and drop area on the guest.
     289 *
     290 * Used by:
     291 * HOST_DND_HG_EVT_LEAVE
     292 */
    250293typedef struct VBOXDNDHGLEAVEMSG
    251294{
    252295    VBoxGuestHGCMCallInfo hdr;
     296} VBOXDNDHGLEAVEMSG;
     297
     298
     299/**
     300 * Tells the guest that the host wants to cancel the current drag and drop operation.
     301 *
     302 * Used by:
     303 * HOST_DND_HG_EVT_CANCEL
     304 */
     305typedef struct VBOXDNDHGCANCELMSG
     306{
     307    VBoxGuestHGCMCallInfo hdr;
     308} VBOXDNDHGCANCELMSG;
     309
     310/**
     311 * Sends the header of an incoming (meta) data block.
     312 *
     313 * Used by:
     314 * HOST_DND_HG_SND_DATA_HDR
     315 * GUEST_DND_GH_SND_DATA_HDR
     316 *
     317 * New since protocol v3.
     318 */
     319typedef struct VBOXDNDHGSENDDATAHDRMSG
     320{
     321    VBoxGuestHGCMCallInfo hdr;
     322
     323    /** Context ID. Unused at the moment. */
     324    HGCMFunctionParameter uContext;        /* OUT uint32_t */
     325    /** Data transfer flags. Not yet used and must be 0. */
     326    HGCMFunctionParameter uFlags;          /* OUT uint32_t */
     327    /** Screen ID where the data originates from. */
     328    HGCMFunctionParameter uScreenId;       /* OUT uint32_t */
     329    /** Total size (in bytes) to transfer. */
     330    HGCMFunctionParameter cbTotal;         /* OUT uint64_t */
    253331    /**
    254      * HG Leave event.
     332     * Total meta data size (in bytes) to transfer.
     333     * This size also is part of cbTotal already, so:
    255334     *
    256      * Used by:
    257      * HOST_DND_HG_EVT_LEAVE
     335     * cbTotal = cbMeta + additional size for files etc.
    258336     */
    259 } VBOXDNDHGLEAVEMSG;
    260 
    261 typedef struct VBOXDNDHGCANCELMSG
    262 {
    263     VBoxGuestHGCMCallInfo hdr;
    264 
    265     /**
    266      * HG Cancel return event.
    267      *
    268      * Used by:
    269      * HOST_DND_HG_EVT_CANCEL
    270      */
    271 } VBOXDNDHGCANCELMSG;
    272 
     337    HGCMFunctionParameter cbMeta;          /* OUT uint64_t */
     338    /** Meta data format. */
     339    HGCMFunctionParameter pvMetaFmt;       /* OUT ptr */
     340    /** Size (in bytes) of meta data format. */
     341    HGCMFunctionParameter cbMetaFmt;       /* OUT uint32_t */
     342    /* Number of objects (files/directories) to transfer. */
     343    HGCMFunctionParameter cObjects;        /* OUT uint64_t */
     344    /** Compression type. */
     345    HGCMFunctionParameter enmCompression;  /* OUT uint32_t */
     346    /** Checksum type. */
     347    HGCMFunctionParameter enmChecksumType; /* OUT uint32_t */
     348    /** Checksum buffer for the entire data to be transferred. */
     349    HGCMFunctionParameter pvChecksum;      /* OUT ptr */
     350    /** Size (in bytes) of checksum. */
     351    HGCMFunctionParameter cbChecksum;      /* OUT uint32_t */
     352} VBOXDNDHGSENDDATAHDRMSG;
     353
     354/**
     355 * Sends a (meta) data block to the guest.
     356 *
     357 * Used by:
     358 * HOST_DND_HG_SND_DATA
     359 */
    273360typedef struct VBOXDNDHGSENDDATAMSG
    274361{
    275362    VBoxGuestHGCMCallInfo hdr;
    276363
    277     /**
    278      * HG Send Data event.
    279      *
    280      * Used by:
    281      * HOST_DND_HG_SND_DATA
    282      */
    283     HGCMFunctionParameter uScreenId;    /* OUT uint32_t */
    284     HGCMFunctionParameter pvFormat;     /* OUT ptr */
    285     HGCMFunctionParameter cFormat;      /* OUT uint32_t */
    286     HGCMFunctionParameter pvData;       /* OUT ptr */
    287     HGCMFunctionParameter cbData;       /* OUT uint32_t */
     364    union
     365    {
     366        struct
     367        {
     368            HGCMFunctionParameter uScreenId;    /* OUT uint32_t */
     369            HGCMFunctionParameter pvFormat;     /* OUT ptr */
     370            HGCMFunctionParameter cbFormat;     /* OUT uint32_t */
     371            HGCMFunctionParameter pvData;       /* OUT ptr */
     372            HGCMFunctionParameter cbData;       /* OUT uint32_t */
     373        } v1;
     374        /* No changes in v2. */
     375        struct
     376        {
     377            /** Context ID. Unused at the moment. */
     378            HGCMFunctionParameter uContext;     /* OUT uint32_t */
     379            /** Data block to send. */
     380            HGCMFunctionParameter pvData;       /* OUT ptr */
     381            /** Size (in bytes) of data block to send. */
     382            HGCMFunctionParameter cbData;       /* OUT uint32_t */
     383            /** Checksum of data block, based on the checksum
     384             *  type in the data header. Optional. */
     385            HGCMFunctionParameter pvChecksum;   /* OUT ptr */
     386            /** Size (in bytes) of checksum to send. */
     387            HGCMFunctionParameter cbChecksum;   /* OUT uint32_t */
     388        } v3;
     389    } u;
    288390} VBOXDNDHGSENDDATAMSG;
    289391
     392/**
     393 * Sends more (meta) data in case the data didn't fit
     394 * into the current XXX_DND_HG_SND_DATA message.
     395 *
     396 ** @todo Deprecated since protocol v3. Don't use! Will be removed.
     397 *
     398 * Used by:
     399 * HOST_DND_HG_SND_MORE_DATA
     400 */
    290401typedef struct VBOXDNDHGSENDMOREDATAMSG
    291402{
    292403    VBoxGuestHGCMCallInfo hdr;
    293404
    294     /**
    295      * HG Send More Data event.
    296      *
    297      * Used by:
    298      * HOST_DND_HG_SND_MORE_DATA
    299      */
    300405    HGCMFunctionParameter pvData;       /* OUT ptr */
    301406    HGCMFunctionParameter cbData;       /* OUT uint32_t */
    302407} VBOXDNDHGSENDMOREDATAMSG;
    303408
     409/**
     410 * Directory entry event.
     411 *
     412 * Used by:
     413 * HOST_DND_HG_SND_DIR
     414 * GUEST_DND_GH_SND_DIR
     415 */
    304416typedef struct VBOXDNDHGSENDDIRMSG
    305417{
    306418    VBoxGuestHGCMCallInfo hdr;
    307419
    308     /**
    309      * HG Directory event.
    310      *
    311      * Used by:
    312      * HOST_DND_HG_SND_DIR
    313      */
     420    /** Directory name. */
    314421    HGCMFunctionParameter pvName;       /* OUT ptr */
     422    /** Size (in bytes) of directory name. */
    315423    HGCMFunctionParameter cbName;       /* OUT uint32_t */
     424    /** Directory mode. */
    316425    HGCMFunctionParameter fMode;        /* OUT uint32_t */
    317426} VBOXDNDHGSENDDIRMSG;
    318427
    319428/**
    320  * File header event.
     429 * File header message, marking the start of transferring a new file.
    321430 * Note: Only for protocol version 2 and up.
    322431 *
    323432 * Used by:
    324433 * HOST_DND_HG_SND_FILE_HDR
    325  * HOST_DND_GH_SND_FILE_HDR
     434 * GUEST_DND_GH_SND_FILE_HDR
    326435 */
    327436typedef struct VBOXDNDHGSENDFILEHDRMSG
     
    341450    /** Total size (in bytes). */
    342451    HGCMFunctionParameter cbTotal;      /* OUT uint64_t */
    343 
    344452} VBOXDNDHGSENDFILEHDRMSG;
    345453
     
    360468        struct
    361469        {
     470            /** File name. */
    362471            HGCMFunctionParameter pvName;       /* OUT ptr */
     472            /** Size (in bytes) of file name. */
    363473            HGCMFunctionParameter cbName;       /* OUT uint32_t */
     474            /** Current data chunk. */
    364475            HGCMFunctionParameter pvData;       /* OUT ptr */
     476            /** Size (in bytes) of current data chunk. */
    365477            HGCMFunctionParameter cbData;       /* OUT uint32_t */
     478            /** File mode. */
    366479            HGCMFunctionParameter fMode;        /* OUT uint32_t */
    367480        } v1;
     
    372485            /** Context ID. Unused at the moment. */
    373486            HGCMFunctionParameter uContext;     /* OUT uint32_t */
     487            /** Current data chunk. */
    374488            HGCMFunctionParameter pvData;       /* OUT ptr */
     489            /** Size (in bytes) of current data chunk. */
    375490            HGCMFunctionParameter cbData;       /* OUT uint32_t */
    376491            /** Note: fMode is now part of the VBOXDNDHGSENDFILEHDRMSG message. */
    377492        } v2;
     493        struct
     494        {
     495            /** Context ID. Unused at the moment. */
     496            HGCMFunctionParameter uContext;     /* OUT uint32_t */
     497            /** Current data chunk. */
     498            HGCMFunctionParameter pvData;       /* OUT ptr */
     499            /** Size (in bytes) of current data chunk. */
     500            HGCMFunctionParameter cbData;       /* OUT uint32_t */
     501            /** Checksum of data block, based on the checksum
     502             *  type in the data header. Optional. */
     503            HGCMFunctionParameter pvChecksum;   /* OUT ptr */
     504            /** Size (in bytes) of curren data chunk checksum. */
     505            HGCMFunctionParameter cbChecksum;   /* OUT uint32_t */
     506        } v3;
    378507    } u;
    379 
    380508} VBOXDNDHGSENDFILEDATAMSG;
    381509
     510/**
     511 * Asks the guest if a guest->host DnD operation is in progress.
     512 *
     513 * Used by:
     514 * HOST_DND_GH_REQ_PENDING
     515 */
    382516typedef struct VBOXDNDGHREQPENDINGMSG
    383517{
    384518    VBoxGuestHGCMCallInfo hdr;
    385519
    386     /**
    387      * GH Request Pending event.
    388      *
    389      * Used by:
    390      * HOST_DND_GH_REQ_PENDING
    391      */
     520    /** Screen ID. */
    392521    HGCMFunctionParameter uScreenId;    /* OUT uint32_t */
    393522} VBOXDNDGHREQPENDINGMSG;
    394523
     524/**
     525 * Tells the guest that the host has dropped the ongoing guest->host
     526 * DnD operation on a valid target on the host.
     527 *
     528 * Used by:
     529 * HOST_DND_GH_EVT_DROPPED
     530 */
    395531typedef struct VBOXDNDGHDROPPEDMSG
    396532{
    397533    VBoxGuestHGCMCallInfo hdr;
    398534
    399     /**
    400      * GH Dropped event.
    401      *
    402      * Used by:
    403      * HOST_DND_GH_EVT_DROPPED
    404      */
     535    /** Requested format for sending the data. */
    405536    HGCMFunctionParameter pvFormat;     /* OUT ptr */
    406     HGCMFunctionParameter cFormat;      /* OUT uint32_t */
     537    /** Size (in bytes) of requested format. */
     538    HGCMFunctionParameter cbFormat;     /* OUT uint32_t */
     539    /** Drop action peformed on the host. */
    407540    HGCMFunctionParameter uAction;      /* OUT uint32_t */
    408541} VBOXDNDGHDROPPEDMSG;
     
    423556    VBoxGuestHGCMCallInfo hdr;
    424557
    425     HGCMFunctionParameter msg;          /* OUT uint32_t */
     558    /** Message ID. */
     559    HGCMFunctionParameter uMsg;      /* OUT uint32_t */
    426560    /** Number of parameters the message needs. */
    427     HGCMFunctionParameter num_parms;    /* OUT uint32_t */
     561    HGCMFunctionParameter cParms;    /* OUT uint32_t */
    428562    /** Whether or not to block (wait) for a
    429563     *  new message to arrive. */
    430     HGCMFunctionParameter block;        /* OUT uint32_t */
    431 
     564    HGCMFunctionParameter fBlock;    /* OUT uint32_t */
    432565} VBOXDNDNEXTMSGMSG;
    433566
    434567/**
    435  * Connection request. Used to tell the DnD protocol
     568 * Guest connection request. Used to tell the DnD protocol
    436569 * version to the (host) service.
    437570 *
     
    447580    /** Connection flags. Optional. */
    448581    HGCMFunctionParameter uFlags;        /* OUT uint32_t */
    449 
    450582} VBOXDNDCONNECTMSG;
    451583
     
    486618
    487619/**
    488  * GH Acknowledge Pending event.
     620 * Acknowledges a pending drag and drop event
     621 * to the host.
    489622 *
    490623 * Used by:
     
    501634
    502635/**
    503  * GH Send Data event.
     636 * Sends the header of an incoming data block
     637 * to the host.
     638 *
     639 * Used by:
     640 * GUEST_DND_GH_SND_DATA_HDR
     641 *
     642 * New since protocol v3.
     643 */
     644typedef struct VBOXDNDHGSENDDATAHDRMSG VBOXDNDGHSENDDATAHDRMSG;
     645
     646/**
     647 * Sends a (meta) data block to the host.
    504648 *
    505649 * Used by:
     
    507651 */
    508652typedef struct VBOXDNDGHSENDDATAMSG
    509 {
    510     VBoxGuestHGCMCallInfo hdr;
    511 
    512     HGCMFunctionParameter pvData;       /* OUT ptr */
    513     /** Total bytes to send. This can be more than
    514      *  the data block specified in pvData above, e.g.
    515      *  when sending over file objects afterwards. */
    516     HGCMFunctionParameter cbTotalBytes; /* OUT uint32_t */
    517 } VBOXDNDGHSENDDATAMSG;
    518 
    519 /**
    520  * GH Directory event.
    521  *
    522  * Used by:
    523  * GUEST_DND_GH_SND_DIR
    524  */
    525 typedef struct VBOXDNDGHSENDDIRMSG
    526 {
    527     VBoxGuestHGCMCallInfo hdr;
    528 
    529     HGCMFunctionParameter pvName;       /* OUT ptr */
    530     HGCMFunctionParameter cbName;       /* OUT uint32_t */
    531     HGCMFunctionParameter fMode;        /* OUT uint32_t */
    532 } VBOXDNDGHSENDDIRMSG;
    533 
    534 /**
    535  * GH File header event.
    536  * Note: Only for protocol version 2 and up.
    537  *
    538  * Used by:
    539  * HOST_DND_GH_SND_FILE_HDR
    540  */
    541 typedef struct VBOXDNDHGSENDFILEHDRMSG VBOXDNDGHSENDFILEHDRMSG;
    542 
    543 /**
    544  * GH File data event.
    545  *
    546  * Used by:
    547  * GUEST_DND_HG_SND_FILE_DATA
    548  */
    549 typedef struct VBOXDNDGHSENDFILEDATAMSG
    550653{
    551654    VBoxGuestHGCMCallInfo hdr;
     
    553656    union
    554657    {
    555         /* Note: Protocol v1 sends the file name + file mode
    556          *       every time a file data chunk is being sent. */
    557         struct
    558         {
    559             HGCMFunctionParameter pvName;   /* OUT ptr */
    560             HGCMFunctionParameter cbName;   /* OUT uint32_t */
    561             HGCMFunctionParameter fMode;    /* OUT uint32_t */
    562             HGCMFunctionParameter pvData;   /* OUT ptr */
    563             HGCMFunctionParameter cbData;   /* OUT uint32_t */
     658        struct
     659        {
     660            HGCMFunctionParameter pvData;       /* OUT ptr */
     661            /** Total bytes to send. This can be more than
     662             * the data block specified in pvData above, e.g.
     663             * when sending over file objects afterwards. */
     664            HGCMFunctionParameter cbTotalBytes; /* OUT uint32_t */
    564665        } v1;
    565666        struct
    566667        {
    567             /** Note: pvName is now part of the VBOXDNDHGSENDFILEHDRMSG message. */
    568             /** Note: cbName is now part of the VBOXDNDHGSENDFILEHDRMSG message. */
    569668            /** Context ID. Unused at the moment. */
    570             HGCMFunctionParameter uContext; /* OUT uint32_t */
    571             HGCMFunctionParameter pvData;   /* OUT ptr */
    572             HGCMFunctionParameter cbData;   /* OUT uint32_t */
    573             /** Note: fMode is now part of the VBOXDNDHGSENDFILEHDRMSG message. */
    574         } v2;
     669            HGCMFunctionParameter uContext;     /* OUT uint32_t */
     670            /** Data block to send. */
     671            HGCMFunctionParameter pvData;       /* OUT ptr */
     672            /** Size (in bytes) of data block to send. */
     673            HGCMFunctionParameter cbData;       /* OUT uint32_t */
     674            /** (Rolling) Checksum, based on checksum type in data header. */
     675            HGCMFunctionParameter pvChecksum;   /* OUT ptr */
     676            /** Size (in bytes) of checksum. */
     677            HGCMFunctionParameter cbChecksum;   /* OUT uint32_t */
     678        } v3;
    575679    } u;
    576 
    577 } VBOXDNDGHSENDFILEDATAMSG;
    578 
    579 /**
    580  * GH Error event.
     680} VBOXDNDGHSENDDATAMSG;
     681
     682/**
     683 * Sends a directory entry to the host.
     684 *
     685 * Used by:
     686 * GUEST_DND_GH_SND_DIR
     687 */
     688typedef struct VBOXDNDHGSENDDIRMSG VBOXDNDGHSENDDIRMSG;
     689
     690/**
     691 * Sends a file header to the host.
     692 *
     693 * Used by:
     694 * GUEST_DND_GH_SND_FILE_HDR
     695 *
     696 * New since protocol v2.
     697 */
     698typedef struct VBOXDNDHGSENDFILEHDRMSG VBOXDNDGHSENDFILEHDRMSG;
     699
     700/**
     701 * Sends file data to the host.
     702 *
     703 * Used by:
     704 * GUEST_DND_GH_SND_FILE_DATA
     705 */
     706typedef struct VBOXDNDHGSENDFILEDATAMSG VBOXDNDGHSENDFILEDATAMSG;
     707
     708/**
     709 * Sends a guest error event to the host.
    581710 *
    582711 * Used by:
     
    604733    CB_MAGIC_DND_GH_ACK_PENDING            = 0xbe975a14,
    605734    CB_MAGIC_DND_GH_SND_DATA               = 0x4eb61bff,
     735    CB_MAGIC_DND_GH_SND_DATA_HDR           = 0x4631ee4f,
    606736    CB_MAGIC_DND_GH_SND_DIR                = 0x411ca754,
    607737    CB_MAGIC_DND_GH_SND_FILE_HDR           = 0x65e35eaf,
     
    669799} VBOXDNDCBGHACKPENDINGDATA, *PVBOXDNDCBGHACKPENDINGDATA;
    670800
     801/**
     802 * Data header.
     803 * New since protocol v3.
     804 */
     805typedef struct VBOXDNDDATAHDR
     806{
     807    /** Data transfer flags. Not yet used and must be 0. */
     808    uint32_t                    uFlags;
     809    /** Screen ID where the data originates from. */
     810    uint32_t                    uScreenId;
     811    /** Total size (in bytes) to transfer. */
     812    uint64_t                    cbTotal;
     813    /** Meta data size (in bytes) to transfer.
     814     *  This size also is part of cbTotal already. */
     815    uint32_t                    cbMeta;
     816    /** Meta format buffer. */
     817    void                       *pvMetaFmt;
     818    /** Size (in bytes) of meta format buffer. */
     819    uint32_t                    cbMetaFmt;
     820    /** Number of objects (files/directories) to transfer. */
     821    uint64_t                    cObjects;
     822    /** Compression type. Currently unused, so specify 0.
     823     **@todo Add IPRT compression type enumeration as soon as it's available. */
     824    uint32_t                    enmCompression;
     825    /** Checksum type. Currently unused, so specify RTDIGESTTYPE_INVALID. */
     826    RTDIGESTTYPE                enmChecksumType;
     827    /** The actual checksum buffer for the entire data to be transferred,
     828     *  based on enmChksumType. If RTDIGESTTYPE_INVALID is specified,
     829     *  no checksum is being used and pvChecksum will be NULL. */
     830    void                       *pvChecksum;
     831    /** Size (in bytes) of checksum. */
     832    uint32_t                    cbChecksum;
     833} VBOXDNDDATAHDR, *PVBOXDNDSNDDATAHDR;
     834
     835/* New since protocol v3. */
     836typedef struct VBOXDNDCBSNDDATAHDRDATA
     837{
     838    /** Callback data header. */
     839    VBOXDNDCBHEADERDATA         hdr;
     840    /** Actual header data. */
     841    VBOXDNDDATAHDR              data;
     842} VBOXDNDCBSNDDATAHDRDATA, *PVBOXDNDCBSNDDATAHDRDATA;
     843
     844typedef struct VBOXDNDSNDDATA
     845{
     846    union
     847    {
     848        struct
     849        {
     850            /** Data block buffer. */
     851            void                       *pvData;
     852            /** Size (in bytes) of data block. */
     853            uint32_t                    cbData;
     854            /** Total metadata size (in bytes). This is transmitted
     855             *  with every message because the size can change. */
     856            uint32_t                    cbTotalSize;
     857        } v1;
     858        /* Protocol v2: No changes. */
     859        struct
     860        {
     861            /** Data block buffer. */
     862            void                       *pvData;
     863            /** Size (in bytes) of data block. */
     864            uint32_t                    cbData;
     865            /** (Rolling) Checksum. Not yet implemented. */
     866            void                       *pvChecksum;
     867            /** Size (in bytes) of checksum. Not yet implemented. */
     868            uint32_t                    cbChecksum;
     869        } v3;
     870    } u;
     871} VBOXDNDSNDDATA, *PVBOXDNDSNDDATA;
     872
    671873typedef struct VBOXDNDCBSNDDATADATA
    672874{
    673875    /** Callback data header. */
    674876    VBOXDNDCBHEADERDATA         hdr;
    675     void                       *pvData;
    676     uint32_t                    cbData;
    677     /** Total metadata size (in bytes). This is transmitted
    678      *  with every message because the size can change. */
    679     uint32_t                    cbTotalSize;
     877    /** Actual data. */
     878    VBOXDNDSNDDATA              data;
    680879} VBOXDNDCBSNDDATADATA, *PVBOXDNDCBSNDDATADATA;
    681880
     
    684883    /** Callback data header. */
    685884    VBOXDNDCBHEADERDATA         hdr;
     885    /** Directory path. */
    686886    char                       *pszPath;
     887    /** Size (in bytes) of path. */
    687888    uint32_t                    cbPath;
     889    /** Directory creation mode. */
    688890    uint32_t                    fMode;
    689891} VBOXDNDCBSNDDIRDATA, *PVBOXDNDCBSNDDIRDATA;
    690892
    691 /*  Note: Only for protocol version 2 and up (>= VBox 5.0). */
     893/* Note: Only for protocol version 2 and up (>= VBox 5.0). */
    692894typedef struct VBOXDNDCBSNDFILEHDRDATA
    693895{
     
    725927            uint32_t            fMode;
    726928        } v1;
    727         /* Note: Protocol version 2 has the file attributes (name, size,
    728                  mode, ...) in the VBOXDNDCBSNDFILEHDRDATA structure. */
     929        /* Protocol v2 + v3: Have the file attributes (name, size, mode, ...)
     930                             in the VBOXDNDCBSNDFILEHDRDATA structure. */
     931        struct
     932        {
     933            /** Checksum for current file data chunk. */
     934            void               *pvChecksum;
     935            /** Size (in bytes) of current data chunk. */
     936            uint32_t            cbChecksum;
     937        } v3;
    729938    } u;
    730939} VBOXDNDCBSNDFILEDATADATA, *PVBOXDNDCBSNDFILEDATADATA;
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