Changeset 81286 in vbox for trunk/src/VBox/HostServices/SharedClipboard
- Timestamp:
- Oct 15, 2019 4:37:37 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
r81229 r81286 197 197 198 198 # ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 199 int shclSvcTransferModeSet(uint32_t fMode); 199 200 int shclSvcTransferStart(PSHCLCLIENT pClient, SHCLTRANSFERDIR enmDir, SHCLSOURCE enmSource, PSHCLTRANSFER *ppTransfer); 200 201 int shclSvcTransferStop(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer); -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-transfers.cpp
r81260 r81286 40 40 * Externals * 41 41 *********************************************************************************************************************************/ 42 extern SHCLEXTSTATE g_ExtState; 43 extern PVBOXHGCMSVCHELPERS g_pHelpers; 42 extern uint32_t g_fTransferMode; 43 extern SHCLEXTSTATE g_ExtState; 44 extern PVBOXHGCMSVCHELPERS g_pHelpers; 45 extern ClipboardClientMap g_mapClients; 44 46 extern ClipboardClientQueue g_listClientsDeferred; 45 47 … … 2186 2188 } 2187 2189 2190 /** 2191 * Sets the host service's (file) transfer mode. 2192 * 2193 * @returns VBox status code. 2194 * @param uMode Transfer mode to set. 2195 */ 2196 int shclSvcTransferModeSet(uint32_t fMode) 2197 { 2198 AssertReturn(!(fMode & ~VBOX_SHCL_TRANSFER_MODE_VALID_MASK), VERR_INVALID_FLAGS); 2199 2200 g_fTransferMode = fMode; 2201 2202 LogRel2(("Shared Clipboard: Transfer mode set to 0x%x\n", g_fTransferMode)); 2203 2204 /* If file transfers are being disabled, make sure to also reset (destroy) all pending transfers. */ 2205 if (g_fTransferMode == VBOX_SHCL_TRANSFER_MODE_DISABLED) 2206 { 2207 ClipboardClientMap::const_iterator itClient = g_mapClients.begin(); 2208 while (itClient != g_mapClients.end()) 2209 { 2210 PSHCLCLIENT pClient = itClient->second; 2211 AssertPtr(pClient); 2212 2213 shclSvcClientTransfersReset(pClient); 2214 2215 ++itClient; 2216 } 2217 } 2218 2219 LogFlowFuncLeaveRC(VINF_SUCCESS); 2220 return VINF_SUCCESS; 2221 } -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
r81229 r81286 235 235 236 236 static RTCRITSECT g_CritSect; 237 static uint32_t g_uMode; 237 /** Global Shared Clipboard mode. */ 238 static uint32_t g_uMode = VBOX_SHCL_MODE_OFF; 239 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 240 /** Global Shared Clipboard (file) transfer mode. */ 241 uint32_t g_fTransferMode = VBOX_SHCL_TRANSFER_MODE_DISABLED; 242 #endif 238 243 239 244 /** Is the clipboard running in headless mode? */ … … 1537 1542 { 1538 1543 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 1539 rc = shclSvcTransferHandler(pClient, callHandle, u32Function, cParms, paParms, tsArrival); 1544 if (g_fTransferMode & VBOX_SHCL_TRANSFER_MODE_ENABLED) 1545 { 1546 rc = shclSvcTransferHandler(pClient, callHandle, u32Function, cParms, paParms, tsArrival); 1547 } 1548 else 1549 rc = VERR_ACCESS_DENIED; 1540 1550 #else 1541 1551 rc = VERR_NOT_IMPLEMENTED; … … 1637 1647 } 1638 1648 1649 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 1650 case VBOX_SHCL_HOST_FN_SET_TRANSFER_MODE: 1651 { 1652 if (cParms != 1) 1653 { 1654 rc = VERR_INVALID_PARAMETER; 1655 } 1656 else 1657 { 1658 uint32_t u32TransferMode; 1659 rc = HGCMSvcGetU32(&paParms[0], &u32TransferMode); 1660 if (RT_SUCCESS(rc)) 1661 rc = shclSvcTransferModeSet(u32TransferMode); 1662 } 1663 break; 1664 } 1665 #endif 1639 1666 case VBOX_SHCL_HOST_FN_SET_HEADLESS: 1640 1667 {
Note:
See TracChangeset
for help on using the changeset viewer.