VirtualBox

Changeset 80883 in vbox


Ignore:
Timestamp:
Sep 18, 2019 11:22:57 AM (5 years ago)
Author:
vboxsync
Message:

Shared Clipboard/Transfers: Simplified client call completion in host service.

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

Legend:

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

    r80866 r80883  
    12391239 * transfer client (guest) handler for the Shared Clipboard host service.
    12401240 *
    1241  * @returns VBox status code.
     1241 * @returns VBox status code, or VINF_HGCM_ASYNC_EXECUTE if returning to the client will be deferred.
    12421242 * @param   pClient             Pointer to associated client.
    12431243 * @param   callHandle          The client's call handle of this call.
     
    12481248 */
    12491249int sharedClipboardSvcTransferHandler(PSHCLCLIENT pClient,
    1250                                 VBOXHGCMCALLHANDLE callHandle,
    1251                                 uint32_t u32Function,
    1252                                 uint32_t cParms,
    1253                                 VBOXHGCMSVCPARM paParms[],
    1254                                 uint64_t tsArrival)
    1255 {
    1256     RT_NOREF(paParms, tsArrival);
     1250                                      VBOXHGCMCALLHANDLE callHandle,
     1251                                      uint32_t u32Function,
     1252                                      uint32_t cParms,
     1253                                      VBOXHGCMSVCPARM paParms[],
     1254                                      uint64_t tsArrival)
     1255{
     1256    RT_NOREF(callHandle, paParms, tsArrival);
    12571257
    12581258    LogFlowFunc(("uClient=%RU32, u32Function=%RU32 (%s), cParms=%RU32, g_ExtState.pfnExtension=%p\n",
     
    12841284     * Pre-check: For certain messages we need to make sure that a (right) transfer is present.
    12851285     */
    1286     uint32_t         uCID      = 0; /* Context ID */
     1286    uint32_t      uCID      = 0; /* Context ID */
    12871287    PSHCLTRANSFER pTransfer = NULL;
    12881288
     
    13231323
    13241324    rc = VERR_INVALID_PARAMETER; /* Play safe. */
    1325 
    1326     bool fDoCallComplete = true;
    13271325
    13281326    switch (u32Function)
     
    14321430        {
    14331431            rc = sharedClipboardSvcTransferHandleReply(pClient, pTransfer, cParms, paParms);
    1434 
    1435             /* This message does not need any completion, as it can happen at any time from the guest side. */
    1436             fDoCallComplete = false;
    14371432            break;
    14381433        }
     
    18581853            LogFunc(("Not implemented\n"));
    18591854            break;
    1860     }
    1861 
    1862     if (fDoCallComplete)
    1863     {
    1864         /* Tell the client that the call is complete (unblocks waiting). */
    1865         LogFlowFunc(("[Client %RU32] Calling pfnCallComplete w/ rc=%Rrc\n", pClient->State.uClientID, rc));
    1866         AssertPtr(g_pHelpers);
    1867         g_pHelpers->pfnCallComplete(callHandle, rc);
    18681855    }
    18691856
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp

    r80866 r80883  
    12011201#endif
    12021202
    1203     bool fDoCallComplete = true;
    1204 
    12051203    switch (u32Function)
    12061204    {
     
    12081206        {
    12091207            rc = sharedClipboardSvcMsgGetOld(pClient, callHandle, cParms, paParms);
    1210             if (rc == VINF_HGCM_ASYNC_EXECUTE)
    1211                 fDoCallComplete = false;
    12121208            break;
    12131209        }
     
    12591255        {
    12601256            rc = sharedClipboardSvcMsgPeek(pClient, callHandle, cParms, paParms, true /*fWait*/);
    1261             if (rc == VINF_HGCM_ASYNC_EXECUTE)
    1262                 fDoCallComplete = false;
    12631257            break;
    12641258        }
     
    12671261        {
    12681262            rc = sharedClipboardSvcMsgGet(pClient, callHandle, cParms, paParms);
    1269             if (rc == VINF_HGCM_ASYNC_EXECUTE)
    1270                 fDoCallComplete = false;
    12711263            break;
    12721264        }
     
    14841476    }
    14851477
    1486     LogFlowFunc(("u32ClientID=%RU32, fDoCallComplete=%RTbool, rc=%Rrc\n", pClient->State.uClientID, fDoCallComplete, rc));
    1487 
    1488     if (fDoCallComplete)
     1478    LogFlowFunc(("[Client %RU32] rc=%Rrc\n", pClient->State.uClientID, rc));
     1479
     1480    if (rc != VINF_HGCM_ASYNC_EXECUTE)
    14891481        g_pHelpers->pfnCallComplete(callHandle, rc);
    1490 
    1491     LogFlowFuncLeaveRC(rc);
    14921482}
    14931483
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