VirtualBox

Changeset 82506 in vbox for trunk/include


Ignore:
Timestamp:
Dec 9, 2019 3:18:31 AM (5 years ago)
Author:
vboxsync
Message:

SharedClipboardSvc,Vbgl: Reviewed and adjusted the handling of the VBOX_SHCL_GUEST_FN_DATA_WRITE message, paddling back two thirds of the parameter changes from the 6.1 dev cycle and fixing a couple of bugs introduced (buggy code commented out and marked with @todos). Fixing the broadcast approach of VBOX_SHCL_GUEST_FN_FORMATS_REPORT as the host doesn't want to know about clipboard stuff when VRDE clients are using the clipboard. Also documented the message. bugref:9437

File:
1 edited

Legend:

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

    r82500 r82506  
    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).
     288 * This function takes three parameters, a 32-bit format bit
     289 * (VBOX_SHCL_FMT_XXX), a buffer and 32-bit number of bytes read (output).
    290290 *
    291291 * There was a period during 6.1 development where it would take five parameters
     
    305305 */
    306306#define VBOX_SHCL_GUEST_FN_DATA_READ              3
    307 /** Writes data in requested format to the host. */
     307/** Writes requested data to the host.
     308 *
     309 * This function takes either 2 or 3 parameters.  The last two parameters are a
     310 * 32-bit format bit (VBOX_SHCL_FMT_XXX) and a data buffer holding the related
     311 * data.  The three parameter variant have a context ID first, which shall be a
     312 * copy of the ID in the data request message.
     313 *
     314 * There was a period during 6.1 development where there would be a 5 parameter
     315 * version of this, inserting an unused flags parameter between the context ID
     316 * and the format bit, as well as a 32-bit data buffer size repate between the
     317 * format bit and the data buffer.  This format is still accepted, though
     318 * deprecated.
     319 *
     320 * @retval  VINF_SUCCESS on success.
     321 * @retval  VERR_INVALID_CLIENT_ID
     322 * @retval  VERR_WRONG_PARAMETER_COUNT
     323 * @retval  VERR_WRONG_PARAMETER_TYPE
     324 * @retval  VERR_INVALID_CONTEXT if the context ID didn't match up.
     325 */
    308326#define VBOX_SHCL_GUEST_FN_DATA_WRITE             4
    309327
     
    704722typedef struct VBoxShClParmDataRead
    705723{
    706     /** uint32_t, in: Requested format. */
     724    /** uint32_t, in:   Requested format (VBOX_SHCL_FMT_XXX). */
    707725    HGCMFunctionParameter f32Format;
    708     /** ptr, out: The data buffer to put the data in on success. */
     726    /** ptr, out:       The data buffer to put the data in on success. */
    709727    HGCMFunctionParameter pData;
    710     /** uint32_t, out: Size of returned data, if larger than the buffer, then no
     728    /** uint32_t, out:  Size of returned data, if larger than the buffer, then no
    711729     * data was actually transferred and the guest must repeat the call.  */
    712730    HGCMFunctionParameter cb32Needed;
    713731} VBoxShClParmDataRead;
     732
    714733#define VBOX_SHCL_CPARMS_DATA_READ      3   /**< The parameter count for VBOX_SHCL_GUEST_FN_DATA_READ. */
    715734#define VBOX_SHCL_CPARMS_DATA_READ_61B  5   /**< The 6.1 dev cycle variant, see VBOX_SHCL_GUEST_FN_DATA_READ.  */
    716735/** @}  */
    717736
    718 /**
    719  * Writes clipboard data.
    720  */
    721 typedef struct _VBoxShClWriteDataMsg
    722 {
    723     VBGLIOCHGCMCALL hdr;
    724 
    725     union
    726     {
    727         struct
    728         {
    729             /** Returned format as requested in the VBOX_SHCL_HOST_MSG_READ_DATA message. */
    730             HGCMFunctionParameter format; /* IN uint32_t */
    731             /** Data.  */
    732             HGCMFunctionParameter ptr;    /* IN linear pointer. */
    733         } v0;
    734         struct
    735         {
    736             /** uint64_t, out: Context ID. */
    737             HGCMFunctionParameter uContext;
    738             /** uint32_t, out: Write flags; currently unused and must be set to 0. */
    739             HGCMFunctionParameter fFlags;
    740             /** uint32_t, out: Requested format to read data in. */
    741             HGCMFunctionParameter uFormat;
    742             /** uint32_t, out: Size of data (in bytes). */
    743             HGCMFunctionParameter cbData;
    744             /** ptr, out: Actual data. */
    745             HGCMFunctionParameter pvData;
    746         } v1;
    747     } u;
    748 } VBoxShClWriteDataMsg;
    749 
    750 #define VBOX_SHCL_CPARMS_WRITE_DATA 5
     737/** @name
     738 * @{ */
     739
     740/** VBOX_SHCL_GUEST_FN_DATA_WRITE parameters. */
     741typedef struct VBoxShClParmDataWrite
     742{
     743    /** uint64_t, in:   Context ID from VBOX_SHCL_HOST_MSG_READ_DATA. */
     744    HGCMFunctionParameter id64Context;
     745    /** uint32_t, in:   The data format (VBOX_SHCL_FMT_XXX). */
     746    HGCMFunctionParameter f32Format;
     747    /** ptr, in:        The data. */
     748    HGCMFunctionParameter pData;
     749} VBoxShClParmDataWrite;
     750
     751/** Old VBOX_SHCL_GUEST_FN_DATA_WRITE parameters. */
     752typedef struct VBoxShClParmDataWriteOld
     753{
     754    /** uint32_t, in:   The data format (VBOX_SHCL_FMT_XXX). */
     755    HGCMFunctionParameter f32Format;
     756    /** ptr, in:        The data. */
     757    HGCMFunctionParameter pData;
     758} VBoxShClParmDataWriteOld;
     759
     760#define VBOX_SHCL_CPARMS_DATA_WRITE     3   /**< The variant used when VBOX_SHCL_GF_0_CONTEXT_ID is reported. */
     761#define VBOX_SHCL_CPARMS_DATA_WRITE_OLD 2   /**< The variant used when VBOX_SHCL_GF_0_CONTEXT_ID isn't reported. */
     762#define VBOX_SHCL_CPARMS_DATA_WRITE_61B 5   /**< The 6.1 dev cycle variant, see VBOX_SHCL_GUEST_FN_DATA_WRITE.  */
     763/** @} */
    751764
    752765/**
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