- Timestamp:
- Dec 10, 2019 10:41:32 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/GuestHost/SharedClipboard.h
r82527 r82534 205 205 SHCLEVENTID ShClEventIDGenerate(PSHCLEVENTSOURCE pSource); 206 206 SHCLEVENTID ShClEventGetLast(PSHCLEVENTSOURCE pSource); 207 int ShClEventRegister(PSHCLEVENTSOURCE pSource, SHCLEVENTID idEvent); 207 /*int ShClEventRegister(PSHCLEVENTSOURCE pSource, SHCLEVENTID idEvent);*/ 208 208 int ShClEventUnregister(PSHCLEVENTSOURCE pSource, SHCLEVENTID idEvent); 209 209 int ShClEventWait(PSHCLEVENTSOURCE pSource, SHCLEVENTID idEvent, RTMSINTERVAL uTimeoutMs, PSHCLEVENTPAYLOAD *ppPayload); -
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp
r82527 r82534 443 443 * @param uID Event ID to signal. 444 444 * @param pPayload Event payload to associate. Takes ownership. Optional. 445 * 446 * @note Caller must enter crit sect protecting the event source! 445 447 */ 446 448 int ShClEventSignal(PSHCLEVENTSOURCE pSource, SHCLEVENTID uID, -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp
r82527 r82534 189 189 if (pReq) 190 190 { 191 const SHCLEVENTID uEvent = ShClEventIDGenerate(&pClient->EventSrc);192 193 191 pReq->pv = pData->pvData; 194 192 pReq->cb = pData->cbData; 195 193 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) 200 197 { 201 198 rc = ShClX11ReadDataFromX11(&pClient->State.pCtx->X11, pData->uFormat, pReq); … … 203 200 { 204 201 PSHCLEVENTPAYLOAD pPayload; 205 rc = ShClEventWait(&pClient->EventSrc, uEvent, 30 * 1000, &pPayload);202 rc = ShClEventWait(&pClient->EventSrc, idEvent, 30 * 1000, &pPayload); 206 203 if (RT_SUCCESS(rc)) 207 204 { … … 213 210 } 214 211 215 ShClEventUnregister(&pClient->EventSrc, uEvent); 212 ShClEventUnregister(&pClient->EventSrc, idEvent); 213 } 214 else 215 { 216 RTMemFree(pReq); 217 rc = VERR_GENERAL_FAILURE; 216 218 } 217 219 } … … 295 297 } 296 298 299 RTCritSectEnter(&pCtx->pClient->CritSect); 297 300 rc2 = ShClEventSignal(&pCtx->pClient->EventSrc, pReq->uEvent, pPayload); 298 301 AssertRC(rc2); 302 RTCritSectLeave(&pCtx->pClient->CritSect); 299 303 } 300 304 -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
r82530 r82534 1236 1236 if (RT_SUCCESS(rc)) 1237 1237 { 1238 RTCritSectEnter(&pClient->CritSect); 1238 1239 rc = ShClEventSignal(&pClient->EventSrc, uEvent, pPayload); 1240 RTCritSectLeave(&pClient->CritSect); 1239 1241 if (RT_FAILURE(rc)) 1240 1242 ShClPayloadFree(pPayload);
Note:
See TracChangeset
for help on using the changeset viewer.