VirtualBox

Ignore:
Timestamp:
Feb 4, 2021 4:31:28 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
142646
Message:

Shared Clipboard/Transfers: More callback code. ​bugref:9437

Location:
trunk/src/VBox/GuestHost/SharedClipboard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/SharedClipboard/ClipboardDataObjectImpl-win.cpp

    r87452 r87611  
    353353
    354354    PSHCLROOTLIST pRootList;
    355     rc = ShClTransferRootsGet(pTransfer, &pRootList);
     355    int rc = ShClTransferRootsGet(pTransfer, &pRootList);
    356356    if (RT_SUCCESS(rc))
    357357    {
     
    967967    logFormat(pFormatEtc->cfFormat);
    968968}
    969 
  • trunk/src/VBox/GuestHost/SharedClipboard/clipboard-transfers.cpp

    r87452 r87611  
    12671267        pTransfer->uObjHandleNext  = 1;
    12681268
    1269         if (pTransfer->ProviderIface.pfnInitialize)
    1270             rc = pTransfer->ProviderIface.pfnInitialize(&pTransfer->ProviderCtx);
     1269        if (pTransfer->Callbacks.pfnOnInitialize)
     1270            rc = pTransfer->Callbacks.pfnOnInitialize(&pTransfer->CallbackCtx);
    12711271    }
    12721272
     
    20162016
    20172017/**
     2018 * Sets or unsets the callback table to be used for a Shared Clipboard transfer.
     2019 *
     2020 * @returns VBox status code.
     2021 * @param   pTransfer           Clipboard transfer to set callbacks for.
     2022 * @param   pCallbacks          Pointer to callback table to set.
     2023 */
     2024void ShClTransferSetCallbacks(PSHCLTRANSFER pTransfer,
     2025                              PSHCLTRANSFERCALLBACKTABLE pCallbacks)
     2026{
     2027    AssertPtrReturnVoid(pTransfer);
     2028    AssertPtrReturnVoid(pCallbacks);
     2029
     2030    LogFlowFunc(("pCallbacks=%p\n", pCallbacks));
     2031
     2032#define SET_CALLBACK(a_pfnCallback)             \
     2033    if (pCallbacks->a_pfnCallback)              \
     2034        pTransfer->Callbacks.a_pfnCallback = pCallbacks->a_pfnCallback
     2035
     2036    SET_CALLBACK(pfnOnInitialize);
     2037    SET_CALLBACK(pfnOnStart);
     2038    SET_CALLBACK(pfnOnCompleted);
     2039    SET_CALLBACK(pfnOnError);
     2040    SET_CALLBACK(pfnOnRegistered);
     2041    SET_CALLBACK(pfnOnUnregistered);
     2042
     2043#undef SET_CALLBACK
     2044
     2045    pTransfer->Callbacks.pvUser = pCallbacks->pvUser;
     2046    pTransfer->Callbacks.cbUser = pCallbacks->cbUser;
     2047}
     2048
     2049/**
    20182050 * Sets the transfer provider interface for a given transfer.
    20192051 *
     
    24842516    int rc;
    24852517
    2486     if (pTransfer->ProviderIface.pfnStart)
    2487     {
    2488         rc = pTransfer->ProviderIface.pfnStart(&pTransfer->ProviderCtx);
     2518    if (pTransfer->Callbacks.pfnOnStart)
     2519    {
     2520        rc = pTransfer->Callbacks.pfnOnStart(&pTransfer->CallbackCtx);
    24892521    }
    24902522    else
     
    27882820    pTransferCtx->cTransfers++;
    27892821
    2790     if (pTransfer->ProviderIface.pfnRegistered)
    2791         pTransfer->ProviderIface.pfnRegistered(&pTransfer->ProviderCtx, pTransferCtx);
     2822    if (pTransfer->Callbacks.pfnOnRegistered)
     2823        pTransfer->Callbacks.pfnOnRegistered(&pTransfer->CallbackCtx, pTransferCtx);
    27922824
    27932825    if (pidTransfer)
     
    28202852            pTransfer->State.uID = idTransfer;
    28212853
    2822             if (pTransfer->ProviderIface.pfnRegistered)
    2823                 pTransfer->ProviderIface.pfnRegistered(&pTransfer->ProviderCtx, pTransferCtx);
     2854            if (pTransfer->Callbacks.pfnOnRegistered)
     2855                pTransfer->Callbacks.pfnOnRegistered(&pTransfer->CallbackCtx, pTransferCtx);
    28242856
    28252857            pTransferCtx->cTransfers++;
     
    28492881    Assert(pTransferCtx->cTransfers >= pTransferCtx->cRunning);
    28502882
    2851     if (pTransfer->ProviderIface.pfnUnregistered)
    2852         pTransfer->ProviderIface.pfnUnregistered(&pTransfer->ProviderCtx, pTransferCtx);
     2883    if (pTransfer->Callbacks.pfnOnUnregistered)
     2884        pTransfer->Callbacks.pfnOnUnregistered(&pTransfer->CallbackCtx, pTransferCtx);
    28532885
    28542886    LogFlowFunc(("Now %RU32 transfers left\n", pTransferCtx->cTransfers));
Note: See TracChangeset for help on using the changeset viewer.

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