Changeset 80283 in vbox for trunk/src/VBox/Additions/WINNT/VBoxTray
- Timestamp:
- Aug 15, 2019 8:47:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp
r79702 r80283 59 59 /** Pointer to the VBoxClient service environment. */ 60 60 const VBOXSERVICEENV *pEnv; 61 /** C lient ID the service is connected to the HGCM service with. */62 uint32_t u32ClientID;61 /** Command context. */ 62 VBGLR3SHCLCMDCTX CmdCtx; 63 63 /** Windows-specific context data. */ 64 64 VBOXCLIPBOARDWINCTX Win; … … 119 119 RTThreadUserSignal(RTThreadSelf()); 120 120 121 uint32_t uClientID; 122 int rc = VbglR3ClipboardConnect(&uClientID); 121 VBGLR3SHCLCMDCTX cmdCtx; 122 RT_ZERO(cmdCtx); 123 124 int rc = VbglR3ClipboardConnect(&cmdCtx.uClientID); 123 125 if (RT_SUCCESS(rc)) 124 126 { 125 rc = VbglR3ClipboardTransferSendStatus( uClientID, SHAREDCLIPBOARDURITRANSFERSTATUS_RUNNING);127 rc = VbglR3ClipboardTransferSendStatus(&cmdCtx, SHAREDCLIPBOARDURITRANSFERSTATUS_RUNNING); 126 128 if (RT_SUCCESS(rc)) 127 129 { … … 132 134 { 133 135 PVBGLR3CLIPBOARDEVENT pEvent = NULL; 134 rc = VbglR3ClipboardEventGetNext( uClientID, pTransfer, &pEvent);136 rc = VbglR3ClipboardEventGetNext(&cmdCtx, pTransfer, &pEvent); 135 137 if (RT_SUCCESS(rc)) 136 138 { … … 152 154 } 153 155 154 VbglR3ClipboardDisconnect( uClientID);156 VbglR3ClipboardDisconnect(cmdCtx.uClientID); 155 157 } 156 158 … … 235 237 AssertPtr(pThisCtx); 236 238 239 RT_NOREF(pThisCtx); 240 237 241 int rc = 0; // VbglR3ClipboardRecvListOpen(pThisCtx->u32ClientID, pListHdr, phList); 238 242 … … 251 255 AssertPtr(pThisCtx); 252 256 253 LogFlowFunc(("c=%RU32\n", pThisCtx->u32ClientID));257 RT_NOREF(pThisCtx); 254 258 255 259 int rc = SharedClipboardURIListHdrInit(pListHdr); … … 293 297 AssertPtr(pThisCtx); 294 298 299 RT_NOREF(pThisCtx); 300 295 301 RT_NOREF(pListEntry); 296 302 int rc = 0; // VbglR3ClipboardListEntryRead(pThisCtx->u32ClientID, pListEntry); … … 316 322 */ 317 323 318 static int vboxClipboardURIObjOpen(PSHAREDCLIPBOARDPROVIDERCTX pCtx, const char *pszPath,319 PVBOXCLIPBOARD CREATEPARMS pCreateParms, PSHAREDCLIPBOARDOBJHANDLE phObj)324 static int vboxClipboardURIObjOpen(PSHAREDCLIPBOARDPROVIDERCTX pCtx, 325 PVBOXCLIPBOARDOBJOPENCREATEPARMS pCreateParms, PSHAREDCLIPBOARDOBJHANDLE phObj) 320 326 { 321 327 LogFlowFuncEnter(); … … 324 330 AssertPtr(pThisCtx); 325 331 326 int rc = VbglR3ClipboardObjOpen (pThisCtx->u32ClientID, pszPath, pCreateParms, phObj);332 int rc = VbglR3ClipboardObjOpenSend(&pThisCtx->CmdCtx, pCreateParms, phObj); 327 333 328 334 LogFlowFuncLeaveRC(rc); … … 337 343 AssertPtr(pThisCtx); 338 344 339 int rc = VbglR3ClipboardObjClose (pThisCtx->u32ClientID, hObj);345 int rc = VbglR3ClipboardObjCloseSend(&pThisCtx->CmdCtx, hObj); 340 346 341 347 LogFlowFuncLeaveRC(rc); … … 353 359 AssertPtr(pThisCtx); 354 360 355 int rc = VbglR3ClipboardObjRead (pThisCtx->u32ClientID, hObj, pvData, cbData, pcbRead);361 int rc = VbglR3ClipboardObjReadSend(&pThisCtx->CmdCtx, hObj, pvData, cbData, pcbRead); 356 362 357 363 LogFlowFuncLeaveRC(rc); … … 369 375 AssertPtr(pThisCtx); 370 376 371 int rc = VbglR3ClipboardObjWrite (pThisCtx->u32ClientID, hObj, pvData, cbData, pcbWritten);377 int rc = VbglR3ClipboardObjWriteSend(&pThisCtx->CmdCtx, hObj, pvData, cbData, pcbWritten); 372 378 373 379 LogFlowFuncLeaveRC(rc); … … 401 407 { 402 408 LogFunc(("WM_CLIPBOARDUPDATE: Reporting formats 0x%x\n", fFormats)); 403 rc = VbglR3ClipboardReportFormats(pCtx-> u32ClientID, fFormats);409 rc = VbglR3ClipboardReportFormats(pCtx->CmdCtx.uClientID, fFormats); 404 410 } 405 411 } … … 425 431 int rc = VBoxClipboardWinGetFormats(pWinCtx, &fFormats); 426 432 if (RT_SUCCESS(rc)) 427 rc = VbglR3ClipboardReportFormats(pCtx-> u32ClientID, fFormats);433 rc = VbglR3ClipboardReportFormats(pCtx->CmdCtx.uClientID, fFormats); 428 434 } 429 435 … … 478 484 { 479 485 /* Read the host data to the preallocated buffer. */ 480 int rc = VbglR3ClipboardReadData(pCtx-> u32ClientID, fFormat, pMem, cbPrealloc, &cb);486 int rc = VbglR3ClipboardReadData(pCtx->CmdCtx.uClientID, fFormat, pMem, cbPrealloc, &cb); 481 487 LogFlowFunc(("VbglR3ClipboardReadData returned with rc = %Rrc\n", rc)); 482 488 … … 509 515 /* Read the host data to the preallocated buffer. */ 510 516 uint32_t cbNew = 0; 511 rc = VbglR3ClipboardReadData(pCtx-> u32ClientID, fFormat, pMem, cb, &cbNew);517 rc = VbglR3ClipboardReadData(pCtx->CmdCtx.uClientID, fFormat, pMem, cb, &cbNew); 512 518 LogFlowFunc(("VbglR3ClipboardReadData returned with rc = %Rrc, cb = %d, cbNew = %d\n", 513 519 rc, cb, cbNew)); … … 698 704 if (lp != NULL) 699 705 { 700 rc = VbglR3ClipboardWriteData(pCtx-> u32ClientID, VBOX_SHARED_CLIPBOARD_FMT_BITMAP,706 rc = VbglR3ClipboardWriteData(pCtx->CmdCtx.uClientID, VBOX_SHARED_CLIPBOARD_FMT_BITMAP, 701 707 lp, GlobalSize(hClip)); 702 708 GlobalUnlock(hClip); … … 716 722 if (uniString != NULL) 717 723 { 718 rc = VbglR3ClipboardWriteData(pCtx-> u32ClientID, VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT,724 rc = VbglR3ClipboardWriteData(pCtx->CmdCtx.uClientID, VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT, 719 725 uniString, (lstrlenW(uniString) + 1) * 2); 720 726 GlobalUnlock(hClip); … … 738 744 if (lp != NULL) 739 745 { 740 rc = VbglR3ClipboardWriteData(pCtx-> u32ClientID, VBOX_SHARED_CLIPBOARD_FMT_HTML,746 rc = VbglR3ClipboardWriteData(pCtx->CmdCtx.uClientID, VBOX_SHARED_CLIPBOARD_FMT_HTML, 741 747 lp, GlobalSize(hClip)); 742 748 GlobalUnlock(hClip); … … 755 761 756 762 /* Requested clipboard format is not available, send empty data. */ 757 VbglR3ClipboardWriteData(pCtx-> u32ClientID, VBOX_SHARED_CLIPBOARD_FMT_NONE, NULL, 0);763 VbglR3ClipboardWriteData(pCtx->CmdCtx.uClientID, VBOX_SHARED_CLIPBOARD_FMT_NONE, NULL, 0); 758 764 #ifdef DEBUG_andy 759 765 AssertFailed(); … … 1047 1053 /* ignore rc */ VBoxClipboardWinCheckAndInitNewAPI(&pCtx->Win.newAPI); 1048 1054 1049 rc = VbglR3ClipboardConnect(&pCtx-> u32ClientID);1055 rc = VbglR3ClipboardConnect(&pCtx->CmdCtx.uClientID); 1050 1056 if (RT_SUCCESS(rc)) 1051 1057 { 1058 pCtx->CmdCtx.uProtocol = 0; 1059 1052 1060 rc = vboxClipboardCreateWindow(pCtx); 1053 1061 if (RT_SUCCESS(rc)) … … 1061 1069 else 1062 1070 { 1063 VbglR3ClipboardDisconnect(pCtx-> u32ClientID);1071 VbglR3ClipboardDisconnect(pCtx->CmdCtx.uClientID); 1064 1072 } 1065 1073 } … … 1095 1103 uint32_t u32Msg; 1096 1104 uint32_t u32Formats; 1097 rc = VbglR3ClipboardGetHostMsgOld(pCtx-> u32ClientID, &u32Msg, &u32Formats);1105 rc = VbglR3ClipboardGetHostMsgOld(pCtx->CmdCtx.uClientID, &u32Msg, &u32Formats); 1098 1106 if (RT_FAILURE(rc)) 1099 1107 { … … 1185 1193 AssertPtr(pCtx); 1186 1194 1187 VbglR3ClipboardDisconnect(pCtx-> u32ClientID);1188 pCtx-> u32ClientID = 0;1195 VbglR3ClipboardDisconnect(pCtx->CmdCtx.uClientID); 1196 pCtx->CmdCtx.uClientID = 0; 1189 1197 1190 1198 LogFlowFuncLeaveRC(VINF_SUCCESS); … … 1200 1208 1201 1209 /* Make sure that we are disconnected. */ 1202 Assert(pCtx-> u32ClientID == 0);1210 Assert(pCtx->CmdCtx.uClientID == 0); 1203 1211 1204 1212 vboxClipboardDestroy(pCtx);
Note:
See TracChangeset
for help on using the changeset viewer.