VirtualBox

Ignore:
Timestamp:
Dec 8, 2019 4:46:38 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
135353
Message:

SharedClipboardSvc,Vbgl: Reviewed and adjusted the handling of the VBOX_SHCL_GUEST_FN_DATA_READ message, paddling back on the parameter changes from the 6.1 dev cycle and fixing a couple of bugs introduced (buggy code commented out and marked with @todos). Also documented the message. bugref:9437

File:
1 edited

Legend:

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

    r82494 r82500  
    286286/** Reads data in specified format from the host.
    287287 *
     288 * This function takes three parameters, a 32-bit format bit, a buffer
     289 * and 32-bit number of bytes read (output).
     290 *
     291 * There was a period during 6.1 development where it would take five parameters
     292 * when VBOX_SHCL_GF_0_CONTEXT_ID was reported by the guest.  A 64-bit context
     293 * ID (ignored as purpose undefined), a 32-bit unused flag (MBZ), then the
     294 * 32-bit format bits, number of bytes read (output), and the buffer.  This
     295 * format is still accepted.
     296 *
    288297 * @retval  VINF_SUCCESS on success.
    289298 * @retval  VINF_BUFFER_OVERLFLOW (VBox >= 6.1 only) if not enough buffer space
    290  *          has been given to retrieve the actual data. The call then must be
    291  *          repeated with a buffer size returned from the host in cbData.
     299 *          has been given to retrieve the actual data, no data actually copied.
     300 *          The call then must be repeated with a buffer size returned from the
     301 *          host in cbData.
    292302 * @retval  VERR_INVALID_CLIENT_ID
    293303 * @retval  VERR_WRONG_PARAMETER_COUNT
     
    689699#define VBOX_SHCL_CPARMS_READ_DATA_REQ 4
    690700
    691 /**
    692  * Reads clipboard data.
    693  */
    694 typedef struct _VBoxShClReadDataMsg
    695 {
    696     VBGLIOCHGCMCALL hdr;
    697 
    698     union
    699     {
    700         struct
    701         {
    702             /** uint32_t, out: Requested format. */
    703             HGCMFunctionParameter format; /* IN uint32_t */
    704             /** ptr, out: The data buffer. */
    705             HGCMFunctionParameter ptr;    /* IN linear pointer. */
    706             /** uint32_t, out: Size of returned data, if > ptr->cb, then no data was
    707              *  actually transferred and the guest must repeat the call.
    708              */
    709             HGCMFunctionParameter size;   /* OUT uint32_t */
    710         } v0;
    711         struct
    712         {
    713             /** uint64_t, out: Context ID. */
    714             HGCMFunctionParameter uContext;
    715             /** uint32_t, out: Read flags; currently unused and must be set to 0. */
    716             HGCMFunctionParameter fFlags;
    717             /** uint32_t, out: Requested format. */
    718             HGCMFunctionParameter uFormat;
    719             /** uint32_t, in/out:
    720              *  On input:  How much data to read max.
    721              *  On output: Size of returned data, if > ptr->cb, then no data was
    722              *  actually transferred and the guest must repeat the call.
    723              */
    724             HGCMFunctionParameter cbData;
    725             /** ptr, out: The data buffer. */
    726             HGCMFunctionParameter pvData;
    727         } v1;
    728     } u;
    729 } VBoxShClReadDataMsg;
    730 
    731 #define VBOX_SHCL_CPARMS_READ_DATA 5
     701/** @name VBOX_SHCL_GUEST_FN_DATA_READ
     702 * @{ */
     703/** VBOX_SHCL_GUEST_FN_DATA_READ parameters. */
     704typedef struct VBoxShClParmDataRead
     705{
     706    /** uint32_t, in: Requested format. */
     707    HGCMFunctionParameter f32Format;
     708    /** ptr, out: The data buffer to put the data in on success. */
     709    HGCMFunctionParameter pData;
     710    /** uint32_t, out: Size of returned data, if larger than the buffer, then no
     711     * data was actually transferred and the guest must repeat the call.  */
     712    HGCMFunctionParameter cb32Needed;
     713} VBoxShClParmDataRead;
     714#define VBOX_SHCL_CPARMS_DATA_READ      3   /**< The parameter count for VBOX_SHCL_GUEST_FN_DATA_READ. */
     715#define VBOX_SHCL_CPARMS_DATA_READ_61B  5   /**< The 6.1 dev cycle variant, see VBOX_SHCL_GUEST_FN_DATA_READ.  */
     716/** @}  */
    732717
    733718/**
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