Index: /trunk/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp	(revision 56505)
+++ /trunk/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp	(revision 56506)
@@ -438,4 +438,8 @@
                                       "Please make sure that all selected elements can be accessed and that your guest user has "
                                       "the appropriate rights."));
+            break;
+
+        case VERR_TIMEOUT:
+            strError += Utf8StrFmt(tr("The guest was not able to fetch the drag and drop data within time."));
             break;
 
@@ -848,13 +852,5 @@
         {
             rc = waitForEvent(msTimeout, pCtx->mCallback, pCtx->mpResp);
-            if (RT_FAILURE(rc))
-            {
-                if (rc == VERR_CANCELLED)
-                    rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_CANCELLED, VINF_SUCCESS);
-                else if (rc != VERR_GSTDND_GUEST_ERROR) /* Guest-side error are already handled in the callback. */
-                    rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR, rc,
-                                                   GuestDnDSource::i_hostErrorToString(rc));
-            }
-            else
+            if (RT_SUCCESS(rc))
                 rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_COMPLETE, VINF_SUCCESS);
         }
@@ -871,8 +867,19 @@
 #undef UNREGISTER_CALLBACK
 
-    if (rc == VERR_CANCELLED)
-    {
-        int rc2 = sendCancel();
-        AssertRC(rc2);
+    if (RT_FAILURE(rc))
+    {
+        if (rc == VERR_CANCELLED)
+        {
+            int rc2 = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_CANCELLED, VINF_SUCCESS);
+            AssertRC(rc2);
+
+            rc2 = sendCancel();
+            AssertRC(rc2);
+        }
+        else if (rc != VERR_GSTDND_GUEST_ERROR) /* Guest-side error are already handled in the callback. */
+        {
+            rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR,
+                                           rc, GuestDnDSource::i_hostErrorToString(rc));
+        }
     }
 
@@ -939,15 +946,11 @@
         if (RT_SUCCESS(rc))
         {
+            LogFlowFunc(("Waiting ...\n"));
+
             rc = waitForEvent(msTimeout, pCtx->mCallback, pCtx->mpResp);
-            if (RT_FAILURE(rc))
-            {
-                if (rc == VERR_CANCELLED)
-                    rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_CANCELLED, VINF_SUCCESS);
-                else if (rc != VERR_GSTDND_GUEST_ERROR) /* Guest-side error are already handled in the callback. */
-                    rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR, rc,
-                                                   GuestDnDSource::i_hostErrorToString(rc));
-            }
-            else
+            if (RT_SUCCESS(rc))
                 rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_COMPLETE, VINF_SUCCESS);
+
+            LogFlowFunc(("Waiting ended with rc=%Rrc\n", rc));
         }
 
@@ -969,8 +972,19 @@
     int rc2;
 
-    if (rc == VERR_CANCELLED)
-    {
-        rc2 = sendCancel();
-        AssertRC(rc2);
+    if (RT_FAILURE(rc))
+    {
+        if (rc == VERR_CANCELLED)
+        {
+            rc2 = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_CANCELLED, VINF_SUCCESS);
+            AssertRC(rc2);
+
+            rc2 = sendCancel();
+            AssertRC(rc2);
+        }
+        else if (rc != VERR_GSTDND_GUEST_ERROR) /* Guest-side error are already handled in the callback. */
+        {
+            rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR,
+                                           rc, GuestDnDSource::i_hostErrorToString(rc));
+        }
     }
 
@@ -1136,9 +1150,12 @@
 
             pCtx->mpResp->reset();
+
             if (RT_SUCCESS(pCBData->rc))
                 pCBData->rc = VERR_GENERAL_FAILURE; /* Make sure some error is set. */
-            rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR, pCBData->rc);
+
+            rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR, pCBData->rc,
+                                           GuestDnDSource::i_guestErrorToString(pCBData->rc));
             if (RT_SUCCESS(rc))
-                rcCallback = pCBData->rc;
+                rcCallback = VERR_GSTDND_GUEST_ERROR;
             break;
         }
