VirtualBox

Ignore:
Timestamp:
Nov 13, 2019 3:59:22 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
134620
Message:

Shared Clipboard/Transfers: Got Linux hosts -> Windows guests working.

Location:
trunk/src/VBox/HostServices/SharedClipboard
Files:
2 edited

Legend:

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

    r81820 r81829  
    13951395                break;
    13961396
     1397            if (   ShClTransferGetSource(pTransfer) == SHCLSOURCE_LOCAL
     1398                && ShClTransferGetDir(pTransfer)    == SHCLTRANSFERDIR_WRITE)
     1399            {
     1400                /* Get roots if this is a local write transfer (host -> guest). */
     1401                rc = ShClSvcImplTransferGetRoots(pClient, pTransfer);
     1402            }
     1403            else
     1404            {
     1405                rc = VERR_INVALID_PARAMETER;
     1406                break;
     1407            }
     1408
    13971409            SHCLROOTLISTHDR rootListHdr;
    13981410            RT_ZERO(rootListHdr);
     
    17551767}
    17561768
     1769int shClSvcTransferHostMsgHandler(PSHCLCLIENT pClient, PSHCLCLIENTMSG pMsg)
     1770{
     1771    RT_NOREF(pClient);
     1772
     1773    int rc;
     1774
     1775    switch (pMsg->uMsg)
     1776    {
     1777        default:
     1778            rc = VINF_SUCCESS;
     1779            break;
     1780    }
     1781
     1782    LogFlowFuncLeaveRC(rc);
     1783    return rc;
     1784}
     1785
    17571786/**
    17581787 * Registers an clipboard transfer area.
     
    20732102                        if (RT_SUCCESS(rc))
    20742103                        {
    2075                             if (   enmSource == SHCLSOURCE_LOCAL
    2076                                 && enmDir    == SHCLTRANSFERDIR_WRITE) /* Get roots if this is a local write transfer. */
    2077                             {
    2078                                 rc = ShClSvcImplTransferGetRoots(pClient, pTransfer);
    2079                             }
    2080 
    20812104                            if (RT_SUCCESS(rc))
    20822105                                rc = ShClTransferStart(pTransfer);
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp

    r81820 r81829  
    393393    LogFlowFuncEnter();
    394394
    395     int rc;
    396 
    397     CLIPREADCBREQ *pReq = (CLIPREADCBREQ *)RTMemAllocZ(sizeof(CLIPREADCBREQ));
    398     if (pReq)
    399     {
    400         pReq->pv        = pTransfer;
    401         pReq->cb        = sizeof(SHCLTRANSFER);
    402         pReq->uEvent    = NIL_SHCLEVENTID; /* No event handling needed. */
    403 
    404     #if 0
    405         SHCLEVENTID uEvent = ShClEventIDGenerate(&pClient->Events);
    406 
    407         rc = ShClEventRegister(&pClient->Events, uEvent);
    408         if (RT_SUCCESS(rc))
    409         {
    410     #endif
     395    SHCLEVENTID uEvent = ShClEventIDGenerate(&pClient->Events);
     396
     397    int rc = ShClEventRegister(&pClient->Events, uEvent);
     398    if (RT_SUCCESS(rc))
     399    {
     400        CLIPREADCBREQ *pReq = (CLIPREADCBREQ *)RTMemAllocZ(sizeof(CLIPREADCBREQ));
     401        if (pReq)
     402        {
     403            pReq->uEvent = uEvent;
     404
    411405            rc = ClipReadDataFromX11(pClient->State.pCtx->pBackend, VBOX_SHCL_FMT_URI_LIST, pReq);
    412     #if 0
    413406            if (RT_SUCCESS(rc))
    414407            {
    415408                /* X supplies the data asynchronously, so we need to wait for data to arrive first. */
    416                 rc = ShClEventWait(&pClient->Events, uEvent, 30 * 1000, NULL /* pPayload */);
     409                PSHCLEVENTPAYLOAD pPayload;
     410                rc = ShClEventWait(&pClient->Events, uEvent, 30 * 1000, &pPayload);
     411                if (RT_SUCCESS(rc))
     412                {
     413                    rc = ShClTransferRootsSet(pTransfer,
     414                                              (char *)pPayload->pvData, pPayload->cbData + 1 /* Include termination */);
     415                }
    417416            }
    418 
    419             ShClEventUnregister(&pClient->Events, uEvent);
    420         }
    421     #endif
    422     }
    423     else
    424         rc = VERR_NO_MEMORY;
     417        }
     418
     419        ShClEventUnregister(&pClient->Events, uEvent);
     420    }
    425421
    426422    LogFlowFuncLeaveRC(rc);
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