VirtualBox

Changeset 86869 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Nov 12, 2020 7:59:52 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
141323
Message:

DnD: Termination fixes / clarification.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp

    r85746 r86869  
    6161 *
    6262 * @returns IPRT status code.
     63 *          Will return VERR_CANCELLED (implemented by the host service) if we need to bail out.
    6364 * @param   pCtx                DnD context to use.
    6465 * @param   puMsg               Where to store the message type.
     
    7273    AssertPtrReturn(pcParms, VERR_INVALID_POINTER);
    7374
    74     HGCMMsgGetNext Msg;
    75     VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_DND_FN_GET_NEXT_HOST_MSG, 3);
    76     Msg.uMsg.SetUInt32(0);
    77     Msg.cParms.SetUInt32(0);
    78     Msg.fBlock.SetUInt32(fWait ? 1 : 0);
    79 
    80     int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
    81     if (RT_SUCCESS(rc))
    82     {
    83         rc = Msg.uMsg.GetUInt32(puMsg);     AssertRC(rc);
    84         rc = Msg.cParms.GetUInt32(pcParms); AssertRC(rc);
    85     }
     75    int rc;
     76
     77    do
     78    {
     79        HGCMMsgGetNext Msg;
     80        VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, GUEST_DND_FN_GET_NEXT_HOST_MSG, 3);
     81        Msg.uMsg.SetUInt32(0);
     82        Msg.cParms.SetUInt32(0);
     83        Msg.fBlock.SetUInt32(fWait ? 1 : 0);
     84
     85        rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
     86        if (RT_SUCCESS(rc))
     87        {
     88            rc = Msg.uMsg.GetUInt32(puMsg);     AssertRC(rc);
     89            rc = Msg.cParms.GetUInt32(pcParms); AssertRC(rc);
     90        }
     91
     92    } while (rc == VERR_INTERRUPTED);
    8693
    8794    return rc;
     
    10781085{
    10791086    AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
     1087
     1088    if (!pCtx->uClientID) /* Already disconnected? Bail out early. */
     1089        return VINF_SUCCESS;
     1090
    10801091    int rc = VbglR3HGCMDisconnect(pCtx->uClientID);
    10811092    if (RT_SUCCESS(rc))
    10821093        pCtx->uClientID = 0;
     1094
    10831095    return rc;
    10841096}
     
    11621174                rc = VbglR3DnDConnect(pCtx);
    11631175        }
     1176    }
     1177
     1178    if (rc == VERR_CANCELLED) /* Host service told us that we have to bail out. */
     1179    {
     1180        pEvent->enmType = VBGLR3DNDEVENTTYPE_QUIT;
     1181
     1182        *ppEvent = pEvent;
     1183
     1184        return VINF_SUCCESS;
    11641185    }
    11651186
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