VirtualBox

Changeset 81960 in vbox for trunk/src/VBox/HostServices


Ignore:
Timestamp:
Nov 18, 2019 7:00:50 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
134757
Message:

Shared Clipboard/Transfers: Update.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp

    r81843 r81960  
    11931193}
    11941194
     1195/**
     1196 * Reports available VBox clipboard formats to the guest.
     1197 *
     1198 * @returns VBox status code.
     1199 * @param   pClient             Client to request to read data form.
     1200 * @param   pFormats            Formats to report.
     1201 */
    11951202int ShClSvcFormatsReport(PSHCLCLIENT pClient, PSHCLFORMATDATA pFormats)
    11961203{
     
    12001207    LogFlowFuncEnter();
    12011208
     1209    uint32_t fFormats = pFormats->Formats;
     1210    uint32_t fFlags   = pFormats->fFlags;
     1211
     1212#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
     1213    /* If transfer mode is set to disabled, don't report the URI list format to the guest. */
     1214    if (!(g_fTransferMode & VBOX_SHCL_TRANSFER_MODE_ENABLED))
     1215        fFormats &= ~VBOX_SHCL_FMT_URI_LIST;
     1216#endif
     1217
     1218    LogFlowFunc(("fFormats=0x%x -> 0x%x\n", pFormats->Formats, fFormats));
     1219
     1220    /* Nothing to report? Bail out early. */
     1221    if (fFormats == VBOX_SHCL_FMT_NONE)
     1222        return VINF_SUCCESS;
     1223
     1224    LogRel2(("Shared Clipboard: Reporting formats 0x%x to guest\n", fFormats));
     1225
    12021226    int rc;
    12031227
     
    12091233        HGCMSvcSetU64(&pMsg->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID,
    12101234                                                                  pClient->Events.uID, uEvent));
    1211         HGCMSvcSetU32(&pMsg->paParms[1], pFormats->Formats);
    1212         HGCMSvcSetU32(&pMsg->paParms[2], 0 /* fFlags */);
     1235        HGCMSvcSetU32(&pMsg->paParms[1], fFormats);
     1236        HGCMSvcSetU32(&pMsg->paParms[2], fFlags);
    12131237
    12141238        rc = shClSvcMsgAdd(pClient, pMsg, true /* fAppend */);
     
    12161240        {
    12171241#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
    1218             /* If this is an URI list, create a transfer locally and also tell the guest to create
     1242            /* If we announce an URI list, create a transfer locally and also tell the guest to create
    12191243             * a transfer on the guest side. */
    1220             if (pFormats->Formats & VBOX_SHCL_FMT_URI_LIST)
     1244            if (fFormats & VBOX_SHCL_FMT_URI_LIST)
    12211245            {
    12221246                rc = shClSvcTransferStart(pClient, SHCLTRANSFERDIR_WRITE, SHCLSOURCE_LOCAL,
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette