Changeset 86948 in vbox
- Timestamp:
- Nov 20, 2020 6:35:24 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxGuestLib.h
r86887 r86948 577 577 * @{ */ 578 578 579 # ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 580 /** 581 * Structure for maintaining a VbglR3 Shared Clipboard transfer context. 582 */ 583 typedef struct VBGLR3SHCLTRANSFERCMDCTX 584 { 585 /** Default chunk size (in bytes). 586 * This is set by VbglR3ClipboardConnectEx(). */ 587 uint32_t cbChunkSize; 588 /** Max chunk size (in bytes). 589 * This is set by VbglR3ClipboardConnectEx(). */ 590 uint32_t cbMaxChunkSize; 591 /** Callback table to use for all transfers. */ 592 SHCLTRANSFERCALLBACKS Callbacks; 593 } VBGLR3SHCLTRANSFERCTX; 594 /** Pointer to a Shared Clipboard transfer context. */ 595 typedef VBGLR3SHCLTRANSFERCMDCTX *PVBGLR3SHCLTRANSFERCMDCTX; 596 # endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */ 597 579 598 /** 580 599 * The context required for either retrieving or sending a HGCM shared clipboard … … 600 619 * This is set by VbglR3ClipboardConnectEx(). */ 601 620 uint64_t fGuestFeatures; 602 # ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS603 /** Default chunk size (in bytes).604 * This is set by VbglR3ClipboardConnectEx(). */605 uint32_t cbChunkSize;606 /** Max chunk size (in bytes).607 * This is set by VbglR3ClipboardConnectEx(). */608 uint32_t cbMaxChunkSize;609 # endif610 611 621 /** The context ID - input or/and output depending on the operation. */ 612 622 uint64_t idContext; … … 614 624 * This is set by ??. */ 615 625 uint32_t cParmsRecived; 616 617 # ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 618 /** Callback table to use for all transfers. */ 619 SHCLTRANSFERCALLBACKS Callbacks; 620 # endif 626 # ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS 627 VBGLR3SHCLTRANSFERCMDCTX Transfers; 628 # endif 621 629 } VBGLR3SHCLCMDCTX; 622 630 /** Pointer to a shared clipboard context for Vbgl. */ -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp
r85121 r86948 161 161 /* The IDataObject *must* be created on the same thread as our (proxy) window, so post a message to it 162 162 * to do the stuff for us. */ 163 const SHCLEVENTID idEvent = ShClEventIDGenerate(&pTransfer->Events); 164 165 rc = ShClEventRegister(&pTransfer->Events, idEvent); 166 if (RT_SUCCESS(rc)) 163 const SHCLEVENTID idEvent = ShClEventIdGenerateAndRegister(&pTransfer->Events); 164 if (idEvent != NIL_SHCLEVENTID) 167 165 { 168 166 /* Don't want to rely on SendMessage (synchronous) here, so just post and wait the event getting signalled. */ -
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp
r86911 r86948 113 113 pCtx->fGuestFeatures |= VBOX_SHCL_GF_0_TRANSFERS_FRONTEND; 114 114 # endif 115 pCtx-> cbChunkSize= VBOX_SHCL_DEFAULT_CHUNK_SIZE; /** @todo Make this configurable. */116 pCtx-> cbMaxChunkSize= VBOX_SHCL_MAX_CHUNK_SIZE; /** @todo Ditto. */115 pCtx->Transfers.cbChunkSize = VBOX_SHCL_DEFAULT_CHUNK_SIZE; /** @todo Make this configurable. */ 116 pCtx->Transfers.cbMaxChunkSize = VBOX_SHCL_MAX_CHUNK_SIZE; /** @todo Ditto. */ 117 117 #endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */ 118 118 … … 148 148 VBGL_HGCM_HDR_INIT(&MsgChunkSize.hdr, pCtx->idClient, VBOX_SHCL_GUEST_FN_NEGOTIATE_CHUNK_SIZE, 149 149 VBOX_SHCL_CPARMS_NEGOTIATE_CHUNK_SIZE); 150 MsgChunkSize.cb32MaxChunkSize.SetUInt32(pCtx-> cbMaxChunkSize);150 MsgChunkSize.cb32MaxChunkSize.SetUInt32(pCtx->Transfers.cbMaxChunkSize); 151 151 MsgChunkSize.cb32ChunkSize.SetUInt32(0); /* If set to 0, let the host choose. */ 152 152 rc = VbglR3HGCMCall(&MsgChunkSize.hdr, sizeof(MsgChunkSize)); … … 155 155 { 156 156 Assert(MsgChunkSize.cb32ChunkSize.type == VMMDevHGCMParmType_32bit); 157 pCtx-> cbChunkSize = RT_MIN(MsgChunkSize.cb32ChunkSize.u.value32, pCtx->cbChunkSize);157 pCtx->Transfers.cbChunkSize = RT_MIN(MsgChunkSize.cb32ChunkSize.u.value32, pCtx->Transfers.cbChunkSize); 158 158 Assert(MsgChunkSize.cb32MaxChunkSize.type == VMMDevHGCMParmType_32bit); 159 pCtx-> cbMaxChunkSize = RT_MIN(MsgChunkSize.cb32MaxChunkSize.u.value32, pCtx->cbMaxChunkSize);159 pCtx->Transfers.cbMaxChunkSize = RT_MIN(MsgChunkSize.cb32MaxChunkSize.u.value32, pCtx->Transfers.cbMaxChunkSize); 160 160 161 161 LogRel2(("Shared Clipboard: Using chunk size %RU32 (maximum is %RU32)\n", 162 pCtx-> cbChunkSize, pCtx->cbMaxChunkSize));162 pCtx->Transfers.cbChunkSize, pCtx->Transfers.cbMaxChunkSize)); 163 163 } 164 164 } … … 1803 1803 if (RT_SUCCESS(rc)) 1804 1804 { 1805 ShClTransferSetCallbacks(pTransfer, &pCmdCtx-> Callbacks);1805 ShClTransferSetCallbacks(pTransfer, &pCmdCtx->Transfers.Callbacks); 1806 1806 1807 1807 rc = ShClTransferCtxTransferRegisterByIndex(pTransferCtx, pTransfer, uTransferID); … … 2218 2218 AssertPtrBreakStmt(pTransfer, rc = VERR_NOT_FOUND); 2219 2219 2220 AssertBreakStmt(pCmdCtx-> cbChunkSize, rc = VERR_INVALID_PARAMETER);2221 2222 const uint32_t cbToRead = RT_MIN(cbBuf, pCmdCtx-> cbChunkSize);2220 AssertBreakStmt(pCmdCtx->Transfers.cbChunkSize, rc = VERR_INVALID_PARAMETER); 2221 2222 const uint32_t cbToRead = RT_MIN(cbBuf, pCmdCtx->Transfers.cbChunkSize); 2223 2223 2224 2224 LogFlowFunc(("hObj=%RU64, cbBuf=%RU32, fFlags=0x%x -> cbChunkSize=%RU32, cbToRead=%RU32\n", 2225 hObj, cbBuf, fFlags, pCmdCtx-> cbChunkSize, cbToRead));2225 hObj, cbBuf, fFlags, pCmdCtx->Transfers.cbChunkSize, cbToRead)); 2226 2226 2227 2227 void *pvBuf = RTMemAlloc(cbToRead); -
trunk/src/VBox/GuestHost/SharedClipboard/ClipboardStreamImpl-win.cpp
r82968 r86948 51 51 , m_lRefCount(1) /* Our IDataObjct *always* holds the last reference to this object; needed for the callbacks. */ 52 52 , m_pTransfer(pTransfer) 53 , m_hObj(SHCLOBJHANDLE_INVALID) 53 54 , m_strPath(strPath) 54 , m_hObj(SHCLOBJHANDLE_INVALID)55 55 , m_objInfo(*pObjInfo) 56 56 , m_cbProcessed(0)
Note:
See TracChangeset
for help on using the changeset viewer.