VirtualBox

Changeset 82501 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 8, 2019 11:00:27 PM (5 years ago)
Author:
vboxsync
Message:

SharedClipboardSvc: Working on unbreaking VRDE/VRDP, the DATA_READ part. bugref:9437#54

File:
1 edited

Legend:

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

    r82500 r82501  
    13831383     * Do the reading.
    13841384     */
    1385     int rc = VINF_SUCCESS;
     1385    int rc;
    13861386    uint32_t cbActual = 0;
    13871387
     
    14001400        /* Read clipboard data from the extension. */
    14011401        rc = g_ExtState.pfnExtension(g_ExtState.pvExtension, VBOX_CLIPBOARD_EXT_FN_DATA_READ, &parms, sizeof(parms));
    1402         LogRelFlowFunc(("g_ExtState.fDelayedAnnouncement=%RTbool, g_ExtState.uDelayedFormats=0x%x\n",
    1403                         g_ExtState.fDelayedAnnouncement, g_ExtState.uDelayedFormats));
     1402        LogRelFlowFunc(("DATA/Ext: fDelayedAnnouncement=%RTbool uDelayedFormats=%#x cbData=%RU32->%RU32 rc=%Rrc\n",
     1403                        g_ExtState.fDelayedAnnouncement, g_ExtState.uDelayedFormats, dataBlock.cbData, parms.cbData, rc));
    14041404
    14051405        /* Did the extension send the clipboard formats yet?
     
    14241424            cbActual = parms.cbData;
    14251425    }
    1426 
    1427     /* Note: The host clipboard *always* has precedence over the service extension above,
    1428      *       so data which has been read above might get overridden by the host clipboard eventually. */
    1429 
    1430     /** @todo r=bird: This precedency stuff changed with the 6.1 overhaul and I'm
    1431      *        not quite sure this makes sense.  Imagine you think about connecting
    1432      *        to a VM running in a non-headless process and there is some stuff in
    1433      *        the host clipboard preventing you from copy & pasting via the RDP
    1434      *        client.  I guess this means clipboard sharing over RDP is only
    1435      *        possible when using VBoxHeadless?
    1436      *
    1437      *        Also, looking at the code, I think the host will _always_ return data
    1438      *        here.  Need to test. Sigh. */
     1426    else
     1427    {
     1428        rc = ShClSvcImplReadData(pClient, &cmdCtx, &dataBlock, &cbActual);
     1429        LogRelFlowFunc(("DATA/Host: cbData=%RU32->%RU32 rc=%Rrc\n", dataBlock.cbData, cbActual, rc));
     1430    }
    14391431
    14401432    if (RT_SUCCESS(rc))
    14411433    {
    1442         rc = ShClSvcImplReadData(pClient, &cmdCtx, &dataBlock, &cbActual);
    1443         if (RT_SUCCESS(rc))
    1444         {
    1445             LogFlowFunc(("cbData=%RU32, cbActual=%RU32\n", dataBlock.cbData, cbActual));
    1446 
    1447             /* Return the actual size required to fullfil the request. */
    1448             if (cParms != VBOX_SHCL_CPARMS_DATA_READ_61B)
    1449                 HGCMSvcSetU32(&paParms[2], cbActual);
    1450             else
    1451                 HGCMSvcSetU32(&paParms[3], cbActual);
    1452 
    1453             /* If the data to return exceeds the buffer the guest supplies, tell it (and let it try again). */
    1454             if (cbActual >= dataBlock.cbData)
    1455                 rc = VINF_BUFFER_OVERFLOW;
    1456 
    1457             if (rc == VINF_SUCCESS)
    1458             {
    1459                 /* Only remove "read active" flag after successful read again. */
    1460                 /** @todo r=bird: This doesn't make any effing sense.  What if the guest
    1461                  *        wants to read another format???  */
    1462                 pClient->State.fFlags &= ~SHCLCLIENTSTATE_FLAGS_READ_ACTIVE;
    1463             }
     1434        /* Return the actual size required to fullfil the request. */
     1435        if (cParms != VBOX_SHCL_CPARMS_DATA_READ_61B)
     1436            HGCMSvcSetU32(&paParms[2], cbActual);
     1437        else
     1438            HGCMSvcSetU32(&paParms[3], cbActual);
     1439
     1440        /* If the data to return exceeds the buffer the guest supplies, tell it (and let it try again). */
     1441        if (cbActual >= dataBlock.cbData)
     1442            rc = VINF_BUFFER_OVERFLOW;
     1443
     1444        if (rc == VINF_SUCCESS)
     1445        {
     1446            /* Only remove "read active" flag after successful read again. */
     1447            /** @todo r=bird: This doesn't make any effing sense.  What if the guest
     1448             *        wants to read another format???  */
     1449            pClient->State.fFlags &= ~SHCLCLIENTSTATE_FLAGS_READ_ACTIVE;
    14641450        }
    14651451    }
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