VirtualBox

Changeset 103450 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Feb 19, 2024 2:55:20 PM (9 months ago)
Author:
vboxsync
Message:

Shared Clipboard: Condensed more code by adding a new Windows-specific function SharedClipboardWinTransferHandOffToDataObject(). bugref:9437

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp

    r103442 r103450  
    179179    AssertPtr(pCtx);
    180180
    181     switch(ShClTransferGetDir(pCbCtx->pTransfer))
     181    PSHCLTRANSFER pTransfer = pCbCtx->pTransfer;
     182    AssertPtr(pTransfer);
     183
     184    switch(ShClTransferGetDir(pTransfer))
    182185    {
    183186        case SHCLTRANSFERDIR_FROM_REMOTE: /* G->H */
    184187        {
    185             SharedClipboardWinDataObject *pObj = pCtx->Win.pDataObjInFlight;
    186             if (pObj)
    187             {
    188                 rc = pObj->SetTransfer(pCbCtx->pTransfer);
    189                 if (RT_SUCCESS(rc))
    190                     rc = pObj->SetStatus(SharedClipboardWinDataObject::Running);
    191 
    192                 pCtx->Win.pDataObjInFlight = NULL; /* Hand off to Windows. */
    193             }
    194             else
    195                 AssertMsgFailed(("No data object in flight!\n"));
    196 
     188            rc = SharedClipboardWinTransferHandOffToDataObject(&pCtx->Win, pTransfer);
    197189            break;
    198190        }
     
    200192        case SHCLTRANSFERDIR_TO_REMOTE: /* H->G */
    201193        {
    202             rc = SharedClipboardWinTransferGetRootsFromClipboard(&pCtx->Win, pCbCtx->pTransfer);
     194            rc = SharedClipboardWinTransferGetRootsFromClipboard(&pCtx->Win, pTransfer);
    203195            break;
    204196        }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette