Changeset 80990 in vbox
- Timestamp:
- Sep 25, 2019 6:20:09 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/GuestHost/SharedClipboard-transfers.h
r80918 r80990 66 66 SHCLTRANSFERSTATUS_KILLED, 67 67 /** The transfer ran into an unrecoverable error. */ 68 SHCLTRANSFERSTATUS_ERROR 68 SHCLTRANSFERSTATUS_ERROR, 69 /** The usual 32-bit hack. */ 70 SHCLTRANSFERSTATUS_32BIT_SIZE_HACK = 0x7fffffff 69 71 } SHCLTRANSFERSTATUSENUM; 70 72 … … 213 215 * SHCLFSOBJATTRADD_LAST. */ 214 216 SHCLFSOBJATTRADD_LAST = SHCLFSOBJATTRADD_EASIZE, 215 216 217 /** The usual 32-bit hack. */ 217 218 SHCLFSOBJATTRADD_32BIT_SIZE_HACK = 0x7fffffff -
trunk/include/VBox/GuestHost/SharedClipboard-win.h
r80863 r80990 67 67 #define SHCL_WIN_WM_READ_DATA WM_USER + 1 68 68 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 69 /** Reports a transfer status to the guest. */ 70 # define SHCL_WIN_WM_URI_TRANSFER_STATUS WM_USER + 2 69 /** Starts a transfer on the guest. 70 * This creates the necessary IDataObject in the matching window thread. */ 71 # define SHCL_WIN_WM_URI_TRANSFER_START WM_USER + 2 71 72 #endif 72 73 -
trunk/include/VBox/GuestHost/clipboard-helper.h
r80847 r80990 193 193 194 194 /** 195 * Translates a Shared Clipboard host function number to a string. 196 * 197 * @returns Function ID string name. 198 * @param uFn The function to translate. 199 */ 200 const char *VBoxShClHostFunctionToStr(uint32_t uFn); 201 202 /** 195 203 * Translates a Shared Clipboard host message enum to a string. 196 204 * -
trunk/include/VBox/HostServices/VBoxClipboardSvc.h
r80970 r80990 274 274 #define VBOX_SHCL_CPARMS_CONNECT 5 275 275 276 /** 277 * Reports available formats. 278 */ 276 279 typedef struct _VBoxShClFormatsMsg 277 280 { … … 298 301 } VBoxShClFormatsMsg; 299 302 303 /** 304 * Requests to read clipboard data. 305 */ 300 306 typedef struct _VBoxShClReadDataReqMsg 301 307 { … … 312 318 #define VBOX_SHCL_CPARMS_READ_DATA_REQ 2 313 319 320 /** 321 * Reads clipboard data. 322 */ 314 323 typedef struct _VBoxShClReadDataMsg 315 324 { … … 329 338 #define VBOX_SHCL_CPARMS_READ_DATA 3 330 339 340 /** 341 * Writes clipboard data. 342 */ 331 343 typedef struct _VBoxShClWriteDataMsg 332 344 { … … 401 413 #define VBOX_SHCL_CPARMS_GET_HOST_MSG 3 402 414 403 /** @todo might be necessary for future. */415 /** No listing flags specified. */ 404 416 #define VBOX_SHCL_LIST_FLAG_NONE 0 417 /** Only returns one entry per read. */ 405 418 #define VBOX_SHCL_LIST_FLAG_RETURN_ONE RT_BIT(0) 419 /** Restarts reading a list from the beginning. */ 406 420 #define VBOX_SHCL_LIST_FLAG_RESTART RT_BIT(1) 407 421 … … 486 500 #define VBOX_SHCL_CPARMS_REPLY_MIN 5 487 501 502 /** 503 * Structure for keeping root list message parameters. 504 */ 488 505 typedef struct _VBoxShClRootListParms 489 506 { … … 520 537 #define VBOX_SHCL_CPARMS_ROOT_LIST_HDR 3 521 538 539 /** 540 * Structure for keeping list entry message parameters. 541 */ 522 542 typedef struct _VBoxShClRootListEntryParms 523 543 { … … 553 573 VBoxShClRootListEntryParms Parms; 554 574 /** pointer, in/out: Entry name. */ 555 HGCMFunctionParameter 575 HGCMFunctionParameter szName; 556 576 /** uint32_t, out: Bytes to be used for information/How many bytes were used. */ 557 HGCMFunctionParameter 577 HGCMFunctionParameter cbInfo; 558 578 /** pointer, in/out: Information to be set/get (SHCLFSOBJINFO only currently). 559 579 * Do not forget to set the SHCLFSOBJINFO::Attr::enmAdditional for Get operation as well. */ 560 HGCMFunctionParameter 580 HGCMFunctionParameter pvInfo; 561 581 } VBoxShClRootListEntryMsg; 562 582 … … 634 654 VBoxShClListHdrReqParms ReqParms; 635 655 /** uint32_t, in/out: Feature flags (see VBOX_SHCL_FEATURE_FLAG_XXX). */ 636 HGCMFunctionParameter 656 HGCMFunctionParameter fFeatures; 637 657 /** uint64_t, in/out: Number of total objects to transfer. */ 638 HGCMFunctionParameter 658 HGCMFunctionParameter cTotalObjects; 639 659 /** uint64_t, in/out: Number of total bytes to transfer. */ 640 HGCMFunctionParameter 660 HGCMFunctionParameter cbTotalSize; 641 661 } VBoxShClListHdrMsg; 642 662 … … 685 705 #define VBOX_SHCL_CPARMS_LIST_ENTRY 6 686 706 707 /** 708 * Opens a Shared Clipboard object. 709 */ 687 710 typedef struct _VBoxShClObjOpenMsg 688 711 { … … 703 726 #define VBOX_SHCL_CPARMS_OBJ_OPEN 5 704 727 728 /** 729 * Closes a Shared Clipboard object. 730 */ 705 731 typedef struct _VBoxShClObjCloseMsg 706 732 { … … 715 741 #define VBOX_SHCL_CPARMS_OBJ_CLOSE 2 716 742 743 /** 744 * Structure for keeping read parameters of a Shared Clipboard object. 745 */ 717 746 typedef struct _VBoxShClObjReadReqParms 718 747 { … … 727 756 } VBoxShClObjReadReqParms; 728 757 758 /** 759 * Reads from a Shared Clipboard object. 760 */ 729 761 typedef struct _VBoxShClObjReadReqMsg 730 762 { … … 785 817 #pragma pack() 786 818 819 /** 820 * Structure for keeping a Shared Clipboard file data chunk. 821 * 822 * @returns VBox status code. 823 */ 787 824 typedef struct _SHCLFILEDATA 788 825 { … … 797 834 } SHCLFILEDATA, *PSHCLFILEDATA; 798 835 836 /** 837 * Structure for keeping Shared Clipboard error data. 838 */ 799 839 typedef struct _SHCLERRORDATA 800 840 { -
trunk/include/VBox/VBoxGuestLib.h
r80905 r80990 672 672 VBGLR3DECL(int) VbglR3ClipboardWriteData(HGCMCLIENTID idClient, uint32_t fFormat, void *pv, uint32_t cb); 673 673 VBGLR3DECL(int) VbglR3ClipboardWriteDataEx(PVBGLR3SHCLCMDCTX pCtx, PSHCLDATABLOCK pData); 674 VBGLR3DECL(int) VbglR3ClipboardFormats Send(PVBGLR3SHCLCMDCTX pCtx, PSHCLFORMATDATA pFormats);675 VBGLR3DECL(int) VbglR3Clipboard ReportFormats(HGCMCLIENTID idClient, uint32_t fFormats);674 VBGLR3DECL(int) VbglR3ClipboardFormatsReportEx(PVBGLR3SHCLCMDCTX pCtx, PSHCLFORMATDATA pFormats); 675 VBGLR3DECL(int) VbglR3ClipboardFormatsReport(HGCMCLIENTID idClient, uint32_t fFormats); 676 676 677 677 VBGLR3DECL(int) VbglR3ClipboardConnectEx(PVBGLR3SHCLCMDCTX pCtx); … … 716 716 VBGLR3DECL(int) VbglR3ClipboardObjReadRecv(PVBGLR3SHCLCMDCTX pCtx, PSHCLOBJHANDLE phObj, uint32_t pcbToRead, 717 717 uint32_t *pfFlags); 718 VBGLR3DECL(int) VbglR3ClipboardObjRead (PVBGLR3SHCLCMDCTX pCtx, SHCLOBJHANDLE hObj, void *pvBuf, uint32_t cbBuf,718 VBGLR3DECL(int) VbglR3ClipboardObjReadSend(PVBGLR3SHCLCMDCTX pCtx, SHCLOBJHANDLE hObj, void *pvBuf, uint32_t cbBuf, 719 719 uint32_t *pcbRead); 720 VBGLR3DECL(int) VbglR3ClipboardObjWrite (PVBGLR3SHCLCMDCTX pCtx, SHCLOBJHANDLE hObj, void *pvBuf, uint32_t cbBuf,721 uint32_t *pcbWritten);720 VBGLR3DECL(int) VbglR3ClipboardObjWriteSend(PVBGLR3SHCLCMDCTX pCtx, SHCLOBJHANDLE hObj, void *pvBuf, uint32_t cbBuf, 721 uint32_t *pcbWritten); 722 722 # endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */ 723 723 /** @} */ -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp
r80967 r80990 94 94 *********************************************************************************************************************************/ 95 95 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 96 static DECLCALLBACK(int) vboxClipboardOnTransferInitCallback(PSHCLTRANSFERCALLBACKDATA pData); 96 97 static DECLCALLBACK(int) vboxClipboardOnTransferStartCallback(PSHCLTRANSFERCALLBACKDATA pData); 97 98 static DECLCALLBACK(void) vboxClipboardOnTransferCompleteCallback(PSHCLTRANSFERCALLBACKDATA pData, int rc); … … 127 128 RTMemFree(pTransfer); 128 129 pTransfer = NULL; 130 } 131 132 static DECLCALLBACK(int) vboxClipboardOnTransferInitCallback(PSHCLTRANSFERCALLBACKDATA pData) 133 { 134 PSHCLCONTEXT pCtx = (PSHCLCONTEXT)pData->pvUser; 135 AssertPtr(pCtx); 136 137 LogFlowFunc(("pCtx=%p\n", pCtx)); 138 139 RT_NOREF(pData, pCtx); 140 141 return VINF_SUCCESS; 129 142 } 130 143 … … 183 196 else if (SharedClipboardTransferGetDir(pTransfer) == SHCLTRANSFERDIR_READ) 184 197 { 185 Assert(SharedClipboardTransferGetSource(pTransfer) == SHCLSOURCE_REMOTE); /* Sanity. */ 186 187 rc = SharedClipboardWinTransferCreate(&pCtx->Win, pTransfer); 198 /* The IDataObject must be created in our window thread, so post a message to it, which 199 * then in turn takes care of the creation. */ 200 ::PostMessage(pCtx->Win.hWnd, SHCL_WIN_WM_URI_TRANSFER_START, 201 0 /* wParm */, (LPARAM)pTransfer /* lParm */); 202 203 rc = VINF_SUCCESS; 188 204 } 189 205 else … … 221 237 vboxClipboardTransferCallbackCleanup(pData); 222 238 } 223 224 static int vboxClipboardTransferOpen(PSHCLPROVIDERCTX pCtx)225 {226 RT_NOREF(pCtx);227 228 LogFlowFuncLeave();229 return VINF_SUCCESS;230 }231 232 static int vboxClipboardTransferClose(PSHCLPROVIDERCTX pCtx)233 {234 RT_NOREF(pCtx);235 236 LogFlowFuncLeave();237 return VINF_SUCCESS;238 }239 240 static int vboxClipboardTransferListOpen(PSHCLPROVIDERCTX pCtx, PSHCLLISTOPENPARMS pOpenParms,241 PSHCLLISTHANDLE phList)242 {243 RT_NOREF(pCtx, pOpenParms, phList);244 245 LogFlowFuncEnter();246 247 PSHCLCONTEXT pThisCtx = (PSHCLCONTEXT)pCtx->pvUser;248 AssertPtr(pThisCtx);249 250 RT_NOREF(pThisCtx);251 252 int rc = 0; // VbglR3ClipboardRecvListOpen(pThisCtx->u32ClientID, pListHdr, phList);253 254 LogFlowFuncLeaveRC(rc);255 return rc;256 }257 258 static int vboxClipboardTransferListClose(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList)259 {260 RT_NOREF(pCtx, hList);261 262 LogFlowFuncEnter();263 264 PSHCLCONTEXT pThisCtx = (PSHCLCONTEXT)pCtx->pvUser;265 AssertPtr(pThisCtx);266 267 RT_NOREF(pThisCtx);268 269 int rc = 0; // VbglR3ClipboardRecvListOpen(pThisCtx->u32ClientID, pListHdr, phList);270 271 LogFlowFuncLeaveRC(rc);272 return rc;273 }274 275 static int vboxClipboardTransferGetRoots(PSHCLPROVIDERCTX pCtx, PSHCLROOTLIST *ppRootList)276 {277 LogFlowFuncEnter();278 279 PSHCLCONTEXT pThisCtx = (PSHCLCONTEXT)pCtx->pvUser;280 AssertPtr(pThisCtx);281 282 int rc = VbglR3ClipboardRootListRead(&pThisCtx->CmdCtx, ppRootList);283 284 LogFlowFuncLeaveRC(rc);285 return rc;286 }287 288 static int vboxClipboardTransferListHdrRead(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList,289 PSHCLLISTHDR pListHdr)290 {291 RT_NOREF(hList);292 293 LogFlowFuncEnter();294 295 PSHCLCONTEXT pThisCtx = (PSHCLCONTEXT)pCtx->pvUser;296 AssertPtr(pThisCtx);297 298 RT_NOREF(pThisCtx);299 300 int rc = SharedClipboardTransferListHdrInit(pListHdr);301 if (RT_SUCCESS(rc))302 {303 if (RT_SUCCESS(rc))304 {305 //rc = VbglR3ClipboardListHdrReadRecv(pThisCtx->u32ClientID, hList, pListHdr);306 }307 else308 SharedClipboardTransferListHdrDestroy(pListHdr);309 }310 311 LogFlowFuncLeaveRC(rc);312 return rc;313 }314 315 /*316 static int vboxClipboardTransferListHdrWrite(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList,317 PSHCLLISTHDR pListHdr)318 {319 LogFlowFuncEnter();320 321 PSHCLCONTEXT pThisCtx = (PSHCLCONTEXT)pCtx->pvUser;322 AssertPtr(pThisCtx);323 324 int rc = VbglR3ClipboardListHdrWrite(pThisCtx->u32ClientID, hList, pListHdr);325 326 LogFlowFuncLeaveRC(rc);327 return rc;328 }*/329 330 static int vboxClipboardTransferListEntryRead(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList,331 PSHCLLISTENTRY pListEntry)332 {333 RT_NOREF(hList);334 335 LogFlowFuncEnter();336 337 PSHCLCONTEXT pThisCtx = (PSHCLCONTEXT)pCtx->pvUser;338 AssertPtr(pThisCtx);339 340 RT_NOREF(pThisCtx);341 342 RT_NOREF(pListEntry);343 int rc = 0; // VbglR3ClipboardListEntryRead(pThisCtx->u32ClientID, pListEntry);344 345 LogFlowFuncLeaveRC(rc);346 return rc;347 }348 349 /*350 static int vboxClipboardTransferListEntryWrite(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList,351 PSHCLLISTENTRY pListEntry)352 {353 LogFlowFuncEnter();354 355 PSHCLCONTEXT pThisCtx = (PSHCLCONTEXT)pCtx->pvUser;356 AssertPtr(pThisCtx);357 358 int rc = VbglR3ClipboardListEntryWrite(pThisCtx->u32ClientID, hList, pListEntry);359 360 LogFlowFuncLeaveRC(rc);361 return rc;362 }363 */364 365 static int vboxClipboardTransferObjOpen(PSHCLPROVIDERCTX pCtx,366 PSHCLOBJOPENCREATEPARMS pCreateParms, PSHCLOBJHANDLE phObj)367 {368 LogFlowFuncEnter();369 370 PSHCLCONTEXT pThisCtx = (PSHCLCONTEXT)pCtx->pvUser;371 AssertPtr(pThisCtx);372 373 int rc = VbglR3ClipboardObjOpenSend(&pThisCtx->CmdCtx, pCreateParms, phObj);374 375 LogFlowFuncLeaveRC(rc);376 return rc;377 }378 379 static int vboxClipboardTransferObjClose(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj)380 {381 LogFlowFuncEnter();382 383 PSHCLCONTEXT pThisCtx = (PSHCLCONTEXT)pCtx->pvUser;384 AssertPtr(pThisCtx);385 386 int rc = VbglR3ClipboardObjCloseSend(&pThisCtx->CmdCtx, hObj);387 388 LogFlowFuncLeaveRC(rc);389 return rc;390 }391 392 static int vboxClipboardTransferObjRead(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj,393 void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbRead)394 {395 RT_NOREF(fFlags);396 397 LogFlowFuncEnter();398 399 PSHCLCONTEXT pThisCtx = (PSHCLCONTEXT)pCtx->pvUser;400 AssertPtr(pThisCtx);401 402 int rc = VbglR3ClipboardObjRead(&pThisCtx->CmdCtx, hObj, pvData, cbData, pcbRead);403 404 LogFlowFuncLeaveRC(rc);405 return rc;406 }407 408 static int vboxClipboardTransferObjWrite(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj,409 void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbWritten)410 {411 RT_NOREF(fFlags);412 413 LogFlowFuncEnter();414 415 PSHCLCONTEXT pThisCtx = (PSHCLCONTEXT)pCtx->pvUser;416 AssertPtr(pThisCtx);417 418 int rc = VbglR3ClipboardObjWrite(&pThisCtx->CmdCtx, hObj, pvData, cbData, pcbWritten);419 420 LogFlowFuncLeaveRC(rc);421 return rc;422 }423 239 #endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */ 424 240 … … 435 251 case WM_CLIPBOARDUPDATE: 436 252 { 437 LogFunc(("WM_CLIPBOARDUPDATE : Waiting ...\n"));253 LogFunc(("WM_CLIPBOARDUPDATE\n")); 438 254 439 255 int rc = RTCritSectEnter(&pWinCtx->CritSect); … … 457 273 { 458 274 LogFunc(("WM_CLIPBOARDUPDATE: Reporting formats 0x%x\n", Formats.uFormats)); 459 rc = VbglR3ClipboardFormats Send(&pCtx->CmdCtx, &Formats);275 rc = VbglR3ClipboardFormatsReportEx(&pCtx->CmdCtx, &Formats); 460 276 } 461 277 } … … 480 296 } 481 297 482 case WM_DRAWCLIPBOARD: 483 { 484 LogFlowFunc(("WM_DRAWCLIPBOARD: hwnd %p\n", pWinCtx->hWnd)); 485 486 if (GetClipboardOwner() != hwnd) 487 { 488 /* Clipboard was updated by another application. */ 489 /* WM_DRAWCLIPBOARD always expects a return code of 0, so don't change "rc" here. */ 490 SHCLFORMATDATA Formats; 491 int rc = SharedClipboardWinGetFormats(pWinCtx, &Formats); 492 if ( RT_SUCCESS(rc) 493 && Formats.uFormats != VBOX_SHCL_FMT_NONE) 494 { 495 rc = VbglR3ClipboardFormatsSend(&pCtx->CmdCtx, &Formats); 496 } 497 } 498 499 lresultRc = SharedClipboardWinChainPassToNext(pWinCtx, msg, wParam, lParam); 500 break; 501 } 298 case WM_DRAWCLIPBOARD: 299 { 300 LogFlowFunc(("WM_DRAWCLIPBOARD\n")); 301 302 int rc = RTCritSectEnter(&pWinCtx->CritSect); 303 if (RT_SUCCESS(rc)) 304 { 305 const HWND hWndClipboardOwner = GetClipboardOwner(); 306 307 LogFunc(("WM_DRAWCLIPBOARD: hWndClipboardOwnerUs=%p, hWndNewClipboardOwner=%p\n", 308 pWinCtx->hWndClipboardOwnerUs, hWndClipboardOwner)); 309 310 if (pWinCtx->hWndClipboardOwnerUs != hWndClipboardOwner) 311 { 312 int rc2 = RTCritSectLeave(&pWinCtx->CritSect); 313 AssertRC(rc2); 314 315 /* Clipboard was updated by another application. */ 316 /* WM_DRAWCLIPBOARD always expects a return code of 0, so don't change "rc" here. */ 317 SHCLFORMATDATA Formats; 318 rc = SharedClipboardWinGetFormats(pWinCtx, &Formats); 319 if (RT_SUCCESS(rc) 320 && Formats.uFormats != VBOX_SHCL_FMT_NONE) 321 { 322 rc = VbglR3ClipboardFormatsReportEx(&pCtx->CmdCtx, &Formats); 323 } 324 } 325 else 326 { 327 int rc2 = RTCritSectLeave(&pWinCtx->CritSect); 328 AssertRC(rc2); 329 } 330 } 331 332 lresultRc = SharedClipboardWinChainPassToNext(pWinCtx, msg, wParam, lParam); 333 break; 334 } 502 335 503 336 case WM_TIMER: … … 819 652 820 653 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 821 case SHCL_WIN_WM_URI_TRANSFER_STA TUS:654 case SHCL_WIN_WM_URI_TRANSFER_START: 822 655 { 823 LogFunc(("SHCL_WIN_WM_URI_TRANSFER_STATUS\n")); 824 656 LogFunc(("SHCL_WIN_WM_URI_TRANSFER_CREATE\n")); 657 658 PSHCLTRANSFER pTransfer = (PSHCLTRANSFER)lParam; 659 AssertPtr(pTransfer); 660 661 Assert(SharedClipboardTransferGetSource(pTransfer) == SHCLSOURCE_REMOTE); /* Sanity. */ 662 663 int rc2 = SharedClipboardWinTransferCreate(&pCtx->Win, pTransfer); 664 AssertRC(rc2); 825 665 break; 826 666 } 827 667 #endif 828 829 #if 0830 /* The host wants to write transfer data. */831 case VBOX_CLIPBOARD_WM_URI_START_WRITE:832 {833 LogFunc(("VBOX_CLIPBOARD_WM_URI_START_WRITE: cTransfersRunning=%RU32\n",834 SharedClipboardTransferCtxGetRunningTransfers(&pCtx->URI)));835 836 PSHCLTRANSFER pTransfer;837 int rc = SharedClipboardTransferCreate(SHCLTRANSFERDIR_READ,838 SHCLSOURCE_LOCAL,839 &pTransfer);840 if (RT_SUCCESS(rc))841 {842 SHCLTRANSFERCALLBACKS TransferCallbacks;843 RT_ZERO(TransferCallbacks);844 845 TransferCallbacks.pvUser = &pCtx->URI;846 TransferCallbacks.pfnTransferComplete = vboxClipboardTransferCompleteCallback;847 TransferCallbacks.pfnTransferError = vboxClipboardTransferErrorCallback;848 849 SharedClipboardTransferSetCallbacks(pTransfer, &TransferCallbacks);850 851 SHCLPROVIDERCREATIONCTX creationCtx;852 RT_ZERO(creationCtx);853 854 creationCtx.enmSource = SHCLSOURCE_REMOTE;855 856 creationCtx.Interface.pfnRootsGet = vboxClipboardTransferGetRoots;857 creationCtx.Interface.pfnListOpen = vboxClipboardTransferListOpen;858 creationCtx.Interface.pfnListClose = vboxClipboardTransferListClose;859 creationCtx.Interface.pfnListHdrRead = vboxClipboardTransferListHdrRead;860 creationCtx.Interface.pfnListEntryRead = vboxClipboardTransferListEntryRead;861 creationCtx.Interface.pfnObjOpen = vboxClipboardTransferObjOpen;862 creationCtx.Interface.pfnObjClose = vboxClipboardTransferObjClose;863 creationCtx.Interface.pfnObjRead = vboxClipboardTransferObjRead;864 865 creationCtx.pvUser = pCtx;866 867 rc = SharedClipboardTransferSetInterface(pTransfer, &creationCtx);868 if (RT_SUCCESS(rc))869 {870 rc = SharedClipboardTransferCtxTransferAdd(&pCtx->URI, pTransfer);871 if (RT_SUCCESS(rc))872 {873 rc = SharedClipboardTransferPrepare(pTransfer);874 if (RT_SUCCESS(rc))875 {876 rc = SharedClipboardWinTransferCreate(pWinCtx, pTransfer);877 }878 }879 }880 }881 882 break;883 }884 #endif /* 0 */885 668 886 669 case WM_DESTROY: … … 1034 817 pCtx->CmdCtx.Transfers.Callbacks.pvUser = pCtx; /* Assign context as user-provided callback data. */ 1035 818 1036 pCtx->CmdCtx.Transfers.Callbacks.pfnTransferStart = vboxClipboardOnTransferStartCallback; 1037 pCtx->CmdCtx.Transfers.Callbacks.pfnTransferComplete = vboxClipboardOnTransferCompleteCallback; 1038 pCtx->CmdCtx.Transfers.Callbacks.pfnTransferError = vboxClipboardOnTransferErrorCallback; 819 pCtx->CmdCtx.Transfers.Callbacks.pfnTransferInitialize = vboxClipboardOnTransferInitCallback; 820 pCtx->CmdCtx.Transfers.Callbacks.pfnTransferStart = vboxClipboardOnTransferStartCallback; 821 pCtx->CmdCtx.Transfers.Callbacks.pfnTransferComplete = vboxClipboardOnTransferCompleteCallback; 822 pCtx->CmdCtx.Transfers.Callbacks.pfnTransferError = vboxClipboardOnTransferErrorCallback; 1039 823 } 1040 824 #endif … … 1186 970 ::PostMessage(pWinCtx->hWnd, SHCL_WIN_WM_REPORT_FORMATS, 1187 971 0 /* wParam */, (LPARAM)pEvent /* lParam */); 972 973 pEvent = NULL; /* Consume pointer. */ 1188 974 break; 1189 975 } … … 1194 980 ::PostMessage(pWinCtx->hWnd, SHCL_WIN_WM_READ_DATA, 1195 981 0 /* wParam */, (LPARAM)pEvent /* lParam */); 982 983 pEvent = NULL; /* Consume pointer. */ 1196 984 break; 1197 985 } 1198 986 1199 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS1200 case VBGLR3CLIPBOARDEVENTTYPE_URI_TRANSFER_STATUS:1201 {1202 ::PostMessage(pWinCtx->hWnd, SHCL_WIN_WM_URI_TRANSFER_STATUS,1203 0 /* wParm */, (LPARAM)pEvent /* lParm */);1204 break;1205 }1206 #endif1207 987 case VBGLR3CLIPBOARDEVENTTYPE_QUIT: 1208 988 { … … 1213 993 } 1214 994 995 case VBGLR3CLIPBOARDEVENTTYPE_URI_TRANSFER_STATUS: 996 { 997 /* Nothing to do here. */ 998 break; 999 } 1000 1001 case VBGLR3CLIPBOARDEVENTTYPE_INVALID: 1215 1002 default: 1216 1003 { 1217 1004 /* Wait a bit before retrying. */ 1218 1005 RTThreadSleep(1000); 1006 1007 rc = VERR_NOT_SUPPORTED; 1219 1008 break; 1220 1009 } 1221 1010 } 1222 1011 1223 if (RT_FAILURE(rc)) 1012 if (pEvent) 1013 { 1224 1014 VbglR3ClipboardEventFree(pEvent); 1015 pEvent = NULL; 1016 } 1225 1017 } 1226 1018 -
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp
r80968 r80990 48 48 49 49 50 /** 51 * Function naming convention: 52 * 53 * FunctionNameRecv = Receives a host message (request). 54 * FunctionNameReply = Replies to a host message (request). 55 * FunctionNameSend = Sends a guest message to the host. 56 */ 57 58 50 59 /********************************************************************************************************************************* 51 60 * Prototypes * … … 1177 1186 } 1178 1187 1179 VBGLR3DECL(int) VbglR3ClipboardObjRead (PVBGLR3SHCLCMDCTX pCtx, SHCLOBJHANDLE hObj,1180 void *pvData, uint32_t cbData, uint32_t *pcbRead)1188 VBGLR3DECL(int) VbglR3ClipboardObjReadSend(PVBGLR3SHCLCMDCTX pCtx, SHCLOBJHANDLE hObj, 1189 void *pvData, uint32_t cbData, uint32_t *pcbRead) 1181 1190 { 1182 1191 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); … … 1214 1223 } 1215 1224 1216 VBGLR3DECL(int) VbglR3ClipboardObjWrite (PVBGLR3SHCLCMDCTX pCtx, SHCLOBJHANDLE hObj,1217 void *pvData, uint32_t cbData, uint32_t *pcbWritten)1225 VBGLR3DECL(int) VbglR3ClipboardObjWriteSend(PVBGLR3SHCLCMDCTX pCtx, SHCLOBJHANDLE hObj, 1226 void *pvData, uint32_t cbData, uint32_t *pcbWritten) 1218 1227 { 1219 1228 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); … … 1243 1252 *pcbWritten = cbData; /** @todo For now return all as being written. */ 1244 1253 } 1254 1255 LogFlowFuncLeaveRC(rc); 1256 return rc; 1257 } 1258 1259 /********************************************************************************************************************************* 1260 * Transfer interface implementations * 1261 *********************************************************************************************************************************/ 1262 1263 static int vbglR3ClipboardTransferIfaceGetRoots(PSHCLPROVIDERCTX pCtx, PSHCLROOTLIST *ppRootList) 1264 { 1265 LogFlowFuncEnter(); 1266 1267 PVBGLR3SHCLCMDCTX pCmdCtx = (PVBGLR3SHCLCMDCTX)pCtx->pvUser; 1268 AssertPtr(pCmdCtx); 1269 1270 int rc = VbglR3ClipboardRootListRead(pCmdCtx, ppRootList); 1271 1272 LogFlowFuncLeaveRC(rc); 1273 return rc; 1274 } 1275 1276 static int vbglR3ClipboardTransferIfaceListOpen(PSHCLPROVIDERCTX pCtx, PSHCLLISTOPENPARMS pOpenParms, 1277 PSHCLLISTHANDLE phList) 1278 { 1279 LogFlowFuncEnter(); 1280 1281 PVBGLR3SHCLCMDCTX pCmdCtx = (PVBGLR3SHCLCMDCTX)pCtx->pvUser; 1282 AssertPtr(pCmdCtx); 1283 1284 int rc = VbglR3ClipboardListOpenSend(pCmdCtx, pOpenParms, phList); 1285 1286 LogFlowFuncLeaveRC(rc); 1287 return rc; 1288 } 1289 1290 static int vbglR3ClipboardTransferIfaceListClose(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList) 1291 { 1292 LogFlowFuncEnter(); 1293 1294 PVBGLR3SHCLCMDCTX pCmdCtx = (PVBGLR3SHCLCMDCTX)pCtx->pvUser; 1295 AssertPtr(pCmdCtx); 1296 1297 int rc = VbglR3ClipboardListCloseSend(pCmdCtx, hList); 1298 1299 LogFlowFuncLeaveRC(rc); 1300 return rc; 1301 } 1302 1303 static int vbglR3ClipboardTransferIfaceListHdrRead(PSHCLPROVIDERCTX pCtx, 1304 SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr) 1305 { 1306 LogFlowFuncEnter(); 1307 1308 PVBGLR3SHCLCMDCTX pCmdCtx = (PVBGLR3SHCLCMDCTX)pCtx->pvUser; 1309 AssertPtr(pCmdCtx); 1310 1311 int rc = SharedClipboardTransferListHdrInit(pListHdr); 1312 if (RT_SUCCESS(rc)) 1313 { 1314 if (RT_SUCCESS(rc)) 1315 { 1316 rc = VbglR3ClipboardListHdrRead(pCmdCtx, hList, 0 /* fFlags */, pListHdr); 1317 } 1318 else 1319 SharedClipboardTransferListHdrDestroy(pListHdr); 1320 } 1321 1322 LogFlowFuncLeaveRC(rc); 1323 return rc; 1324 } 1325 1326 static int vbglR3ClipboardTransferIfaceListEntryRead(PSHCLPROVIDERCTX pCtx, 1327 SHCLLISTHANDLE hList, PSHCLLISTENTRY pEntry) 1328 { 1329 LogFlowFuncEnter(); 1330 1331 PVBGLR3SHCLCMDCTX pCmdCtx = (PVBGLR3SHCLCMDCTX)pCtx->pvUser; 1332 AssertPtr(pCmdCtx); 1333 1334 int rc = VbglR3ClipboardListEntryRead(pCmdCtx, hList, pEntry); 1335 1336 LogFlowFuncLeaveRC(rc); 1337 return rc; 1338 } 1339 1340 static int vbglR3ClipboardTransferIfaceObjOpen(PSHCLPROVIDERCTX pCtx, 1341 PSHCLOBJOPENCREATEPARMS pCreateParms, PSHCLOBJHANDLE phObj) 1342 { 1343 LogFlowFuncEnter(); 1344 1345 PVBGLR3SHCLCMDCTX pCmdCtx = (PVBGLR3SHCLCMDCTX)pCtx->pvUser; 1346 AssertPtr(pCmdCtx); 1347 1348 int rc = VbglR3ClipboardObjOpenSend(pCmdCtx, pCreateParms, phObj); 1349 1350 LogFlowFuncLeaveRC(rc); 1351 return rc; 1352 } 1353 1354 static int vbglR3ClipboardTransferIfaceObjClose(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj) 1355 { 1356 LogFlowFuncEnter(); 1357 1358 PVBGLR3SHCLCMDCTX pCmdCtx = (PVBGLR3SHCLCMDCTX)pCtx->pvUser; 1359 AssertPtr(pCmdCtx); 1360 1361 int rc = VbglR3ClipboardObjCloseSend(pCmdCtx, hObj); 1362 1363 LogFlowFuncLeaveRC(rc); 1364 return rc; 1365 } 1366 1367 static int vbglR3ClipboardTransferIfaceObjRead(PSHCLPROVIDERCTX pCtx, 1368 SHCLOBJHANDLE hObj, void *pvData, uint32_t cbData, 1369 uint32_t fFlags, uint32_t *pcbRead) 1370 { 1371 LogFlowFuncEnter(); 1372 1373 PVBGLR3SHCLCMDCTX pCmdCtx = (PVBGLR3SHCLCMDCTX)pCtx->pvUser; 1374 AssertPtr(pCmdCtx); 1375 1376 RT_NOREF(fFlags); /* Not used yet. */ 1377 1378 int rc = VbglR3ClipboardObjReadSend(pCmdCtx, hObj, pvData, cbData, pcbRead); 1245 1379 1246 1380 LogFlowFuncLeaveRC(rc); … … 1275 1409 if (RT_SUCCESS(rc)) 1276 1410 { 1277 rc = SharedClipboardTransferStart(pTransfer); 1411 /* If this is a read transfer (reading data from host), set the interface to use 1412 * our VbglR3 routines here. */ 1413 if (enmDir == SHCLTRANSFERDIR_READ) 1414 { 1415 SHCLPROVIDERCREATIONCTX creationCtx; 1416 RT_ZERO(creationCtx); 1417 1418 creationCtx.Interface.pfnRootsGet = vbglR3ClipboardTransferIfaceGetRoots; 1419 1420 creationCtx.Interface.pfnListOpen = vbglR3ClipboardTransferIfaceListOpen; 1421 creationCtx.Interface.pfnListClose = vbglR3ClipboardTransferIfaceListClose; 1422 creationCtx.Interface.pfnListHdrRead = vbglR3ClipboardTransferIfaceListHdrRead; 1423 creationCtx.Interface.pfnListEntryRead = vbglR3ClipboardTransferIfaceListEntryRead; 1424 1425 creationCtx.Interface.pfnObjOpen = vbglR3ClipboardTransferIfaceObjOpen; 1426 creationCtx.Interface.pfnObjClose = vbglR3ClipboardTransferIfaceObjClose; 1427 creationCtx.Interface.pfnObjRead = vbglR3ClipboardTransferIfaceObjRead; 1428 1429 rc = SharedClipboardTransferSetInterface(pTransfer, &creationCtx); 1430 } 1431 1432 if (RT_SUCCESS(rc)) 1433 rc = SharedClipboardTransferStart(pTransfer); 1278 1434 } 1279 else 1435 1436 if (RT_FAILURE(rc)) 1280 1437 SharedClipboardTransferCtxTransferUnregister(pTransferCtx, uTransferID); 1281 1438 } … … 1300 1457 ? SHCLTRANSFERSTATUS_STARTED : SHCLTRANSFERSTATUS_ERROR, rc); 1301 1458 AssertRC(rc2); 1459 1460 if (RT_FAILURE(rc)) 1461 { 1462 SharedClipboardTransferDestroy(pTransfer); 1463 pTransfer = NULL; 1464 } 1302 1465 1303 1466 LogFlowFuncLeaveRC(rc); … … 1424 1587 pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_URI_TRANSFER_STATUS; 1425 1588 1426 LogRel2(("Shared Clipboard: Received status % RU32 (%Rrc) for transfer ID=%RU16\n",1427 pEvent->u.TransferStatus.Report.uStatus, pEvent->u.TransferStatus.Report.rc,1589 LogRel2(("Shared Clipboard: Received status %s (rc=%Rrc) for transfer ID=%RU16\n", 1590 VBoxShClTransferStatusToStr(pEvent->u.TransferStatus.Report.uStatus), pEvent->u.TransferStatus.Report.rc, 1428 1591 pEvent->u.TransferStatus.uID)); 1429 1592 } … … 1550 1713 break; 1551 1714 } 1552 1553 #if 01554 case VBOX_SHCL_HOST_MSG_TRANSFER_LIST_HDR_WRITE:1555 {1556 LogFlowFunc(("VBOX_SHCL_HOST_MSG_TRANSFER_LIST_HDR_WRITE\n"));1557 1558 SHCLLISTHDR hdrList;1559 rc = SharedClipboardTransferListHdrInit(&hdrList);1560 if (RT_SUCCESS(rc))1561 {1562 rc = VBglR3ClipboardListHdrRecv(pCtx, )1563 }1564 break;1565 }1566 #endif1567 1715 1568 1716 case VBOX_SHCL_HOST_MSG_TRANSFER_LIST_ENTRY_READ: … … 1603 1751 } 1604 1752 1605 #if 01606 case VBOX_SHCL_HOST_MSG_TRANSFER_LIST_ENTRY_WRITE:1607 {1608 LogFlowFunc(("VBOX_SHCL_HOST_MSG_TRANSFER_LIST_ENTRY_WRITE\n"));1609 pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_URI_LIST_ENTRY_WRITE;1610 break;1611 }1612 #endif1613 1614 1753 case VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_OPEN: 1615 1754 { … … 1684 1823 rc = SharedClipboardTransferObjectRead(pTransfer, hObj, pvBuf, cbToRead, &cbRead, fFlags); 1685 1824 if (RT_SUCCESS(rc)) 1686 rc = VbglR3ClipboardObjWrite (pCmdCtx, hObj, pvBuf, cbRead, NULL /* pcbWritten */);1825 rc = VbglR3ClipboardObjWriteSend(pCmdCtx, hObj, pvBuf, cbRead, NULL /* pcbWritten */); 1687 1826 1688 1827 RTMemFree(pvBuf); … … 1695 1834 } 1696 1835 1697 #if 01698 case VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_WRITE:1699 {1700 LogFlowFunc(("VBOX_SHCL_HOST_MSG_TRANSFER_OBJ_WRITE\n"));1701 break;1702 }1703 #endif1704 1705 1836 default: 1706 1837 { … … 1792 1923 } 1793 1924 1794 #if 01795 VBGLR3DECL(int) VbglR3ClipboardListHdrReadRecv(HGCMCLIENTID idClient, PSHCLLISTHANDLE phList)1796 {1797 AssertPtrReturn(phList, VERR_INVALID_POINTER);1798 1799 VBoxShClListHdrReadMsg Msg;1800 RT_ZERO(Msg);1801 1802 VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient,1803 VBOX_SHCL_GUEST_FN_LIST_HDR_READ, VBOX_SHCL_CPARMS_LIST_HDR_READ);1804 1805 Msg.uContext.SetUInt32(0); /** @todo Not used yet. */1806 Msg.uHandle.SetUInt64(0);1807 1808 int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));1809 if (RT_SUCCESS(rc))1810 {1811 Msg.uHandle.GetUInt32(phList);1812 }1813 1814 LogFlowFuncLeaveRC(rc);1815 return rc;1816 }1817 1818 1925 /** 1819 * Sends a list headerto the host.1926 * Reports (advertises) guest clipboard formats to the host. 1820 1927 * 1821 1928 * @returns VBox status code. 1822 * @param idClient The client id returned by VbglR3ClipboardConnect(). 1823 * @param hList List handle to send header for. 1824 * @param pListHdr List header to send. 1929 * @param pCtx The command context returned by VbglR3ClipboardConnectEx(). 1930 * @param pFormats The formats to report. 1825 1931 */ 1826 VBGLR3DECL(int) VbglR3ClipboardListHdrSend(HGCMCLIENTID idClient, 1827 SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr) 1828 { 1829 AssertPtrReturn(pListHdr, VERR_INVALID_POINTER); 1830 1831 VBoxShClListHdrMsg Msg; 1832 RT_ZERO(Msg); 1833 1834 VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, 1835 VBOX_SHCL_GUEST_FN_LIST_HDR_WRITE, VBOX_SHCL_CPARMS_LIST_HDR); 1836 1837 Msg.uContext.SetUInt32(0); /** @todo Not used yet. */ 1838 Msg.fFeatures.SetUInt32(pListHdr->fFeatures); 1839 Msg.cTotalObjects.SetUInt64(pListHdr->cTotalObjects); 1840 Msg.cbTotalSize.SetUInt64(pListHdr->cbTotalSize); 1841 Msg.enmCompression.SetUInt32(pListHdr->enmCompression); 1842 Msg.enmChecksumType.SetUInt32(RTDIGESTTYPE_INVALID); 1843 1844 int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg)); 1845 1846 LogFlowFuncLeaveRC(rc); 1847 return rc; 1848 } 1849 1850 /** 1851 * Sends a list entry to the host. 1852 * 1853 * @returns IPRT status code. 1854 * @param idClient The client id returned by VbglR3ClipboardConnect() 1855 * @param hList List handle to send entry for. 1856 * @param pListEntry List entry to send. 1857 */ 1858 VBGLR3DECL(int) VbglR3ClipboardSendListEntryWrite(HGCMCLIENTID idClient, 1859 SHCLLISTHANDLE hList, PSHCLLISTENTRY pListEntry) 1860 { 1861 AssertPtrReturn(pListEntry, VERR_INVALID_POINTER); 1862 1863 VBoxShClListEntryWriteMsg Msg; 1864 RT_ZERO(Msg); 1865 1866 VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, 1867 VBOX_SHCL_GUEST_FN_LIST_ENTRY_WRITE, VBOX_SHCL_CPARMS_LIST_ENTRY_WRITE); 1868 1869 Msg.uContext.SetUInt32(0); /** @todo Not used yet. */ 1870 Msg.uHandle.SetUInt64(hList); 1871 Msg.fInfo.SetUInt32(pListEntry->fInfo); 1872 Msg.cbInfo.SetUInt32(pListEntry->cbInfo); 1873 Msg.pvInfo.SetPtr(pListEntry->pvInfo, pListEntry->cbInfo); 1874 1875 int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg)); 1876 1877 LogFlowFuncLeaveRC(rc); 1878 return rc; 1879 } 1880 #endif 1881 1882 /** 1883 * Sends (reports) guest clipboard formats to the host. 1884 * 1885 * @returns VBox status code. 1886 * @param pCtx The command context returned by VbglR3ClipboardConnect(). 1887 * @param pFormats The formats to send (report). 1888 */ 1889 VBGLR3DECL(int) VbglR3ClipboardFormatsSend(PVBGLR3SHCLCMDCTX pCtx, PSHCLFORMATDATA pFormats) 1890 { 1932 VBGLR3DECL(int) VbglR3ClipboardFormatsReportEx(PVBGLR3SHCLCMDCTX pCtx, PSHCLFORMATDATA pFormats) 1933 { 1934 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 1935 AssertPtrReturn(pFormats, VERR_INVALID_POINTER); 1936 1891 1937 VBoxShClFormatsMsg Msg; 1892 1938 1893 1939 int rc; 1940 1941 LogFlowFunc(("uFormats=0x%x\n", pFormats->uFormats)); 1894 1942 1895 1943 if (pCtx->uProtocolVer == 0) … … 1922 1970 * @returns VBox status code. 1923 1971 * @param idClient The client id returned by VbglR3ClipboardConnect(). 1924 * @param fFormats The formats to advertise.1972 * @param fFormats The formats to report. 1925 1973 */ 1926 VBGLR3DECL(int) VbglR3ClipboardReportFormats(HGCMCLIENTID idClient, uint32_t fFormats) 1927 { 1974 VBGLR3DECL(int) VbglR3ClipboardFormatsReport(HGCMCLIENTID idClient, uint32_t fFormats) 1975 { 1976 AssertReturn(idClient, VERR_INVALID_PARAMETER); 1977 AssertReturn(fFormats, VERR_INVALID_PARAMETER); 1978 1928 1979 VBoxShClFormatsMsg Msg; 1929 1980 … … 1948 1999 VBGLR3DECL(int) VbglR3ClipboardWriteData(HGCMCLIENTID idClient, uint32_t fFormat, void *pv, uint32_t cb) 1949 2000 { 2001 AssertReturn (idClient, VERR_INVALID_PARAMETER); 2002 AssertPtrReturn(pv, VERR_INVALID_POINTER); 2003 AssertReturn (cb, VERR_INVALID_PARAMETER); 2004 1950 2005 VBoxShClWriteDataMsg Msg; 1951 2006 RT_ZERO(Msg); … … 1970 2025 * 1971 2026 * @returns VBox status code. 1972 * @param pCtx The command context returned by VbglR3ClipboardConnect ().2027 * @param pCtx The command context returned by VbglR3ClipboardConnectEx(). 1973 2028 * @param pData Clipboard data to send. 1974 2029 */ 1975 2030 VBGLR3DECL(int) VbglR3ClipboardWriteDataEx(PVBGLR3SHCLCMDCTX pCtx, PSHCLDATABLOCK pData) 1976 2031 { 2032 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 2033 AssertPtrReturn(pData, VERR_INVALID_POINTER); 2034 1977 2035 int rc; 1978 2036 … … 2012 2070 VBGLR3DECL(int) VbglR3ClipboardWriteError(HGCMCLIENTID idClient, int rcErr) 2013 2071 { 2072 AssertReturn(idClient, VERR_INVALID_PARAMETER); 2073 2014 2074 VBoxShClWriteErrorMsg Msg; 2015 2075 RT_ZERO(Msg); -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceClipboard-os2.cpp
r80847 r80990 611 611 } 612 612 VGSvcVerbose(4, "clipboard: reporting fFormats=%#x\n", fFormats); 613 VbglR3Clipboard ReportFormats(g_u32ClientId, fFormats);613 VbglR3ClipboardFormatsReport(g_u32ClientId, fFormats); 614 614 } 615 615 … … 658 658 g_fEmptyClipboard = true; 659 659 VGSvcVerbose(3, "Reporting empty clipboard\n"); 660 VbglR3Clipboard ReportFormats(g_u32ClientId, 0);660 VbglR3ClipboardFormatsReport(g_u32ClientId, 0); 661 661 } 662 662 } … … 681 681 g_fEmptyClipboard = true; 682 682 VGSvcVerbose(3, "Reporting empty clipboard\n"); 683 VbglR3Clipboard ReportFormats(g_u32ClientId, 0);683 VbglR3ClipboardFormatsReport(g_u32ClientId, 0); 684 684 685 685 vgsvcClipboardOs2PollViewer(); -
trunk/src/VBox/Additions/darwin/VBoxClient/VBoxClientClipboard.cpp
r80847 r80990 177 177 { 178 178 fFormats = vbclClipboardGetAvailableFormats(g_PasteboardRef); 179 rc = VbglR3Clipboard ReportFormats(g_u32ClientId, fFormats);179 rc = VbglR3ClipboardFormatsReport(g_u32ClientId, fFormats); 180 180 if (RT_FAILURE(rc)) 181 181 { … … 287 287 AssertReturn(g_u32ClientId != 0, VERR_GENERAL_FAILURE); 288 288 289 VbglR3Clipboard ReportFormats(g_u32ClientId, 0);289 VbglR3ClipboardFormatsReport(g_u32ClientId, 0); 290 290 291 291 rc = VbglR3ClipboardDisconnect(g_u32ClientId); -
trunk/src/VBox/Additions/haiku/VBoxTray/VBoxClipboard.cpp
r80847 r80990 345 345 be_clipboard->Unlock(); 346 346 347 VbglR3Clipboard ReportFormats(fClientId, formats);347 VbglR3ClipboardFormatsReport(fClientId, formats); 348 348 break; 349 349 } -
trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp
r80847 r80990 152 152 RT_NOREF1(pCtx); 153 153 LogRelFlowFunc(("u32Formats=%d\n", u32Formats)); 154 int rc = VbglR3Clipboard ReportFormats(g_ctx.client, u32Formats);154 int rc = VbglR3ClipboardFormatsReport(g_ctx.client, u32Formats); 155 155 LogRelFlowFunc(("rc=%Rrc\n", rc)); 156 156 } -
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp
r80907 r80990 815 815 } 816 816 #endif /* LOG_ENABLED */ 817 818 /** 819 * Translates a Shared Clipboard host function number to a string. 820 * 821 * @returns Function ID string name. 822 * @param uFn The function to translate. 823 */ 824 const char *VBoxShClHostFunctionToStr(uint32_t uFn) 825 { 826 switch (uFn) 827 { 828 RT_CASE_RET_STR(VBOX_SHCL_HOST_FN_SET_MODE); 829 RT_CASE_RET_STR(VBOX_SHCL_HOST_FN_SET_HEADLESS); 830 RT_CASE_RET_STR(VBOX_SHCL_HOST_FN_CANCEL); 831 RT_CASE_RET_STR(VBOX_SHCL_HOST_FN_ERROR); 832 RT_CASE_RET_STR(VBOX_SHCL_HOST_FN_AREA_REGISTER); 833 RT_CASE_RET_STR(VBOX_SHCL_HOST_FN_AREA_UNREGISTER); 834 RT_CASE_RET_STR(VBOX_SHCL_HOST_FN_AREA_ATTACH); 835 RT_CASE_RET_STR(VBOX_SHCL_HOST_FN_AREA_DETACH); 836 } 837 return "Unknown"; 838 } 817 839 818 840 /** … … 889 911 return "Unknown"; 890 912 } 891 -
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-transfers.cpp
r80918 r80990 1064 1064 pTransfer->State.enmDir = SHCLTRANSFERDIR_UNKNOWN; 1065 1065 pTransfer->State.enmSource = SHCLSOURCE_INVALID; 1066 1067 LogFlowFunc(("enmDir=%RU32, enmSource=%RU32\n", pTransfer->State.enmDir, pTransfer->State.enmSource));1068 1066 1069 1067 pTransfer->pArea = NULL; /* Will be created later if needed. */ -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-internal.h
r80866 r80990 223 223 224 224 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 225 int sharedClipboardSvcTransfer Open(PSHCLPROVIDERCTX pCtx);226 DECLCALLBACK(int) sharedClipboardSvcTransferClose(PSHCLPROVIDERCTX pCtx);227 228 int sharedClipboardSvcTransfer GetRoots(PSHCLPROVIDERCTX pCtx, PSHCLROOTLIST *ppRootList);229 230 int sharedClipboardSvcTransfer ListOpen(PSHCLPROVIDERCTX pCtx, PSHCLLISTOPENPARMS pOpenParms, PSHCLLISTHANDLE phList);231 int sharedClipboardSvcTransfer ListClose(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList);232 int sharedClipboardSvcTransfer ListHdrRead(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr);233 int sharedClipboardSvcTransfer ListHdrWrite(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr);234 int sharedClipboardSvcTransfer ListEntryRead(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTENTRY pListEntry);235 int sharedClipboardSvcTransfer ListEntryWrite(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTENTRY pListEntry);236 237 int sharedClipboardSvcTransfer ObjOpen(PSHCLPROVIDERCTX pCtx, PSHCLOBJOPENCREATEPARMS pCreateParms,238 PSHCLOBJHANDLE phObj);239 int sharedClipboardSvcTransfer ObjClose(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj);240 int sharedClipboardSvcTransfer ObjRead(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj,241 void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbRead);242 int sharedClipboardSvcTransfer ObjWrite(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj,243 void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbWritten);225 int sharedClipboardSvcTransferIfaceOpen(PSHCLPROVIDERCTX pCtx); 226 int sharedClipboardSvcTransferIfaceClose(PSHCLPROVIDERCTX pCtx); 227 228 int sharedClipboardSvcTransferIfaceGetRoots(PSHCLPROVIDERCTX pCtx, PSHCLROOTLIST *ppRootList); 229 230 int sharedClipboardSvcTransferIfaceListOpen(PSHCLPROVIDERCTX pCtx, PSHCLLISTOPENPARMS pOpenParms, PSHCLLISTHANDLE phList); 231 int sharedClipboardSvcTransferIfaceListClose(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList); 232 int sharedClipboardSvcTransferIfaceListHdrRead(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr); 233 int sharedClipboardSvcTransferIfaceListHdrWrite(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr); 234 int sharedClipboardSvcTransferIfaceListEntryRead(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTENTRY pListEntry); 235 int sharedClipboardSvcTransferIfaceListEntryWrite(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList, PSHCLLISTENTRY pListEntry); 236 237 int sharedClipboardSvcTransferIfaceObjOpen(PSHCLPROVIDERCTX pCtx, PSHCLOBJOPENCREATEPARMS pCreateParms, 238 PSHCLOBJHANDLE phObj); 239 int sharedClipboardSvcTransferIfaceObjClose(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj); 240 int sharedClipboardSvcTransferIfaceObjRead(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj, 241 void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbRead); 242 int sharedClipboardSvcTransferIfaceObjWrite(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj, 243 void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbWritten); 244 244 245 245 DECLCALLBACK(void) VBoxSvcClipboardTransferPrepareCallback(PSHCLTRANSFERCALLBACKDATA pData); -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-transfers.cpp
r80918 r80990 58 58 *********************************************************************************************************************************/ 59 59 60 DECLCALLBACK(int) sharedClipboardSvcTransfer Open(PSHCLPROVIDERCTX pCtx)60 DECLCALLBACK(int) sharedClipboardSvcTransferIfaceOpen(PSHCLPROVIDERCTX pCtx) 61 61 { 62 62 RT_NOREF(pCtx); … … 66 66 } 67 67 68 DECLCALLBACK(int) sharedClipboardSvcTransfer Close(PSHCLPROVIDERCTX pCtx)68 DECLCALLBACK(int) sharedClipboardSvcTransferIfaceClose(PSHCLPROVIDERCTX pCtx) 69 69 { 70 70 RT_NOREF(pCtx); … … 74 74 } 75 75 76 DECLCALLBACK(int) sharedClipboardSvcTransfer GetRoots(PSHCLPROVIDERCTX pCtx, PSHCLROOTLIST *ppRootList)76 DECLCALLBACK(int) sharedClipboardSvcTransferIfaceGetRoots(PSHCLPROVIDERCTX pCtx, PSHCLROOTLIST *ppRootList) 77 77 { 78 78 LogFlowFuncEnter(); … … 192 192 } 193 193 194 DECLCALLBACK(int) sharedClipboardSvcTransfer ListOpen(PSHCLPROVIDERCTX pCtx,195 PSHCLLISTOPENPARMS pOpenParms, PSHCLLISTHANDLE phList)194 DECLCALLBACK(int) sharedClipboardSvcTransferIfaceListOpen(PSHCLPROVIDERCTX pCtx, 195 PSHCLLISTOPENPARMS pOpenParms, PSHCLLISTHANDLE phList) 196 196 { 197 197 LogFlowFuncEnter(); … … 251 251 } 252 252 253 DECLCALLBACK(int) sharedClipboardSvcTransfer ListClose(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList)253 DECLCALLBACK(int) sharedClipboardSvcTransferIfaceListClose(PSHCLPROVIDERCTX pCtx, SHCLLISTHANDLE hList) 254 254 { 255 255 LogFlowFuncEnter(); … … 298 298 } 299 299 300 DECLCALLBACK(int) sharedClipboardSvcTransfer ListHdrRead(PSHCLPROVIDERCTX pCtx,301 SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr)300 DECLCALLBACK(int) sharedClipboardSvcTransferIfaceListHdrRead(PSHCLPROVIDERCTX pCtx, 301 SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr) 302 302 { 303 303 LogFlowFuncEnter(); … … 315 315 316 316 HGCMSvcSetU32(&pMsg->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 317 317 pCtx->pTransfer->State.uID, uEvent)); 318 318 HGCMSvcSetU64(&pMsg->paParms[1], hList); 319 319 HGCMSvcSetU32(&pMsg->paParms[2], 0 /* fFlags */); … … 349 349 } 350 350 351 DECLCALLBACK(int) sharedClipboardSvcTransfer ListHdrWrite(PSHCLPROVIDERCTX pCtx,352 SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr)351 DECLCALLBACK(int) sharedClipboardSvcTransferIfaceListHdrWrite(PSHCLPROVIDERCTX pCtx, 352 SHCLLISTHANDLE hList, PSHCLLISTHDR pListHdr) 353 353 { 354 354 RT_NOREF(pCtx, hList, pListHdr); … … 359 359 } 360 360 361 DECLCALLBACK(int) sharedClipboardSvcTransfer ListEntryRead(PSHCLPROVIDERCTX pCtx,362 SHCLLISTHANDLE hList, PSHCLLISTENTRY pListEntry)361 DECLCALLBACK(int) sharedClipboardSvcTransferIfaceListEntryRead(PSHCLPROVIDERCTX pCtx, 362 SHCLLISTHANDLE hList, PSHCLLISTENTRY pListEntry) 363 363 { 364 364 LogFlowFuncEnter(); … … 409 409 } 410 410 411 DECLCALLBACK(int) sharedClipboardSvcTransfer ListEntryWrite(PSHCLPROVIDERCTX pCtx,412 SHCLLISTHANDLE hList, PSHCLLISTENTRY pListEntry)411 DECLCALLBACK(int) sharedClipboardSvcTransferIfaceListEntryWrite(PSHCLPROVIDERCTX pCtx, 412 SHCLLISTHANDLE hList, PSHCLLISTENTRY pListEntry) 413 413 { 414 414 RT_NOREF(pCtx, hList, pListEntry); … … 419 419 } 420 420 421 int sharedClipboardSvcTransfer ObjOpen(PSHCLPROVIDERCTX pCtx, PSHCLOBJOPENCREATEPARMS pCreateParms,422 PSHCLOBJHANDLE phObj)421 int sharedClipboardSvcTransferIfaceObjOpen(PSHCLPROVIDERCTX pCtx, PSHCLOBJOPENCREATEPARMS pCreateParms, 422 PSHCLOBJHANDLE phObj) 423 423 { 424 424 LogFlowFuncEnter(); … … 440 440 441 441 HGCMSvcSetU32(&pMsg->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 442 442 pCtx->pTransfer->State.uID, uEvent)); 443 443 HGCMSvcSetU64(&pMsg->paParms[1], 0); /* uHandle */ 444 444 HGCMSvcSetU32(&pMsg->paParms[2], cbPath); … … 480 480 } 481 481 482 int sharedClipboardSvcTransfer ObjClose(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj)482 int sharedClipboardSvcTransferIfaceObjClose(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj) 483 483 { 484 484 LogFlowFuncEnter(); … … 496 496 497 497 HGCMSvcSetU32(&pMsg->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 498 498 pCtx->pTransfer->State.uID, uEvent)); 499 499 HGCMSvcSetU64(&pMsg->paParms[1], hObj); 500 500 … … 533 533 } 534 534 535 int sharedClipboardSvcTransfer ObjRead(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj,536 void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbRead)535 int sharedClipboardSvcTransferIfaceObjRead(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj, 536 void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbRead) 537 537 { 538 538 LogFlowFuncEnter(); … … 550 550 551 551 HGCMSvcSetU32(&pMsg->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 552 552 pCtx->pTransfer->State.uID, uEvent)); 553 553 HGCMSvcSetU64(&pMsg->paParms[1], hObj); 554 554 HGCMSvcSetU32(&pMsg->paParms[2], cbData); … … 592 592 } 593 593 594 int sharedClipboardSvcTransfer ObjWrite(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj,595 void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbWritten)594 int sharedClipboardSvcTransferIfaceObjWrite(PSHCLPROVIDERCTX pCtx, SHCLOBJHANDLE hObj, 595 void *pvData, uint32_t cbData, uint32_t fFlags, uint32_t *pcbWritten) 596 596 { 597 597 LogFlowFuncEnter(); … … 609 609 610 610 HGCMSvcSetU32(&pMsg->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 611 611 pCtx->pTransfer->State.uID, uEvent)); 612 612 HGCMSvcSetU64(&pMsg->paParms[1], hObj); 613 613 HGCMSvcSetU64(&pMsg->paParms[2], cbData); … … 2130 2130 if (RT_SUCCESS(rc)) 2131 2131 { 2132 creationCtx.Interface.pfnTransferOpen = sharedClipboardSvcTransferOpen; 2133 creationCtx.Interface.pfnTransferClose = sharedClipboardSvcTransferClose; 2134 creationCtx.Interface.pfnListOpen = sharedClipboardSvcTransferListOpen; 2135 creationCtx.Interface.pfnListClose = sharedClipboardSvcTransferListClose; 2136 creationCtx.Interface.pfnObjOpen = sharedClipboardSvcTransferObjOpen; 2137 creationCtx.Interface.pfnObjClose = sharedClipboardSvcTransferObjClose; 2138 2139 creationCtx.Interface.pfnRootsGet = sharedClipboardSvcTransferGetRoots; 2140 creationCtx.Interface.pfnListHdrRead = sharedClipboardSvcTransferListHdrRead; 2141 creationCtx.Interface.pfnListEntryRead = sharedClipboardSvcTransferListEntryRead; 2142 creationCtx.Interface.pfnObjRead = sharedClipboardSvcTransferObjRead; 2132 creationCtx.Interface.pfnTransferOpen = sharedClipboardSvcTransferIfaceOpen; 2133 creationCtx.Interface.pfnTransferClose = sharedClipboardSvcTransferIfaceClose; 2134 2135 creationCtx.Interface.pfnRootsGet = sharedClipboardSvcTransferIfaceGetRoots; 2136 2137 creationCtx.Interface.pfnListOpen = sharedClipboardSvcTransferIfaceListOpen; 2138 creationCtx.Interface.pfnListClose = sharedClipboardSvcTransferIfaceListClose; 2139 creationCtx.Interface.pfnListHdrRead = sharedClipboardSvcTransferIfaceListHdrRead; 2140 creationCtx.Interface.pfnListEntryRead = sharedClipboardSvcTransferIfaceListEntryRead; 2141 2142 creationCtx.Interface.pfnObjOpen = sharedClipboardSvcTransferIfaceObjOpen; 2143 creationCtx.Interface.pfnObjClose = sharedClipboardSvcTransferIfaceObjClose; 2144 creationCtx.Interface.pfnObjRead = sharedClipboardSvcTransferIfaceObjRead; 2143 2145 } 2144 2146 } 2145 2147 else if (enmDir == SHCLTRANSFERDIR_WRITE) 2146 2148 { 2147 creationCtx.Interface.pfnListHdrWrite = sharedClipboardSvcTransfer ListHdrWrite;2148 creationCtx.Interface.pfnListEntryWrite = sharedClipboardSvcTransfer ListEntryWrite;2149 creationCtx.Interface.pfnObjWrite = sharedClipboardSvcTransfer ObjWrite;2149 creationCtx.Interface.pfnListHdrWrite = sharedClipboardSvcTransferIfaceListHdrWrite; 2150 creationCtx.Interface.pfnListEntryWrite = sharedClipboardSvcTransferIfaceListEntryWrite; 2151 creationCtx.Interface.pfnObjWrite = sharedClipboardSvcTransferIfaceObjWrite; 2150 2152 } 2151 2153 else -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp
r80866 r80990 213 213 case WM_CLIPBOARDUPDATE: 214 214 { 215 LogFunc(("WM_CLIPBOARDUPDATE : Waiting ...\n"));215 LogFunc(("WM_CLIPBOARDUPDATE\n")); 216 216 217 217 int rc = RTCritSectEnter(&pWinCtx->CritSect); … … 257 257 LogFunc(("WM_DRAWCLIPBOARD\n")); 258 258 259 if (GetClipboardOwner() != hWnd) 260 { 261 /* Clipboard was updated by another application, retrieve formats and report back. */ 262 int rc = vboxClipboardSvcWinSyncInternal(pCtx); 263 if (RT_SUCCESS(rc)) 264 sharedClipboardSvcSetSource(pCtx->pClient, SHCLSOURCE_LOCAL); 259 int rc = RTCritSectEnter(&pWinCtx->CritSect); 260 if (RT_SUCCESS(rc)) 261 { 262 const HWND hWndClipboardOwner = GetClipboardOwner(); 263 264 LogFunc(("WM_DRAWCLIPBOARD: hWndClipboardOwnerUs=%p, hWndNewClipboardOwner=%p\n", 265 pWinCtx->hWndClipboardOwnerUs, hWndClipboardOwner)); 266 267 if (pWinCtx->hWndClipboardOwnerUs != hWndClipboardOwner) 268 { 269 int rc2 = RTCritSectLeave(&pWinCtx->CritSect); 270 AssertRC(rc2); 271 272 /* Clipboard was updated by another application, retrieve formats and report back. */ 273 rc = vboxClipboardSvcWinSyncInternal(pCtx); 274 if (RT_SUCCESS(rc)) 275 sharedClipboardSvcSetSource(pCtx->pClient, SHCLSOURCE_LOCAL); 276 } 277 else 278 { 279 int rc2 = RTCritSectLeave(&pWinCtx->CritSect); 280 AssertRC(rc2); 281 } 265 282 } 266 283 … … 389 406 } 390 407 391 LogFlowFunc((" hWnd=%p, WM_ %u\n", hWnd, uMsg));408 LogFlowFunc(("LEAVE hWnd=%p, WM_ %u\n", hWnd, uMsg)); 392 409 return DefWindowProc(hWnd, uMsg, wParam, lParam); 393 410 } -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp
r80858 r80990 59 59 /** 60 60 * Report formats available in the X11 clipboard to VBox. 61 * @param pCtx Opaque context pointer for the glue code 62 * @param u32Formats The formats available 63 * @note Host glue code 61 * @param pCtx Opaque context pointer for the glue code. 62 * @param u32Formats The formats available. 64 63 */ 65 64 void ClipReportX11Formats(SHCLCONTEXT *pCtx, uint32_t u32Formats) 66 65 { 67 66 LogFlowFunc(("pCtx=%p, u32Formats=%02X\n", pCtx, u32Formats)); 67 68 if (u32Formats == VBOX_SHCL_FMT_NONE) /* No formats to report? Bail out early. */ 69 return; 68 70 69 71 SHCLFORMATDATA formatData; -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
r80918 r80990 937 937 if (pMsg) 938 938 { 939 SHCLEVENTID uEvent = SharedClipboardEventIDGenerate(&pClient->Events);939 const SHCLEVENTID uEvent = SharedClipboardEventIDGenerate(&pClient->Events); 940 940 941 941 HGCMSvcSetU32(&pMsg->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, … … 948 948 { 949 949 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 950 /* If this is an URI list, create a transfer locally and also tell the guest to create 951 * a transfer on the guest side. */ 950 952 if (pFormats->uFormats & VBOX_SHCL_FMT_URI_LIST) 951 953 { … … 955 957 LogRel(("Shared Clipboard: Initializing host write transfer failed with %Rrc\n", rc)); 956 958 } 959 else 960 { 957 961 #endif 958 if (RT_SUCCESS(rc))959 962 rc = sharedClipboardSvcClientWakeup(pClient); 963 964 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 965 } 966 #endif 960 967 } 961 968 } … … 1322 1329 rc = VERR_ACCESS_DENIED; 1323 1330 } 1324 else 1331 else if (uFormats != VBOX_SHCL_FMT_NONE) /* Only announce formats if we actually *have* formats to announce! */ 1325 1332 { 1326 1333 rc = sharedClipboardSvcSetSource(pClient, SHCLSOURCE_REMOTE); … … 1334 1341 parms.uFormat = uFormats; 1335 1342 1336 g_ExtState.pfnExtension(g_ExtState.pvExtension, VBOX_CLIPBOARD_EXT_FN_FORMAT_ANNOUNCE, &parms, sizeof(parms)); 1343 g_ExtState.pfnExtension(g_ExtState.pvExtension, VBOX_CLIPBOARD_EXT_FN_FORMAT_ANNOUNCE, 1344 &parms, sizeof(parms)); 1337 1345 } 1338 1346 … … 1344 1352 1345 1353 formatData.uFormats = uFormats; 1354 Assert(formatData.uFormats != VBOX_SHCL_FMT_NONE); /* Sanity. */ 1346 1355 1347 1356 rc = SharedClipboardSvcImplFormatAnnounce(pClient, &cmdCtx, &formatData); … … 1413 1422 1414 1423 formatData.uFormats = g_ExtState.uDelayedFormats; 1424 Assert(formatData.uFormats != VBOX_SHCL_FMT_NONE); /* There better is *any* format here now. */ 1415 1425 1416 1426 int rc2 = sharedClipboardSvcFormatsReport(pClient, &formatData); … … 1544 1554 1545 1555 LogFlowFunc(("u32Function=%RU32 (%s), cParms=%RU32, paParms=%p\n", 1546 u32Function, VBoxShClHost MsgToStr(u32Function), cParms, paParms));1556 u32Function, VBoxShClHostFunctionToStr(u32Function), cParms, paParms)); 1547 1557 1548 1558 switch (u32Function) … … 1826 1836 g_ExtState.uDelayedFormats = u32Format; 1827 1837 } 1828 else 1838 else if (u32Format != VBOX_SHCL_FMT_NONE) 1829 1839 { 1830 1840 SHCLFORMATDATA formatData;
Note:
See TracChangeset
for help on using the changeset viewer.