VirtualBox

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


Ignore:
Timestamp:
Jul 11, 2019 7:34:05 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
132047
Message:

Shared Clipboard/URI: Update.

File:
1 edited

Legend:

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

    r79672 r79702  
    423423}
    424424
     425VBGLR3DECL(int) VbglR3ClipboardListCloseReply(HGCMCLIENTID idClient, int rcReply, SHAREDCLIPBOARDLISTHANDLE hList)
     426{
     427    VBoxClipboardReplyMsg Msg;
     428    RT_ZERO(Msg);
     429
     430    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient,
     431                       VBOX_SHARED_CLIPBOARD_GUEST_FN_REPLY, 6);
     432
     433    Msg.uContext.SetUInt32(0); /** @todo Context ID not used yet. */
     434    Msg.enmType.SetUInt32(VBOX_SHAREDCLIPBOARD_REPLYMSGTYPE_LIST_CLOSE);
     435    Msg.rc.SetUInt32((uint32_t)rcReply); /** int vs. uint32_t */
     436    Msg.cbPayload.SetUInt32(0);
     437    Msg.pvPayload.SetPtr(0, NULL);
     438
     439    Msg.u.ListOpen.uHandle.SetUInt64(hList);
     440
     441    int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
     442
     443    LogFlowFuncLeaveRC(rc);
     444    return rc;
     445}
     446
    425447VBGLR3DECL(int) VbglR3ClipboardListCloseSend(HGCMCLIENTID idClient, SHAREDCLIPBOARDLISTHANDLE hList)
    426448{
     
    671693                    if (RT_SUCCESS(rc))
    672694                    {
    673                         /** @todo Handle fFlags. */
     695                        /** @todo Handle Roots.fRoots flags. */
    674696
    675697                        char    *pszRoots = NULL;
     
    680702                            /** @todo Split up transfers in _64K each. */
    681703
    682                             rc = VbglR3ClipboardRootsWrite(idClient, cRoots,
    683                                                            pszRoots, pszRoots ? (uint32_t)strlen(pszRoots) : NULL);
     704                            const uint32_t cbRoots = pszRoots
     705                                                   ? (uint32_t)strlen(pszRoots) + 1 /* Include termination. */
     706                                                   : 0;
     707
     708                            rc = VbglR3ClipboardRootsWrite(idClient, cRoots, pszRoots, cbRoots);
    684709                        }
    685710                    }
     
    725750                {
    726751                    rc = SharedClipboardURITransferListClose(pTransfer, hList);
     752
     753                    /* Reply in any case. */
     754                    int rc2 = VbglR3ClipboardListCloseReply(idClient, rc, hList);
     755                    AssertRC(rc2);
    727756                }
    728757
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