VirtualBox

Changeset 79174 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Jun 17, 2019 10:30:49 AM (5 years ago)
Author:
vboxsync
Message:

Shared Clipboard/URI: Update.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp

    r79120 r79174  
    199199        Msg.enmChecksumType.GetUInt32((uint32_t *)&pDataHdr->enmChecksumType);
    200200        Msg.cbChecksum.GetUInt32(&pDataHdr->cbChecksum);
     201
     202        AssertReturn(SharedClipboardURIDataHdrIsValid(pDataHdr), VERR_INVALID_PARAMETER);
    201203    }
    202204
     
    208210 * Sends a guest clipboard data header to the host.
    209211 *
    210  * This is usually called in reply to a VBOX_SHARED_CLIPBOARD_HOST_MSG_WRITE_DATA_HDR message
    211  * from the host.
     212 * This is usually called in reply to a VBOX_SHARED_CLIPBOARD_HOST_READ_DATA message from the host
     213 * (if URI format is specified).
    212214 *
    213215 * @returns VBox status code.
     
    218220{
    219221    VBoxClipboardWriteDataHdrMsg Msg;
     222    RT_ZERO(Msg);
     223
    220224    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, VBOX_SHARED_CLIPBOARD_GUEST_FN_WRITE_DATA_HDR, VBOX_SHARED_CLIPBOARD_CPARMS_WRITE_DATA_HDR);
     225
     226    AssertReturn(SharedClipboardURIDataHdrIsValid(pDataHdr), VERR_INVALID_PARAMETER);
    221227
    222228    Msg.uContext.SetUInt32(0);                                          /** @todo Not used yet. */
    223229    Msg.uFlags.SetUInt32(pDataHdr->uFlags);                             /** @todo Not used yet. */
    224     Msg.uScreenId.SetUInt32(pDataHdr->uScreenId);                       /** @todo Not used for guest->host (yet). */
     230    Msg.uScreenId.SetUInt32(pDataHdr->uScreenId);                       /** @todo Not used yet. */
    225231    Msg.cbTotal.SetUInt64(pDataHdr->cbTotal);
    226232    Msg.cbMeta.SetUInt32(pDataHdr->cbMeta);
    227     Msg.cbMetaFmt.SetPtr(pDataHdr->pvMetaFmt, pDataHdr->cbMetaFmt);
     233    Msg.pvMetaFmt.SetPtr(pDataHdr->pvMetaFmt, pDataHdr->cbMetaFmt);
    228234    Msg.cbMetaFmt.SetUInt32(pDataHdr->cbMetaFmt);
    229235    Msg.cObjects.SetUInt64(pDataHdr->cObjects);
    230236    Msg.enmCompression.SetUInt32(pDataHdr->enmCompression);             /** @todo Not used yet. */
    231     Msg.enmChecksumType.SetUInt32(pDataHdr->enmChecksumType);           /** @todo Not used yet. */
    232     Msg.cbChecksum.SetPtr(pDataHdr->pvChecksum, pDataHdr->cbChecksum);  /** @todo Not used yet. */
    233     Msg.cbChecksum.SetUInt32(pDataHdr->cbChecksum);                     /** @todo Not used yet. */
    234 
    235     return VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
     237    Msg.enmChecksumType.SetUInt32(RTDIGESTTYPE_INVALID);                /** @todo Not used yet. */
     238    Msg.pvChecksum.SetPtr(NULL, 0);                                     /** @todo Not used yet. */
     239    Msg.cbChecksum.SetUInt32(0);                                        /** @todo Not used yet. */
     240
     241    int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
     242
     243    LogFlowFunc(("cbTotal=%RU64, cbMeta=%RU32, pvMetaFmt=%p (%RU32), cObjects=%RU64, rc=%Rrc\n",
     244                 pDataHdr->cbTotal, pDataHdr->cbMeta, pDataHdr->pvMetaFmt, pDataHdr->cbMetaFmt, pDataHdr->cObjects, rc));
     245
     246    LogFlowFuncLeaveRC(rc);
     247    return rc;
    236248}
    237249
     
    789801VBGLR3DECL(int) VbglR3ClipboardReportFormats(HGCMCLIENTID idClient, uint32_t fFormats)
    790802{
    791     VBoxClipboardWriteFormatsMsg Msg;
    792 
    793     VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, VBOX_SHARED_CLIPBOARD_GUEST_FN_REPORT_FORMATS, VBOX_SHARED_CLIPBOARD_CPARMS_FORMATS);
     803    VBoxClipboardReportFormatsMsg Msg;
     804
     805    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, VBOX_SHARED_CLIPBOARD_GUEST_FN_REPORT_FORMATS, VBOX_SHARED_CLIPBOARD_CPARMS_REPORT_FORMATS);
    794806    VbglHGCMParmUInt32Set(&Msg.formats, fFormats);
    795807
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