VirtualBox

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


Ignore:
Timestamp:
Feb 19, 2024 1:51:37 PM (9 months ago)
Author:
vboxsync
Message:

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

Location:
trunk/src/VBox/HostServices/SharedClipboard
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-transfers.cpp

    r102954 r103442  
    24102410
    24112411        rc = ShClTransferInit(pTransfer);
    2412         if (RT_SUCCESS(rc))
    2413         {
    2414             /* Sanity: Make sure that the transfer we're gonna report as INITIALIZED to the guest
    2415              *         actually has some root entries set, as the guest can query for those at any time then. */
    2416             if (enmDir == SHCLTRANSFERDIR_TO_REMOTE)
    2417                 AssertMsgStmt(ShClTransferRootsCount(pTransfer), ("Transfer has no root entries set\n"), rc = VERR_WRONG_ORDER);
    2418         }
    24192412    }
    24202413    else
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp

    r103363 r103442  
    289289
    290290/**
    291  * @copydoc SHCLTRANSFERCALLBACKS::pfnOnInitialized
     291 * @copydoc SHCLTRANSFERCALLBACKS::pfnOnInitialize
    292292 *
    293293 * For G->H: Called on transfer intialization to notify the "in-flight" IDataObject about a data transfer.
     
    296296 * @thread  Service main thread.
    297297 */
    298 static DECLCALLBACK(void) shClSvcWinTransferOnInitializedCallback(PSHCLTRANSFERCALLBACKCTX pCbCtx)
     298static DECLCALLBACK(void) shClSvcWinTransferOnInitializeCallback(PSHCLTRANSFERCALLBACKCTX pCbCtx)
    299299{
    300300    LogFlowFuncEnter();
     
    346346
    347347    LogFlowFuncLeaveRC(rc);
     348    return rc;
    348349}
    349350
     
    857858        pClient->Transfers.Callbacks.cbUser = sizeof(SHCLCONTEXT);
    858859
    859         pClient->Transfers.Callbacks.pfnOnCreated     = shClSvcWinTransferOnCreatedCallback;
    860         pClient->Transfers.Callbacks.pfnOnInitialized = shClSvcWinTransferOnInitializedCallback;
    861         pClient->Transfers.Callbacks.pfnOnDestroy     = shClSvcWinTransferOnDestroyCallback;
     860        pClient->Transfers.Callbacks.pfnOnCreated    = shClSvcWinTransferOnCreatedCallback;
     861        pClient->Transfers.Callbacks.pfnOnInitialize = shClSvcWinTransferOnInitializeCallback;
     862        pClient->Transfers.Callbacks.pfnOnDestroy    = shClSvcWinTransferOnDestroyCallback;
    862863#endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */
    863864    }
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp

    r103323 r103442  
    8989#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
    9090static DECLCALLBACK(void) shClSvcX11TransferOnCreatedCallback(PSHCLTRANSFERCALLBACKCTX pCbCtx);
    91 static DECLCALLBACK(void) shClSvcX11TransferOnInitCallback(PSHCLTRANSFERCALLBACKCTX pCbCtx);
     91static DECLCALLBACK(int) shClSvcX11TransferOnInitCallback(PSHCLTRANSFERCALLBACKCTX pCbCtx);
    9292static DECLCALLBACK(void) shClSvcX11TransferOnDestroyCallback(PSHCLTRANSFERCALLBACKCTX pCbCtx);
    9393static DECLCALLBACK(void) shClSvcX11TransferOnUnregisteredCallback(PSHCLTRANSFERCALLBACKCTX pCbCtx, PSHCLTRANSFERCTX pTransferCtx);
     
    178178
    179179                pClient->Transfers.Callbacks.pfnOnCreated      = shClSvcX11TransferOnCreatedCallback;
    180                 pClient->Transfers.Callbacks.pfnOnInitialized  = shClSvcX11TransferOnInitCallback;
     180                pClient->Transfers.Callbacks.pfnOnInitialize   = shClSvcX11TransferOnInitCallback;
    181181                pClient->Transfers.Callbacks.pfnOnDestroy      = shClSvcX11TransferOnDestroyCallback;
    182182                pClient->Transfers.Callbacks.pfnOnUnregistered = shClSvcX11TransferOnUnregisteredCallback;
     
    411411
    412412/**
    413  * @copydoc SHCLTRANSFERCALLBACKS::pfnOnInitialized
     413 * @copydoc SHCLTRANSFERCALLBACKS::pfnOnInitialize
    414414 *
    415415 * For G->H: Starts the HTTP server if not done yet and registers the transfer with it.
     
    418418 * @thread  Service main thread.
    419419 */
    420 static DECLCALLBACK(void) shClSvcX11TransferOnInitCallback(PSHCLTRANSFERCALLBACKCTX pCbCtx)
     420static DECLCALLBACK(int) shClSvcX11TransferOnInitCallback(PSHCLTRANSFERCALLBACKCTX pCbCtx)
    421421{
    422422    LogFlowFuncEnter();
     
    455455
    456456    LogFlowFuncLeaveRC(rc);
     457    return rc;
    457458}
    458459
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