Changeset 76891 in vbox
- Timestamp:
- Jan 18, 2019 1:17:20 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
include/VBox/HostServices/DragAndDropSvc.h (modified) (2 diffs)
-
src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp (modified) (4 diffs)
-
src/VBox/HostServices/DragAndDrop/dndmanager.h (modified) (1 diff)
-
src/VBox/HostServices/DragAndDrop/service.cpp (modified) (5 diffs)
-
src/VBox/Main/include/GuestDnDTargetImpl.h (modified) (1 diff)
-
src/VBox/Main/src-client/GuestDnDPrivate.cpp (modified) (1 diff)
-
src/VBox/Main/src-client/GuestDnDTargetImpl.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/HostServices/DragAndDropSvc.h
r76585 r76891 88 88 /** The host sets a new DnD mode. */ 89 89 HOST_DND_SET_MODE = 100, 90 /** The host requests to cancel the current DnD operation on 91 * the guest side. This can happen on user request on the host's 92 * UI side or due to some host error which has happened. 93 * 94 * Note: This is a fire-and-forget message, as the host should 95 * not rely on an answer from the guest side in order to 96 * properly cancel the operation. */ 97 HOST_DND_CANCEL = 204, 90 98 91 99 /* … … 103 111 * ready to transfer data over to the guest. */ 104 112 HOST_DND_HG_EVT_DROPPED = 203, 105 /** The host requests to cancel the current DnD operation on106 * the guest side. This can happen on user request on the host's107 * UI side or due to some host error which has happened.108 *109 * Note: This is a fire-and-forget message, as the host should110 * not rely on an answer from the guest side in order to111 * properly cancel the operation. */112 HOST_DND_HG_EVT_CANCEL = 204,113 113 /** The host sends the data header at the beginning of a (new) 114 114 * data transfer. */ -
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp
r76553 r76891 208 208 RT_ZERO(Msg); 209 209 210 VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, HOST_DND_ HG_EVT_CANCEL, 1);210 VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, HOST_DND_CANCEL, 1); 211 211 /** @todo Context ID not used yet. */ 212 212 Msg.u.v3.uContext.SetUInt32(0); … … 534 534 535 535 if ( RT_SUCCESS(rc) 536 && uNextMsg == HOST_DND_HG_SND_FILE_DATA) 536 && uNextMsg == HOST_DND_HG_SND_FILE_DATA 537 && cbChunkRead) 537 538 { 538 539 uint32_t cbChunkWritten; … … 570 571 break; 571 572 } 572 case HOST_DND_ HG_EVT_CANCEL:573 case HOST_DND_CANCEL: 573 574 { 574 575 rc = vbglR3DnDHGRecvCancel(pCtx); … … 1267 1268 break; 1268 1269 } 1269 case HOST_DND_ HG_EVT_CANCEL:1270 case HOST_DND_CANCEL: 1270 1271 { 1271 1272 rc = vbglR3DnDHGRecvCancel(pCtx); -
trunk/src/VBox/HostServices/DragAndDrop/dndmanager.h
r76570 r76891 69 69 DnDHGCancelMessage(void) 70 70 { 71 int rc2 = initData(DragAndDropSvc::HOST_DND_ HG_EVT_CANCEL,71 int rc2 = initData(DragAndDropSvc::HOST_DND_CANCEL, 72 72 0 /* cParms */, 0 /* aParms */); 73 73 AssertRC(rc2); -
trunk/src/VBox/HostServices/DragAndDrop/service.cpp
r76553 r76891 931 931 #endif /* VBOX_WITH_DRAG_AND_DROP_GH */ 932 932 933 /*934 * Note: This is a fire-and-forget message, as the host should935 * not rely on an answer from the guest side in order to936 * properly cancel the operation.937 */938 case HOST_DND_HG_EVT_CANCEL:939 {940 LogFlowFunc(("HOST_DND_HG_EVT_CANCEL\n"));941 942 VBOXDNDCBEVTERRORDATA data;943 RT_ZERO(data);944 data.hdr.uMagic = CB_MAGIC_DND_GH_EVT_ERROR;945 946 switch (pClient->GetProtocolVer())947 {948 case 3:949 {950 /* Protocol v3+ at least requires the context ID. */951 if (cParms == 1)952 rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID);953 954 break;955 }956 957 default:958 break;959 }960 961 /* Tell the host that the guest has cancelled the operation. */962 data.rc = VERR_CANCELLED;963 964 DO_HOST_CALLBACK();965 966 /* Note: If the host is not prepared for handling the cancelling reply967 * from the guest, don't report this back to the guest. */968 if (RT_FAILURE(rc))969 rc = VINF_SUCCESS;970 break;971 }972 973 933 default: 974 934 { … … 1069 1029 } 1070 1030 1071 case HOST_DND_HG_EVT_ENTER: 1072 { 1073 /* Reset the message queue as a new DnD operation just began. */ 1074 m_pManager->Reset(); 1075 1076 fSendToGuest = true; 1077 rc = VINF_SUCCESS; 1078 break; 1079 } 1080 1081 case HOST_DND_HG_EVT_CANCEL: 1031 case HOST_DND_CANCEL: 1082 1032 { 1083 1033 LogFlowFunc(("Cancelling all waiting clients ...\n")); … … 1085 1035 /* Reset the message queue as the host cancelled the whole operation. */ 1086 1036 m_pManager->Reset(); 1037 1038 rc = m_pManager->AddMsg(u32Function, cParms, paParms, true /* fAppend */); 1039 if (RT_FAILURE(rc)) 1040 { 1041 AssertMsgFailed(("Adding new message of type=%RU32 failed with rc=%Rrc\n", u32Function, rc)); 1042 break; 1043 } 1087 1044 1088 1045 /* … … 1099 1056 AssertPtr(pClient); 1100 1057 1101 int rc2 = pClient->SetDeferredMsgInfo(HOST_DND_ HG_EVT_CANCEL,1058 int rc2 = pClient->SetDeferredMsgInfo(HOST_DND_CANCEL, 1102 1059 /* Protocol v3+ also contains the context ID. */ 1103 1060 pClient->GetProtocolVer() >= 3 ? 1 : 0); … … 1111 1068 1112 1069 /* Tell the host that everything went well. */ 1070 rc = VINF_SUCCESS; 1071 break; 1072 } 1073 1074 case HOST_DND_HG_EVT_ENTER: 1075 { 1076 /* Reset the message queue as a new DnD operation just began. */ 1077 m_pManager->Reset(); 1078 1079 fSendToGuest = true; 1113 1080 rc = VINF_SUCCESS; 1114 1081 break; -
trunk/src/VBox/Main/include/GuestDnDTargetImpl.h
r76562 r76891 87 87 protected: 88 88 89 int i_cancelOperation(void);90 89 int i_sendData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout); 91 90 int i_sendDataBody(PSENDDATACTX pCtx, GuestDnDData *pData); -
trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp
r76553 r76891 922 922 int GuestDnDBase::sendCancel(void) 923 923 { 924 int rc = GuestDnDInst()->hostCall(HOST_DND_HG_EVT_CANCEL, 925 0 /* cParms */, NULL /* paParms */); 926 927 LogFlowFunc(("Generated cancelling request, rc=%Rrc\n", rc)); 928 return rc; 924 GuestDnDMsg Msg; 925 Msg.setType(HOST_DND_CANCEL); 926 if (mDataBase.m_uProtocolVersion >= 3) 927 Msg.setNextUInt32(0); /** @todo ContextID not used yet. */ 928 929 LogRel2(("DnD: Cancelling operation on guest ...")); 930 931 return GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms()); 929 932 } 930 933 -
trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
r76553 r76891 652 652 { 653 653 delete pTask; 654 LogRel2(("DnD: Could not create SendDataTask object \n"));654 LogRel2(("DnD: Could not create SendDataTask object\n")); 655 655 throw hr = E_FAIL; 656 656 } … … 686 686 return hr; 687 687 #endif /* VBOX_WITH_DRAG_AND_DROP */ 688 }689 690 int GuestDnDTarget::i_cancelOperation(void)691 {692 /** @todo Check for pending cancel requests. */693 694 #if 0 /** @todo Later. */695 /* Cancel any outstanding waits for guest responses first. */696 if (pResp)697 pResp->notifyAboutGuestResponse();698 #endif699 700 LogFlowFunc(("Cancelling operation, telling guest ...\n"));701 702 GuestDnDMsg Msg;703 Msg.setType(HOST_DND_HG_EVT_CANCEL);704 if (mDataBase.m_uProtocolVersion >= 3)705 Msg.setNextUInt32(0); /** @todo ContextID not used yet. */706 707 return GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());708 688 } 709 689 … … 1553 1533 #else /* VBOX_WITH_DRAG_AND_DROP */ 1554 1534 1555 int rc = i_cancelOperation();1535 int rc = GuestDnDBase::sendCancel(); 1556 1536 1557 1537 if (aVeto)
Note:
See TracChangeset
for help on using the changeset viewer.

