Index: trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-transfers.cpp
===================================================================
--- trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-transfers.cpp	(revision 80907)
+++ trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-transfers.cpp	(revision 80918)
@@ -2110,5 +2110,5 @@
     LogFlowFuncEnter();
 
-    SharedClipboardTransferCtxTransfersCleanup(&pClient->TransferCtx);
+    SharedClipboardTransferCtxCleanup(&pClient->TransferCtx);
 
     int rc;
Index: trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
===================================================================
--- trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp	(revision 80907)
+++ trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp	(revision 80918)
@@ -869,5 +869,5 @@
 
         HGCMSvcSetU32(&pMsgReadData->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID,
-                                                                                      pClient->Events.uID, uEvent));
+                                                                          pClient->Events.uID, uEvent));
         HGCMSvcSetU32(&pMsgReadData->paParms[1], pDataReq->uFmt);
         HGCMSvcSetU32(&pMsgReadData->paParms[2], pClient->State.cbChunkSize);
@@ -940,5 +940,5 @@
 
         HGCMSvcSetU32(&pMsg->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID,
-                                                                              pClient->Events.uID, uEvent));
+                                                                  pClient->Events.uID, uEvent));
         HGCMSvcSetU32(&pMsg->paParms[1], pFormats->uFormats);
         HGCMSvcSetU32(&pMsg->paParms[2], 0 /* fFlags */);
@@ -946,5 +946,17 @@
         rc = sharedClipboardSvcMsgAdd(pClient, pMsg, true /* fAppend */);
         if (RT_SUCCESS(rc))
-            rc = sharedClipboardSvcClientWakeup(pClient);
+        {
+#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
+            if (pFormats->uFormats & VBOX_SHCL_FMT_URI_LIST)
+            {
+                rc = sharedClipboardSvcTransferStart(pClient, SHCLTRANSFERDIR_WRITE, SHCLSOURCE_LOCAL,
+                                                     NULL /* pTransfer */);
+                if (RT_FAILURE(rc))
+                    LogRel(("Shared Clipboard: Initializing host write transfer failed with %Rrc\n", rc));
+            }
+#endif
+            if (RT_SUCCESS(rc))
+                rc = sharedClipboardSvcClientWakeup(pClient);
+        }
     }
     else
@@ -1367,90 +1379,76 @@
                 if (RT_SUCCESS(rc))
                 {
-#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
-                    if (uFormat == VBOX_SHCL_FMT_URI_LIST)
+                    void    *pv;
+                    uint32_t cb;
+                    rc = HGCMSvcGetBuf(&paParms[1], &pv, &cb);
+                    if (RT_SUCCESS(rc))
                     {
-                        rc = sharedClipboardSvcTransferStart(pClient, SHCLTRANSFERDIR_WRITE, SHCLSOURCE_LOCAL,
-                                                             NULL /* pTransfer */);
-                        if (RT_FAILURE(rc))
-                            LogRel(("Shared Clipboard: Initializing host write transfer failed with %Rrc\n", rc));
-                    }
-                    else
-                    {
-#endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */
-                        void    *pv;
-                        uint32_t cb;
-                        rc = HGCMSvcGetBuf(&paParms[1], &pv, &cb);
+                        uint32_t cbActual = 0;
+
+                        /* If there is a service extension active, try reading data from it first. */
+                        if (g_ExtState.pfnExtension)
+                        {
+                            SHCLEXTPARMS parms;
+                            RT_ZERO(parms);
+
+                            parms.uFormat  = uFormat;
+                            parms.u.pvData = pv;
+                            parms.cbData   = cb;
+
+                            g_ExtState.fReadingData = true;
+
+                            /* Read clipboard data from the extension. */
+                            rc = g_ExtState.pfnExtension(g_ExtState.pvExtension, VBOX_CLIPBOARD_EXT_FN_DATA_READ,
+                                                         &parms, sizeof(parms));
+
+                            LogFlowFunc(("g_ExtState.fDelayedAnnouncement=%RTbool, g_ExtState.uDelayedFormats=0x%x\n",
+                                         g_ExtState.fDelayedAnnouncement, g_ExtState.uDelayedFormats));
+
+                            /* Did the extension send the clipboard formats yet?
+                             * Otherwise, do this now. */
+                            if (g_ExtState.fDelayedAnnouncement)
+                            {
+                                SHCLFORMATDATA formatData;
+                                RT_ZERO(formatData);
+
+                                formatData.uFormats = g_ExtState.uDelayedFormats;
+
+                                int rc2 = sharedClipboardSvcFormatsReport(pClient, &formatData);
+                                AssertRC(rc2);
+
+                                g_ExtState.fDelayedAnnouncement = false;
+                                g_ExtState.uDelayedFormats = 0;
+                            }
+
+                            g_ExtState.fReadingData = false;
+
+                            if (RT_SUCCESS(rc))
+                            {
+                                cbActual = parms.cbData;
+                            }
+                        }
+
+                        /* Note: The host clipboard *always* has precedence over the service extension above,
+                         *       so data which has been read above might get overridden by the host clipboard eventually. */
+
+                        SHCLCLIENTCMDCTX cmdCtx;
+                        RT_ZERO(cmdCtx);
+
+                        /* Release any other pending read, as we only
+                         * support one pending read at one time. */
                         if (RT_SUCCESS(rc))
                         {
-                            uint32_t cbActual = 0;
-
-                            /* If there is a service extension active, try reading data from it first. */
-                            if (g_ExtState.pfnExtension)
-                            {
-                                SHCLEXTPARMS parms;
-                                RT_ZERO(parms);
-
-                                parms.uFormat  = uFormat;
-                                parms.u.pvData = pv;
-                                parms.cbData   = cb;
-
-                                g_ExtState.fReadingData = true;
-
-                                /* Read clipboard data from the extension. */
-                                rc = g_ExtState.pfnExtension(g_ExtState.pvExtension, VBOX_CLIPBOARD_EXT_FN_DATA_READ,
-                                                             &parms, sizeof(parms));
-
-                                LogFlowFunc(("g_ExtState.fDelayedAnnouncement=%RTbool, g_ExtState.uDelayedFormats=0x%x\n",
-                                             g_ExtState.fDelayedAnnouncement, g_ExtState.uDelayedFormats));
-
-                                /* Did the extension send the clipboard formats yet?
-                                 * Otherwise, do this now. */
-                                if (g_ExtState.fDelayedAnnouncement)
-                                {
-                                    SHCLFORMATDATA formatData;
-                                    RT_ZERO(formatData);
-
-                                    formatData.uFormats = g_ExtState.uDelayedFormats;
-
-                                    int rc2 = sharedClipboardSvcFormatsReport(pClient, &formatData);
-                                    AssertRC(rc2);
-
-                                    g_ExtState.fDelayedAnnouncement = false;
-                                    g_ExtState.uDelayedFormats = 0;
-                                }
-
-                                g_ExtState.fReadingData = false;
-
-                                if (RT_SUCCESS(rc))
-                                {
-                                    cbActual = parms.cbData;
-                                }
-                            }
-
-                            /* Note: The host clipboard *always* has precedence over the service extension above,
-                             *       so data which has been read above might get overridden by the host clipboard eventually. */
-
-                            SHCLCLIENTCMDCTX cmdCtx;
-                            RT_ZERO(cmdCtx);
-
-                            /* Release any other pending read, as we only
-                             * support one pending read at one time. */
+                            SHCLDATABLOCK dataBlock;
+                            RT_ZERO(dataBlock);
+
+                            dataBlock.pvData  = pv;
+                            dataBlock.cbData  = cb;
+                            dataBlock.uFormat = uFormat;
+
+                            rc = SharedClipboardSvcImplReadData(pClient, &cmdCtx, &dataBlock, &cbActual);
                             if (RT_SUCCESS(rc))
-                            {
-                                SHCLDATABLOCK dataBlock;
-                                RT_ZERO(dataBlock);
-
-                                dataBlock.pvData  = pv;
-                                dataBlock.cbData  = cb;
-                                dataBlock.uFormat = uFormat;
-
-                                rc = SharedClipboardSvcImplReadData(pClient, &cmdCtx, &dataBlock, &cbActual);
-                                if (RT_SUCCESS(rc))
-                                    HGCMSvcSetU32(&paParms[2], cbActual);
-                            }
+                                HGCMSvcSetU32(&paParms[2], cbActual);
                         }
-#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
                     }
-#endif
                 }
             }
