Index: /trunk/include/VBox/GuestHost/SharedClipboard-win.h
===================================================================
--- /trunk/include/VBox/GuestHost/SharedClipboard-win.h	(revision 103449)
+++ /trunk/include/VBox/GuestHost/SharedClipboard-win.h	(revision 103450)
@@ -499,4 +499,5 @@
 void SharedClipboardWinTransferDestroy(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer);
 
+int SharedClipboardWinTransferHandOffToDataObject(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer);
 int SharedClipboardWinTransferCreateAndSetDataObject(PSHCLWINCTX pWinCtx, PSHCLCONTEXT pCtx, SharedClipboardWinDataObject::PCALLBACKS pCallbacks);
 # endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */
Index: /trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp	(revision 103449)
+++ /trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp	(revision 103450)
@@ -179,20 +179,12 @@
     AssertPtr(pCtx);
 
-    switch(ShClTransferGetDir(pCbCtx->pTransfer))
+    PSHCLTRANSFER pTransfer = pCbCtx->pTransfer;
+    AssertPtr(pTransfer);
+
+    switch(ShClTransferGetDir(pTransfer))
     {
         case SHCLTRANSFERDIR_FROM_REMOTE: /* G->H */
         {
-            SharedClipboardWinDataObject *pObj = pCtx->Win.pDataObjInFlight;
-            if (pObj)
-            {
-                rc = pObj->SetTransfer(pCbCtx->pTransfer);
-                if (RT_SUCCESS(rc))
-                    rc = pObj->SetStatus(SharedClipboardWinDataObject::Running);
-
-                pCtx->Win.pDataObjInFlight = NULL; /* Hand off to Windows. */
-            }
-            else
-                AssertMsgFailed(("No data object in flight!\n"));
-
+            rc = SharedClipboardWinTransferHandOffToDataObject(&pCtx->Win, pTransfer);
             break;
         }
@@ -200,5 +192,5 @@
         case SHCLTRANSFERDIR_TO_REMOTE: /* H->G */
         {
-            rc = SharedClipboardWinTransferGetRootsFromClipboard(&pCtx->Win, pCbCtx->pTransfer);
+            rc = SharedClipboardWinTransferGetRootsFromClipboard(&pCtx->Win, pTransfer);
             break;
         }
Index: /trunk/src/VBox/GuestHost/SharedClipboard/clipboard-win.cpp
===================================================================
--- /trunk/src/VBox/GuestHost/SharedClipboard/clipboard-win.cpp	(revision 103449)
+++ /trunk/src/VBox/GuestHost/SharedClipboard/clipboard-win.cpp	(revision 103450)
@@ -1192,4 +1192,41 @@
 
 /**
+ * Hands off a transfer to the current data object in-flight.
+ *
+ * @returns VBox status code.
+ * @param   pWinCtx             Windows context to use.
+ * @param   pTransfer           Transfer to hand off to the data object.
+ *
+ * @note    The data object will be put into running state on success and handed over to Windows.
+ *          Our data object pointer will be invalid afterwards.
+ */
+int SharedClipboardWinTransferHandOffToDataObject(PSHCLWINCTX pWinCtx, PSHCLTRANSFER pTransfer)
+{
+    int rc = RTCritSectEnter(&pCtx->Win.CritSect);
+    if (RT_SUCCESS(rc))
+    {
+        SharedClipboardWinDataObject *pObj = pCtx->Win.pDataObjInFlight;
+        if (pObj)
+        {
+            rc = pObj->SetTransfer(pTransfer);
+            if (RT_SUCCESS(rc))
+                rc = pObj->SetStatus(SharedClipboardWinDataObject::Running);
+
+            pCtx->Win.pDataObjInFlight = NULL; /* Hand off to Windows. */
+        }
+        else
+        {
+            AssertMsgFailed(("No data object in flight (yet)!\n"));
+            rc = VERR_WRONG_ORDER);
+        }
+
+        int rc2 = RTCritSectLeave(&pCtx->Win.CritSect);
+        AssertRC(rc2);
+    }
+
+    return rc;
+}
+
+/**
  * Retrieves the roots for a transfer by opening the clipboard and getting the clipboard data
  * as string list (CF_HDROP), assigning it to the transfer as roots then.
Index: /trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp
===================================================================
--- /trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp	(revision 103449)
+++ /trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp	(revision 103450)
@@ -312,23 +312,5 @@
         case SHCLTRANSFERDIR_FROM_REMOTE: /* G->H */
         {
-            rc = RTCritSectEnter(&pCtx->Win.CritSect);
-            if (RT_SUCCESS(rc))
-            {
-                SharedClipboardWinDataObject *pObj = pCtx->Win.pDataObjInFlight;
-                if (pObj)
-                {
-                    rc = pObj->SetTransfer(pTransfer);
-                    if (RT_SUCCESS(rc))
-                        rc = pObj->SetStatus(SharedClipboardWinDataObject::Running);
-
-                    pCtx->Win.pDataObjInFlight = NULL; /* Hand off to Windows. */
-                }
-                else
-                    AssertMsgFailed(("No data object in flight!\n"));
-
-                int rc2 = RTCritSectLeave(&pCtx->Win.CritSect);
-                AssertRC(rc2);
-            }
-
+            rc = SharedClipboardWinTransferSet(&pCtx->Win, pTransfer);
             break;
         }
