Changeset 82875 in vbox
- Timestamp:
- Jan 27, 2020 1:31:54 PM (5 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp
r82874 r82875 196 196 * Generates a new event ID for a specific event source and registers it. 197 197 * 198 * @returns New event ID generated, or 0on error.198 * @returns New event ID generated, or NIL_SHCLEVENTID on error. 199 199 * @param pSource Event source to generate event for. 200 200 */ 201 201 SHCLEVENTID ShClEventIdGenerateAndRegister(PSHCLEVENTSOURCE pSource) 202 202 { 203 AssertPtrReturn(pSource, 0);203 AssertPtrReturn(pSource, NIL_SHCLEVENTID); 204 204 205 205 /* … … 207 207 */ 208 208 PSHCLEVENT pEvent = (PSHCLEVENT)RTMemAllocZ(sizeof(SHCLEVENT)); 209 AssertReturn(pEvent, 0);209 AssertReturn(pEvent, NIL_SHCLEVENTID); 210 210 int rc = RTSemEventMultiCreate(&pEvent->hEvtMulSem); 211 AssertRCReturnStmt(rc, RTMemFree(pEvent), 0);211 AssertRCReturnStmt(rc, RTMemFree(pEvent), NIL_SHCLEVENTID); 212 212 213 213 /* … … 237 237 238 238 RTMemFree(pEvent); 239 return 0;239 return NIL_SHCLEVENTID; 240 240 } 241 241 -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-transfers.cpp
r82852 r82875 126 126 { 127 127 SHCLEVENTID idEvent = ShClEventIdGenerateAndRegister(&pCtx->pTransfer->Events); 128 if (idEvent )128 if (idEvent != NIL_SHCLEVENTID) 129 129 { 130 130 HGCMSvcSetU64(&pMsgHdr->aParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, … … 163 163 164 164 idEvent = ShClEventIdGenerateAndRegister(&pCtx->pTransfer->Events); 165 if (idEvent )165 if (idEvent != NIL_SHCLEVENTID) 166 166 { 167 167 HGCMSvcSetU64(&pMsgEntry->aParms[0], … … 218 218 ShClEventUnregister(&pCtx->pTransfer->Events, idEvent); 219 219 } 220 else 221 rc = VERR_SHCLPB_MAX_EVENTS_REACHED; 220 222 } 221 223 else … … 241 243 { 242 244 const SHCLEVENTID idEvent = ShClEventIdGenerateAndRegister(&pCtx->pTransfer->Events); 243 if (idEvent )245 if (idEvent != NIL_SHCLEVENTID) 244 246 { 245 247 pMsg->idCtx = VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, pCtx->pTransfer->State.uID, … … 300 302 { 301 303 const SHCLEVENTID idEvent = ShClEventIdGenerateAndRegister(&pCtx->pTransfer->Events); 302 if (idEvent )304 if (idEvent != NIL_SHCLEVENTID) 303 305 { 304 306 pMsg->idCtx = VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, pCtx->pTransfer->State.uID, … … 347 349 { 348 350 const SHCLEVENTID idEvent = ShClEventIdGenerateAndRegister(&pCtx->pTransfer->Events); 349 if (idEvent )351 if (idEvent != NIL_SHCLEVENTID) 350 352 { 351 353 HGCMSvcSetU64(&pMsg->aParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, … … 409 411 { 410 412 const SHCLEVENTID idEvent = ShClEventIdGenerateAndRegister(&pCtx->pTransfer->Events); 411 if (idEvent )413 if (idEvent != NIL_SHCLEVENTID) 412 414 { 413 415 HGCMSvcSetU64(&pMsg->aParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, … … 470 472 { 471 473 const SHCLEVENTID idEvent = ShClEventIdGenerateAndRegister(&pCtx->pTransfer->Events); 472 if (idEvent )474 if (idEvent != NIL_SHCLEVENTID) 473 475 { 474 476 LogFlowFunc(("pszPath=%s, fCreate=0x%x\n", pCreateParms->pszPath, pCreateParms->fCreate)); … … 533 535 { 534 536 const SHCLEVENTID idEvent = ShClEventIdGenerateAndRegister(&pCtx->pTransfer->Events); 535 if (idEvent )537 if (idEvent != NIL_SHCLEVENTID) 536 538 { 537 539 HGCMSvcSetU64(&pMsg->aParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, … … 588 590 { 589 591 const SHCLEVENTID idEvent = ShClEventIdGenerateAndRegister(&pCtx->pTransfer->Events); 590 if (idEvent )592 if (idEvent != NIL_SHCLEVENTID) 591 593 { 592 594 HGCMSvcSetU64(&pMsg->aParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, … … 648 650 { 649 651 const SHCLEVENTID idEvent = ShClEventIdGenerateAndRegister(&pCtx->pTransfer->Events); 650 if (idEvent )652 if (idEvent != NIL_SHCLEVENTID) 651 653 { 652 654 HGCMSvcSetU64(&pMsg->aParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, … … 1994 1996 1995 1997 const SHCLEVENTID idEvent = ShClEventIdGenerateAndRegister(&pTransfer->Events); 1996 if (idEvent )1998 if (idEvent != NIL_SHCLEVENTID) 1997 1999 { 1998 2000 HGCMSvcSetU64(&pMsgReadData->aParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, … … 2021 2023 ShClEventUnregister(&pTransfer->Events, idEvent); 2022 2024 } 2025 else 2026 rc = VERR_SHCLPB_MAX_EVENTS_REACHED; 2023 2027 2024 2028 LogFlowFuncLeaveRC(rc); -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp
r82848 r82875 194 194 const SHCLEVENTID idEvent = ShClEventIdGenerateAndRegister(&pClient->EventSrc); 195 195 pReq->idEvent = idEvent; 196 if (idEvent )196 if (idEvent != NIL_SHCLEVENTID) 197 197 { 198 198 rc = ShClX11ReadDataFromX11(&pClient->State.pCtx->X11, pData->uFormat, pReq); … … 392 392 393 393 SHCLEVENTID idEvent = ShClEventIdGenerateAndRegister(&pClient->EventSrc); 394 if (idEvent )394 if (idEvent != NIL_SHCLEVENTID) 395 395 { 396 396 CLIPREADCBREQ *pReq = (CLIPREADCBREQ *)RTMemAllocZ(sizeof(CLIPREADCBREQ)); -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
r82873 r82875 1216 1216 1217 1217 const SHCLEVENTID idEvent = ShClEventIdGenerateAndRegister(&pClient->EventSrc); 1218 if (idEvent != 0)1218 if (idEvent != NIL_SHCLEVENTID) 1219 1219 { 1220 1220 LogFlowFunc(("fFormat=%#x idEvent=%#x\n", fFormat, idEvent));
Note:
See TracChangeset
for help on using the changeset viewer.