VirtualBox

Changeset 82534 in vbox for trunk


Ignore:
Timestamp:
Dec 10, 2019 10:41:32 AM (5 years ago)
Author:
vboxsync
Message:

VBoxSharedClipboardSvc: Fixed unresolved ShClEventIDGenerate in ShClSvcImplReadData. bugref:9437

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/GuestHost/SharedClipboard.h

    r82527 r82534  
    205205SHCLEVENTID ShClEventIDGenerate(PSHCLEVENTSOURCE pSource);
    206206SHCLEVENTID ShClEventGetLast(PSHCLEVENTSOURCE pSource);
    207 int ShClEventRegister(PSHCLEVENTSOURCE pSource, SHCLEVENTID idEvent);
     207/*int ShClEventRegister(PSHCLEVENTSOURCE pSource, SHCLEVENTID idEvent);*/
    208208int ShClEventUnregister(PSHCLEVENTSOURCE pSource, SHCLEVENTID idEvent);
    209209int ShClEventWait(PSHCLEVENTSOURCE pSource, SHCLEVENTID idEvent, RTMSINTERVAL uTimeoutMs, PSHCLEVENTPAYLOAD *ppPayload);
  • trunk/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp

    r82527 r82534  
    443443 * @param   uID                 Event ID to signal.
    444444 * @param   pPayload            Event payload to associate. Takes ownership. Optional.
     445 *
     446 * @note    Caller must enter crit sect protecting the event source!
    445447 */
    446448int ShClEventSignal(PSHCLEVENTSOURCE pSource, SHCLEVENTID uID,
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp

    r82527 r82534  
    189189    if (pReq)
    190190    {
    191         const SHCLEVENTID uEvent = ShClEventIDGenerate(&pClient->EventSrc);
    192 
    193191        pReq->pv        = pData->pvData;
    194192        pReq->cb        = pData->cbData;
    195193        pReq->pcbActual = pcbActual;
    196         pReq->uEvent    = uEvent;
    197 
    198         rc = ShClEventRegister(&pClient->EventSrc, uEvent);
    199         if (RT_SUCCESS(rc))
     194        const SHCLEVENTID idEvent = ShClEventIdGenerateAndRegister(&pClient->EventSrc);
     195        pReq->uEvent    = idEvent;
     196        if (idEvent)
    200197        {
    201198            rc = ShClX11ReadDataFromX11(&pClient->State.pCtx->X11, pData->uFormat, pReq);
     
    203200            {
    204201                PSHCLEVENTPAYLOAD pPayload;
    205                 rc = ShClEventWait(&pClient->EventSrc, uEvent, 30 * 1000, &pPayload);
     202                rc = ShClEventWait(&pClient->EventSrc, idEvent, 30 * 1000, &pPayload);
    206203                if (RT_SUCCESS(rc))
    207204                {
     
    213210            }
    214211
    215             ShClEventUnregister(&pClient->EventSrc, uEvent);
     212            ShClEventUnregister(&pClient->EventSrc, idEvent);
     213        }
     214        else
     215        {
     216            RTMemFree(pReq);
     217            rc = VERR_GENERAL_FAILURE;
    216218        }
    217219    }
     
    295297        }
    296298
     299        RTCritSectEnter(&pCtx->pClient->CritSect);
    297300        rc2 = ShClEventSignal(&pCtx->pClient->EventSrc, pReq->uEvent, pPayload);
    298301        AssertRC(rc2);
     302        RTCritSectLeave(&pCtx->pClient->CritSect);
    299303    }
    300304
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp

    r82530 r82534  
    12361236    if (RT_SUCCESS(rc))
    12371237    {
     1238        RTCritSectEnter(&pClient->CritSect);
    12381239        rc = ShClEventSignal(&pClient->EventSrc, uEvent, pPayload);
     1240        RTCritSectLeave(&pClient->CritSect);
    12391241        if (RT_FAILURE(rc))
    12401242            ShClPayloadFree(pPayload);
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