Changeset 82846 in vbox for trunk/src/VBox
- Timestamp:
- Jan 24, 2020 9:36:52 AM (5 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp
r82689 r82846 161 161 /* The IDataObject *must* be created on the same thread as our (proxy) window, so post a message to it 162 162 * to do the stuff for us. */ 163 const SHCLEVENTID uEvent = ShClEventIDGenerate(&pTransfer->Events);164 165 rc = ShClEventRegister(&pTransfer->Events, uEvent);163 const SHCLEVENTID idEvent = ShClEventIDGenerate(&pTransfer->Events); 164 165 rc = ShClEventRegister(&pTransfer->Events, idEvent); 166 166 if (RT_SUCCESS(rc)) 167 167 { 168 168 /* Don't want to rely on SendMessage (synchronous) here, so just post and wait the event getting signalled. */ 169 ::PostMessage(pCtx->Win.hWnd, SHCL_WIN_WM_TRANSFER_START, (WPARAM)pTransfer, (LPARAM) uEvent);169 ::PostMessage(pCtx->Win.hWnd, SHCL_WIN_WM_TRANSFER_START, (WPARAM)pTransfer, (LPARAM)idEvent); 170 170 171 171 PSHCLEVENTPAYLOAD pPayload; 172 rc = ShClEventWait(&pTransfer->Events, uEvent, 30 * 1000 /* Timeout in ms */, &pPayload);172 rc = ShClEventWait(&pTransfer->Events, idEvent, 30 * 1000 /* Timeout in ms */, &pPayload); 173 173 if (RT_SUCCESS(rc)) 174 174 { … … 179 179 } 180 180 181 ShClEventUnregister(&pTransfer->Events, uEvent);181 ShClEventUnregister(&pTransfer->Events, idEvent); 182 182 } 183 183 } … … 671 671 AssertPtr(pTransfer); 672 672 673 const SHCLEVENTID uEvent = (SHCLEVENTID)lParam;673 const SHCLEVENTID idEvent = (SHCLEVENTID)lParam; 674 674 675 675 Assert(ShClTransferGetSource(pTransfer) == SHCLSOURCE_REMOTE); /* Sanity. */ … … 678 678 679 679 PSHCLEVENTPAYLOAD pPayload = NULL; 680 int rc = ShClPayloadAlloc( uEvent, &rcTransfer, sizeof(rcTransfer), &pPayload);680 int rc = ShClPayloadAlloc(idEvent, &rcTransfer, sizeof(rcTransfer), &pPayload); 681 681 if (RT_SUCCESS(rc)) 682 682 { 683 rc = ShClEventSignal(&pTransfer->Events, uEvent, pPayload);683 rc = ShClEventSignal(&pTransfer->Events, idEvent, pPayload); 684 684 if (RT_FAILURE(rc)) 685 685 ShClPayloadFree(pPayload); -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-darwin.cpp
r82527 r82846 208 208 #endif 209 209 210 return ShClSvcDataReadRequest(pClient, pFormats->Formats, NULL /* p uEvent */);210 return ShClSvcDataReadRequest(pClient, pFormats->Formats, NULL /* pidEvent */); 211 211 } 212 212 -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-internal.h
r82527 r82846 251 251 * @{ 252 252 */ 253 int ShClSvcDataReadRequest(PSHCLCLIENT pClient, SHCLFORMAT fFormat, PSHCLEVENTID p uEvent);253 int ShClSvcDataReadRequest(PSHCLCLIENT pClient, SHCLFORMAT fFormat, PSHCLEVENTID pidEvent); 254 254 int ShClSvcDataReadSignal(PSHCLCLIENT pClient, PSHCLCLIENTCMDCTX pCmdCtx, PSHCLDATABLOCK pData); 255 255 int ShClSvcHostReportFormats(PSHCLCLIENT pClient, SHCLFORMATS fFormats); -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-transfers.cpp
r82527 r82846 125 125 if (pMsgHdr) 126 126 { 127 SHCLEVENTID uEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events);127 SHCLEVENTID idEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events); 128 128 129 129 HGCMSvcSetU64(&pMsgHdr->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 130 pCtx->pTransfer->State.uID, uEvent));130 pCtx->pTransfer->State.uID, idEvent)); 131 131 HGCMSvcSetU32(&pMsgHdr->paParms[1], 0 /* fRoots */); 132 132 … … 134 134 if (RT_SUCCESS(rc)) 135 135 { 136 int rc2 = ShClEventRegister(&pCtx->pTransfer->Events, uEvent);136 int rc2 = ShClEventRegister(&pCtx->pTransfer->Events, idEvent); 137 137 AssertRC(rc2); 138 138 … … 141 141 { 142 142 PSHCLEVENTPAYLOAD pPayloadHdr; 143 rc = ShClEventWait(&pCtx->pTransfer->Events, uEvent,143 rc = ShClEventWait(&pCtx->pTransfer->Events, idEvent, 144 144 pCtx->pTransfer->uTimeoutMs, &pPayloadHdr); 145 145 if (RT_SUCCESS(rc)) … … 165 165 VBOX_SHCL_CPARMS_ROOT_LIST_ENTRY_READ_REQ); 166 166 167 uEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events);167 idEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events); 168 168 169 169 HGCMSvcSetU64(&pMsgEntry->paParms[0], 170 170 VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uClientID, 171 pCtx->pTransfer->State.uID, uEvent));171 pCtx->pTransfer->State.uID, idEvent)); 172 172 HGCMSvcSetU32(&pMsgEntry->paParms[1], 0 /* fRoots */); 173 173 HGCMSvcSetU32(&pMsgEntry->paParms[2], i /* uIndex */); 174 174 175 rc2 = ShClEventRegister(&pCtx->pTransfer->Events, uEvent);175 rc2 = ShClEventRegister(&pCtx->pTransfer->Events, idEvent); 176 176 AssertRC(rc2); 177 177 … … 181 181 182 182 PSHCLEVENTPAYLOAD pPayloadEntry; 183 rc = ShClEventWait(&pCtx->pTransfer->Events, uEvent,183 rc = ShClEventWait(&pCtx->pTransfer->Events, idEvent, 184 184 pCtx->pTransfer->uTimeoutMs, &pPayloadEntry); 185 185 if (RT_FAILURE(rc)) … … 193 193 ShClPayloadFree(pPayloadEntry); 194 194 195 ShClEventUnregister(&pCtx->pTransfer->Events, uEvent);195 ShClEventUnregister(&pCtx->pTransfer->Events, idEvent); 196 196 197 197 if (RT_FAILURE(rc)) … … 220 220 } 221 221 222 ShClEventUnregister(&pCtx->pTransfer->Events, uEvent);222 ShClEventUnregister(&pCtx->pTransfer->Events, idEvent); 223 223 } 224 224 } … … 244 244 if (pMsg) 245 245 { 246 const SHCLEVENTID uEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events);246 const SHCLEVENTID idEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events); 247 247 248 248 pMsg->Ctx.uContextID = VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, pCtx->pTransfer->State.uID, 249 uEvent);249 idEvent); 250 250 251 251 rc = shClSvcTransferSetListOpen(pMsg->cParms, pMsg->paParms, &pMsg->Ctx, pOpenParms); … … 255 255 if (RT_SUCCESS(rc)) 256 256 { 257 int rc2 = ShClEventRegister(&pCtx->pTransfer->Events, uEvent);257 int rc2 = ShClEventRegister(&pCtx->pTransfer->Events, idEvent); 258 258 AssertRC(rc2); 259 259 … … 262 262 { 263 263 PSHCLEVENTPAYLOAD pPayload; 264 rc = ShClEventWait(&pCtx->pTransfer->Events, uEvent, pCtx->pTransfer->uTimeoutMs, &pPayload);264 rc = ShClEventWait(&pCtx->pTransfer->Events, idEvent, pCtx->pTransfer->uTimeoutMs, &pPayload); 265 265 if (RT_SUCCESS(rc)) 266 266 { … … 280 280 } 281 281 282 ShClEventUnregister(&pCtx->pTransfer->Events, uEvent);282 ShClEventUnregister(&pCtx->pTransfer->Events, idEvent); 283 283 } 284 284 } … … 304 304 if (pMsg) 305 305 { 306 const SHCLEVENTID uEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events);306 const SHCLEVENTID idEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events); 307 307 308 308 pMsg->Ctx.uContextID = VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, pCtx->pTransfer->State.uID, 309 uEvent);309 idEvent); 310 310 311 311 rc = shClSvcTransferSetListClose(pMsg->cParms, pMsg->paParms, &pMsg->Ctx, hList); … … 315 315 if (RT_SUCCESS(rc)) 316 316 { 317 int rc2 = ShClEventRegister(&pCtx->pTransfer->Events, uEvent);317 int rc2 = ShClEventRegister(&pCtx->pTransfer->Events, idEvent); 318 318 AssertRC(rc2); 319 319 … … 322 322 { 323 323 PSHCLEVENTPAYLOAD pPayload; 324 rc = ShClEventWait(&pCtx->pTransfer->Events, uEvent, pCtx->pTransfer->uTimeoutMs, &pPayload);324 rc = ShClEventWait(&pCtx->pTransfer->Events, idEvent, pCtx->pTransfer->uTimeoutMs, &pPayload); 325 325 if (RT_SUCCESS(rc)) 326 326 ShClPayloadFree(pPayload); 327 327 } 328 328 329 ShClEventUnregister(&pCtx->pTransfer->Events, uEvent);329 ShClEventUnregister(&pCtx->pTransfer->Events, idEvent); 330 330 } 331 331 } … … 352 352 if (pMsg) 353 353 { 354 const SHCLEVENTID uEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events);354 const SHCLEVENTID idEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events); 355 355 356 356 HGCMSvcSetU64(&pMsg->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 357 pCtx->pTransfer->State.uID, uEvent));357 pCtx->pTransfer->State.uID, idEvent)); 358 358 HGCMSvcSetU64(&pMsg->paParms[1], hList); 359 359 HGCMSvcSetU32(&pMsg->paParms[2], 0 /* fFlags */); … … 362 362 if (RT_SUCCESS(rc)) 363 363 { 364 int rc2 = ShClEventRegister(&pCtx->pTransfer->Events, uEvent);364 int rc2 = ShClEventRegister(&pCtx->pTransfer->Events, idEvent); 365 365 AssertRC(rc2); 366 366 … … 369 369 { 370 370 PSHCLEVENTPAYLOAD pPayload; 371 rc = ShClEventWait(&pCtx->pTransfer->Events, uEvent,371 rc = ShClEventWait(&pCtx->pTransfer->Events, idEvent, 372 372 pCtx->pTransfer->uTimeoutMs, &pPayload); 373 373 if (RT_SUCCESS(rc)) … … 413 413 if (pMsg) 414 414 { 415 const SHCLEVENTID uEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events);415 const SHCLEVENTID idEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events); 416 416 417 417 HGCMSvcSetU64(&pMsg->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 418 pCtx->pTransfer->State.uID, uEvent));418 pCtx->pTransfer->State.uID, idEvent)); 419 419 HGCMSvcSetU64(&pMsg->paParms[1], hList); 420 420 HGCMSvcSetU32(&pMsg->paParms[2], 0 /* fInfo */); … … 423 423 if (RT_SUCCESS(rc)) 424 424 { 425 int rc2 = ShClEventRegister(&pCtx->pTransfer->Events, uEvent);425 int rc2 = ShClEventRegister(&pCtx->pTransfer->Events, idEvent); 426 426 AssertRC(rc2); 427 427 … … 430 430 { 431 431 PSHCLEVENTPAYLOAD pPayload; 432 rc = ShClEventWait(&pCtx->pTransfer->Events, uEvent, pCtx->pTransfer->uTimeoutMs, &pPayload);432 rc = ShClEventWait(&pCtx->pTransfer->Events, idEvent, pCtx->pTransfer->uTimeoutMs, &pPayload); 433 433 if (RT_SUCCESS(rc)) 434 434 { … … 473 473 if (pMsg) 474 474 { 475 const SHCLEVENTID uEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events);475 const SHCLEVENTID idEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events); 476 476 477 477 LogFlowFunc(("pszPath=%s, fCreate=0x%x\n", pCreateParms->pszPath, pCreateParms->fCreate)); … … 480 480 481 481 HGCMSvcSetU64(&pMsg->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 482 pCtx->pTransfer->State.uID, uEvent));482 pCtx->pTransfer->State.uID, idEvent)); 483 483 HGCMSvcSetU64(&pMsg->paParms[1], 0); /* uHandle */ 484 484 HGCMSvcSetU32(&pMsg->paParms[2], cbPath); … … 489 489 if (RT_SUCCESS(rc)) 490 490 { 491 int rc2 = ShClEventRegister(&pCtx->pTransfer->Events, uEvent);491 int rc2 = ShClEventRegister(&pCtx->pTransfer->Events, idEvent); 492 492 AssertRC(rc2); 493 493 … … 496 496 { 497 497 PSHCLEVENTPAYLOAD pPayload; 498 rc = ShClEventWait(&pCtx->pTransfer->Events, uEvent, pCtx->pTransfer->uTimeoutMs, &pPayload);498 rc = ShClEventWait(&pCtx->pTransfer->Events, idEvent, pCtx->pTransfer->uTimeoutMs, &pPayload); 499 499 if (RT_SUCCESS(rc)) 500 500 { … … 535 535 if (pMsg) 536 536 { 537 const SHCLEVENTID uEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events);537 const SHCLEVENTID idEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events); 538 538 539 539 HGCMSvcSetU64(&pMsg->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 540 pCtx->pTransfer->State.uID, uEvent));540 pCtx->pTransfer->State.uID, idEvent)); 541 541 HGCMSvcSetU64(&pMsg->paParms[1], hObj); 542 542 … … 544 544 if (RT_SUCCESS(rc)) 545 545 { 546 int rc2 = ShClEventRegister(&pCtx->pTransfer->Events, uEvent);546 int rc2 = ShClEventRegister(&pCtx->pTransfer->Events, idEvent); 547 547 AssertRC(rc2); 548 548 … … 551 551 { 552 552 PSHCLEVENTPAYLOAD pPayload; 553 rc = ShClEventWait(&pCtx->pTransfer->Events, uEvent, pCtx->pTransfer->uTimeoutMs, &pPayload);553 rc = ShClEventWait(&pCtx->pTransfer->Events, idEvent, pCtx->pTransfer->uTimeoutMs, &pPayload); 554 554 if (RT_SUCCESS(rc)) 555 555 { … … 591 591 if (pMsg) 592 592 { 593 const SHCLEVENTID uEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events);593 const SHCLEVENTID idEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events); 594 594 595 595 HGCMSvcSetU64(&pMsg->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 596 pCtx->pTransfer->State.uID, uEvent));596 pCtx->pTransfer->State.uID, idEvent)); 597 597 HGCMSvcSetU64(&pMsg->paParms[1], hObj); 598 598 HGCMSvcSetU32(&pMsg->paParms[2], cbData); … … 602 602 if (RT_SUCCESS(rc)) 603 603 { 604 int rc2 = ShClEventRegister(&pCtx->pTransfer->Events, uEvent);604 int rc2 = ShClEventRegister(&pCtx->pTransfer->Events, idEvent); 605 605 AssertRC(rc2); 606 606 … … 609 609 { 610 610 PSHCLEVENTPAYLOAD pPayload; 611 rc = ShClEventWait(&pCtx->pTransfer->Events, uEvent, pCtx->pTransfer->uTimeoutMs, &pPayload);611 rc = ShClEventWait(&pCtx->pTransfer->Events, idEvent, pCtx->pTransfer->uTimeoutMs, &pPayload); 612 612 if (RT_SUCCESS(rc)) 613 613 { … … 650 650 if (pMsg) 651 651 { 652 const SHCLEVENTID uEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events);652 const SHCLEVENTID idEvent = ShClEventIDGenerate(&pCtx->pTransfer->Events); 653 653 654 654 HGCMSvcSetU64(&pMsg->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 655 pCtx->pTransfer->State.uID, uEvent));655 pCtx->pTransfer->State.uID, idEvent)); 656 656 HGCMSvcSetU64(&pMsg->paParms[1], hObj); 657 657 HGCMSvcSetU64(&pMsg->paParms[2], cbData); … … 661 661 if (RT_SUCCESS(rc)) 662 662 { 663 int rc2 = ShClEventRegister(&pCtx->pTransfer->Events, uEvent);663 int rc2 = ShClEventRegister(&pCtx->pTransfer->Events, idEvent); 664 664 AssertRC(rc2); 665 665 … … 668 668 { 669 669 PSHCLEVENTPAYLOAD pPayload; 670 rc = ShClEventWait(&pCtx->pTransfer->Events, uEvent, pCtx->pTransfer->uTimeoutMs, &pPayload);670 rc = ShClEventWait(&pCtx->pTransfer->Events, idEvent, pCtx->pTransfer->uTimeoutMs, &pPayload); 671 671 if (RT_SUCCESS(rc)) 672 672 { … … 1262 1262 if (RT_SUCCESS(rc)) 1263 1263 { 1264 const SHCLEVENTID uEvent = VBOX_SHCL_CONTEXTID_GET_EVENT(uCID);1265 1266 LogFlowFunc(("uCID=%RU64 -> uEvent=%RU32\n", uCID, uEvent));1267 1268 rc = ShClEventSignal(&pTransfer->Events, uEvent, pPayload);1264 const SHCLEVENTID idEvent = VBOX_SHCL_CONTEXTID_GET_EVENT(uCID); 1265 1266 LogFlowFunc(("uCID=%RU64 -> idEvent=%RU32\n", uCID, idEvent)); 1267 1268 rc = ShClEventSignal(&pTransfer->Events, idEvent, pPayload); 1269 1269 } 1270 1270 break; … … 1430 1430 uint32_t cbData = sizeof(SHCLROOTLISTHDR); 1431 1431 1432 const SHCLEVENTID uEvent = VBOX_SHCL_CONTEXTID_GET_EVENT(uCID);1432 const SHCLEVENTID idEvent = VBOX_SHCL_CONTEXTID_GET_EVENT(uCID); 1433 1433 1434 1434 PSHCLEVENTPAYLOAD pPayload; 1435 rc = ShClPayloadAlloc( uEvent, pvData, cbData, &pPayload);1435 rc = ShClPayloadAlloc(idEvent, pvData, cbData, &pPayload); 1436 1436 if (RT_SUCCESS(rc)) 1437 1437 { 1438 rc = ShClEventSignal(&pTransfer->Events, uEvent, pPayload);1438 rc = ShClEventSignal(&pTransfer->Events, idEvent, pPayload); 1439 1439 if (RT_FAILURE(rc)) 1440 1440 ShClPayloadFree(pPayload); … … 1475 1475 uint32_t cbData = sizeof(SHCLROOTLISTENTRY); 1476 1476 1477 const SHCLEVENTID uEvent = VBOX_SHCL_CONTEXTID_GET_EVENT(uCID);1477 const SHCLEVENTID idEvent = VBOX_SHCL_CONTEXTID_GET_EVENT(uCID); 1478 1478 1479 1479 PSHCLEVENTPAYLOAD pPayload; 1480 rc = ShClPayloadAlloc( uEvent, pvData, cbData, &pPayload);1480 rc = ShClPayloadAlloc(idEvent, pvData, cbData, &pPayload); 1481 1481 if (RT_SUCCESS(rc)) 1482 1482 { 1483 rc = ShClEventSignal(&pTransfer->Events, uEvent, pPayload);1483 rc = ShClEventSignal(&pTransfer->Events, idEvent, pPayload); 1484 1484 if (RT_FAILURE(rc)) 1485 1485 ShClPayloadFree(pPayload); … … 1550 1550 uint32_t cbData = sizeof(SHCLLISTHDR); 1551 1551 1552 const SHCLEVENTID uEvent = VBOX_SHCL_CONTEXTID_GET_EVENT(uCID);1552 const SHCLEVENTID idEvent = VBOX_SHCL_CONTEXTID_GET_EVENT(uCID); 1553 1553 1554 1554 PSHCLEVENTPAYLOAD pPayload; 1555 rc = ShClPayloadAlloc( uEvent, pvData, cbData, &pPayload);1555 rc = ShClPayloadAlloc(idEvent, pvData, cbData, &pPayload); 1556 1556 if (RT_SUCCESS(rc)) 1557 1557 { 1558 rc = ShClEventSignal(&pTransfer->Events, uEvent, pPayload);1558 rc = ShClEventSignal(&pTransfer->Events, idEvent, pPayload); 1559 1559 if (RT_FAILURE(rc)) 1560 1560 ShClPayloadFree(pPayload); … … 1599 1599 uint32_t cbData = sizeof(SHCLLISTENTRY); 1600 1600 1601 const SHCLEVENTID uEvent = VBOX_SHCL_CONTEXTID_GET_EVENT(uCID);1601 const SHCLEVENTID idEvent = VBOX_SHCL_CONTEXTID_GET_EVENT(uCID); 1602 1602 1603 1603 PSHCLEVENTPAYLOAD pPayload; 1604 rc = ShClPayloadAlloc( uEvent, pvData, cbData, &pPayload);1604 rc = ShClPayloadAlloc(idEvent, pvData, cbData, &pPayload); 1605 1605 if (RT_SUCCESS(rc)) 1606 1606 { 1607 rc = ShClEventSignal(&pTransfer->Events, uEvent, pPayload);1607 rc = ShClEventSignal(&pTransfer->Events, idEvent, pPayload); 1608 1608 if (RT_FAILURE(rc)) 1609 1609 ShClPayloadFree(pPayload); … … 1711 1711 uint32_t cbData = sizeof(SHCLOBJDATACHUNK); 1712 1712 1713 const SHCLEVENTID uEvent = VBOX_SHCL_CONTEXTID_GET_EVENT(uCID);1713 const SHCLEVENTID idEvent = VBOX_SHCL_CONTEXTID_GET_EVENT(uCID); 1714 1714 1715 1715 PSHCLEVENTPAYLOAD pPayload; 1716 rc = ShClPayloadAlloc( uEvent, pvData, cbData, &pPayload);1716 rc = ShClPayloadAlloc(idEvent, pvData, cbData, &pPayload); 1717 1717 if (RT_SUCCESS(rc)) 1718 1718 { 1719 rc = ShClEventSignal(&pTransfer->Events, uEvent, pPayload);1719 rc = ShClEventSignal(&pTransfer->Events, idEvent, pPayload); 1720 1720 if (RT_FAILURE(rc)) 1721 1721 ShClPayloadFree(pPayload); … … 1977 1977 * @param uStatus Status to report. 1978 1978 * @param rcTransfer Result code to report. Optional and depending on status. 1979 * @param p uEvent Where to store the created wait event. Optional.1979 * @param pidEvent Where to store the created wait event. Optional. 1980 1980 */ 1981 1981 int shClSvcTransferSendStatus(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer, SHCLTRANSFERSTATUS uStatus, 1982 int rcTransfer, PSHCLEVENTID p uEvent)1982 int rcTransfer, PSHCLEVENTID pidEvent) 1983 1983 { 1984 1984 AssertPtrReturn(pClient, VERR_INVALID_POINTER); 1985 1985 AssertPtrReturn(pTransfer, VERR_INVALID_POINTER); 1986 /* p uEvent is optional. */1986 /* pidEvent is optional. */ 1987 1987 1988 1988 PSHCLCLIENTMSG pMsgReadData = shClSvcMsgAlloc(pClient, VBOX_SHCL_HOST_MSG_TRANSFER_STATUS, … … 1991 1991 return VERR_NO_MEMORY; 1992 1992 1993 const SHCLEVENTID uEvent = ShClEventIDGenerate(&pTransfer->Events);1993 const SHCLEVENTID idEvent = ShClEventIDGenerate(&pTransfer->Events); 1994 1994 1995 1995 HGCMSvcSetU64(&pMsgReadData->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID, 1996 pTransfer->State.uID, uEvent));1996 pTransfer->State.uID, idEvent)); 1997 1997 HGCMSvcSetU32(&pMsgReadData->paParms[1], pTransfer->State.enmDir); 1998 1998 HGCMSvcSetU32(&pMsgReadData->paParms[2], uStatus); … … 2003 2003 if (RT_SUCCESS(rc)) 2004 2004 { 2005 rc = ShClEventRegister(&pTransfer->Events, uEvent);2005 rc = ShClEventRegister(&pTransfer->Events, idEvent); 2006 2006 if (RT_SUCCESS(rc)) 2007 2007 { … … 2012 2012 ShClTransferStatusToStr(uStatus), rcTransfer, pTransfer->State.uID)); 2013 2013 2014 if (p uEvent)2015 *p uEvent = uEvent;2014 if (pidEvent) 2015 *pidEvent = idEvent; 2016 2016 } 2017 2017 else 2018 ShClEventUnregister(&pTransfer->Events, uEvent);2018 ShClEventUnregister(&pTransfer->Events, idEvent); 2019 2019 } 2020 2020 } … … 2108 2108 if (RT_SUCCESS(rc)) 2109 2109 { 2110 SHCLEVENTID uEvent;2110 SHCLEVENTID idEvent; 2111 2111 rc = shClSvcTransferSendStatus(pClient, pTransfer, 2112 2112 SHCLTRANSFERSTATUS_INITIALIZED, VINF_SUCCESS, 2113 & uEvent);2113 &idEvent); 2114 2114 if (RT_SUCCESS(rc)) 2115 2115 { … … 2118 2118 2119 2119 PSHCLEVENTPAYLOAD pPayload; 2120 rc = ShClEventWait(&pTransfer->Events, uEvent, pTransfer->uTimeoutMs, &pPayload);2120 rc = ShClEventWait(&pTransfer->Events, idEvent, pTransfer->uTimeoutMs, &pPayload); 2121 2121 if (RT_SUCCESS(rc)) 2122 2122 { … … 2183 2183 int shClSvcTransferStop(PSHCLCLIENT pClient, PSHCLTRANSFER pTransfer) 2184 2184 { 2185 SHCLEVENTID uEvent;2185 SHCLEVENTID idEvent; 2186 2186 int rc = shClSvcTransferSendStatus(pClient, pTransfer, 2187 2187 SHCLTRANSFERSTATUS_STOPPED, VINF_SUCCESS, 2188 & uEvent);2188 &idEvent); 2189 2189 if (RT_SUCCESS(rc)) 2190 2190 { 2191 2191 LogRel2(("Shared Clipboard: Waiting for stop of transfer %RU32 on guest ...\n", pTransfer->State.uID)); 2192 2192 2193 rc = ShClEventWait(&pTransfer->Events, uEvent, pTransfer->uTimeoutMs, NULL);2193 rc = ShClEventWait(&pTransfer->Events, idEvent, pTransfer->uTimeoutMs, NULL); 2194 2194 if (RT_SUCCESS(rc)) 2195 2195 LogRel2(("Shared Clipboard: Stopped transfer %RU32 on guest\n", pTransfer->State.uID)); -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp
r82628 r82846 178 178 } 179 179 180 SHCLEVENTID uEvent = 0;181 int rc = ShClSvcDataReadRequest(pCtx->pClient, fFormat, & uEvent);180 SHCLEVENTID idEvent = 0; 181 int rc = ShClSvcDataReadRequest(pCtx->pClient, fFormat, &idEvent); 182 182 if (RT_SUCCESS(rc)) 183 183 { 184 184 PSHCLEVENTPAYLOAD pPayload; 185 rc = ShClEventWait(&pCtx->pClient->EventSrc, uEvent, 30 * 1000, &pPayload);185 rc = ShClEventWait(&pCtx->pClient->EventSrc, idEvent, 30 * 1000, &pPayload); 186 186 if (RT_SUCCESS(rc)) 187 187 { … … 190 190 191 191 /* Detach the payload, as the caller then will own the data. */ 192 ShClEventPayloadDetach(&pCtx->pClient->EventSrc, uEvent);192 ShClEventPayloadDetach(&pCtx->pClient->EventSrc, idEvent); 193 193 /** 194 194 * @todo r=bird: The payload has already been detached, … … 198 198 } 199 199 200 ShClEventUnregister(&pCtx->pClient->EventSrc, uEvent);200 ShClEventUnregister(&pCtx->pClient->EventSrc, idEvent); 201 201 } 202 202 -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp
r82628 r82846 167 167 uint32_t *pcbActual; 168 168 /** The request's event ID. */ 169 SHCLEVENTID uEvent;169 SHCLEVENTID idEvent; 170 170 }; 171 171 … … 193 193 pReq->pcbActual = pcbActual; 194 194 const SHCLEVENTID idEvent = ShClEventIdGenerateAndRegister(&pClient->EventSrc); 195 pReq-> uEvent = idEvent;195 pReq->idEvent = idEvent; 196 196 if (idEvent) 197 197 { … … 283 283 RT_NOREF(rcCompletion); 284 284 285 LogFlowFunc(("rcCompletion=%Rrc, pReq=%p, pv=%p, cb=%RU32, uEvent=%RU32\n", rcCompletion, pReq, pv, cb, pReq->uEvent));285 LogFlowFunc(("rcCompletion=%Rrc, pReq=%p, pv=%p, cb=%RU32, idEvent=%RU32\n", rcCompletion, pReq, pv, cb, pReq->idEvent)); 286 286 287 287 AssertMsgRC(rcCompletion, ("Clipboard data completion from X11 failed with %Rrc\n", rcCompletion)); 288 288 289 if (pReq-> uEvent != NIL_SHCLEVENTID)289 if (pReq->idEvent != NIL_SHCLEVENTID) 290 290 { 291 291 int rc2; … … 294 294 if (pv && cb) 295 295 { 296 rc2 = ShClPayloadAlloc(pReq-> uEvent, pv, cb, &pPayload);296 rc2 = ShClPayloadAlloc(pReq->idEvent, pv, cb, &pPayload); 297 297 AssertRC(rc2); 298 298 } 299 299 300 300 RTCritSectEnter(&pCtx->pClient->CritSect); 301 rc2 = ShClEventSignal(&pCtx->pClient->EventSrc, pReq-> uEvent, pPayload);301 rc2 = ShClEventSignal(&pCtx->pClient->EventSrc, pReq->idEvent, pPayload); 302 302 AssertRC(rc2); 303 303 RTCritSectLeave(&pCtx->pClient->CritSect); … … 340 340 { 341 341 /* Request data from the guest. */ 342 SHCLEVENTID uEvent;343 rc = ShClSvcDataReadRequest(pCtx->pClient, fFormat, & uEvent);342 SHCLEVENTID idEvent; 343 rc = ShClSvcDataReadRequest(pCtx->pClient, fFormat, &idEvent); 344 344 if (RT_SUCCESS(rc)) 345 345 { 346 346 PSHCLEVENTPAYLOAD pPayload; 347 rc = ShClEventWait(&pCtx->pClient->EventSrc, uEvent, 30 * 1000, &pPayload);347 rc = ShClEventWait(&pCtx->pClient->EventSrc, idEvent, 30 * 1000, &pPayload); 348 348 if (RT_SUCCESS(rc)) 349 349 { … … 352 352 353 353 /* Detach the payload, as the caller then will own the data. */ 354 ShClEventPayloadDetach(&pCtx->pClient->EventSrc, uEvent);354 ShClEventPayloadDetach(&pCtx->pClient->EventSrc, idEvent); 355 355 } 356 356 357 ShClEventUnregister(&pCtx->pClient->EventSrc, uEvent);357 ShClEventUnregister(&pCtx->pClient->EventSrc, idEvent); 358 358 } 359 359 } … … 389 389 LogFlowFuncEnter(); 390 390 391 SHCLEVENTID uEvent = ShClEventIDGenerate(&pClient->EventSrc);392 393 int rc = ShClEventRegister(&pClient->EventSrc, uEvent);391 SHCLEVENTID idEvent = ShClEventIDGenerate(&pClient->EventSrc); 392 393 int rc = ShClEventRegister(&pClient->EventSrc, idEvent); 394 394 if (RT_SUCCESS(rc)) 395 395 { … … 397 397 if (pReq) 398 398 { 399 pReq-> uEvent = uEvent;399 pReq->idEvent = idEvent; 400 400 401 401 rc = ShClX11ReadDataFromX11(&pClient->State.pCtx->X11, VBOX_SHCL_FMT_URI_LIST, pReq); … … 404 404 /* X supplies the data asynchronously, so we need to wait for data to arrive first. */ 405 405 PSHCLEVENTPAYLOAD pPayload; 406 rc = ShClEventWait(&pClient->EventSrc, uEvent, 30 * 1000, &pPayload);406 rc = ShClEventWait(&pClient->EventSrc, idEvent, 30 * 1000, &pPayload); 407 407 if (RT_SUCCESS(rc)) 408 408 { … … 413 413 } 414 414 415 ShClEventUnregister(&pClient->EventSrc, uEvent);415 ShClEventUnregister(&pClient->EventSrc, idEvent); 416 416 } 417 417 -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
r82540 r82846 1218 1218 LogFlowFuncEnter(); 1219 1219 1220 SHCLEVENTID uEvent;1220 SHCLEVENTID idEvent; 1221 1221 if (!(pClient->State.fGuestFeatures0 & VBOX_SHCL_GF_0_CONTEXT_ID)) /* Legacy, Guest Additions < 6.1. */ 1222 1222 { 1223 1223 /* Older Guest Additions (<= VBox 6.0) did not have any context ID handling, so we ASSUME that the last event registered 1224 1224 * is the one we want to handle (as this all was a synchronous protocol anyway). */ 1225 uEvent = ShClEventGetLast(&pClient->EventSrc);1225 idEvent = ShClEventGetLast(&pClient->EventSrc); 1226 1226 } 1227 1227 else 1228 uEvent = VBOX_SHCL_CONTEXTID_GET_EVENT(pCmdCtx->uContextID);1228 idEvent = VBOX_SHCL_CONTEXTID_GET_EVENT(pCmdCtx->uContextID); 1229 1229 1230 1230 int rc = VINF_SUCCESS; … … 1232 1232 PSHCLEVENTPAYLOAD pPayload = NULL; 1233 1233 if (pData->cbData) 1234 rc = ShClPayloadAlloc( uEvent, pData->pvData, pData->cbData, &pPayload);1234 rc = ShClPayloadAlloc(idEvent, pData->pvData, pData->cbData, &pPayload); 1235 1235 1236 1236 if (RT_SUCCESS(rc)) 1237 1237 { 1238 1238 RTCritSectEnter(&pClient->CritSect); 1239 rc = ShClEventSignal(&pClient->EventSrc, uEvent, pPayload);1239 rc = ShClEventSignal(&pClient->EventSrc, idEvent, pPayload); 1240 1240 RTCritSectLeave(&pClient->CritSect); 1241 1241 if (RT_FAILURE(rc)) … … 2392 2392 /* The service extension wants read data from the guest. */ 2393 2393 case VBOX_CLIPBOARD_EXT_FN_DATA_READ: 2394 rc = ShClSvcDataReadRequest(pClient, u32Format, NULL /* p uEvent */);2394 rc = ShClSvcDataReadRequest(pClient, u32Format, NULL /* pidEvent */); 2395 2395 break; 2396 2396 -
trunk/src/VBox/HostServices/SharedClipboard/testcase/tstClipboardServiceHost.cpp
r82527 r82846 130 130 static void testMsgAddReadData(PSHCLCLIENT pClient, uint32_t fFormat) 131 131 { 132 int rc = ShClSvcDataReadRequest(pClient, fFormat, NULL /* p uEvent */);132 int rc = ShClSvcDataReadRequest(pClient, fFormat, NULL /* pidEvent */); 133 133 RTTESTI_CHECK_RC_OK(rc); 134 134 }
Note:
See TracChangeset
for help on using the changeset viewer.