Changeset 80858 in vbox for trunk/src/VBox/HostServices/SharedClipboard
- Timestamp:
- Sep 17, 2019 1:03:39 PM (5 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedClipboard
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-darwin.cpp
r80849 r80858 215 215 216 216 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 217 if (pFormats->uFormats & VBOX_SHCL_FMT_URI_LIST) /* No URIsupport yet. */217 if (pFormats->uFormats & VBOX_SHCL_FMT_URI_LIST) /* No transfer support yet. */ 218 218 return VINF_SUCCESS; 219 219 #endif … … 277 277 278 278 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 279 int SharedClipboardSvcImpl URIReadDir(PSHCLCLIENT pClient, PSHCLDIRDATA pDirData)279 int SharedClipboardSvcImplTransferReadDir(PSHCLCLIENT pClient, PSHCLDIRDATA pDirData) 280 280 { 281 281 RT_NOREF(pClient, pDirData); … … 283 283 } 284 284 285 int SharedClipboardSvcImpl URIWriteDir(PSHCLCLIENT pClient, PSHCLDIRDATA pDirData)285 int SharedClipboardSvcImplTransferWriteDir(PSHCLCLIENT pClient, PSHCLDIRDATA pDirData) 286 286 { 287 287 RT_NOREF(pClient, pDirData); … … 289 289 } 290 290 291 int SharedClipboardSvcImpl URIReadFileHdr(PSHCLCLIENT pClient, PSHCLFILEHDR pFileHdr)291 int SharedClipboardSvcImplTransferReadFileHdr(PSHCLCLIENT pClient, PSHCLFILEHDR pFileHdr) 292 292 { 293 293 RT_NOREF(pClient, pFileHdr); … … 295 295 } 296 296 297 int SharedClipboardSvcImpl URIWriteFileHdr(PSHCLCLIENT pClient, PSHCLFILEHDR pFileHdr)297 int SharedClipboardSvcImplTransferWriteFileHdr(PSHCLCLIENT pClient, PSHCLFILEHDR pFileHdr) 298 298 { 299 299 RT_NOREF(pClient, pFileHdr); … … 301 301 } 302 302 303 int SharedClipboardSvcImpl URIReadFileData(PSHCLCLIENT pClient, PSHCLFILEDATA pFileData)303 int SharedClipboardSvcImplTransferReadFileData(PSHCLCLIENT pClient, PSHCLFILEDATA pFileData) 304 304 { 305 305 RT_NOREF(pClient, pFileData); … … 307 307 } 308 308 309 int SharedClipboardSvcImpl URIWriteFileData(PSHCLCLIENT pClient, PSHCLFILEDATA pFileData)309 int SharedClipboardSvcImplTransferWriteFileData(PSHCLCLIENT pClient, PSHCLFILEDATA pFileData) 310 310 { 311 311 RT_NOREF(pClient, pFileData); -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-internal.h
r80849 r80858 67 67 } SHCLCLIENTMSG, *PSHCLCLIENTMSG; 68 68 69 typedef struct SHCLCLIENT URISTATE69 typedef struct SHCLCLIENTTRANSFERSTATE 70 70 { 71 71 /** Directory of the transfer to start. */ 72 SHCL URITRANSFERDIR enmTransferDir;73 } SHCLCLIENT URISTATE, *PSHCLCLIENTURISTATE;72 SHCLTRANSFERDIR enmTransferDir; 73 } SHCLCLIENTTRANSFERSTATE, *PSHCLCLIENTTRANSFERSTATE; 74 74 75 75 /** … … 93 93 uint32_t cbChunkSize; 94 94 SHCLSOURCE enmSource; 95 /** The client's URIstate. */96 SHCLCLIENT URISTATE URI;95 /** The client's transfers state. */ 96 SHCLCLIENTTRANSFERSTATE Transfers; 97 97 } SHCLCLIENTSTATE, *PSHCLCLIENTSTATE; 98 98 … … 112 112 SHCLEVENTSOURCE Events; 113 113 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 114 /** URI contextdata. */115 SHCL URICTX URI;114 /** Transfer contextdata. */ 115 SHCLTRANSFERCTX TransferCtx; 116 116 #endif 117 117 /** Structure for keeping the client's pending (deferred return) state. … … 197 197 198 198 # ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 199 int sharedClipboardSvc URITransferStart(PSHCLCLIENT pClient,200 SHCL URITRANSFERDIR enmDir, SHCLSOURCE enmSource,201 PSHCL URITRANSFER *ppTransfer);202 bool sharedClipboardSvc URIMsgIsAllowed(uint32_t uMode, uint32_t uMsg);199 int sharedClipboardSvcTransferTransferStart(PSHCLCLIENT pClient, 200 SHCLTRANSFERDIR enmDir, SHCLSOURCE enmSource, 201 PSHCLTRANSFER *ppTransfer); 202 bool sharedClipboardSvcTransferMsgIsAllowed(uint32_t uMode, uint32_t uMsg); 203 203 # endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */ 204 204 … … 222 222 223 223 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 224 int sharedClipboardSvc URITransferOpen(PSHCLPROVIDERCTX pCtx);225 DECLCALLBACK(int) sharedClipboardSvc URITransferClose(PSHCLPROVIDERCTX pCtx);226 227 int sharedClipboardSvc URIGetRoots(PSHCLPROVIDERCTX pCtx, PSHCLROOTLIST *ppRootList);228 229 int sharedClipboardSvc URIListOpen(PSHCLPROVIDERCTX pCtx, PSHCLLISTOPENPARMS pOpenParms, PSHCLLISTHANDLE phList);230 int sharedClipboardSvc URIListClose(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList);231 int sharedClipboardSvc URIListHdrRead(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr);232 int sharedClipboardSvc URIListHdrWrite(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr);233 int sharedClipboardSvc URIListEntryRead(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTENTRY pListEntry);234 int sharedClipboardSvc URIListEntryWrite(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTENTRY pListEntry);235 236 int sharedClipboardSvc URIObjOpen(PSHCLPROVIDERCTX pCtx, PSHCLOBJOPENCREATEPARMS pCreateParms,224 int sharedClipboardSvcTransferTransferOpen(PSHCLPROVIDERCTX pCtx); 225 DECLCALLBACK(int) sharedClipboardSvcTransferTransferClose(PSHCLPROVIDERCTX pCtx); 226 227 int sharedClipboardSvcTransferGetRoots(PSHCLPROVIDERCTX pCtx, PSHCLROOTLIST *ppRootList); 228 229 int sharedClipboardSvcTransferListOpen(PSHCLPROVIDERCTX pCtx, PSHCLLISTOPENPARMS pOpenParms, PSHCLLISTHANDLE phList); 230 int sharedClipboardSvcTransferListClose(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList); 231 int sharedClipboardSvcTransferListHdrRead(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr); 232 int sharedClipboardSvcTransferListHdrWrite(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr); 233 int sharedClipboardSvcTransferListEntryRead(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTENTRY pListEntry); 234 int sharedClipboardSvcTransferListEntryWrite(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTENTRY pListEntry); 235 236 int sharedClipboardSvcTransferObjOpen(PSHCLPROVIDERCTX pCtx, PSHCLOBJOPENCREATEPARMS pCreateParms, 237 237 PSHCLOBJHANDLE phObj); 238 int sharedClipboardSvc URIObjClose(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj);239 int sharedClipboardSvc URIObjRead(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj,238 int sharedClipboardSvcTransferObjClose(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj); 239 int sharedClipboardSvcTransferObjRead(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj, 240 240 void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbRead); 241 int sharedClipboardSvc URIObjWrite(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj,241 int sharedClipboardSvcTransferObjWrite(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj, 242 242 void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbWritten); 243 243 244 DECLCALLBACK(void) VBoxSvcClipboard URITransferPrepareCallback(PSHCLURITRANSFERCALLBACKDATA pData);245 DECLCALLBACK(void) VBoxSvcClipboard URIDataHeaderCompleteCallback(PSHCLURITRANSFERCALLBACKDATA pData);246 DECLCALLBACK(void) VBoxSvcClipboard URIDataCompleteCallback(PSHCLURITRANSFERCALLBACKDATA pData);247 DECLCALLBACK(void) VBoxSvcClipboard URITransferCompleteCallback(PSHCLURITRANSFERCALLBACKDATA pData, int rc);248 DECLCALLBACK(void) VBoxSvcClipboard URITransferCanceledCallback(PSHCLURITRANSFERCALLBACKDATA pData);249 DECLCALLBACK(void) VBoxSvcClipboard URITransferErrorCallback(PSHCLURITRANSFERCALLBACKDATA pData, int rc);250 251 int SharedClipboardSvcImpl URITransferCreate(PSHCLCLIENT pClient, PSHCLURITRANSFER pTransfer);252 int SharedClipboardSvcImpl URITransferDestroy(PSHCLCLIENT pClient, PSHCLURITRANSFER pTransfer);244 DECLCALLBACK(void) VBoxSvcClipboardTransferPrepareCallback(PSHCLTRANSFERCALLBACKDATA pData); 245 DECLCALLBACK(void) VBoxSvcClipboardDataHeaderCompleteCallback(PSHCLTRANSFERCALLBACKDATA pData); 246 DECLCALLBACK(void) VBoxSvcClipboardDataCompleteCallback(PSHCLTRANSFERCALLBACKDATA pData); 247 DECLCALLBACK(void) VBoxSvcClipboardTransferCompleteCallback(PSHCLTRANSFERCALLBACKDATA pData, int rc); 248 DECLCALLBACK(void) VBoxSvcClipboardTransferCanceledCallback(PSHCLTRANSFERCALLBACKDATA pData); 249 DECLCALLBACK(void) VBoxSvcClipboardTransferErrorCallback(PSHCLTRANSFERCALLBACKDATA pData, int rc); 250 251 int SharedClipboardSvcImplTransferCreate(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer); 252 int SharedClipboardSvcImplTransferDestroy(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer); 253 253 #endif /*VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */ 254 254 -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-uri.cpp
r80848 r80858 1 1 /* $Id$ */ 2 2 /** @file 3 * Shared Clipboard Service - Internal code for URI(list) handling.3 * Shared Clipboard Service - Internal code for transfer (list) handling. 4 4 */ 5 5 … … 48 48 * Prototypes * 49 49 *********************************************************************************************************************************/ 50 static int sharedClipboardSvc URISetListOpen(uint32_t cParms, VBOXHGCMSVCPARM paParms[],51 PSHCLMSGCTX pMsgCtx, PSHCLLISTOPENPARMS pOpenParms);52 static int sharedClipboardSvc URISetListClose(uint32_t cParms, VBOXHGCMSVCPARM paParms[],53 PSHCLMSGCTX pMsgCtx, SHCLLISTHANDLE hList);50 static int sharedClipboardSvcTransferSetListOpen(uint32_t cParms, VBOXHGCMSVCPARM paParms[], 51 PSHCLMSGCTX pMsgCtx, PSHCLLISTOPENPARMS pOpenParms); 52 static int sharedClipboardSvcTransferSetListClose(uint32_t cParms, VBOXHGCMSVCPARM paParms[], 53 PSHCLMSGCTX pMsgCtx, SHCLLISTHANDLE hList); 54 54 55 55 … … 58 58 *********************************************************************************************************************************/ 59 59 60 DECLCALLBACK(int) sharedClipboardSvc URITransferOpen(PSHCLPROVIDERCTX pCtx)60 DECLCALLBACK(int) sharedClipboardSvcTransferTransferOpen(PSHCLPROVIDERCTX pCtx) 61 61 { 62 62 RT_NOREF(pCtx); … … 66 66 } 67 67 68 DECLCALLBACK(int) sharedClipboardSvc URITransferClose(PSHCLPROVIDERCTX pCtx)68 DECLCALLBACK(int) sharedClipboardSvcTransferTransferClose(PSHCLPROVIDERCTX pCtx) 69 69 { 70 70 RT_NOREF(pCtx); … … 74 74 } 75 75 76 DECLCALLBACK(int) sharedClipboardSvc URIGetRoots(PSHCLPROVIDERCTX pCtx, PSHCLROOTLIST *ppRootList)76 DECLCALLBACK(int) sharedClipboardSvcTransferGetRoots(PSHCLPROVIDERCTX pCtx, PSHCLROOTLIST *ppRootList) 77 77 { 78 78 LogFlowFuncEnter(); … … 83 83 int rc; 84 84 85 PSHCLCLIENTMSG pMsgHdr = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_ URI_ROOT_LIST_HDR_READ,85 PSHCLCLIENTMSG pMsgHdr = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_HDR_READ, 86 86 VBOX_SHCL_CPARMS_ROOT_LIST_HDR_READ); 87 87 if (pMsgHdr) … … 112 112 LogFlowFunc(("cRoots=%RU32, fRoots=0x%x\n", pSrcRootListHdr->cRoots, pSrcRootListHdr->fRoots)); 113 113 114 PSHCLROOTLIST pRootList = SharedClipboard URIRootListAlloc();114 PSHCLROOTLIST pRootList = SharedClipboardTransferRootListAlloc(); 115 115 if (pRootList) 116 116 { … … 124 124 for (uint32_t i = 0; i < pSrcRootListHdr->cRoots; i++) 125 125 { 126 PSHCLCLIENTMSG pMsgEntry = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_ URI_ROOT_LIST_ENTRY_READ,126 PSHCLCLIENTMSG pMsgEntry = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_ROOT_LIST_ENTRY_READ, 127 127 VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY_READ_REQ); 128 128 … … 151 151 Assert(pPayloadEntry->cbData == sizeof(SHCLROOTLISTENTRY)); 152 152 153 rc = SharedClipboard URIListEntryCopy(&pRootList->paEntries[i], pSrcRootListEntry);153 rc = SharedClipboardTransferListEntryCopy(&pRootList->paEntries[i], pSrcRootListEntry); 154 154 155 155 SharedClipboardPayloadFree(pPayloadEntry); … … 173 173 } 174 174 else 175 SharedClipboard URIRootListFree(pRootList);175 SharedClipboardTransferRootListFree(pRootList); 176 176 177 177 SharedClipboardPayloadFree(pPayloadHdr); … … 192 192 } 193 193 194 DECLCALLBACK(int) sharedClipboardSvc URIListOpen(PSHCLPROVIDERCTX pCtx,195 PSHCLLISTOPENPARMS pOpenParms, PSHCLLISTHANDLE phList)194 DECLCALLBACK(int) sharedClipboardSvcTransferListOpen(PSHCLPROVIDERCTX pCtx, 195 PSHCLLISTOPENPARMS pOpenParms, PSHCLLISTHANDLE phList) 196 196 { 197 197 LogFlowFuncEnter(); … … 202 202 int rc; 203 203 204 PSHCLCLIENTMSG pMsg = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_ URI_LIST_OPEN,204 PSHCLCLIENTMSG pMsg = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_LIST_OPEN, 205 205 VBOX_SHCL_CPARMS_LIST_OPEN); 206 206 if (pMsg) … … 211 211 uEvent); 212 212 213 rc = sharedClipboardSvc URISetListOpen(pMsg->cParms, pMsg->paParms, &pMsg->Ctx, pOpenParms);213 rc = sharedClipboardSvcTransferSetListOpen(pMsg->cParms, pMsg->paParms, &pMsg->Ctx, pOpenParms); 214 214 if (RT_SUCCESS(rc)) 215 215 { … … 251 251 } 252 252 253 DECLCALLBACK(int) sharedClipboardSvc URIListClose(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList)253 DECLCALLBACK(int) sharedClipboardSvcTransferListClose(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList) 254 254 { 255 255 LogFlowFuncEnter(); … … 260 260 int rc; 261 261 262 PSHCLCLIENTMSG pMsg = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_ URI_LIST_CLOSE,262 PSHCLCLIENTMSG pMsg = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_LIST_CLOSE, 263 263 VBOX_SHCL_CPARMS_LIST_CLOSE); 264 264 if (pMsg) … … 269 269 uEvent); 270 270 271 rc = sharedClipboardSvc URISetListClose(pMsg->cParms, pMsg->paParms, &pMsg->Ctx, hList);271 rc = sharedClipboardSvcTransferSetListClose(pMsg->cParms, pMsg->paParms, &pMsg->Ctx, hList); 272 272 if (RT_SUCCESS(rc)) 273 273 { … … 298 298 } 299 299 300 DECLCALLBACK(int) sharedClipboardSvc URIListHdrRead(PSHCLPROVIDERCTX pCtx,301 SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr)300 DECLCALLBACK(int) sharedClipboardSvcTransferListHdrRead(PSHCLPROVIDERCTX pCtx, 301 SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr) 302 302 { 303 303 LogFlowFuncEnter(); … … 308 308 int rc; 309 309 310 PSHCLCLIENTMSG pMsg = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_ URI_LIST_HDR_READ,310 PSHCLCLIENTMSG pMsg = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_LIST_HDR_READ, 311 311 VBOX_SHCL_CPARMS_LIST_HDR_READ_REQ); 312 312 if (pMsg) … … 349 349 } 350 350 351 DECLCALLBACK(int) sharedClipboardSvc URIListHdrWrite(PSHCLPROVIDERCTX pCtx,352 SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr)351 DECLCALLBACK(int) sharedClipboardSvcTransferListHdrWrite(PSHCLPROVIDERCTX pCtx, 352 SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr) 353 353 { 354 354 RT_NOREF(pCtx, hList, pListHdr); … … 359 359 } 360 360 361 DECLCALLBACK(int) sharedClipboardSvc URIListEntryRead(PSHCLPROVIDERCTX pCtx,362 SHCLLISTHANDLE hList, PSHCLLISTENTRY pListEntry)361 DECLCALLBACK(int) sharedClipboardSvcTransferListEntryRead(PSHCLPROVIDERCTX pCtx, 362 SHCLLISTHANDLE hList, PSHCLLISTENTRY pListEntry) 363 363 { 364 364 LogFlowFuncEnter(); … … 369 369 int rc; 370 370 371 PSHCLCLIENTMSG pMsg = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_ URI_LIST_ENTRY_READ,371 PSHCLCLIENTMSG pMsg = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_LIST_ENTRY_READ, 372 372 VBOX_SHCL_CPARMS_LIST_ENTRY_READ); 373 373 if (pMsg) … … 395 395 Assert(pPayload->cbData == sizeof(SHCLLISTENTRY)); 396 396 397 rc = SharedClipboard URIListEntryCopy(pListEntry, (PSHCLLISTENTRY)pPayload->pvData);397 rc = SharedClipboardTransferListEntryCopy(pListEntry, (PSHCLLISTENTRY)pPayload->pvData); 398 398 399 399 SharedClipboardPayloadFree(pPayload); … … 409 409 } 410 410 411 DECLCALLBACK(int) sharedClipboardSvc URIListEntryWrite(PSHCLPROVIDERCTX pCtx,412 SHCLLISTHANDLE hList, PSHCLLISTENTRY pListEntry)411 DECLCALLBACK(int) sharedClipboardSvcTransferListEntryWrite(PSHCLPROVIDERCTX pCtx, 412 SHCLLISTHANDLE hList, PSHCLLISTENTRY pListEntry) 413 413 { 414 414 RT_NOREF(pCtx, hList, pListEntry); … … 419 419 } 420 420 421 int sharedClipboardSvc URIObjOpen(PSHCLPROVIDERCTX pCtx, PSHCLOBJOPENCREATEPARMS pCreateParms,422 PSHCLOBJHANDLE phObj)421 int sharedClipboardSvcTransferObjOpen(PSHCLPROVIDERCTX pCtx, PSHCLOBJOPENCREATEPARMS pCreateParms, 422 PSHCLOBJHANDLE phObj) 423 423 { 424 424 LogFlowFuncEnter(); … … 429 429 int rc; 430 430 431 PSHCLCLIENTMSG pMsg = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_ URI_OBJ_OPEN,431 PSHCLCLIENTMSG pMsg = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_OPEN, 432 432 VBOX_SHCL_CPARMS_OBJ_OPEN); 433 433 if (pMsg) … … 480 480 } 481 481 482 int sharedClipboardSvc URIObjClose(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj)482 int sharedClipboardSvcTransferObjClose(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj) 483 483 { 484 484 LogFlowFuncEnter(); … … 489 489 int rc; 490 490 491 PSHCLCLIENTMSG pMsg = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_ URI_OBJ_CLOSE,491 PSHCLCLIENTMSG pMsg = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_CLOSE, 492 492 VBOX_SHCL_CPARMS_OBJ_CLOSE); 493 493 if (pMsg) … … 533 533 } 534 534 535 int sharedClipboardSvc URIObjRead(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj,536 void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbRead)535 int sharedClipboardSvcTransferObjRead(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj, 536 void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbRead) 537 537 { 538 538 LogFlowFuncEnter(); … … 543 543 int rc; 544 544 545 PSHCLCLIENTMSG pMsg = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_ URI_OBJ_READ,545 PSHCLCLIENTMSG pMsg = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_READ, 546 546 VBOX_SHCL_CPARMS_OBJ_READ_REQ); 547 547 if (pMsg) … … 592 592 } 593 593 594 int sharedClipboardSvc URIObjWrite(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj,595 void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbWritten)594 int sharedClipboardSvcTransferObjWrite(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj, 595 void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbWritten) 596 596 { 597 597 LogFlowFuncEnter(); … … 602 602 int rc; 603 603 604 PSHCLCLIENTMSG pMsg = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_ URI_OBJ_WRITE,604 PSHCLCLIENTMSG pMsg = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_WRITE, 605 605 VBOX_SHCL_CPARMS_OBJ_WRITE); 606 606 if (pMsg) … … 648 648 649 649 /********************************************************************************************************************************* 650 * URIcallbacks *650 * transfer callbacks * 651 651 *********************************************************************************************************************************/ 652 652 653 DECLCALLBACK(void) VBoxSvcClipboard URITransferPrepareCallback(PSHCLURITRANSFERCALLBACKDATA pData)653 DECLCALLBACK(void) VBoxSvcClipboardTransferPrepareCallback(PSHCLTRANSFERCALLBACKDATA pData) 654 654 { 655 655 RT_NOREF(pData); … … 658 658 } 659 659 660 DECLCALLBACK(void) VBoxSvcClipboard URITransferCompleteCallback(PSHCLURITRANSFERCALLBACKDATA pData, int rc)660 DECLCALLBACK(void) VBoxSvcClipboardTransferCompleteCallback(PSHCLTRANSFERCALLBACKDATA pData, int rc) 661 661 { 662 662 RT_NOREF(pData, rc); … … 667 667 } 668 668 669 DECLCALLBACK(void) VBoxSvcClipboard URITransferCanceledCallback(PSHCLURITRANSFERCALLBACKDATA pData)669 DECLCALLBACK(void) VBoxSvcClipboardTransferCanceledCallback(PSHCLTRANSFERCALLBACKDATA pData) 670 670 { 671 671 LogFlowFuncEnter(); … … 676 676 } 677 677 678 DECLCALLBACK(void) VBoxSvcClipboard URITransferErrorCallback(PSHCLURITRANSFERCALLBACKDATA pData, int rc)678 DECLCALLBACK(void) VBoxSvcClipboardTransferErrorCallback(PSHCLTRANSFERCALLBACKDATA pData, int rc) 679 679 { 680 680 LogFlowFuncEnter(); … … 691 691 692 692 /** 693 * Gets a n URImessage reply from HGCM service parameters.693 * Gets a transfer message reply from HGCM service parameters. 694 694 * 695 695 * @returns VBox status code. … … 698 698 * @param pReply Where to store the reply. 699 699 */ 700 static int sharedClipboardSvc URIGetReply(uint32_t cParms, VBOXHGCMSVCPARM paParms[],701 PSHCLREPLY pReply)700 static int sharedClipboardSvcTransferGetReply(uint32_t cParms, VBOXHGCMSVCPARM paParms[], 701 PSHCLREPLY pReply) 702 702 { 703 703 int rc; … … 767 767 768 768 /** 769 * Gets a n URIroot list header from HGCM service parameters.769 * Gets a transfer root list header from HGCM service parameters. 770 770 * 771 771 * @returns VBox status code. 772 772 * @param cParms Number of HGCM parameters supplied in \a paParms. 773 773 * @param paParms Array of HGCM parameters. 774 * @param pRootLstHdr Where to store the URIroot list header on success.774 * @param pRootLstHdr Where to store the transfer root list header on success. 775 775 */ 776 static int sharedClipboardSvc URIGetRootListHdr(uint32_t cParms, VBOXHGCMSVCPARM paParms[],777 PSHCLROOTLISTHDR pRootLstHdr)776 static int sharedClipboardSvcTransferGetRootListHdr(uint32_t cParms, VBOXHGCMSVCPARM paParms[], 777 PSHCLROOTLISTHDR pRootLstHdr) 778 778 { 779 779 int rc; … … 793 793 794 794 /** 795 * Gets a n URIroot list entry from HGCM service parameters.795 * Gets a transfer root list entry from HGCM service parameters. 796 796 * 797 797 * @returns VBox status code. … … 800 800 * @param pListEntry Where to store the root list entry. 801 801 */ 802 static int sharedClipboardSvc URIGetRootListEntry(uint32_t cParms, VBOXHGCMSVCPARM paParms[],803 PSHCLROOTLISTENTRY pListEntry)802 static int sharedClipboardSvcTransferGetRootListEntry(uint32_t cParms, VBOXHGCMSVCPARM paParms[], 803 PSHCLROOTLISTENTRY pListEntry) 804 804 { 805 805 int rc; … … 830 830 831 831 /** 832 * Gets a n URIlist open request from HGCM service parameters.832 * Gets a transfer list open request from HGCM service parameters. 833 833 * 834 834 * @returns VBox status code. … … 837 837 * @param pOpenParms Where to store the open parameters of the request. 838 838 */ 839 static int sharedClipboardSvc URIGetListOpen(uint32_t cParms, VBOXHGCMSVCPARM paParms[],840 PSHCLLISTOPENPARMS pOpenParms)839 static int sharedClipboardSvcTransferGetListOpen(uint32_t cParms, VBOXHGCMSVCPARM paParms[], 840 PSHCLLISTOPENPARMS pOpenParms) 841 841 { 842 842 int rc; … … 876 876 877 877 /** 878 * Sets a n URIlist open request to HGCM service parameters.878 * Sets a transfer list open request to HGCM service parameters. 879 879 * 880 880 * @returns VBox status code. … … 884 884 * @param pOpenParms List open parameters to set. 885 885 */ 886 static int sharedClipboardSvc URISetListOpen(uint32_t cParms, VBOXHGCMSVCPARM paParms[],887 PSHCLMSGCTX pMsgCtx, PSHCLLISTOPENPARMS pOpenParms)886 static int sharedClipboardSvcTransferSetListOpen(uint32_t cParms, VBOXHGCMSVCPARM paParms[], 887 PSHCLMSGCTX pMsgCtx, PSHCLLISTOPENPARMS pOpenParms) 888 888 { 889 889 int rc; … … 909 909 910 910 /** 911 * Sets a n URIlist close request to HGCM service parameters.911 * Sets a transfer list close request to HGCM service parameters. 912 912 * 913 913 * @returns VBox status code. … … 917 917 * @param hList Handle of list to close. 918 918 */ 919 static int sharedClipboardSvc URISetListClose(uint32_t cParms, VBOXHGCMSVCPARM paParms[],920 PSHCLMSGCTX pMsgCtx, SHCLLISTHANDLE hList)919 static int sharedClipboardSvcTransferSetListClose(uint32_t cParms, VBOXHGCMSVCPARM paParms[], 920 PSHCLMSGCTX pMsgCtx, SHCLLISTHANDLE hList) 921 921 { 922 922 int rc; … … 937 937 938 938 /** 939 * Gets a n URIlist header from HGCM service parameters.939 * Gets a transfer list header from HGCM service parameters. 940 940 * 941 941 * @returns VBox status code. … … 945 945 * @param pListHdr Where to store the list header. 946 946 */ 947 static int sharedClipboardSvc URIGetListHdr(uint32_t cParms, VBOXHGCMSVCPARM paParms[],948 PSHCLLISTHANDLE phList, PSHCLLISTHDR pListHdr)947 static int sharedClipboardSvcTransferGetListHdr(uint32_t cParms, VBOXHGCMSVCPARM paParms[], 948 PSHCLLISTHANDLE phList, PSHCLLISTHDR pListHdr) 949 949 { 950 950 int rc; … … 976 976 #if 0 977 977 /** 978 * Sets a n URIlist header to HGCM service parameters.978 * Sets a transfer list header to HGCM service parameters. 979 979 * 980 980 * @returns VBox status code. … … 984 984 * @param pListHdr Pointer to data to set to the HGCM parameters. 985 985 */ 986 static int sharedClipboardSvc URISetListHdr(uint32_t cParms, VBOXHGCMSVCPARM paParms[],987 PVBOXSHCLMSGCTX pMsgCtx, PSHCLLISTHDR pListHdr)986 static int sharedClipboardSvcTransferSetListHdr(uint32_t cParms, VBOXHGCMSVCPARM paParms[], 987 PVBOXSHCLMSGCTX pMsgCtx, PSHCLLISTHDR pListHdr) 988 988 { 989 989 int rc; … … 1011 1011 1012 1012 /** 1013 * Gets a n URIlist entry from HGCM service parameters.1013 * Gets a transfer list entry from HGCM service parameters. 1014 1014 * 1015 1015 * @returns VBox status code. … … 1019 1019 * @param pListEntry Where to store the list entry. 1020 1020 */ 1021 static int sharedClipboardSvc URIGetListEntry(uint32_t cParms, VBOXHGCMSVCPARM paParms[],1022 PSHCLLISTHANDLE phList, PSHCLLISTENTRY pListEntry)1021 static int sharedClipboardSvcTransferGetListEntry(uint32_t cParms, VBOXHGCMSVCPARM paParms[], 1022 PSHCLLISTHANDLE phList, PSHCLLISTENTRY pListEntry) 1023 1023 { 1024 1024 int rc; … … 1044 1044 if (RT_SUCCESS(rc)) 1045 1045 { 1046 if (!SharedClipboard URIListEntryIsValid(pListEntry))1046 if (!SharedClipboardTransferListEntryIsValid(pListEntry)) 1047 1047 rc = VERR_INVALID_PARAMETER; 1048 1048 } … … 1057 1057 #if 0 1058 1058 /** 1059 * Sets a n URI datachunk to HGCM service parameters.1059 * Sets a transfer data chunk to HGCM service parameters. 1060 1060 * 1061 1061 * @returns VBox status code. … … 1065 1065 * @param pListEntry Pointer to data to set to the HGCM parameters. 1066 1066 */ 1067 static int sharedClipboardSvc URISetListEntry(uint32_t cParms, VBOXHGCMSVCPARM paParms[],1068 PVBOXSHCLMSGCTX pMsgCtx, PSHCLLISTENTRY pListEntry)1067 static int sharedClipboardSvcTransferSetListEntry(uint32_t cParms, VBOXHGCMSVCPARM paParms[], 1068 PVBOXSHCLMSGCTX pMsgCtx, PSHCLLISTENTRY pListEntry) 1069 1069 { 1070 1070 int rc; … … 1090 1090 1091 1091 /** 1092 * Gets a n URIobject data chunk from HGCM service parameters.1092 * Gets a transfer object data chunk from HGCM service parameters. 1093 1093 * 1094 1094 * @returns VBox status code. … … 1097 1097 * @param pDataChunk Where to store the object data chunk data. 1098 1098 */ 1099 static int sharedClipboardSvc URIGetObjDataChunk(uint32_t cParms, VBOXHGCMSVCPARM paParms[], PSHCLOBJDATACHUNK pDataChunk)1099 static int sharedClipboardSvcTransferGetObjDataChunk(uint32_t cParms, VBOXHGCMSVCPARM paParms[], PSHCLOBJDATACHUNK pDataChunk) 1100 1100 { 1101 1101 AssertPtrReturn(paParms, VERR_INVALID_PARAMETER); … … 1128 1128 1129 1129 /** 1130 * Gets a n URIerror from HGCM service parameters.1130 * Gets a transfer error from HGCM service parameters. 1131 1131 * 1132 1132 * @returns VBox status code. … … 1135 1135 * @param pRc Where to store the received error code. 1136 1136 */ 1137 static int sharedClipboardSvc URIGetError(uint32_t cParms, VBOXHGCMSVCPARM paParms[], int *pRc)1137 static int sharedClipboardSvcTransferGetError(uint32_t cParms, VBOXHGCMSVCPARM paParms[], int *pRc) 1138 1138 { 1139 1139 AssertPtrReturn(paParms, VERR_INVALID_PARAMETER); … … 1162 1162 * @param paParms Array function parameters supplied. 1163 1163 */ 1164 static int sharedClipboardSvc URITransferHandleReply(PSHCLCLIENT pClient, PSHCLURITRANSFER pTransfer,1165 uint32_t cParms, VBOXHGCMSVCPARM paParms[])1164 static int sharedClipboardSvcTransferTransferHandleReply(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer, 1165 uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 1166 1166 { 1167 1167 RT_NOREF(pClient); … … 1173 1173 if (pReply) 1174 1174 { 1175 rc = sharedClipboardSvc URIGetReply(cParms, paParms, pReply);1175 rc = sharedClipboardSvcTransferGetReply(cParms, paParms, pReply); 1176 1176 if (RT_SUCCESS(rc)) 1177 1177 { … … 1237 1237 1238 1238 /** 1239 * URIclient (guest) handler for the Shared Clipboard host service.1239 * transfer client (guest) handler for the Shared Clipboard host service. 1240 1240 * 1241 1241 * @returns VBox status code. … … 1247 1247 * @param tsArrival Timestamp of arrival. 1248 1248 */ 1249 int sharedClipboardSvc URIHandler(PSHCLCLIENT pClient,1249 int sharedClipboardSvcTransferHandler(PSHCLCLIENT pClient, 1250 1250 VBOXHGCMCALLHANDLE callHandle, 1251 1251 uint32_t u32Function, … … 1261 1261 #if 0 1262 1262 /* Check if we've the right mode set. */ 1263 if (!sharedClipboardSvc URIMsgIsAllowed(sharedClipboardSvcGetMode(), u32Function))1263 if (!sharedClipboardSvcTransferMsgIsAllowed(sharedClipboardSvcGetMode(), u32Function)) 1264 1264 { 1265 1265 LogFunc(("Wrong clipboard mode, denying access\n")); … … 1275 1275 AssertPtr(g_ExtState.pfnExtension); 1276 1276 #endif 1277 LogFunc(("Invalid / no service extension set, skipping URIhandling\n"));1277 LogFunc(("Invalid / no service extension set, skipping transfer handling\n")); 1278 1278 return VERR_NOT_SUPPORTED; 1279 1279 } … … 1285 1285 */ 1286 1286 uint32_t uCID = 0; /* Context ID */ 1287 PSHCL URITRANSFER pTransfer = NULL;1287 PSHCLTRANSFER pTransfer = NULL; 1288 1288 1289 1289 switch (u32Function) … … 1293 1293 default: 1294 1294 { 1295 if (!SharedClipboard URICtxGetTotalTransfers(&pClient->URI))1295 if (!SharedClipboardTransferCtxGetTotalTransfers(&pClient->TransferCtx)) 1296 1296 { 1297 1297 LogFunc(("No transfers found\n")); … … 1307 1307 break; 1308 1308 1309 const SHCL URITRANSFERID uTransferID = VBOX_SHCL_CONTEXTID_GET_TRANSFER(uCID);1310 1311 pTransfer = SharedClipboard URICtxGetTransfer(&pClient->URI, uTransferID);1309 const SHCLTRANSFERID uTransferID = VBOX_SHCL_CONTEXTID_GET_TRANSFER(uCID); 1310 1311 pTransfer = SharedClipboardTransferCtxGetTransfer(&pClient->TransferCtx, uTransferID); 1312 1312 if (!pTransfer) 1313 1313 { … … 1334 1334 break; 1335 1335 1336 SHCL URITRANSFERSTATUS uStatus = SHCLURITRANSFERSTATUS_NONE;1336 SHCLTRANSFERSTATUS uStatus = SHCLTRANSFERSTATUS_NONE; 1337 1337 rc = HGCMSvcGetU32(&paParms[1], &uStatus); 1338 1338 if (RT_FAILURE(rc)) … … 1341 1341 LogFlowFunc(("uStatus: %RU32\n", uStatus)); 1342 1342 1343 SharedClipboard URICtxTransfersCleanup(&pClient->URI);1344 1345 if (SharedClipboard URICtxTransfersMaximumReached(&pClient->URI))1343 SharedClipboardTransferCtxTransfersCleanup(&pClient->URI); 1344 1345 if (SharedClipboardTransferCtxTransfersMaximumReached(&pClient->URI)) 1346 1346 { 1347 1347 rc = VERR_SHCLPB_MAX_TRANSFERS_REACHED; … … 1349 1349 } 1350 1350 1351 if (uStatus == SHCL URITRANSFERSTATUS_RUNNING)1352 { 1353 const SHCL URITRANSFERDIR enmDir = SHCLURITRANSFERDIR_READ;1354 1355 PSHCL URITRANSFER pTransfer;1356 rc = SharedClipboard URITransferCreate(enmDir,1351 if (uStatus == SHCLTRANSFERSTATUS_RUNNING) 1352 { 1353 const SHCLTRANSFERDIR enmDir = SHCLTRANSFERDIR_READ; 1354 1355 PSHCLTRANSFER pTransfer; 1356 rc = SharedClipboardTransferCreate(enmDir, 1357 1357 SHCLSOURCE_REMOTE, &pTransfer); 1358 1358 if (RT_SUCCESS(rc)) 1359 1359 { 1360 rc = sharedClipboardSvc URIAreaRegister(&pClient->State, pTransfer);1360 rc = sharedClipboardSvcTransferAreaRegister(&pClient->State, pTransfer); 1361 1361 if (RT_SUCCESS(rc)) 1362 1362 { … … 1366 1366 creationCtx.enmSource = pClient->State.enmSource; 1367 1367 1368 creationCtx.Interface.pfnTransferOpen = sharedClipboardSvc URITransferOpen;1369 creationCtx.Interface.pfnTransferClose = sharedClipboardSvc URITransferClose;1370 creationCtx.Interface.pfnListOpen = sharedClipboardSvc URIListOpen;1371 creationCtx.Interface.pfnListClose = sharedClipboardSvc URIListClose;1372 creationCtx.Interface.pfnObjOpen = sharedClipboardSvc URIObjOpen;1373 creationCtx.Interface.pfnObjClose = sharedClipboardSvc URIObjClose;1374 1375 if (enmDir == SHCL URITRANSFERDIR_READ)1368 creationCtx.Interface.pfnTransferOpen = sharedClipboardSvcTransferTransferOpen; 1369 creationCtx.Interface.pfnTransferClose = sharedClipboardSvcTransferTransferClose; 1370 creationCtx.Interface.pfnListOpen = sharedClipboardSvcTransferListOpen; 1371 creationCtx.Interface.pfnListClose = sharedClipboardSvcTransferListClose; 1372 creationCtx.Interface.pfnObjOpen = sharedClipboardSvcTransferObjOpen; 1373 creationCtx.Interface.pfnObjClose = sharedClipboardSvcTransferObjClose; 1374 1375 if (enmDir == SHCLTRANSFERDIR_READ) 1376 1376 { 1377 creationCtx.Interface.pfnGetRoots = sharedClipboardSvc URIGetRoots;1378 creationCtx.Interface.pfnListHdrRead = sharedClipboardSvc URIListHdrRead;1379 creationCtx.Interface.pfnListEntryRead = sharedClipboardSvc URIListEntryRead;1380 creationCtx.Interface.pfnObjRead = sharedClipboardSvc URIObjRead;1377 creationCtx.Interface.pfnGetRoots = sharedClipboardSvcTransferGetRoots; 1378 creationCtx.Interface.pfnListHdrRead = sharedClipboardSvcTransferListHdrRead; 1379 creationCtx.Interface.pfnListEntryRead = sharedClipboardSvcTransferListEntryRead; 1380 creationCtx.Interface.pfnObjRead = sharedClipboardSvcTransferObjRead; 1381 1381 } 1382 1382 else … … 1388 1388 1389 1389 /* Register needed callbacks so that we can wait for the meta data to arrive here. */ 1390 SHCL URITRANSFERCALLBACKS Callbacks;1390 SHCLTRANSFERCALLBACKS Callbacks; 1391 1391 RT_ZERO(Callbacks); 1392 1392 1393 1393 Callbacks.pvUser = pClient; 1394 1394 1395 Callbacks.pfnTransferPrepare = VBoxSvcClipboard URITransferPrepareCallback;1396 Callbacks.pfnTransferComplete = VBoxSvcClipboard URITransferCompleteCallback;1397 Callbacks.pfnTransferCanceled = VBoxSvcClipboard URITransferCanceledCallback;1398 Callbacks.pfnTransferError = VBoxSvcClipboard URITransferErrorCallback;1399 1400 SharedClipboard URITransferSetCallbacks(pTransfer, &Callbacks);1401 1402 rc = SharedClipboard URITransferSetInterface(pTransfer, &creationCtx);1395 Callbacks.pfnTransferPrepare = VBoxSvcClipboardTransferPrepareCallback; 1396 Callbacks.pfnTransferComplete = VBoxSvcClipboardTransferCompleteCallback; 1397 Callbacks.pfnTransferCanceled = VBoxSvcClipboardTransferCanceledCallback; 1398 Callbacks.pfnTransferError = VBoxSvcClipboardTransferErrorCallback; 1399 1400 SharedClipboardTransferSetCallbacks(pTransfer, &Callbacks); 1401 1402 rc = SharedClipboardTransferSetInterface(pTransfer, &creationCtx); 1403 1403 if (RT_SUCCESS(rc)) 1404 rc = SharedClipboard URICtxTransferAdd(&pClient->URI, pTransfer);1404 rc = SharedClipboardTransferCtxTransferAdd(&pClient->URI, pTransfer); 1405 1405 } 1406 1406 1407 1407 if (RT_SUCCESS(rc)) 1408 1408 { 1409 rc = SharedClipboardSvcImpl URITransferCreate(pClient, pTransfer);1409 rc = SharedClipboardSvcImplTransferCreate(pClient, pTransfer); 1410 1410 if (RT_SUCCESS(rc)) 1411 1411 rc = SharedClipboardSvcImplFormatAnnounce(pClient, VBOX_SHCL_FMT_URI_LIST); … … 1414 1414 if (RT_FAILURE(rc)) 1415 1415 { 1416 SharedClipboardSvcImpl URITransferDestroy(pClient, pTransfer);1417 SharedClipboard URITransferDestroy(pTransfer);1416 SharedClipboardSvcImplTransferDestroy(pClient, pTransfer); 1417 SharedClipboardTransferDestroy(pTransfer); 1418 1418 } 1419 1419 } … … 1431 1431 case VBOX_SHCL_GUEST_FN_REPLY: 1432 1432 { 1433 rc = sharedClipboardSvc URITransferHandleReply(pClient, pTransfer, cParms, paParms);1433 rc = sharedClipboardSvcTransferTransferHandleReply(pClient, pTransfer, cParms, paParms); 1434 1434 1435 1435 /* This message does not need any completion, as it can happen at any time from the guest side. */ … … 1446 1446 { 1447 1447 SHCLROOTLISTHDR lstHdr; 1448 rc = sharedClipboardSvc URIGetRootListHdr(cParms, paParms, &lstHdr);1449 if (RT_SUCCESS(rc)) 1450 { 1451 void *pvData = SharedClipboard URIRootListHdrDup(&lstHdr);1448 rc = sharedClipboardSvcTransferGetRootListHdr(cParms, paParms, &lstHdr); 1449 if (RT_SUCCESS(rc)) 1450 { 1451 void *pvData = SharedClipboardTransferRootListHdrDup(&lstHdr); 1452 1452 uint32_t cbData = sizeof(SHCLROOTLISTHDR); 1453 1453 … … 1470 1470 #if 0 1471 1471 SHCLROOTLISTENTRY lstEntry; 1472 rc = VBoxSvcClipboard URIGetRootListEntry(cParms, paParms, &lstEntry);1473 if (RT_SUCCESS(rc)) 1474 { 1475 void *pvData = SharedClipboard URIRootListEntryDup(&lstEntry);1472 rc = VBoxSvcClipboardGetRootListEntry(cParms, paParms, &lstEntry); 1473 if (RT_SUCCESS(rc)) 1474 { 1475 void *pvData = SharedClipboardTransferRootListEntryDup(&lstEntry); 1476 1476 uint32_t cbData = sizeof(SHCLROOTLISTENTRY); 1477 1477 1478 PSHCL URITRANSFERPAYLOAD pPayload;1479 rc = SharedClipboard URITransferPayloadAlloc(SHCLURITRANSFEREVENTTYPE_ROOT_LIST_HDR_READ,1478 PSHCLTRANSFERPAYLOAD pPayload; 1479 rc = SharedClipboardTransferPayloadAlloc(SHCLTRANSFEREVENTTYPE_ROOT_LIST_HDR_READ, 1480 1480 pvData, cbData, &pPayload); 1481 1481 if (RT_SUCCESS(rc)) 1482 rc = SharedClipboard URITransferEventSignal(pTransfer, SHCLURITRANSFEREVENTTYPE_ROOT_LIST_HDR_READ,1483 1482 rc = SharedClipboardTransferEventSignal(pTransfer, SHCLTRANSFEREVENTTYPE_ROOT_LIST_HDR_READ, 1483 pPayload); 1484 1484 } 1485 1485 break; … … 1490 1490 { 1491 1491 SHCLROOTLISTENTRY lstEntry; 1492 rc = sharedClipboardSvc URIGetRootListEntry(cParms, paParms, &lstEntry);1493 if (RT_SUCCESS(rc)) 1494 { 1495 void *pvData = SharedClipboard URIRootListEntryDup(&lstEntry);1492 rc = sharedClipboardSvcTransferGetRootListEntry(cParms, paParms, &lstEntry); 1493 if (RT_SUCCESS(rc)) 1494 { 1495 void *pvData = SharedClipboardTransferRootListEntryDup(&lstEntry); 1496 1496 uint32_t cbData = sizeof(SHCLROOTLISTENTRY); 1497 1497 … … 1513 1513 { 1514 1514 SHCLLISTOPENPARMS listOpenParms; 1515 rc = sharedClipboardSvc URIGetListOpen(cParms, paParms, &listOpenParms);1515 rc = sharedClipboardSvcTransferGetListOpen(cParms, paParms, &listOpenParms); 1516 1516 if (RT_SUCCESS(rc)) 1517 1517 { 1518 1518 SHCLLISTHANDLE hList; 1519 rc = SharedClipboard URITransferListOpen(pTransfer, &listOpenParms, &hList);1519 rc = SharedClipboardTransferListOpen(pTransfer, &listOpenParms, &hList); 1520 1520 if (RT_SUCCESS(rc)) 1521 1521 { … … 1536 1536 if (RT_SUCCESS(rc)) 1537 1537 { 1538 rc = SharedClipboard URITransferListClose(pTransfer, hList);1538 rc = SharedClipboardTransferListClose(pTransfer, hList); 1539 1539 } 1540 1540 break; … … 1551 1551 { 1552 1552 SHCLLISTHDR hdrList; 1553 rc = SharedClipboard URITransferListGetHeader(pTransfer, hList, &hdrList);1553 rc = SharedClipboardTransferListGetHeader(pTransfer, hList, &hdrList); 1554 1554 /*if (RT_SUCCESS(rc)) 1555 rc = sharedClipboardSvc URISetListHdr(cParms, paParms, &hdrList);*/1555 rc = sharedClipboardSvcTransferSetListHdr(cParms, paParms, &hdrList);*/ 1556 1556 } 1557 1557 break; … … 1561 1561 { 1562 1562 SHCLLISTHDR hdrList; 1563 rc = SharedClipboard URIListHdrInit(&hdrList);1563 rc = SharedClipboardTransferListHdrInit(&hdrList); 1564 1564 if (RT_SUCCESS(rc)) 1565 1565 { 1566 1566 SHCLLISTHANDLE hList; 1567 rc = sharedClipboardSvc URIGetListHdr(cParms, paParms, &hList, &hdrList);1567 rc = sharedClipboardSvcTransferGetListHdr(cParms, paParms, &hList, &hdrList); 1568 1568 if (RT_SUCCESS(rc)) 1569 1569 { 1570 void *pvData = SharedClipboard URIListHdrDup(&hdrList);1570 void *pvData = SharedClipboardTransferListHdrDup(&hdrList); 1571 1571 uint32_t cbData = sizeof(SHCLLISTHDR); 1572 1572 … … 1596 1596 { 1597 1597 SHCLLISTENTRY entryList; 1598 rc = SharedClipboard URITransferListRead(pTransfer, hList, &entryList);1598 rc = SharedClipboardTransferListRead(pTransfer, hList, &entryList); 1599 1599 } 1600 1600 break; … … 1604 1604 { 1605 1605 SHCLLISTENTRY entryList; 1606 rc = SharedClipboard URIListEntryInit(&entryList);1606 rc = SharedClipboardTransferListEntryInit(&entryList); 1607 1607 if (RT_SUCCESS(rc)) 1608 1608 { 1609 1609 SHCLLISTHANDLE hList; 1610 rc = sharedClipboardSvc URIGetListEntry(cParms, paParms, &hList, &entryList);1610 rc = sharedClipboardSvcTransferGetListEntry(cParms, paParms, &hList, &entryList); 1611 1611 if (RT_SUCCESS(rc)) 1612 1612 { 1613 void *pvData = SharedClipboard URIListEntryDup(&entryList);1613 void *pvData = SharedClipboardTransferListEntryDup(&entryList); 1614 1614 uint32_t cbData = sizeof(SHCLLISTENTRY); 1615 1615 … … 1649 1649 { 1650 1650 SHCLOBJDATACHUNK dataChunk; 1651 rc = sharedClipboardSvc URIGetObjDataChunk(cParms, paParms, &dataChunk);1652 if (RT_SUCCESS(rc)) 1653 { 1654 void *pvData = SharedClipboard URIObjectDataChunkDup(&dataChunk);1651 rc = sharedClipboardSvcTransferGetObjDataChunk(cParms, paParms, &dataChunk); 1652 if (RT_SUCCESS(rc)) 1653 { 1654 void *pvData = SharedClipboardTransferObjectDataChunkDup(&dataChunk); 1655 1655 uint32_t cbData = sizeof(SHCLOBJDATACHUNK); 1656 1656 … … 1676 1676 1677 1677 SHCLDIRDATA dirData; 1678 rc = VBoxSvcClipboard URIGetDir(cParms, paParms, &dirData);1679 if (RT_SUCCESS(rc)) 1680 { 1681 SharedClipboardArea *pArea = SharedClipboard URITransferGetArea(pTransfer);1678 rc = VBoxSvcClipboardGetDir(cParms, paParms, &dirData); 1679 if (RT_SUCCESS(rc)) 1680 { 1681 SharedClipboardArea *pArea = SharedClipboardTransferGetArea(pTransfer); 1682 1682 AssertPtrBreakStmt(pArea, rc = VERR_INVALID_POINTER); 1683 1683 … … 1709 1709 1710 1710 SHCLFILEHDR fileHdr; 1711 rc = VBoxSvcClipboard URISetFileHdr(cParms, paParms, &fileHdr);1711 rc = VBoxSvcClipboardSetFileHdr(cParms, paParms, &fileHdr); 1712 1712 break; 1713 1713 } … … 1717 1717 LogFlowFunc(("VBOX_SHCL_GUEST_FN_WRITE_FILE_HDR\n")); 1718 1718 1719 if (!SharedClipboard URIObjCtxIsValid(SharedClipboardURITransferGetCurrentObjCtx(pTransfer)))1720 { 1721 pTransfer->State.ObjCtx.pObj = new SharedClipboard URIObject(SharedClipboardURIObject::Type_File);1719 if (!SharedClipboardTransferObjCtxIsValid(SharedClipboardTransferGetCurrentObjCtx(pTransfer))) 1720 { 1721 pTransfer->State.ObjCtx.pObj = new SharedClipboardTransferObject(SharedClipboardTransferObject::Type_File); 1722 1722 if (pTransfer->State.ObjCtx.pObj) /** @todo Can this throw? */ 1723 1723 { … … 1734 1734 1735 1735 SHCLFILEHDR fileHdr; 1736 rc = VBoxSvcClipboard URIGetFileHdr(cParms, paParms, &fileHdr);1737 if (RT_SUCCESS(rc)) 1738 { 1739 SharedClipboardArea *pArea = SharedClipboard URITransferGetArea(pTransfer);1736 rc = VBoxSvcClipboardGetFileHdr(cParms, paParms, &fileHdr); 1737 if (RT_SUCCESS(rc)) 1738 { 1739 SharedClipboardArea *pArea = SharedClipboardTransferGetArea(pTransfer); 1740 1740 AssertPtrBreakStmt(pArea, rc = VERR_WRONG_ORDER); 1741 1741 … … 1749 1749 if (RT_SUCCESS(rc)) 1750 1750 { 1751 PSHCLCLIENT URIOBJCTX pObjCtx = SharedClipboardURITransferGetCurrentObjCtx(pTransfer);1751 PSHCLCLIENTTRANSFEROBJCTX pObjCtx = SharedClipboardTransferGetCurrentObjCtx(pTransfer); 1752 1752 AssertPtrBreakStmt(pObjCtx, VERR_INVALID_POINTER); 1753 1753 1754 SharedClipboard URIObject *pObj = pObjCtx->pObj;1754 SharedClipboardTransferObject *pObj = pObjCtx->pObj; 1755 1755 AssertPtrBreakStmt(pObj, VERR_INVALID_POINTER); 1756 1756 … … 1758 1758 1759 1759 /** @todo Add sparse file support based on fFlags? (Use Open(..., fFlags | SPARSE). */ 1760 rc = pObj->OpenFileEx(pszPathAbs, SharedClipboard URIObject::View_Target,1760 rc = pObj->OpenFileEx(pszPathAbs, SharedClipboardTransferObject::View_Target, 1761 1761 RTFILE_O_CREATE_REPLACE | RTFILE_O_WRITE | RTFILE_O_DENY_WRITE, 1762 1762 (fileHdr.fMode & RTFS_UNIX_MASK) | RTFS_UNIX_IRUSR | RTFS_UNIX_IWUSR); … … 1775 1775 pObj->GetDestPathAbs().c_str())); 1776 1776 1777 SharedClipboard URIObjCtxDestroy(&pTransfer->State.ObjCtx);1777 SharedClipboardTransferObjCtxDestroy(&pTransfer->State.ObjCtx); 1778 1778 } 1779 1779 … … 1795 1795 1796 1796 SHCLFILEDATA fileData; 1797 rc = VBoxSvcClipboard URISetFileData(cParms, paParms, &fileData);1797 rc = VBoxSvcClipboardSetFileData(cParms, paParms, &fileData); 1798 1798 break; 1799 1799 } … … 1803 1803 LogFlowFunc(("VBOX_SHCL_FN_WRITE_FILE_DATA\n")); 1804 1804 1805 if (!SharedClipboard URIObjCtxIsValid(&pTransfer->State.ObjCtx))1805 if (!SharedClipboardTransferObjCtxIsValid(&pTransfer->State.ObjCtx)) 1806 1806 { 1807 1807 rc = VERR_WRONG_ORDER; … … 1810 1810 1811 1811 SHCLFILEDATA fileData; 1812 rc = VBoxSvcClipboard URIGetFileData(cParms, paParms, &fileData);1813 if (RT_SUCCESS(rc)) 1814 { 1815 PSHCLCLIENT URIOBJCTX pObjCtx = SharedClipboardURITransferGetCurrentObjCtx(pTransfer);1812 rc = VBoxSvcClipboardGetFileData(cParms, paParms, &fileData); 1813 if (RT_SUCCESS(rc)) 1814 { 1815 PSHCLCLIENTTRANSFEROBJCTX pObjCtx = SharedClipboardTransferGetCurrentObjCtx(pTransfer); 1816 1816 AssertPtrBreakStmt(pObjCtx, VERR_INVALID_POINTER); 1817 1817 1818 SharedClipboard URIObject *pObj = pObjCtx->pObj;1818 SharedClipboardTransferObject *pObj = pObjCtx->pObj; 1819 1819 AssertPtrBreakStmt(pObj, VERR_INVALID_POINTER); 1820 1820 … … 1832 1832 if ( pObj->IsComplete() 1833 1833 || RT_FAILURE(rc)) 1834 SharedClipboard URIObjCtxDestroy(&pTransfer->State.ObjCtx);1834 SharedClipboardTransferObjCtxDestroy(&pTransfer->State.ObjCtx); 1835 1835 } 1836 1836 else … … 1849 1849 { 1850 1850 int rcGuest; 1851 rc = sharedClipboardSvc URIGetError(cParms,paParms, &rcGuest);1851 rc = sharedClipboardSvcTransferGetError(cParms,paParms, &rcGuest); 1852 1852 if (RT_SUCCESS(rc)) 1853 1853 LogRel(("Shared Clipboard: Transfer error: %Rrc\n", rcGuest)); … … 1873 1873 1874 1874 /** 1875 * URIhost handler for the Shared Clipboard host service.1875 * transfer host handler for the Shared Clipboard host service. 1876 1876 * 1877 1877 * @returns VBox status code. … … 1880 1880 * @param paParms Array function parameters supplied. 1881 1881 */ 1882 int sharedClipboardSvc URIHostHandler(uint32_t u32Function,1883 uint32_t cParms,1884 VBOXHGCMSVCPARM paParms[])1882 int sharedClipboardSvcTransferHostHandler(uint32_t u32Function, 1883 uint32_t cParms, 1884 VBOXHGCMSVCPARM paParms[]) 1885 1885 { 1886 1886 RT_NOREF(cParms, paParms); … … 1906 1906 1907 1907 /** 1908 * Registers an URI clipboardarea.1908 * Registers an clipboard transfer area. 1909 1909 * 1910 1910 * @returns VBox status code. 1911 1911 * @param pClientState Client state to use. 1912 * @param pTransfer URItransfer to register a clipboard area for.1912 * @param pTransfer Shared Clipboard transfer to register a clipboard area for. 1913 1913 */ 1914 int sharedClipboardSvc URIAreaRegister(PSHCLCLIENTSTATE pClientState, PSHCLURITRANSFER pTransfer)1914 int sharedClipboardSvcTransferAreaRegister(PSHCLCLIENTSTATE pClientState, PSHCLTRANSFER pTransfer) 1915 1915 { 1916 1916 RT_NOREF(pClientState); … … 1955 1955 1956 1956 /** 1957 * Unregisters an URI clipboardarea.1957 * Unregisters an clipboard transfer area. 1958 1958 * 1959 1959 * @returns VBox status code. 1960 1960 * @param pClientState Client state to use. 1961 * @param pTransfer URItransfer to unregister a clipboard area from.1961 * @param pTransfer Shared Clipboard transfer to unregister a clipboard area from. 1962 1962 */ 1963 int sharedClipboardSvc URIAreaUnregister(PSHCLCLIENTSTATE pClientState, PSHCLURITRANSFER pTransfer)1963 int sharedClipboardSvcTransferAreaUnregister(PSHCLCLIENTSTATE pClientState, PSHCLTRANSFER pTransfer) 1964 1964 { 1965 1965 RT_NOREF(pClientState); … … 2002 2002 2003 2003 /** 2004 * Attaches to an existing (registered) URI clipboardarea.2004 * Attaches to an existing (registered) clipboard transfer area. 2005 2005 * 2006 2006 * @returns VBox status code. 2007 2007 * @param pClientState Client state to use. 2008 * @param pTransfer URItransfer to attach a clipboard area to.2008 * @param pTransfer Shared Clipboard transfer to attach a clipboard area to. 2009 2009 * @param uID ID of clipboard area to to attach to. Specify 0 to attach to the most recent one. 2010 2010 */ 2011 int sharedClipboardSvc URIAreaAttach(PSHCLCLIENTSTATE pClientState, PSHCLURITRANSFER pTransfer,2012 SHCLAREAID uID)2011 int sharedClipboardSvcTransferAreaAttach(PSHCLCLIENTSTATE pClientState, PSHCLTRANSFER pTransfer, 2012 SHCLAREAID uID) 2013 2013 { 2014 2014 RT_NOREF(pClientState); … … 2051 2051 2052 2052 /** 2053 * Detaches from an URI clipboardarea.2053 * Detaches from an clipboard transfer area. 2054 2054 * 2055 2055 * @returns VBox status code. 2056 2056 * @param pClientState Client state to use. 2057 * @param pTransfer URItransfer to detach a clipboard area from.2057 * @param pTransfer Shared Clipboard transfer to detach a clipboard area from. 2058 2058 */ 2059 int sharedClipboardSvc URIAreaDetach(PSHCLCLIENTSTATE pClientState, PSHCLURITRANSFER pTransfer)2059 int sharedClipboardSvcTransferAreaDetach(PSHCLCLIENTSTATE pClientState, PSHCLTRANSFER pTransfer) 2060 2060 { 2061 2061 RT_NOREF(pClientState); … … 2099 2099 * @param puEvent Where to store the created wait event. Optional. 2100 2100 */ 2101 int sharedClipboardSvc URITransferSendStatus(PSHCLCLIENT pClient, PSHCLURITRANSFER pTransfer, SHCLURITRANSFERSTATUS uStatus,2102 int rcTransfer, PSHCLEVENTID puEvent)2101 int sharedClipboardSvcTransferTransferSendStatus(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer, SHCLTRANSFERSTATUS uStatus, 2102 int rcTransfer, PSHCLEVENTID puEvent) 2103 2103 { 2104 2104 AssertPtrReturn(pClient, VERR_INVALID_POINTER); … … 2106 2106 /* puEvent is optional. */ 2107 2107 2108 PSHCLCLIENTMSG pMsgReadData = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_ URI_TRANSFER_STATUS,2108 PSHCLCLIENTMSG pMsgReadData = sharedClipboardSvcMsgAlloc(VBOX_SHCL_HOST_MSG_TRANSFER_TRANSFER_STATUS, 2109 2109 VBOX_SHCL_CPARMS_TRANSFER_STATUS); 2110 2110 if (!pMsgReadData) … … 2153 2153 * @param ppTransfer Where to return the created transfer on success. Optional. 2154 2154 */ 2155 int sharedClipboardSvc URITransferStart(PSHCLCLIENT pClient,2156 SHCLURITRANSFERDIR enmDir, SHCLSOURCE enmSource,2157 PSHCLURITRANSFER *ppTransfer)2155 int sharedClipboardSvcTransferTransferStart(PSHCLCLIENT pClient, 2156 SHCLTRANSFERDIR enmDir, SHCLSOURCE enmSource, 2157 PSHCLTRANSFER *ppTransfer) 2158 2158 { 2159 2159 AssertPtrReturn(pClient, VERR_INVALID_POINTER); … … 2162 2162 LogFlowFuncEnter(); 2163 2163 2164 SharedClipboard URICtxTransfersCleanup(&pClient->URI);2164 SharedClipboardTransferCtxTransfersCleanup(&pClient->TransferCtx); 2165 2165 2166 2166 int rc; 2167 2167 2168 if (!SharedClipboard URICtxTransfersMaximumReached(&pClient->URI))2169 { 2170 LogRel2(("Shared Clipboard: Starting %s transfer ...\n", enmDir == SHCL URITRANSFERDIR_READ ? "read" : "write"));2171 2172 PSHCL URITRANSFER pTransfer;2173 rc = SharedClipboard URITransferCreate(&pTransfer);2168 if (!SharedClipboardTransferCtxTransfersMaximumReached(&pClient->TransferCtx)) 2169 { 2170 LogRel2(("Shared Clipboard: Starting %s transfer ...\n", enmDir == SHCLTRANSFERDIR_READ ? "read" : "write")); 2171 2172 PSHCLTRANSFER pTransfer; 2173 rc = SharedClipboardTransferCreate(&pTransfer); 2174 2174 if (RT_SUCCESS(rc)) 2175 2175 { … … 2177 2177 RT_ZERO(creationCtx); 2178 2178 2179 if (enmDir == SHCL URITRANSFERDIR_READ)2180 { 2181 rc = sharedClipboardSvc URIAreaRegister(&pClient->State, pTransfer);2179 if (enmDir == SHCLTRANSFERDIR_READ) 2180 { 2181 rc = sharedClipboardSvcTransferAreaRegister(&pClient->State, pTransfer); 2182 2182 if (RT_SUCCESS(rc)) 2183 2183 { 2184 creationCtx.Interface.pfnTransferOpen = sharedClipboardSvc URITransferOpen;2185 creationCtx.Interface.pfnTransferClose = sharedClipboardSvc URITransferClose;2186 creationCtx.Interface.pfnListOpen = sharedClipboardSvc URIListOpen;2187 creationCtx.Interface.pfnListClose = sharedClipboardSvc URIListClose;2188 creationCtx.Interface.pfnObjOpen = sharedClipboardSvc URIObjOpen;2189 creationCtx.Interface.pfnObjClose = sharedClipboardSvc URIObjClose;2190 2191 creationCtx.Interface.pfnGetRoots = sharedClipboardSvc URIGetRoots;2192 creationCtx.Interface.pfnListHdrRead = sharedClipboardSvc URIListHdrRead;2193 creationCtx.Interface.pfnListEntryRead = sharedClipboardSvc URIListEntryRead;2194 creationCtx.Interface.pfnObjRead = sharedClipboardSvc URIObjRead;2195 } 2196 } 2197 else if (enmDir == SHCL URITRANSFERDIR_WRITE)2198 { 2199 creationCtx.Interface.pfnListHdrWrite = sharedClipboardSvc URIListHdrWrite;2200 creationCtx.Interface.pfnListEntryWrite = sharedClipboardSvc URIListEntryWrite;2201 creationCtx.Interface.pfnObjWrite = sharedClipboardSvc URIObjWrite;2184 creationCtx.Interface.pfnTransferOpen = sharedClipboardSvcTransferTransferOpen; 2185 creationCtx.Interface.pfnTransferClose = sharedClipboardSvcTransferTransferClose; 2186 creationCtx.Interface.pfnListOpen = sharedClipboardSvcTransferListOpen; 2187 creationCtx.Interface.pfnListClose = sharedClipboardSvcTransferListClose; 2188 creationCtx.Interface.pfnObjOpen = sharedClipboardSvcTransferObjOpen; 2189 creationCtx.Interface.pfnObjClose = sharedClipboardSvcTransferObjClose; 2190 2191 creationCtx.Interface.pfnGetRoots = sharedClipboardSvcTransferGetRoots; 2192 creationCtx.Interface.pfnListHdrRead = sharedClipboardSvcTransferListHdrRead; 2193 creationCtx.Interface.pfnListEntryRead = sharedClipboardSvcTransferListEntryRead; 2194 creationCtx.Interface.pfnObjRead = sharedClipboardSvcTransferObjRead; 2195 } 2196 } 2197 else if (enmDir == SHCLTRANSFERDIR_WRITE) 2198 { 2199 creationCtx.Interface.pfnListHdrWrite = sharedClipboardSvcTransferListHdrWrite; 2200 creationCtx.Interface.pfnListEntryWrite = sharedClipboardSvcTransferListEntryWrite; 2201 creationCtx.Interface.pfnObjWrite = sharedClipboardSvcTransferObjWrite; 2202 2202 } 2203 2203 else … … 2208 2208 2209 2209 /* Register needed callbacks so that we can wait for the meta data to arrive here. */ 2210 SHCL URITRANSFERCALLBACKS Callbacks;2210 SHCLTRANSFERCALLBACKS Callbacks; 2211 2211 RT_ZERO(Callbacks); 2212 2212 2213 2213 Callbacks.pvUser = pClient; 2214 2214 2215 Callbacks.pfnTransferPrepare = VBoxSvcClipboard URITransferPrepareCallback;2216 Callbacks.pfnTransferComplete = VBoxSvcClipboard URITransferCompleteCallback;2217 Callbacks.pfnTransferCanceled = VBoxSvcClipboard URITransferCanceledCallback;2218 Callbacks.pfnTransferError = VBoxSvcClipboard URITransferErrorCallback;2219 2220 SharedClipboard URITransferSetCallbacks(pTransfer, &Callbacks);2215 Callbacks.pfnTransferPrepare = VBoxSvcClipboardTransferPrepareCallback; 2216 Callbacks.pfnTransferComplete = VBoxSvcClipboardTransferCompleteCallback; 2217 Callbacks.pfnTransferCanceled = VBoxSvcClipboardTransferCanceledCallback; 2218 Callbacks.pfnTransferError = VBoxSvcClipboardTransferErrorCallback; 2219 2220 SharedClipboardTransferSetCallbacks(pTransfer, &Callbacks); 2221 2221 2222 2222 uint32_t uTransferID = 0; 2223 2223 2224 rc = SharedClipboard URITransferSetInterface(pTransfer, &creationCtx);2225 if (RT_SUCCESS(rc)) 2226 { 2227 rc = SharedClipboardSvcImpl URITransferCreate(pClient, pTransfer);2224 rc = SharedClipboardTransferSetInterface(pTransfer, &creationCtx); 2225 if (RT_SUCCESS(rc)) 2226 { 2227 rc = SharedClipboardSvcImplTransferCreate(pClient, pTransfer); 2228 2228 if (RT_SUCCESS(rc)) 2229 2229 { 2230 rc = SharedClipboard URICtxTransferRegister(&pClient->URI, pTransfer, &uTransferID);2230 rc = SharedClipboardTransferCtxTransferRegister(&pClient->TransferCtx, pTransfer, &uTransferID); 2231 2231 if (RT_SUCCESS(rc)) 2232 2232 { 2233 rc = SharedClipboard URITransferInit(pTransfer, uTransferID, enmDir, enmSource);2233 rc = SharedClipboardTransferInit(pTransfer, uTransferID, enmDir, enmSource); 2234 2234 if (RT_SUCCESS(rc)) 2235 2235 { 2236 2236 SHCLEVENTID uEvent; 2237 rc = sharedClipboardSvc URITransferSendStatus(pClient, pTransfer,2238 SHCLURITRANSFERSTATUS_READY, VINF_SUCCESS,2239 &uEvent);2237 rc = sharedClipboardSvcTransferTransferSendStatus(pClient, pTransfer, 2238 SHCLTRANSFERSTATUS_READY, VINF_SUCCESS, 2239 &uEvent); 2240 2240 if (RT_SUCCESS(rc)) 2241 2241 { … … 2273 2273 if (RT_FAILURE(rc)) 2274 2274 { 2275 SharedClipboard URICtxTransferUnregister(&pClient->URI, uTransferID);2276 2277 SharedClipboard URITransferDestroy(pTransfer);2275 SharedClipboardTransferCtxTransferUnregister(&pClient->TransferCtx, uTransferID); 2276 2277 SharedClipboardTransferDestroy(pTransfer); 2278 2278 2279 2279 RTMemFree(pTransfer); … … 2304 2304 * @param pTransfer Transfer to stop. 2305 2305 */ 2306 int sharedClipboardSvc URITransferStop(PSHCLCLIENT pClient, PSHCLURITRANSFER pTransfer)2307 { 2308 int rc = SharedClipboard URITransferClose(pTransfer);2306 int sharedClipboardSvcTransferTransferStop(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer) 2307 { 2308 int rc = SharedClipboardTransferClose(pTransfer); 2309 2309 if (RT_SUCCESS(rc)) 2310 2310 { 2311 2311 SHCLEVENTID uEvent; 2312 rc = sharedClipboardSvc URITransferSendStatus(pClient, pTransfer,2313 SHCLURITRANSFERSTATUS_STOPPED, VINF_SUCCESS,2314 &uEvent);2312 rc = sharedClipboardSvcTransferTransferSendStatus(pClient, pTransfer, 2313 SHCLTRANSFERSTATUS_STOPPED, VINF_SUCCESS, 2314 &uEvent); 2315 2315 if (RT_SUCCESS(rc)) 2316 2316 { … … 2320 2320 if (RT_SUCCESS(rc)) 2321 2321 { 2322 rc = SharedClipboard URICtxTransferUnregister(&pClient->URI, SharedClipboardURITransferGetID(pTransfer));2322 rc = SharedClipboardTransferCtxTransferUnregister(&pClient->TransferCtx, SharedClipboardTransferGetID(pTransfer)); 2323 2323 2324 2324 LogRel2(("Shared Clipboard: Stopped transfer %RU32 on guest\n", pTransfer->State.uID)); -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-uri.h
r80664 r80858 1 1 /* $Id$ */ 2 2 /** @file 3 * Shared Clipboard Service - Internal header for URI(list) handling.3 * Shared Clipboard Service - Internal header for transfer (list) handling. 4 4 */ 5 5 … … 22 22 #endif 23 23 24 int sharedClipboardSvc URIHandler(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE callHandle, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[], uint64_t tsArrival);25 int sharedClipboardSvc URIHostHandler(uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[]);24 int sharedClipboardSvcTransferHandler(PSHCLCLIENT pClient, VBOXHGCMCALLHANDLE callHandle, uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[], uint64_t tsArrival); 25 int sharedClipboardSvcTransferHostHandler(uint32_t u32Function, uint32_t cParms, VBOXHGCMSVCPARM paParms[]); 26 26 27 int sharedClipboardSvc URIAreaRegister(PSHCLCLIENTSTATE pClientState, PSHCLURITRANSFER pTransfer);28 int sharedClipboardSvc URIAreaUnregister(PSHCLCLIENTSTATE pClientState, PSHCLURITRANSFER pTransfer);29 int sharedClipboardSvc URIAreaAttach(PSHCLCLIENTSTATE pClientState, PSHCLURITRANSFER pTransfer, SHCLAREAID uID);30 int sharedClipboardSvc URIAreaDetach(PSHCLCLIENTSTATE pClientState, PSHCLURITRANSFER pTransfer);27 int sharedClipboardSvcTransferAreaRegister(PSHCLCLIENTSTATE pClientState, PSHCLTRANSFER pTransfer); 28 int sharedClipboardSvcTransferAreaUnregister(PSHCLCLIENTSTATE pClientState, PSHCLTRANSFER pTransfer); 29 int sharedClipboardSvcTransferAreaAttach(PSHCLCLIENTSTATE pClientState, PSHCLTRANSFER pTransfer, SHCLAREAID uID); 30 int sharedClipboardSvcTransferAreaDetach(PSHCLCLIENTSTATE pClientState, PSHCLTRANSFER pTransfer); 31 31 32 32 #endif /* !VBOX_INCLUDED_SRC_SharedClipboard_VBoxSharedClipboardSvc_uri_h */ -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-utils.cpp
r80849 r80858 101 101 switch (uMsg) 102 102 { 103 case VBOX_SHCL_HOST_MSG_ URI_TRANSFER_START:103 case VBOX_SHCL_HOST_MSG_TRANSFER_TRANSFER_START: 104 104 { 105 105 Assert(pClient->State.URI.fTransferStart == false); 106 106 107 LogFlowFunc(("VBOX_SHCL_HOST_MSG_ URI_TRANSFER_START\n"));107 LogFlowFunc(("VBOX_SHCL_HOST_MSG_TRANSFER_TRANSFER_START\n")); 108 108 109 109 if ( sharedClipboardSvcGetMode() != VBOX_SHCL_MODE_HOST_TO_GUEST … … 115 115 116 116 pClient->State.URI.fTransferStart = true; 117 pClient->State.URI.enmTransferDir = (SHCL URITRANSFERDIR)uParm;117 pClient->State.URI.enmTransferDir = (SHCLTRANSFERDIR)uParm; 118 118 break; 119 119 … … 130 130 } 131 131 132 bool sharedClipboardSvc URIReturnMsg(PSHCLCLIENT pClient, uint32_t cParms, VBOXHGCMSVCPARM paParms[])132 bool sharedClipboardSvcTransferReturnMsg(PSHCLCLIENT pClient, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 133 133 { 134 134 RT_NOREF(pClient, cParms, paParms); … … 139 139 && cParms >= 2) 140 140 { 141 HGCMSvcSetU32(&paParms[0], VBOX_SHCL_HOST_MSG_ URI_TRANSFER_START);141 HGCMSvcSetU32(&paParms[0], VBOX_SHCL_HOST_MSG_TRANSFER_TRANSFER_START); 142 142 HGCMSvcSetU32(&paParms[1], pClient->State.URI.enmTransferDir); 143 143 pClient->State.URI.fTransferStart = false; -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp
r80849 r80858 339 339 if (fFormats & VBOX_SHCL_FMT_URI_LIST) 340 340 { 341 PSHCL URITRANSFER pTransfer;342 int rc = sharedClipboardSvc URITransferStart(pCtx->pClient,343 SHCLURITRANSFERDIR_READ, SHCLSOURCE_REMOTE,344 &pTransfer);341 PSHCLTRANSFER pTransfer; 342 int rc = sharedClipboardSvcTransferTransferStart(pCtx->pClient, 343 SHCLTRANSFERDIR_READ, SHCLSOURCE_REMOTE, 344 &pTransfer); 345 345 if (RT_SUCCESS(rc)) 346 346 { 347 347 /* Create the IDataObject implementation the host OS needs and assign 348 348 * the newly created transfer to this object. */ 349 rc = SharedClipboardWin URITransferCreate(&pCtx->Win, pTransfer);349 rc = SharedClipboardWinTransferCreate(&pCtx->Win, pTransfer); 350 350 351 351 /* Note: The actual requesting + retrieving of data will be done in the IDataObject implementation … … 843 843 844 844 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 845 int SharedClipboardSvcImpl URITransferCreate(PSHCLCLIENT pClient, PSHCLURITRANSFER pTransfer)845 int SharedClipboardSvcImplTransferCreate(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer) 846 846 { 847 847 RT_NOREF(pClient, pTransfer); … … 852 852 } 853 853 854 int SharedClipboardSvcImpl URITransferDestroy(PSHCLCLIENT pClient, PSHCLURITRANSFER pTransfer)854 int SharedClipboardSvcImplTransferDestroy(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer) 855 855 { 856 856 LogFlowFuncEnter(); 857 857 858 SharedClipboardWin URITransferDestroy(&pClient->State.pCtx->Win, pTransfer);858 SharedClipboardWinTransferDestroy(&pClient->State.pCtx->Win, pTransfer); 859 859 860 860 return VINF_SUCCESS; -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp
r80849 r80858 205 205 206 206 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 207 if (pFormats->uFormats & VBOX_SHCL_FMT_URI_LIST) /* No URIsupport yet. */207 if (pFormats->uFormats & VBOX_SHCL_FMT_URI_LIST) /* No transfer support yet. */ 208 208 return VINF_SUCCESS; 209 209 #endif … … 390 390 391 391 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 392 int SharedClipboardSvcImpl URITransferCreate(PSHCLCLIENT pClient, PSHCLURITRANSFER pTransfer)392 int SharedClipboardSvcImplTransferCreate(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer) 393 393 { 394 394 RT_NOREF(pClient, pTransfer); … … 396 396 } 397 397 398 int SharedClipboardSvcImpl URITransferDestroy(PSHCLCLIENT pClient, PSHCLURITRANSFER pTransfer)398 int SharedClipboardSvcImplTransferDestroy(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer) 399 399 { 400 400 RT_NOREF(pClient, pTransfer); -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
r80849 r80858 85 85 * Since VBox x.x.x transferring files via Shared Clipboard is supported. 86 86 * See the VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS define for supported / enabled 87 * platforms. This is called " URItransfers".87 * platforms. This is called "Shared Clipboard transfers". 88 88 * 89 89 * Copying files / directories from guest A to guest B requires the host … … 103 103 * - No (maybe never) support for NT4. 104 104 * 105 * @section sec_ uri_areasClipboard areas.105 * @section sec_transfers_areas Clipboard areas. 106 106 * 107 107 * For larger / longer transfers there might be file data … … 123 123 * host's file system directly? 124 124 * 125 * @section sec_ uri_structure URIhandling structure125 * @section sec_transfer_structure Transfer handling structure 126 126 * 127 127 * All structures / classes are designed for running on both, on the guest … … 129 129 * duplication where applicable. 130 130 * 131 * Per HGCM client there is a so-called " URIcontext", which in turn can have132 * one or mulitple so-called " URItransfer" objects. At the moment we only support133 * on concurrent URI transfer per URIcontext. It's being used for reading from a134 * source or writing to destination, depening on its direction. An URItransfer131 * Per HGCM client there is a so-called "transfer context", which in turn can have 132 * one or mulitple so-called "Shared Clipboard transfer" objects. At the moment we only support 133 * on concurrent Shared Clipboard transfer per transfer context. It's being used for reading from a 134 * source or writing to destination, depening on its direction. An Shared Clipboard transfer 135 135 * can have optional callbacks which might be needed by various implementations. 136 136 * Also, transfers optionally can run in an asynchronous thread to prevent 137 137 * blocking the UI while running. 138 138 * 139 * An URItransfer can maintain its own clipboard area; for the host service such139 * An Shared Clipboard transfer can maintain its own clipboard area; for the host service such 140 140 * a clipboard area is coupled to a clipboard area registered or attached with 141 141 * VBoxSVC. This is needed because multiple transfers from multiple VMs (n:n) can … … 145 145 * no references are held to it anymore, or if VBoxSVC goes down. 146 146 * 147 * @section sec_ uri_providers URIproviders147 * @section sec_transfer_providers Transfer providers 148 148 * 149 149 * For certain implementations (for example on Windows guests / hosts, using 150 150 * IDataObject and IStream objects) a more flexible approach reqarding reading / 151 * writing is needed. For this so-called URIproviders abstract the way of how151 * writing is needed. For this so-called transfer providers abstract the way of how 152 152 * data is being read / written in the current context (host / guest), while 153 153 * the rest of the code stays the same. 154 154 * 155 * @section sec_ uri_protocol URIprotocol155 * @section sec_transfer_protocol Transfer protocol 156 156 * 157 157 * The host service issues commands which the guest has to respond with an own … … 170 170 * might need this mechanism. 171 171 * 172 * An URItransfer has three stages:173 * - 1. Announcement: An URItransfer-compatible format (currently only one format available)172 * An Shared Clipboard transfer has three stages: 173 * - 1. Announcement: An Shared Clipboard transfer-compatible format (currently only one format available) 174 174 * has been announced, the destination side creates a transfer object, which then, 175 175 * depending on the actual implementation, can be used to tell the OS that 176 * there is URI(file) data available.176 * there is transfer (file) data available. 177 177 * At this point this just acts as a (kind-of) promise to the OS that we 178 178 * can provide (file) data at some later point in time. … … 1100 1100 1101 1101 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 1102 PSHCL URITRANSFER pTransfer = SharedClipboardURICtxGetTransfer(&pClient->URI, 0 /* Index*/);1102 PSHCLTRANSFER pTransfer = SharedClipboardTransferCtxGetTransfer(&pClient->TransferCtx, 0 /* Index*/); 1103 1103 if (pTransfer) 1104 sharedClipboardSvc URIAreaDetach(&pClient->State, pTransfer);1105 1106 SharedClipboard URICtxDestroy(&pClient->URI);1104 sharedClipboardSvcTransferAreaDetach(&pClient->State, pTransfer); 1105 1106 SharedClipboardTransferCtxDestroy(&pClient->TransferCtx); 1107 1107 #endif 1108 1108 … … 1151 1151 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 1152 1152 if (RT_SUCCESS(rc)) 1153 rc = SharedClipboard URICtxInit(&pClient->URI);1153 rc = SharedClipboardTransferCtxInit(&pClient->TransferCtx); 1154 1154 #endif 1155 1155 if (RT_SUCCESS(rc)) … … 1378 1378 if (uFormat == VBOX_SHCL_FMT_URI_LIST) 1379 1379 { 1380 rc = sharedClipboardSvc URITransferStart(pClient, SHCLURITRANSFERDIR_WRITE, SHCLSOURCE_LOCAL,1381 NULL /* pTransfer */);1380 rc = sharedClipboardSvcTransferTransferStart(pClient, SHCLTRANSFERDIR_WRITE, SHCLSOURCE_LOCAL, 1381 NULL /* pTransfer */); 1382 1382 if (RT_FAILURE(rc)) 1383 1383 LogRel(("Shared Clipboard: Initializing host write transfer failed with %Rrc\n", rc)); … … 1476 1476 { 1477 1477 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 1478 rc = sharedClipboardSvc URIHandler(pClient, callHandle, u32Function, cParms, paParms, tsArrival);1478 rc = sharedClipboardSvcTransferHandler(pClient, callHandle, u32Function, cParms, paParms, tsArrival); 1479 1479 #else 1480 1480 rc = VERR_NOT_IMPLEMENTED; … … 1538 1538 1539 1539 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 1540 pClientState-> URI.enmTransferDir = SHCLURITRANSFERDIR_UNKNOWN;1540 pClientState->Transfers.enmTransferDir = SHCLTRANSFERDIR_UNKNOWN; 1541 1541 #else 1542 1542 RT_NOREF(pClientState); … … 1599 1599 { 1600 1600 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 1601 rc = sharedClipboardSvc URIHostHandler(u32Function, cParms, paParms);1601 rc = sharedClipboardSvcTransferHostHandler(u32Function, cParms, paParms); 1602 1602 #else 1603 1603 rc = VERR_NOT_IMPLEMENTED; … … 1628 1628 static SSMFIELD const s_aShClSSMClientURIState[] = 1629 1629 { 1630 SSMFIELD_ENTRY(SHCLCLIENT URISTATE, enmTransferDir),1630 SSMFIELD_ENTRY(SHCLCLIENTTRANSFERSTATE, enmTransferDir), 1631 1631 SSMFIELD_ENTRY_TERM() 1632 1632 }; … … 1675 1675 AssertRCReturn(rc, rc); 1676 1676 1677 rc = SSMR3PutStructEx(pSSM, &pClient->State. URI, sizeof(pClient->State.URI), 0 /*fFlags*/, &s_aShClSSMClientURIState[0], NULL);1677 rc = SSMR3PutStructEx(pSSM, &pClient->State.Transfers, sizeof(pClient->State.Transfers), 0 /*fFlags*/, &s_aShClSSMClientURIState[0], NULL); 1678 1678 AssertRCReturn(rc, rc); 1679 1679 … … 1764 1764 AssertRCReturn(rc, rc); 1765 1765 1766 rc = SSMR3GetStructEx(pSSM, &pClient->State. URI, sizeof(pClient->State.URI), 0 /*fFlags*/, &s_aShClSSMClientURIState[0], NULL);1766 rc = SSMR3GetStructEx(pSSM, &pClient->State.Transfers, sizeof(pClient->State.Transfers), 0 /*fFlags*/, &s_aShClSSMClientURIState[0], NULL); 1767 1767 AssertRCReturn(rc, rc); 1768 1768
Note:
See TracChangeset
for help on using the changeset viewer.