Changeset 82501 in vbox for trunk/src/VBox
- Timestamp:
- Dec 8, 2019 11:00:27 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
r82500 r82501 1383 1383 * Do the reading. 1384 1384 */ 1385 int rc = VINF_SUCCESS;1385 int rc; 1386 1386 uint32_t cbActual = 0; 1387 1387 … … 1400 1400 /* Read clipboard data from the extension. */ 1401 1401 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)); 1404 1404 1405 1405 /* Did the extension send the clipboard formats yet? … … 1424 1424 cbActual = parms.cbData; 1425 1425 } 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 } 1439 1431 1440 1432 if (RT_SUCCESS(rc)) 1441 1433 { 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; 1464 1450 } 1465 1451 }
Note:
See TracChangeset
for help on using the changeset viewer.