VirtualBox

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


Ignore:
Timestamp:
Feb 19, 2024 1:51:37 PM (14 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161773
Message:

Shared Clipboard: Condensed more code by adding a SHCLTRANSFERCALLBACKS::pfnOnInitialize() callback function. bugref:9437

Location:
trunk/src/VBox/Additions
Files:
3 edited

Legend:

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

    r103367 r103442  
    162162
    163163/**
    164  * @copydoc SHCLTRANSFERCALLBACKS::pfnOnInitialized
     164 * @copydoc SHCLTRANSFERCALLBACKS::pfnOnInitialize
    165165 *
    166166 * Called by ShClTransferInit via VbglR3.
     
    170170 * @thread  Clipboard main thread.
    171171 */
    172 static DECLCALLBACK(void) vbtrShClTransferInitializedCallback(PSHCLTRANSFERCALLBACKCTX pCbCtx)
     172static DECLCALLBACK(int) vbtrShClTransferInitializeCallback(PSHCLTRANSFERCALLBACKCTX pCbCtx)
    173173{
    174174    LogFlowFuncEnter();
     
    209209
    210210    LogFlowFuncLeaveRC(rc);
     211    return rc;
    211212}
    212213
     
    979980    pCtx->CmdCtx.Transfers.Callbacks.pfnOnCreated     = vbtrShClTransferCreatedCallback;
    980981    pCtx->CmdCtx.Transfers.Callbacks.pfnOnDestroy     = vbtrShClTransferDestroyCallback;
    981     pCtx->CmdCtx.Transfers.Callbacks.pfnOnInitialized = vbtrShClTransferInitializedCallback;
     982    pCtx->CmdCtx.Transfers.Callbacks.pfnOnInitialize  = vbtrShClTransferInitializeCallback;
    982983    pCtx->CmdCtx.Transfers.Callbacks.pfnOnStarted     = vbtrShClTransferStartedCallback;
    983984    pCtx->CmdCtx.Transfers.Callbacks.pfnOnCompleted   = vbtrShClTransferCompletedCallback;
  • trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp

    r103365 r103442  
    21522152    int rc = ShClTransferSetProvider(pTransfer, &Provider);
    21532153    if (RT_SUCCESS(rc))
    2154     {
    21552154        rc = ShClTransferInit(pTransfer);
    2156         if (RT_SUCCESS(rc))
    2157         {
    2158             /* As soon as we report the INITIALIZED state to the host, the host can start reading stuff from the transfer.
    2159              * So make sure that we really are ready here. */
    2160             if (enmDir == SHCLTRANSFERDIR_TO_REMOTE)
    2161                 AssertMsgStmt(ShClTransferRootsCount(pTransfer), ("No root entries set yet!\n"
    2162                                                                   "Those have to be present as soon we report the transfer as being INITIALIZED to the host\n"),
    2163                               rc = VERR_WRONG_ORDER);
    2164         }
    2165     }
    21662155
    21672156    SHCLTRANSFERID const idTransfer = ShClTransferGetID(pTransfer);
  • trunk/src/VBox/Additions/x11/VBoxClient/clipboard-x11.cpp

    r103365 r103442  
    5757#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS_HTTP
    5858/**
    59  * @copydoc SHCLTRANSFERCALLBACKS::pfnOnInitialized
     59 * @copydoc SHCLTRANSFERCALLBACKS::pfnOnInitialize
    6060 *
    6161 * @thread Clipboard main thread.
    6262 */
    63 static DECLCALLBACK(void) vbclX11OnTransferInitializedCallback(PSHCLTRANSFERCALLBACKCTX pCbCtx)
     63static DECLCALLBACK(int) vbclX11OnTransferInitializeCallback(PSHCLTRANSFERCALLBACKCTX pCbCtx)
    6464{
    6565    LogFlowFuncEnter();
     
    111111
    112112    LogFlowFuncLeaveRC(rc);
     113    return rc;
    113114}
    114115
     
    384385    pCtx->CmdCtx.Transfers.Callbacks.cbUser = sizeof(SHCLCONTEXT);
    385386
    386     pCtx->CmdCtx.Transfers.Callbacks.pfnOnInitialized  = vbclX11OnTransferInitializedCallback;
     387    pCtx->CmdCtx.Transfers.Callbacks.pfnOnInitialize   = vbclX11OnTransferInitializeCallback;
    387388    pCtx->CmdCtx.Transfers.Callbacks.pfnOnRegistered   = vbclX11OnTransferRegisteredCallback;
    388389    pCtx->CmdCtx.Transfers.Callbacks.pfnOnUnregistered = vbclX11OnTransferUnregisteredCallback;
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