Changeset 50636 in vbox
- Timestamp:
- Feb 27, 2014 6:46:50 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/DragAndDrop/service.cpp
r50593 r50636 193 193 194 194 /* Check if we've the right mode set. */ 195 bool fIgnoreRequest = true; /* Play safe. */195 int rc = VERR_ACCESS_DENIED; /* Play safe. */ 196 196 switch (u32Function) 197 197 { … … 199 199 if (modeGet() != VBOX_DRAG_AND_DROP_MODE_OFF) 200 200 { 201 fIgnoreRequest = false;201 rc = VINF_SUCCESS; 202 202 } 203 203 else 204 LogFlowFunc(("Drag'n drop disabled, ignoring request\n")); 204 { 205 LogFlowFunc(("DnD disabled, deferring request\n")); 206 rc = VINF_HGCM_ASYNC_EXECUTE; 207 } 205 208 break; 206 209 case DragAndDropSvc::GUEST_DND_HG_ACK_OP: … … 209 212 || modeGet() == VBOX_DRAG_AND_DROP_MODE_HOST_TO_GUEST) 210 213 { 211 fIgnoreRequest = false;214 rc = VINF_SUCCESS; 212 215 } 213 216 else 214 LogFlowFunc(("Host -> guest DnD mode disabled, ignoring request\n"));217 LogFlowFunc(("Host -> Guest DnD mode disabled, ignoring request\n")); 215 218 break; 216 #ifdef VBOX_WITH_DRAG_AND_DROP_GH217 219 case DragAndDropSvc::GUEST_DND_GH_ACK_PENDING: 218 220 case DragAndDropSvc::GUEST_DND_GH_SND_DATA: … … 220 222 case DragAndDropSvc::GUEST_DND_GH_SND_FILE: 221 223 case DragAndDropSvc::GUEST_DND_GH_EVT_ERROR: 224 #ifdef VBOX_WITH_DRAG_AND_DROP_GH 222 225 if ( modeGet() == VBOX_DRAG_AND_DROP_MODE_BIDIRECTIONAL 223 226 || modeGet() == VBOX_DRAG_AND_DROP_MODE_GUEST_TO_HOST) 224 227 { 225 fIgnoreRequest = false;228 rc = VINF_SUCCESS; 226 229 } 227 230 else 228 LogFlowFunc(("Guest -> host DnD mode disabled, ignoring request\n")); 231 #endif 232 LogFlowFunc(("Guest -> Host DnD mode disabled, ignoring request\n")); 229 233 break; 230 #endif231 234 default: 232 235 /* Reach through to DnD manager. */ 233 fIgnoreRequest = false;236 rc = VINF_SUCCESS; 234 237 break; 235 238 } 236 239 237 int rc; 238 if (!fIgnoreRequest) 240 #ifdef DEBUG_andy 241 LogFlowFunc(("Mode check rc=%Rrc\n", rc)); 242 #endif 243 244 if (rc == VINF_SUCCESS) /* Note: rc might be VINF_HGCM_ASYNC_EXECUTE! */ 239 245 { 240 246 switch (u32Function) … … 259 265 && paParms[2].u.uint32) /* Blocking? */ 260 266 { 261 m_clientQueue.append(new HGCM::Client(u32ClientID, callHandle, 262 u32Function, cParms, paParms)); 267 /* Defer client returning. */ 263 268 rc = VINF_HGCM_ASYNC_EXECUTE; 264 269 } … … 276 281 DragAndDropSvc::VBOXDNDCBHGACKOPDATA data; 277 282 data.hdr.u32Magic = DragAndDropSvc::CB_MAGIC_DND_HG_ACK_OP; 278 paParms[0].getUInt32(&data.uAction); 279 if (m_pfnHostCallback) 280 rc = m_pfnHostCallback(m_pvHostData, u32Function, &data, sizeof(data)); 281 // m_pHelpers->pfnCallComplete(callHandle, rc); 283 paParms[0].getUInt32(&data.uAction); /* Get drop action. */ 284 if (m_pfnHostCallback) 285 rc = m_pfnHostCallback(m_pvHostData, u32Function, &data, sizeof(data)); 282 286 } 283 287 break; … … 297 301 if (m_pfnHostCallback) 298 302 rc = m_pfnHostCallback(m_pvHostData, u32Function, &data, sizeof(data)); 299 // m_pHelpers->pfnCallComplete(callHandle, rc);300 // if (data.pszFormat)301 // RTMemFree(data.pszFormat);302 // if (data.pszTmpPath)303 // RTMemFree(data.pszTmpPath);304 303 } 305 304 break; … … 428 427 } 429 428 } 430 else 431 rc = VERR_ACCESS_DENIED; 432 433 /* If async execute is requested, we didn't notify the guest about 429 430 /* If async execution is requested, we didn't notify the guest yet about 434 431 * completion. The client is queued into the waiters list and will be 435 432 * notified as soon as a new event is available. */ 433 if (rc == VINF_HGCM_ASYNC_EXECUTE) 434 { 435 m_clientQueue.append(new HGCM::Client(u32ClientID, callHandle, 436 u32Function, cParms, paParms)); 437 } 438 436 439 if ( rc != VINF_HGCM_ASYNC_EXECUTE 437 440 && m_pHelpers)
Note:
See TracChangeset
for help on using the changeset viewer.