Changeset 100393 in vbox for trunk/src/VBox/GuestHost/SharedClipboard
- Timestamp:
- Jul 5, 2023 4:18:02 PM (21 months ago)
- svn:sync-xref-src-repo-rev:
- 158133
- Location:
- trunk/src/VBox/GuestHost/SharedClipboard
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-transfers.cpp
r100385 r100393 44 44 45 45 46 47 /********************************************************************************************************************************* 48 * Prototypes * 49 ********************************************************************************************************************************/ 50 51 static void shClTransferCopyCallbacks(PSHCLTRANSFERCALLBACKS pCallbacksDst, PSHCLTRANSFERCALLBACKS pCallbacksSrc); 46 52 DECLINLINE(void) shClTransferLock(PSHCLTRANSFER pTransfer); 47 53 DECLINLINE(void) shClTransferUnlock(PSHCLTRANSFER pTransfer); 54 static void shClTransferSetCallbacks(PSHCLTRANSFER pTransfer, PSHCLTRANSFERCALLBACKS pCallbacks); 48 55 static int shClTransferSetStatus(PSHCLTRANSFER pTransfer, SHCLTRANSFERSTATUS enmStatus); 49 56 static int shClTransferThreadCreate(PSHCLTRANSFER pTransfer, PFNRTTHREAD pfnThreadFunc, void *pvUser); … … 1052 1059 * @param enmDir Specifies the transfer direction of this transfer. 1053 1060 * @param enmSource Specifies the data source of the transfer. 1061 * @param pCallbacks Callback table to use. Optional and can be NULL. 1054 1062 * @param cbMaxChunkSize Maximum transfer chunk size (in bytes) to use. 1055 1063 * @param cMaxListHandles Maximum list entries the transfer can have. … … 1058 1066 * Must be destroyed by ShClTransferDestroy(). 1059 1067 */ 1060 int ShClTransferCreateEx(SHCLTRANSFERDIR enmDir, SHCLSOURCE enmSource, 1068 int ShClTransferCreateEx(SHCLTRANSFERDIR enmDir, SHCLSOURCE enmSource, PSHCLTRANSFERCALLBACKS pCallbacks, 1061 1069 uint32_t cbMaxChunkSize, uint32_t cMaxListHandles, uint32_t cMaxObjHandles, PSHCLTRANSFER *ppTransfer) 1062 1070 { 1063 1064 1065 1071 AssertPtrReturn(ppTransfer, VERR_INVALID_POINTER); 1072 /* pCallbacks can be NULL. */ 1066 1073 1067 1074 LogFlowFuncEnter(); … … 1096 1103 RT_ZERO(pTransfer->ProviderCtx); 1097 1104 RT_ZERO(pTransfer->ProviderIface); 1105 1106 /* Make sure to set the callbacks before calling pfnOnCreate below. */ 1107 shClTransferSetCallbacks(pTransfer, pCallbacks); 1098 1108 1099 1109 ShClTransferListInit(&pTransfer->lstRoots); … … 1132 1142 * @param enmDir Specifies the transfer direction of this transfer. 1133 1143 * @param enmSource Specifies the data source of the transfer. 1144 * @param pCallbacks Callback table to use. Optional and can be NULL. 1134 1145 * @param ppTransfer Where to return the created clipboard transfer struct. 1135 1146 * Must be destroyed by ShClTransferDestroy(). 1136 1147 */ 1137 int ShClTransferCreate(SHCLTRANSFERDIR enmDir, SHCLSOURCE enmSource, PSHCLTRANSFER *ppTransfer)1138 { 1139 return ShClTransferCreateEx(enmDir, enmSource, 1148 int ShClTransferCreate(SHCLTRANSFERDIR enmDir, SHCLSOURCE enmSource, PSHCLTRANSFERCALLBACKS pCallbacks, PSHCLTRANSFER *ppTransfer) 1149 { 1150 return ShClTransferCreateEx(enmDir, enmSource, pCallbacks, 1140 1151 SHCL_TRANSFER_DEFAULT_MAX_CHUNK_SIZE, 1141 1152 SHCL_TRANSFER_DEFAULT_MAX_LIST_HANDLES, … … 1469 1480 * destination callback table will be unset. 1470 1481 */ 1471 void ShClTransferCopyCallbacks(PSHCLTRANSFERCALLBACKS pCallbacksDst, 1472 PSHCLTRANSFERCALLBACKS pCallbacksSrc) 1482 static void shClTransferCopyCallbacks(PSHCLTRANSFERCALLBACKS pCallbacksDst, PSHCLTRANSFERCALLBACKS pCallbacksSrc) 1473 1483 { 1474 1484 AssertPtrReturnVoid(pCallbacksDst); 1485 /* pCallbacksSrc can be NULL */ 1475 1486 1476 1487 if (pCallbacksSrc) /* Set */ … … 1508 1519 * @note Must come before initializing the transfer via ShClTransferInit(). 1509 1520 */ 1510 void ShClTransferSetCallbacks(PSHCLTRANSFER pTransfer, 1511 PSHCLTRANSFERCALLBACKS pCallbacks) 1521 static void shClTransferSetCallbacks(PSHCLTRANSFER pTransfer, PSHCLTRANSFERCALLBACKS pCallbacks) 1512 1522 { 1513 1523 AssertPtrReturnVoid(pTransfer); 1514 1524 /* pCallbacks can be NULL. */ 1515 1525 1516 ShClTransferCopyCallbacks(&pTransfer->Callbacks, pCallbacks);1526 shClTransferCopyCallbacks(&pTransfer->Callbacks, pCallbacks); 1517 1527 1518 1528 /* Make sure that the callback context has all values set according to the callback table. -
trunk/src/VBox/GuestHost/SharedClipboard/testcase/tstClipboardHttpServer.cpp
r100367 r100393 212 212 { 213 213 PSHCLTRANSFER pTx; 214 RTTEST_CHECK_RC_OK(hTest, ShClTransferCreate(SHCLTRANSFERDIR_TO_REMOTE, SHCLSOURCE_LOCAL, &pTx));214 RTTEST_CHECK_RC_OK(hTest, ShClTransferCreate(SHCLTRANSFERDIR_TO_REMOTE, SHCLSOURCE_LOCAL, NULL /* Callbacks */, &pTx)); 215 215 RTTEST_CHECK_RC_OK(hTest, ShClTransferSetProvider(pTx, &Provider)); 216 216 RTTEST_CHECK_RC_OK(hTest, ShClTransferInit(pTx));
Note:
See TracChangeset
for help on using the changeset viewer.