Changeset 50265 in vbox for trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnD.cpp
- Timestamp:
- Jan 29, 2014 11:12:44 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnD.cpp
r50179 r50265 229 229 } while (RT_SUCCESS(rc)); 230 230 231 int rc2 = pThis->UnregisterAsDropTarget(); 232 if (RT_SUCCESS(rc)) 233 rc = rc2; 234 231 235 OleUninitialize(); 232 236 } … … 405 409 reset(); 406 410 407 Assert(mMode == Unknown);408 411 mMode = HG; 409 412 … … 464 467 465 468 rc = OnHgCancel(); 466 467 reset();468 469 break; 469 470 } … … 473 474 LogFlowThisFunc(("HOST_DND_GH_REQ_PENDING\n")); 474 475 #ifdef VBOX_WITH_DRAG_AND_DROP_GH 475 Assert( mMode == Unknown 476 || mMode == GH); 477 mMode = GH; 478 rc = OnGhIsDnDPending(pEvent->Event.uScreenId); 476 if ( mMode == Unknown 477 /* There can be more than one HOST_DND_GH_REQ_PENDING 478 * messages coming in. */ 479 || mMode == GH) 480 { 481 mMode = GH; 482 rc = OnGhIsDnDPending(pEvent->Event.uScreenId); 483 } 484 else 485 rc = VERR_WRONG_ORDER; 479 486 #else 480 487 rc = VERR_NOT_SUPPORTED; … … 487 494 LogFlowThisFunc(("HOST_DND_GH_EVT_DROPPED\n")); 488 495 #ifdef VBOX_WITH_DRAG_AND_DROP_GH 489 Assert(mMode == GH); 490 rc = OnGhDropped(pEvent->Event.pszFormats, 491 pEvent->Event.cbFormats, 492 pEvent->Event.u.a.uDefAction); 493 mMode = Unknown; 496 if (mMode == GH) 497 { 498 rc = OnGhDropped(pEvent->Event.pszFormats, 499 pEvent->Event.cbFormats, 500 pEvent->Event.u.a.uDefAction); 501 } 502 else 503 rc = VERR_WRONG_ORDER; 494 504 #else 495 505 rc = VERR_NOT_SUPPORTED; … … 585 595 } 586 596 else 597 { 587 598 rc = VINF_SUCCESS; 599 } 588 600 } 589 601 catch (std::bad_alloc) … … 598 610 int VBoxDnDWnd::UnregisterAsDropTarget(void) 599 611 { 612 LogFlowFuncEnter(); 613 600 614 if (!pDropTarget) /* No drop target? Bail out. */ 601 615 return VINF_SUCCESS; … … 606 620 TRUE /* fLastUnlockReleases */); 607 621 if (SUCCEEDED(hr)) 608 pDropTarget->Release(); 622 { 623 ULONG cRefs = pDropTarget->Release(); 624 625 Assert(cRefs == 0); 626 pDropTarget = NULL; 627 } 609 628 610 629 int rc = SUCCEEDED(hr) … … 652 671 */ 653 672 const RTCList<RTCString> lstAllowedMimeTypes = RTCList<RTCString>() 654 /* U ri's */673 /* URI's */ 655 674 << "text/uri-list" 656 675 /* Text */ … … 661 680 << "TEXT" 662 681 << "STRING" 663 /* OpenOffice format es */682 /* OpenOffice formats */ 664 683 << "application/x-openoffice-embed-source-xml;windows_formatname=\"Star Embed Source (XML)\"" 665 684 << "application/x-openoffice-drawing;windows_formatname=\"Drawing Format\""; … … 855 874 if (RT_SUCCESS(rc)) 856 875 rc = rc2; 876 877 reset(); 857 878 858 879 return rc; … … 959 980 if (RT_SUCCESS(rc)) 960 981 { 982 AssertPtr(pDropTarget); 983 961 984 uint32_t uDefAction = DND_IGNORE_ACTION; 962 985 RTCString strFormat = "unknown"; 963 if ( pDropTarget 964 && pDropTarget->HasData()) 986 if (pDropTarget->HasData()) 965 987 { 966 988 uDefAction = DND_COPY_ACTION; … … 970 992 * with \r\n. */ 971 993 strFormat = "text/plain;charset=utf-8"; 972 } 973 974 LogFlowFunc(("Acknowledging pDropTarget=0x%p, uDefAction=0x%x, uAllActions=0x%x, strFormat=%s\n",975 pDropTarget, uDefAction, uAllActions, strFormat.c_str()));976 rc = VbglR3DnDGHAcknowledgePending(mClientID,977 uDefAction, uAllActions, strFormat.c_str());994 995 LogFlowFunc(("Acknowledging pDropTarget=0x%p, uDefAction=0x%x, uAllActions=0x%x, strFormat=%s\n", 996 pDropTarget, uDefAction, uAllActions, strFormat.c_str())); 997 rc = VbglR3DnDGHAcknowledgePending(mClientID, 998 uDefAction, uAllActions, strFormat.c_str()); 999 } 978 1000 } 979 1001 … … 985 1007 uint32_t uDefAction) 986 1008 { 987 LogFlowThisFunc(("mMode=%ld, mState=%ld, cbFormats=%RU32, uDefAction=0x%x\n",988 mMode, mState, cbFormats, uDefAction));1009 LogFlowThisFunc(("mMode=%ld, mState=%ld, pDropTarget=0x%p, cbFormats=%RU32, uDefAction=0x%x\n", 1010 mMode, mState, pDropTarget, cbFormats, uDefAction)); 989 1011 int rc; 990 1012 if (mState == Dragging) 991 1013 { 992 1014 AssertPtr(pDropTarget); 1015 rc = pDropTarget->WaitForDrop(30 * 1000 /* Timeout */); 1016 if (RT_SUCCESS(rc)) 1017 { 1018 /** @todo Respect uDefAction. */ 1019 /** @todo Do data checking / conversion based on pszFormats. */ 1020 1021 void *pvData = pDropTarget->DataMutableRaw(); 1022 AssertPtr(pvData); 1023 uint32_t cbData = pDropTarget->DataSize(); 1024 Assert(cbData); 1025 1026 rc = VbglR3DnDGHSendData(mClientID, pvData, cbData); 1027 LogFlowFunc(("Sent pvData=0x%p, cbData=%RU32, rc=%Rrc\n", 1028 pvData, cbData, rc)); 1029 } 1030 1031 reset(); 993 1032 } 994 1033 else
Note:
See TracChangeset
for help on using the changeset viewer.