Changeset 82852 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Jan 24, 2020 3:12:23 PM (5 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedClipboard
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-internal.h
r82848 r82852 116 116 /** Guest feature flags, VBOX_SHCL_GF_1_XXX. */ 117 117 uint64_t fGuestFeatures1; 118 /** Maximum chunk size to use for data transfers. Set to _64K by default. */118 /** Chunk size to use for data transfers. */ 119 119 uint32_t cbChunkSize; 120 120 /** Where the transfer sources its data from. */ -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-transfers.cpp
r82848 r82852 737 737 738 738 case VBOX_SHCL_GUEST_FN_CONNECT: 739 RT_FALL_THROUGH(); 740 case VBOX_SHCL_GUEST_FN_NEGOTIATE_CHUNK_SIZE: 739 741 RT_FALL_THROUGH(); 740 742 case VBOX_SHCL_GUEST_FN_MSG_PEEK_WAIT: -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
r82851 r82852 663 663 } 664 664 665 static int shClSvcClientNegogiateChunkSize(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, 666 uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 667 { 668 /* 669 * Validate the request. 670 */ 671 ASSERT_GUEST_RETURN(cParms == VBOX_SHCL_CPARMS_NEGOTIATE_CHUNK_SIZE, VERR_WRONG_PARAMETER_COUNT); 672 ASSERT_GUEST_RETURN(paParms[0].type == VBOX_HGCM_SVC_PARM_32BIT, VERR_WRONG_PARAMETER_TYPE); 673 uint32_t const cbClientMaxChunkSize = paParms[0].u.uint32; 674 ASSERT_GUEST_RETURN(paParms[1].type == VBOX_HGCM_SVC_PARM_32BIT, VERR_WRONG_PARAMETER_TYPE); 675 uint32_t const cbClientChunkSize = paParms[1].u.uint32; 676 677 uint32_t const cbHostMaxChunkSize = VBOX_SHCL_MAX_CHUNK_SIZE; /** @todo Make this configurable. */ 678 679 /* 680 * Do the work. 681 */ 682 if (cbClientChunkSize == 0) /* Does the client want us to choose? */ 683 { 684 paParms[0].u.uint32 = cbHostMaxChunkSize; /* Maximum */ 685 paParms[1].u.uint32 = RT_MIN(pClient->State.cbChunkSize, cbHostMaxChunkSize); /* Preferred */ 686 687 } 688 else /* The client told us what it supports, so update and report back. */ 689 { 690 paParms[0].u.uint32 = RT_MIN(cbClientMaxChunkSize, cbHostMaxChunkSize); /* Maximum */ 691 paParms[1].u.uint32 = RT_MIN(cbClientMaxChunkSize, pClient->State.cbChunkSize); /* Preferred */ 692 } 693 694 int rc = g_pHelpers->pfnCallComplete(hCall, VINF_SUCCESS); 695 if (RT_SUCCESS(rc)) 696 { 697 Log(("[Client %RU32] chunk size: %#RU32, max: %#RU32\n", paParms[1].u.uint32, paParms[0].u.uint32)); 698 } 699 else 700 LogFunc(("pfnCallComplete -> %Rrc\n", rc)); 701 702 return VINF_HGCM_ASYNC_EXECUTE; 703 } 704 665 705 /** 666 706 * Implements VBOX_SHCL_GUEST_FN_REPORT_FEATURES. … … 677 717 * @param paParms Array of parameters. 678 718 */ 679 int shClSvcClientReportFeatures(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall,680 uint32_t cParms, VBOXHGCMSVCPARM paParms[])719 static int shClSvcClientReportFeatures(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE hCall, 720 uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 681 721 { 682 722 /* … … 720 760 * @param paParms Array of parameters. 721 761 */ 722 int shClSvcClientQueryFeatures(VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[])762 static int shClSvcClientQueryFeatures(VBOXHGCMCALLHANDLE hCall, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 723 763 { 724 764 /* … … 1518 1558 /* Read clipboard data from the extension. */ 1519 1559 rc = g_ExtState.pfnExtension(g_ExtState.pvExtension, VBOX_CLIPBOARD_EXT_FN_DATA_READ, &parms, sizeof(parms)); 1520 LogRelFlowFunc((" DATA/Ext: fDelayedAnnouncement=%RTbool fDelayedFormats=%#x cbData=%RU32->%RU32 rc=%Rrc\n",1560 LogRelFlowFunc(("Shared Clipboard: DATA/Ext: fDelayedAnnouncement=%RTbool fDelayedFormats=%#x cbData=%RU32->%RU32 rc=%Rrc\n", 1521 1561 g_ExtState.fDelayedAnnouncement, g_ExtState.fDelayedFormats, dataBlock.cbData, parms.cbData, rc)); 1522 1562 … … 1540 1580 { 1541 1581 rc = ShClSvcImplReadData(pClient, &cmdCtx, &dataBlock, &cbActual); 1542 LogRelFlowFunc((" DATA/Host: cbData=%RU32->%RU32 rc=%Rrc\n", dataBlock.cbData, cbActual, rc));1582 LogRelFlowFunc(("Shared Clipboard: DATA/Host: cbData=%RU32->%RU32 rc=%Rrc\n", dataBlock.cbData, cbActual, rc)); 1543 1583 } 1544 1584 … … 1871 1911 1872 1912 case VBOX_SHCL_GUEST_FN_CONNECT: 1873 LogRel((" 6.1.0 beta or rc additions detected. Please upgrade!\n"));1913 LogRel(("Shared Clipboard: 6.1.0 beta or rc Guest Additions detected. Please upgrade!\n")); 1874 1914 rc = VERR_NOT_IMPLEMENTED; 1915 break; 1916 1917 case VBOX_SHCL_GUEST_FN_NEGOTIATE_CHUNK_SIZE: 1918 rc = shClSvcClientNegogiateChunkSize(pClient, callHandle, cParms, paParms); 1875 1919 break; 1876 1920 … … 2012 2056 pClientState->fGuestFeatures1 = VBOX_SHCL_GF_NONE; 2013 2057 2014 pClientState->cbChunkSize = _64K; /**Make this configurable. */2015 pClientState->enmSource 2016 pClientState->fFlags 2058 pClientState->cbChunkSize = VBOX_SHCL_DEFAULT_CHUNK_SIZE; /** @todo Make this configurable. */ 2059 pClientState->enmSource = SHCLSOURCE_INVALID; 2060 pClientState->fFlags = SHCLCLIENTSTATE_FLAGS_NONE; 2017 2061 2018 2062 pClientState->POD.enmDir = SHCLTRANSFERDIR_UNKNOWN;
Note:
See TracChangeset
for help on using the changeset viewer.