Changeset 97763 in vbox
- Timestamp:
- Dec 8, 2022 3:27:14 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/DragAndDrop/VBoxDragAndDropSvc.cpp
r97748 r97763 1070 1070 DnDHostMsgToStr(u32Function), u32Function, cParms, m_clientMap.size(), m_clientQueue.size())); 1071 1071 1072 int rc; 1072 uint32_t const uMode = modeGet(); 1073 1074 /* Check if we've the right mode set. */ 1075 int rc = VERR_ACCESS_DENIED; /* Play safe. */ 1076 switch (u32Function) 1077 { 1078 /* 1079 * Host -> Guest mode 1080 */ 1081 case HOST_DND_FN_HG_EVT_ENTER: 1082 RT_FALL_THROUGH(); 1083 case HOST_DND_FN_HG_EVT_MOVE: 1084 RT_FALL_THROUGH(); 1085 case HOST_DND_FN_HG_EVT_LEAVE: 1086 RT_FALL_THROUGH(); 1087 case HOST_DND_FN_HG_EVT_DROPPED: 1088 RT_FALL_THROUGH(); 1089 case HOST_DND_FN_HG_SND_DATA_HDR: 1090 RT_FALL_THROUGH(); 1091 case HOST_DND_FN_HG_SND_DATA: 1092 RT_FALL_THROUGH(); 1093 case HOST_DND_FN_HG_SND_MORE_DATA: 1094 RT_FALL_THROUGH(); 1095 case HOST_DND_FN_HG_SND_DIR: 1096 RT_FALL_THROUGH(); 1097 case HOST_DND_FN_HG_SND_FILE_DATA: 1098 RT_FALL_THROUGH(); 1099 case HOST_DND_FN_HG_SND_FILE_HDR: 1100 { 1101 if ( uMode == VBOX_DRAG_AND_DROP_MODE_HOST_TO_GUEST 1102 || uMode == VBOX_DRAG_AND_DROP_MODE_BIDIRECTIONAL) 1103 rc = VINF_SUCCESS; 1104 else 1105 { 1106 LogRel2(("DnD: Host to guest mode is disabled, ignoring request from host\n")); 1107 } 1108 break; 1109 } 1110 1111 /* 1112 * Guest -> Host mode 1113 */ 1114 case HOST_DND_FN_GH_REQ_PENDING: 1115 RT_FALL_THROUGH(); 1116 case HOST_DND_FN_GH_EVT_DROPPED: 1117 { 1118 if ( uMode == VBOX_DRAG_AND_DROP_MODE_GUEST_TO_HOST 1119 || uMode == VBOX_DRAG_AND_DROP_MODE_BIDIRECTIONAL) 1120 rc = VINF_SUCCESS; 1121 else 1122 { 1123 LogRel2(("DnD: Guest to host mode is disabled, ignoring request from host\n")); 1124 } 1125 break; 1126 } 1127 1128 /* 1129 * Both modes 1130 */ 1131 case HOST_DND_FN_CANCEL: 1132 if (uMode != VBOX_DRAG_AND_DROP_MODE_OFF) 1133 rc = VINF_SUCCESS; 1134 break; 1135 1136 /* 1137 * Functions that always work. 1138 */ 1139 case HOST_DND_FN_SET_MODE: 1140 rc = VINF_SUCCESS; 1141 break; 1142 1143 /* 1144 * Forbid everything else not explicitly allowed. 1145 */ 1146 default: 1147 break; 1148 } 1149 1150 if (RT_FAILURE(rc)) 1151 return rc; 1152 1073 1153 bool fSendToGuest = false; /* Whether to send the message down to the guest side or not. */ 1074 1154 … … 1151 1231 if (fSendToGuest) 1152 1232 { 1153 if (modeGet() == VBOX_DRAG_AND_DROP_MODE_OFF)1154 {1155 /* Tell the host that a wrong drag'n drop mode is set. */1156 rc = VERR_ACCESS_DENIED;1157 break;1158 }1159 1160 1233 if (m_clientMap.empty()) /* At least one client on the guest connected? */ 1161 1234 {
Note:
See TracChangeset
for help on using the changeset viewer.