Index: /trunk/include/VBox/HostServices/DragAndDropSvc.h
===================================================================
--- /trunk/include/VBox/HostServices/DragAndDropSvc.h	(revision 76890)
+++ /trunk/include/VBox/HostServices/DragAndDropSvc.h	(revision 76891)
@@ -88,4 +88,12 @@
     /** The host sets a new DnD mode. */
     HOST_DND_SET_MODE                  = 100,
+    /** The host requests to cancel the current DnD operation on
+     *  the guest side. This can happen on user request on the host's
+     *  UI side or due to some host error which has happened.
+     *
+     *  Note: This is a fire-and-forget message, as the host should
+     *        not rely on an answer from the guest side in order to
+     *        properly cancel the operation. */
+    HOST_DND_CANCEL                    = 204,
 
     /*
@@ -103,12 +111,4 @@
      *  ready to transfer data over to the guest. */
     HOST_DND_HG_EVT_DROPPED            = 203,
-    /** The host requests to cancel the current DnD operation on
-     *  the guest side. This can happen on user request on the host's
-     *  UI side or due to some host error which has happened.
-     *
-     *  Note: This is a fire-and-forget message, as the host should
-     *        not rely on an answer from the guest side in order to
-     *        properly cancel the operation. */
-    HOST_DND_HG_EVT_CANCEL             = 204,
     /** The host sends the data header at the beginning of a (new)
      *  data transfer. */
Index: /trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp	(revision 76890)
+++ /trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp	(revision 76891)
@@ -208,5 +208,5 @@
     RT_ZERO(Msg);
 
-    VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, HOST_DND_HG_EVT_CANCEL, 1);
+    VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, HOST_DND_CANCEL, 1);
     /** @todo Context ID not used yet. */
     Msg.u.v3.uContext.SetUInt32(0);
@@ -534,5 +534,6 @@
 
                     if (   RT_SUCCESS(rc)
-                        && uNextMsg == HOST_DND_HG_SND_FILE_DATA)
+                        && uNextMsg == HOST_DND_HG_SND_FILE_DATA
+                        && cbChunkRead)
                     {
                         uint32_t cbChunkWritten;
@@ -570,5 +571,5 @@
                     break;
                 }
-                case HOST_DND_HG_EVT_CANCEL:
+                case HOST_DND_CANCEL:
                 {
                     rc = vbglR3DnDHGRecvCancel(pCtx);
@@ -1267,5 +1268,5 @@
                 break;
             }
-            case HOST_DND_HG_EVT_CANCEL:
+            case HOST_DND_CANCEL:
             {
                 rc = vbglR3DnDHGRecvCancel(pCtx);
Index: /trunk/src/VBox/HostServices/DragAndDrop/dndmanager.h
===================================================================
--- /trunk/src/VBox/HostServices/DragAndDrop/dndmanager.h	(revision 76890)
+++ /trunk/src/VBox/HostServices/DragAndDrop/dndmanager.h	(revision 76891)
@@ -69,5 +69,5 @@
     DnDHGCancelMessage(void)
     {
-        int rc2 = initData(DragAndDropSvc::HOST_DND_HG_EVT_CANCEL,
+        int rc2 = initData(DragAndDropSvc::HOST_DND_CANCEL,
                            0 /* cParms */, 0 /* aParms */);
         AssertRC(rc2);
Index: /trunk/src/VBox/HostServices/DragAndDrop/service.cpp
===================================================================
--- /trunk/src/VBox/HostServices/DragAndDrop/service.cpp	(revision 76890)
+++ /trunk/src/VBox/HostServices/DragAndDrop/service.cpp	(revision 76891)
@@ -931,44 +931,4 @@
 #endif /* VBOX_WITH_DRAG_AND_DROP_GH */
 
-            /*
-             * Note: This is a fire-and-forget message, as the host should
-             *       not rely on an answer from the guest side in order to
-             *       properly cancel the operation.
-             */
-            case HOST_DND_HG_EVT_CANCEL:
-            {
-                LogFlowFunc(("HOST_DND_HG_EVT_CANCEL\n"));
-
-                VBOXDNDCBEVTERRORDATA data;
-                RT_ZERO(data);
-                data.hdr.uMagic = CB_MAGIC_DND_GH_EVT_ERROR;
-
-                switch (pClient->GetProtocolVer())
-                {
-                    case 3:
-                    {
-                        /* Protocol v3+ at least requires the context ID. */
-                        if (cParms == 1)
-                            rc = HGCMSvcGetU32(&paParms[0], &data.hdr.uContextID);
-
-                        break;
-                    }
-
-                    default:
-                        break;
-                }
-
-                /* Tell the host that the guest has cancelled the operation. */
-                data.rc = VERR_CANCELLED;
-
-                DO_HOST_CALLBACK();
-
-                /* Note: If the host is not prepared for handling the cancelling reply
-                 *       from the guest, don't report this back to the guest. */
-                if (RT_FAILURE(rc))
-                    rc = VINF_SUCCESS;
-                break;
-            }
-
             default:
             {
@@ -1069,15 +1029,5 @@
             }
 
-            case HOST_DND_HG_EVT_ENTER:
-            {
-                /* Reset the message queue as a new DnD operation just began. */
-                m_pManager->Reset();
-
-                fSendToGuest = true;
-                rc = VINF_SUCCESS;
-                break;
-            }
-
-            case HOST_DND_HG_EVT_CANCEL:
+            case HOST_DND_CANCEL:
             {
                 LogFlowFunc(("Cancelling all waiting clients ...\n"));
@@ -1085,4 +1035,11 @@
                 /* Reset the message queue as the host cancelled the whole operation. */
                 m_pManager->Reset();
+
+                rc = m_pManager->AddMsg(u32Function, cParms, paParms, true /* fAppend */);
+                if (RT_FAILURE(rc))
+                {
+                    AssertMsgFailed(("Adding new message of type=%RU32 failed with rc=%Rrc\n", u32Function, rc));
+                    break;
+                }
 
                 /*
@@ -1099,5 +1056,5 @@
                     AssertPtr(pClient);
 
-                    int rc2 = pClient->SetDeferredMsgInfo(HOST_DND_HG_EVT_CANCEL,
+                    int rc2 = pClient->SetDeferredMsgInfo(HOST_DND_CANCEL,
                                                           /* Protocol v3+ also contains the context ID. */
                                                           pClient->GetProtocolVer() >= 3 ? 1 : 0);
@@ -1111,4 +1068,14 @@
 
                 /* Tell the host that everything went well. */
+                rc = VINF_SUCCESS;
+                break;
+            }
+
+            case HOST_DND_HG_EVT_ENTER:
+            {
+                /* Reset the message queue as a new DnD operation just began. */
+                m_pManager->Reset();
+
+                fSendToGuest = true;
                 rc = VINF_SUCCESS;
                 break;
Index: /trunk/src/VBox/Main/include/GuestDnDTargetImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/GuestDnDTargetImpl.h	(revision 76890)
+++ /trunk/src/VBox/Main/include/GuestDnDTargetImpl.h	(revision 76891)
@@ -87,5 +87,4 @@
 protected:
 
-    int i_cancelOperation(void);
     int i_sendData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout);
     int i_sendDataBody(PSENDDATACTX pCtx, GuestDnDData *pData);
Index: /trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp	(revision 76890)
+++ /trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp	(revision 76891)
@@ -922,9 +922,12 @@
 int GuestDnDBase::sendCancel(void)
 {
-    int rc = GuestDnDInst()->hostCall(HOST_DND_HG_EVT_CANCEL,
-                                      0 /* cParms */, NULL /* paParms */);
-
-    LogFlowFunc(("Generated cancelling request, rc=%Rrc\n", rc));
-    return rc;
+    GuestDnDMsg Msg;
+    Msg.setType(HOST_DND_CANCEL);
+    if (mDataBase.m_uProtocolVersion >= 3)
+        Msg.setNextUInt32(0); /** @todo ContextID not used yet. */
+
+    LogRel2(("DnD: Cancelling operation on guest ..."));
+
+    return GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
 }
 
Index: /trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp	(revision 76890)
+++ /trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp	(revision 76891)
@@ -652,5 +652,5 @@
         {
             delete pTask;
-            LogRel2(("DnD: Could not create SendDataTask object \n"));
+            LogRel2(("DnD: Could not create SendDataTask object\n"));
             throw hr = E_FAIL;
         }
@@ -686,24 +686,4 @@
     return hr;
 #endif /* VBOX_WITH_DRAG_AND_DROP */
-}
-
-int GuestDnDTarget::i_cancelOperation(void)
-{
-    /** @todo Check for pending cancel requests. */
-
-#if 0 /** @todo Later. */
-    /* Cancel any outstanding waits for guest responses first. */
-    if (pResp)
-        pResp->notifyAboutGuestResponse();
-#endif
-
-    LogFlowFunc(("Cancelling operation, telling guest ...\n"));
-
-    GuestDnDMsg Msg;
-    Msg.setType(HOST_DND_HG_EVT_CANCEL);
-    if (mDataBase.m_uProtocolVersion >= 3)
-        Msg.setNextUInt32(0); /** @todo ContextID not used yet. */
-
-    return GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
 }
 
@@ -1553,5 +1533,5 @@
 #else /* VBOX_WITH_DRAG_AND_DROP */
 
-    int rc = i_cancelOperation();
+    int rc = GuestDnDBase::sendCancel();
 
     if (aVeto)
