Index: /trunk/include/VBox/GuestHost/SharedClipboard.h
===================================================================
--- /trunk/include/VBox/GuestHost/SharedClipboard.h	(revision 81842)
+++ /trunk/include/VBox/GuestHost/SharedClipboard.h	(revision 81843)
@@ -110,5 +110,5 @@
 {
     /** Available format(s) as bit map. */
-    SHCLFORMATS uFormats;
+    SHCLFORMATS Formats;
     /** Formats flags. Currently unused. */
     uint32_t    fFlags;
@@ -284,6 +284,6 @@
  *  @{
  */
-extern DECLCALLBACK(int)  ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, uint32_t u32Format, void **ppv, uint32_t *pcb);
-extern DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, uint32_t u32Formats);
+extern DECLCALLBACK(int)  ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, SHCLFORMAT Format, void **ppv, uint32_t *pcb);
+extern DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, SHCLFORMATS Formats);
 extern DECLCALLBACK(void) ClipRequestFromX11CompleteCallback(SHCLCONTEXT *pCtx, int rc, CLIPREADCBREQ *pReq, void *pv, uint32_t cb);
 /** @} */
Index: /trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp	(revision 81842)
+++ /trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxClipboard.cpp	(revision 81843)
@@ -257,5 +257,5 @@
                     if (RT_SUCCESS(rc))
                     {
-                        LogFunc(("WM_CLIPBOARDUPDATE: Reporting formats 0x%x\n", Formats.uFormats));
+                        LogFunc(("WM_CLIPBOARDUPDATE: Reporting formats 0x%x\n", Formats.Formats));
                         rc = VbglR3ClipboardFormatsReportEx(&pCtx->CmdCtx, &Formats);
                     }
@@ -303,5 +303,5 @@
                     rc = SharedClipboardWinGetFormats(pWinCtx, &Formats);
                     if (RT_SUCCESS(rc)
-                        && Formats.uFormats != VBOX_SHCL_FMT_NONE)
+                        && Formats.Formats != VBOX_SHCL_FMT_NONE)
                     {
                         rc = VbglR3ClipboardFormatsReportEx(&pCtx->CmdCtx, &Formats);
@@ -515,5 +515,5 @@
             Assert(pEvent->enmType == VBGLR3CLIPBOARDEVENTTYPE_REPORT_FORMATS);
 
-            const SHCLFORMATS fFormats = pEvent->u.ReportedFormats.uFormats;
+            const SHCLFORMATS fFormats = pEvent->u.ReportedFormats.Formats;
 
             if (fFormats != VBOX_SHCL_FMT_NONE) /* Could arrive with some older GA versions. */
@@ -1016,5 +1016,5 @@
                     {
                         pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_REPORT_FORMATS;
-                        pEvent->u.ReportedFormats.uFormats = uFormats;
+                        pEvent->u.ReportedFormats.Formats = uFormats;
                         break;
                     }
Index: /trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp	(revision 81842)
+++ /trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp	(revision 81843)
@@ -200,5 +200,5 @@
         rc = Msg.u.v1.uContext.GetUInt64(&pCtx->uContextID);
         if (RT_SUCCESS(rc))
-            rc = Msg.u.v1.uFormats.GetUInt32(&pFormats->uFormats);
+            rc = Msg.u.v1.uFormats.GetUInt32(&pFormats->Formats);
         if (RT_SUCCESS(rc))
             rc = Msg.u.v1.fFlags.GetUInt32(&pFormats->fFlags);
@@ -2363,10 +2363,10 @@
     int rc;
 
-    LogFlowFunc(("uFormats=0x%x\n", pFormats->uFormats));
+    LogFlowFunc(("uFormats=0x%x\n", pFormats->Formats));
 
     if (pCtx->fUseLegacyProtocol)
     {
         VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, VBOX_SHCL_GUEST_FN_FORMATS_REPORT, 1);
-        Msg.u.v0.uFormats.SetUInt32(pFormats->uFormats);
+        Msg.u.v0.uFormats.SetUInt32(pFormats->Formats);
 
         rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg.hdr) + sizeof(Msg.u.v0));
@@ -2377,5 +2377,5 @@
 
         Msg.u.v1.uContext.SetUInt64(pCtx->uContextID);
-        Msg.u.v1.uFormats.SetUInt32(pFormats->uFormats);
+        Msg.u.v1.uFormats.SetUInt32(pFormats->Formats);
         Msg.u.v1.fFlags.SetUInt32(pFormats->fFlags);
 
Index: /trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp	(revision 81842)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp	(revision 81843)
@@ -46,31 +46,16 @@
 struct _SHCLCONTEXT
 {
-    /** Client ID for the clipboard subsystem */
-    uint32_t client;
-
-    /** Pointer to the X11 clipboard backend */
-    CLIPBACKEND *pBackend;
+    /** Client command context */
+    VBGLR3SHCLCMDCTX CmdCtx;
+#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
+    /** Associated transfer data. */
+    SHCLTRANSFERCTX  TransferCtx;
+#endif
+    /** Pointer to the X11 clipboard backend. */
+    CLIPBACKEND     *pBackend;
 };
 
 /** Only one client is supported. There seems to be no need for more clients. */
-static SHCLCONTEXT g_ctx;
-
-
-/**
- * Transfer clipboard data from the guest to the host.
- *
- * @returns VBox result code
- * @param   u32Format The format of the data being sent
- * @param   pv        Pointer to the data being sent
- * @param   cb        Size of the data being sent in bytes
- */
-static int vboxClipboardSendData(uint32_t u32Format, void *pv, uint32_t cb)
-{
-    int rc;
-    LogFlowFunc(("u32Format=%d, pv=%p, cb=%d\n", u32Format, pv, cb));
-    rc = VbglR3ClipboardWriteData(g_ctx.client, u32Format, pv, cb);
-    LogFlowFuncLeaveRC(rc);
-    return rc;
-}
+static SHCLCONTEXT g_Ctx;
 
 
@@ -79,65 +64,93 @@
  *
  * @returns VBox result code
- * @param   pCtx      Our context information
- * @param   u32Format The format of the data being requested
- * @param   ppv       On success and if pcb > 0, this will point to a buffer
- *                    to be freed with RTMemFree containing the data read.
- * @param   pcb       On success, this contains the number of bytes of data
- *                    returned
- */
-DECLCALLBACK(int) ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, uint32_t u32Format, void **ppv, uint32_t *pcb)
+ * @param   pCtx                Our context information.
+ * @param   Format              The format of the data being requested.
+ * @param   ppv                 On success and if pcb > 0, this will point to a buffer
+ *                              to be freed with RTMemFree containing the data read.
+ * @param   pcb                 On success, this contains the number of bytes of data
+ *                              returned.
+ */
+DECLCALLBACK(int) ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, SHCLFORMAT Format, void **ppv, uint32_t *pcb)
 {
     RT_NOREF(pCtx);
+
+    LogFlowFunc(("Format=0x%x\n", Format));
+
     int rc = VINF_SUCCESS;
-    uint32_t cb = 1024;
-    void *pv = RTMemAlloc(cb);
-
-    *ppv = 0;
-    LogFlowFunc(("u32Format=%u\n", u32Format));
-    if (RT_UNLIKELY(!pv))
-        rc = VERR_NO_MEMORY;
-    if (RT_SUCCESS(rc))
-        rc = VbglR3ClipboardReadData(g_ctx.client, u32Format, pv, cb, pcb);
-    if (RT_SUCCESS(rc) && (rc != VINF_BUFFER_OVERFLOW))
-        *ppv = pv;
-    /* A return value of VINF_BUFFER_OVERFLOW tells us to try again with a
-     * larger buffer.  The size of the buffer needed is placed in *pcb.
-     * So we start all over again. */
-    if (rc == VINF_BUFFER_OVERFLOW)
-    {
-        cb = *pcb;
-        RTMemFree(pv);
-        pv = RTMemAlloc(cb);
-        if (RT_UNLIKELY(!pv))
+
+    uint32_t cbRead = 0;
+
+#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
+    if (Format == VBOX_SHCL_FMT_URI_LIST)
+    {
+        //rc = VbglR3ClipboardRootListRead()
+    }
+    else
+#endif
+    {
+        SHCLDATABLOCK dataBlock;
+        RT_ZERO(dataBlock);
+
+        dataBlock.uFormat = Format;
+        dataBlock.cbData  = _4K;
+        dataBlock.pvData  = RTMemAlloc(dataBlock.cbData);
+        if (dataBlock.pvData)
+        {
+            rc = VbglR3ClipboardReadDataEx(&pCtx->CmdCtx, &dataBlock, &cbRead);
+        }
+        else
             rc = VERR_NO_MEMORY;
-        if (RT_SUCCESS(rc))
-            rc = VbglR3ClipboardReadData(g_ctx.client, u32Format, pv, cb, pcb);
-        if (RT_SUCCESS(rc) && (rc != VINF_BUFFER_OVERFLOW))
-            *ppv = pv;
-    }
-    /* Catch other errors. This also catches the case in which the buffer was
-     * too small a second time, possibly because the clipboard contents
-     * changed half-way through the operation.  Since we can't say whether or
-     * not this is actually an error, we just return size 0.
-     */
-    if (RT_FAILURE(rc) || (VINF_BUFFER_OVERFLOW == rc))
-    {
-        *pcb = 0;
-        if (pv != NULL)
-            RTMemFree(pv);
-    }
+
+        /*
+         * A return value of VINF_BUFFER_OVERFLOW tells us to try again with a
+         * larger buffer.  The size of the buffer needed is placed in *pcb.
+         * So we start all over again.
+         */
+        if (rc == VINF_BUFFER_OVERFLOW)
+        {
+            /* cbRead contains the size required. */
+
+            dataBlock.cbData = cbRead;
+            dataBlock.pvData = RTMemRealloc(dataBlock.pvData, cbRead);
+            if (dataBlock.pvData)
+            {
+                rc = VbglR3ClipboardReadDataEx(&pCtx->CmdCtx, &dataBlock, &cbRead);
+                if (    RT_SUCCESS(rc)
+                     && (rc != VINF_BUFFER_OVERFLOW))
+                {
+                    *pcb = cbRead; /* Actual bytes read. */
+                    *ppv = dataBlock.pvData;
+                }
+            }
+            else
+                rc = VERR_NO_MEMORY;
+        }
+
+        /*
+         * Catch other errors. This also catches the case in which the buffer was
+         * too small a second time, possibly because the clipboard contents
+         * changed half-way through the operation.  Since we can't say whether or
+         * not this is actually an error, we just return size 0.
+         */
+        if (   RT_FAILURE(rc)
+            || (VINF_BUFFER_OVERFLOW == rc))
+        {
+            RTMemFree(dataBlock.pvData);
+        }
+    }
+
     LogFlowFuncLeaveRC(rc);
-    if (RT_SUCCESS(rc))
-        LogFlow(("    *pcb=%d\n", *pcb));
     return rc;
 }
 
-/** Opaque data structure describing a request from the host for clipboard
+/**
+ * Opaque data structure describing a request from the host for clipboard
  * data, passed in when the request is forwarded to the X11 backend so that
- * it can be completed correctly. */
+ * it can be completed correctly.
+ */
 struct _CLIPREADCBREQ
 {
     /** The data format that was requested. */
-    uint32_t u32Format;
+    SHCLFORMAT Format;
 };
 
@@ -146,36 +159,56 @@
  *
  * @param pCtx                  Our context information.
- * @param u32Formats            The formats to report.
- */
-DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, uint32_t u32Formats)
+ * @param Formats               The formats to report.
+ */
+DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, SHCLFORMATS Formats)
 {
     RT_NOREF(pCtx);
 
-    LogFlowFunc(("u32Formats=%RU32\n", u32Formats));
-
-    int rc = VbglR3ClipboardFormatsReport(g_ctx.client, u32Formats);
-    RT_NOREF(rc);
-
-    LogFlowFuncLeaveRC(rc);
-}
-
-/** This is called by the backend to tell us that a request for data from
+    LogFlowFunc(("Formats=0x%x\n", Formats));
+
+    SHCLFORMATDATA formatData;
+    RT_ZERO(formatData);
+
+    formatData.Formats = Formats;
+
+    int rc2 = VbglR3ClipboardFormatsReportEx(&pCtx->CmdCtx, &formatData);
+    RT_NOREF(rc2);
+    LogFlowFuncLeaveRC(rc2);
+}
+
+/**
+ * This is called by the backend to tell us that a request for data from
  * X11 has completed.
- * @param  pCtx      Our context information
- * @param  rc        the iprt result code of the request
- * @param  pReq      the request structure that we passed in when we started
- *                   the request.  We RTMemFree() this in this function.
- * @param  pv        the clipboard data returned from X11 if the request
- *                   succeeded (see @a rc)
- * @param  cb        the size of the data in @a pv
+ *
+ * @param  pCtx                 Our context information.
+ * @param  rc                   The IPRT result code of the request.
+ * @param  pReq                 The request structure that we passed in when we started
+ *                              the request.  We RTMemFree() this in this function.
+ * @param  pv                   The clipboard data returned from X11 if the request succeeded (see @a rc).
+ * @param  cb                   The size of the data in @a pv.
  */
 DECLCALLBACK(void) ClipRequestFromX11CompleteCallback(SHCLCONTEXT *pCtx, int rc, CLIPREADCBREQ *pReq, void *pv, uint32_t cb)
 {
     RT_NOREF(pCtx);
+
+    LogFlowFunc(("rc=%Rrc, Format=0x%x, pv=%p, cb=%RU32\n", rc, pReq->Format, pv, cb));
+
+    SHCLDATABLOCK dataBlock;
+    RT_ZERO(dataBlock);
+
+    dataBlock.uFormat = pReq->Format;
+
     if (RT_SUCCESS(rc))
-        vboxClipboardSendData(pReq->u32Format, pv, cb);
-    else
-        vboxClipboardSendData(0, NULL, 0);
+    {
+        dataBlock.pvData = pv;
+        dataBlock.cbData = cb;
+    }
+
+    int rc2 = VbglR3ClipboardWriteDataEx(&pCtx->CmdCtx, &dataBlock);
+    RT_NOREF(rc2);
+
     RTMemFree(pReq);
+
+    LogFlowFuncLeaveRC(rc2);
 }
 
@@ -183,5 +216,5 @@
  * Connect the guest clipboard to the host.
  *
- * @returns VBox status code
+ * @returns VBox status code.
  */
 static int vboxClipboardConnect(void)
@@ -189,23 +222,13 @@
     LogFlowFuncEnter();
 
-    /* Sanity */
-    AssertReturn(g_ctx.client   == 0,    VERR_WRONG_ORDER);
-    AssertReturn(g_ctx.pBackend == NULL, VERR_WRONG_ORDER);
-
     int rc;
 
-    g_ctx.pBackend = ClipConstructX11(&g_ctx, false);
-    if (g_ctx.pBackend)
-    {
-        rc = ClipStartX11(g_ctx.pBackend, false /* grab */);
+    g_Ctx.pBackend = ClipConstructX11(&g_Ctx, false);
+    if (g_Ctx.pBackend)
+    {
+        rc = ClipStartX11(g_Ctx.pBackend, false /* grab */);
         if (RT_SUCCESS(rc))
         {
-            rc = VbglR3ClipboardConnect(&g_ctx.client);
-            if (RT_SUCCESS(rc))
-            {
-                Assert(g_ctx.client);
-            }
-            else
-                VBClLogError("Error connecting to host, rc=%Rrc\n", rc);
+            rc = VbglR3ClipboardConnectEx(&g_Ctx.CmdCtx);
         }
     }
@@ -213,6 +236,11 @@
         rc = VERR_NO_MEMORY;
 
-    if (rc != VINF_SUCCESS && g_ctx.pBackend)
-        ClipDestructX11(g_ctx.pBackend);
+    if (RT_FAILURE(rc))
+    {
+        VBClLogError("Error connecting to host service, rc=%Rrc\n", rc);
+
+        VbglR3ClipboardDisconnectEx(&g_Ctx.CmdCtx);
+        ClipDestructX11(g_Ctx.pBackend);
+    }
 
     LogFlowFuncLeaveRC(rc);
@@ -225,55 +253,151 @@
 int vboxClipboardMain(void)
 {
+    LogRel2(("Worker loop running\n"));
+
     int rc;
-    LogFlowFunc(("Starting guest clipboard service\n"));
-    bool fExiting = false;
-
-    while (!fExiting)
-    {
-        uint32_t Msg;
-        uint32_t fFormats;
-        rc = VbglR3ClipboardGetHostMsgOld(g_ctx.client, &Msg, &fFormats);
-        if (RT_SUCCESS(rc))
-        {
-            switch (Msg)
-            {
-                case VBOX_SHCL_HOST_MSG_FORMATS_REPORT:
-                {
-                    /* The host has announced available clipboard formats.
-                     * Save the information so that it is available for
-                     * future requests from guest applications.
-                     */
-                    LogFlowFunc(("VBOX_SHCL_HOST_MSG_FORMATS_WRITE fFormats=%x\n", fFormats));
-                    ClipAnnounceFormatToX11(g_ctx.pBackend, fFormats);
-                    break;
-                }
-
-                case VBOX_SHCL_HOST_MSG_READ_DATA:
+
+    SHCLCONTEXT *pCtx = &g_Ctx;
+
+    bool fShutdown = false;
+
+    /* The thread waits for incoming messages from the host. */
+    for (;;)
+    {
+        PVBGLR3CLIPBOARDEVENT pEvent = NULL;
+
+        LogFlowFunc(("Waiting for host message (fUseLegacyProtocol=%RTbool, fHostFeatures=%#RX64) ...\n",
+                     pCtx->CmdCtx.fUseLegacyProtocol, pCtx->CmdCtx.fHostFeatures));
+
+        if (pCtx->CmdCtx.fUseLegacyProtocol)
+        {
+            uint32_t uMsg;
+            uint32_t uFormats;
+
+            rc = VbglR3ClipboardGetHostMsgOld(pCtx->CmdCtx.uClientID, &uMsg, &uFormats);
+            if (RT_FAILURE(rc))
+            {
+                if (rc == VERR_INTERRUPTED)
+                    break;
+
+                LogFunc(("Error getting host message, rc=%Rrc\n", rc));
+            }
+            else
+            {
+                pEvent = (PVBGLR3CLIPBOARDEVENT)RTMemAllocZ(sizeof(VBGLR3CLIPBOARDEVENT));
+                AssertPtrBreakStmt(pEvent, rc = VERR_NO_MEMORY);
+
+                switch (uMsg)
+                {
+                    case VBOX_SHCL_HOST_MSG_FORMATS_REPORT:
+                    {
+                        pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_REPORT_FORMATS;
+                        pEvent->u.ReportedFormats.Formats = uFormats;
+                        break;
+                    }
+
+                    case VBOX_SHCL_HOST_MSG_READ_DATA:
+                    {
+                        pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_READ_DATA;
+                        pEvent->u.ReadData.uFmt = uFormats;
+                        break;
+                    }
+
+                    case VBOX_SHCL_HOST_MSG_QUIT:
+                    {
+                        pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_QUIT;
+                        break;
+                    }
+
+                    default:
+                        rc = VERR_NOT_SUPPORTED;
+                        break;
+                }
+
+                if (RT_SUCCESS(rc))
+                {
+                    /* Copy over our command context to the event. */
+                    pEvent->cmdCtx = pCtx->CmdCtx;
+                }
+            }
+        }
+        else /* Host service has peeking for messages support. */
+        {
+            pEvent = (PVBGLR3CLIPBOARDEVENT)RTMemAllocZ(sizeof(VBGLR3CLIPBOARDEVENT));
+            AssertPtrBreakStmt(pEvent, rc = VERR_NO_MEMORY);
+
+            uint32_t uMsg   = 0;
+            uint32_t cParms = 0;
+            rc = VbglR3ClipboardMsgPeekWait(&pCtx->CmdCtx, &uMsg, &cParms, NULL /* pidRestoreCheck */);
+            if (RT_SUCCESS(rc))
+            {
+#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
+                rc = VbglR3ClipboardEventGetNextEx(uMsg, cParms, &pCtx->CmdCtx, &pCtx->TransferCtx, pEvent);
+#else
+                rc = VbglR3ClipboardEventGetNext(uMsg, cParms, &pCtx->CmdCtx, pEvent);
+#endif
+            }
+        }
+
+        if (RT_FAILURE(rc))
+        {
+            LogFlowFunc(("Getting next event failed with %Rrc\n", rc));
+
+            VbglR3ClipboardEventFree(pEvent);
+            pEvent = NULL;
+
+            if (fShutdown)
+                break;
+
+            /* Wait a bit before retrying. */
+            RTThreadSleep(1000);
+            continue;
+        }
+        else
+        {
+            AssertPtr(pEvent);
+            LogFlowFunc(("Event uType=%RU32\n", pEvent->enmType));
+
+            switch (pEvent->enmType)
+            {
+                case VBGLR3CLIPBOARDEVENTTYPE_REPORT_FORMATS:
+                {
+                    ClipAnnounceFormatToX11(g_Ctx.pBackend, pEvent->u.ReportedFormats.Formats);
+                    break;
+                }
+
+                case VBGLR3CLIPBOARDEVENTTYPE_READ_DATA:
                 {
                     /* The host needs data in the specified format. */
-                    LogFlowFunc(("VBOX_SHCL_HOST_MSG_READ_DATA fFormats=%x\n", fFormats));
                     CLIPREADCBREQ *pReq;
-                    pReq = (CLIPREADCBREQ *)RTMemAllocZ(sizeof(*pReq));
-                    if (!pReq)
+                    pReq = (CLIPREADCBREQ *)RTMemAllocZ(sizeof(CLIPREADCBREQ));
+                    if (pReq)
                     {
-                        rc = VERR_NO_MEMORY;
-                        fExiting = true;
+                        pReq->Format = pEvent->u.ReadData.uFmt;
+                        ClipReadDataFromX11(g_Ctx.pBackend, pReq->Format, pReq);
                     }
                     else
-                    {
-                        pReq->u32Format = fFormats;
-                        ClipReadDataFromX11(g_ctx.pBackend, fFormats,
-                                               pReq);
-                    }
-                    break;
-                }
-
-                case VBOX_SHCL_HOST_MSG_QUIT:
-                {
-                    /* The host is terminating. */
-                    LogFlowFunc(("VBOX_SHCL_HOST_MSG_QUIT\n"));
-                    if (RT_SUCCESS(ClipStopX11(g_ctx.pBackend)))
-                        ClipDestructX11(g_ctx.pBackend);
-                    fExiting = true;
+                        rc = VERR_NO_MEMORY;
+                    break;
+                }
+
+                case VBGLR3CLIPBOARDEVENTTYPE_QUIT:
+                {
+                    LogRel2(("Host requested termination\n"));
+                    fShutdown = true;
+                    break;
+                }
+
+#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
+                case VBGLR3CLIPBOARDEVENTTYPE_TRANSFER_STATUS:
+                {
+                    /* Nothing to do here. */
+                    rc = VINF_SUCCESS;
+                    break;
+                }
+#endif
+                case VBGLR3CLIPBOARDEVENTTYPE_NONE:
+                {
+                    /* Nothing to do here. */
+                    rc = VINF_SUCCESS;
                     break;
                 }
@@ -281,12 +405,21 @@
                 default:
                 {
-                    VBClLogInfo("Unsupported message from host (%RU32)\n", Msg);
-                    break;
-                }
-            }
-        }
-
-        LogFlow(("processed host event rc = %d\n", rc));
-    }
+                    AssertMsgFailedBreakStmt(("Event type %RU32 not implemented\n", pEvent->enmType), rc = VERR_NOT_SUPPORTED);
+                }
+            }
+
+            if (pEvent)
+            {
+                VbglR3ClipboardEventFree(pEvent);
+                pEvent = NULL;
+            }
+        }
+
+        if (fShutdown)
+            break;
+    }
+
+    LogRel(("Worker loop ended\n"));
+
     LogFlowFuncLeaveRC(rc);
     return rc;
@@ -343,5 +476,5 @@
 };
 
-struct VBCLSERVICE **VBClGetClipboardService()
+struct VBCLSERVICE **VBClGetClipboardService(void)
 {
     struct CLIPBOARDSERVICE *pService =
Index: /trunk/src/VBox/GuestHost/SharedClipboard/clipboard-win.cpp
===================================================================
--- /trunk/src/VBox/GuestHost/SharedClipboard/clipboard-win.cpp	(revision 81842)
+++ /trunk/src/VBox/GuestHost/SharedClipboard/clipboard-win.cpp	(revision 81843)
@@ -459,5 +459,5 @@
         LogFlowFunc(("fFormats=0x%08X\n", fFormats));
 
-        pFormats->uFormats = fFormats;
+        pFormats->Formats = fFormats;
         pFormats->fFlags   = 0; /** @todo Handle flags. */
     }
Index: /trunk/src/VBox/GuestHost/SharedClipboard/clipboard-x11.cpp
===================================================================
--- /trunk/src/VBox/GuestHost/SharedClipboard/clipboard-x11.cpp	(revision 81842)
+++ /trunk/src/VBox/GuestHost/SharedClipboard/clipboard-x11.cpp	(revision 81843)
@@ -252,5 +252,5 @@
 #endif
     /** What formats does VBox have on offer? */
-    uint32_t vboxFormats;
+    SHCLFORMATS vboxFormats;
     /** Cache of the last unicode data that we received */
     void *pvUnicodeCache;
@@ -1100,9 +1100,15 @@
 void ClipDestructX11(CLIPBACKEND *pCtx)
 {
+    if (!pCtx)
+        return;
+
     if (pCtx->fHaveX11)
+    {
         /* We set this to NULL when the event thread exits.  It really should
          * have exited at this point, when we are about to unload the code from
          * memory. */
         Assert(pCtx->widget == NULL);
+    }
+
     RTMemFree(pCtx);
 }
@@ -1251,14 +1257,15 @@
  * data returned.
  */
-static int clipReadVBoxShCl(CLIPBACKEND *pCtx, uint32_t u32Format,
+static int clipReadVBoxShCl(CLIPBACKEND *pCtx, SHCLFORMAT Format,
                             void **ppv, uint32_t *pcb)
 {
+    LogFlowFunc(("pCtx=%p, Format=%02X, ppv=%p, pcb=%p\n", pCtx, Format, ppv, pcb));
+
     int rc = VINF_SUCCESS;
-    LogFlowFunc(("pCtx=%p, u32Format=%02X, ppv=%p, pcb=%p\n", pCtx,
-                 u32Format, ppv, pcb));
-    if (u32Format == VBOX_SHCL_FMT_UNICODETEXT)
+
+    if (Format == VBOX_SHCL_FMT_UNICODETEXT)
     {
         if (pCtx->pvUnicodeCache == NULL)
-            rc = ClipRequestDataForX11Callback(pCtx->pFrontend, u32Format,
+            rc = ClipRequestDataForX11Callback(pCtx->pFrontend, Format,
                                                &pCtx->pvUnicodeCache,
                                                &pCtx->cbUnicodeCache);
@@ -1272,5 +1279,5 @@
     }
     else
-        rc = ClipRequestDataForX11Callback(pCtx->pFrontend, u32Format,
+        rc = ClipRequestDataForX11Callback(pCtx->pFrontend, Format,
                                            ppv, pcb);
     if (RT_SUCCESS(rc))
@@ -1489,7 +1496,9 @@
 
     CLIPX11FORMAT x11Format = clipFindX11FormatByAtom(pCtx, *atomTarget);
-    CLIPFORMAT format = clipRealFormatForX11Format(x11Format);
-
-    if (   ((format == UTF8) || (format == TEXT))
+    CLIPFORMAT clipFormat = clipRealFormatForX11Format(x11Format);
+
+    LogFlowFunc(("fFormats=0x%x, x11Format=%u, clipFormat=%u\n", pCtx->vboxFormats, x11Format, clipFormat));
+
+    if (   ((clipFormat == UTF8) || (clipFormat == TEXT))
         && (pCtx->vboxFormats & VBOX_SHCL_FMT_UNICODETEXT))
     {
@@ -1499,5 +1508,5 @@
         if (RT_SUCCESS(rc) && (cb == 0))
             rc = VERR_NO_DATA;
-        if (RT_SUCCESS(rc) && ((format == UTF8) || (format == TEXT)))
+        if (RT_SUCCESS(rc) && ((clipFormat == UTF8) || (clipFormat == TEXT)))
             rc = clipWinTxtToUtf8ForX11CB(XtDisplay(pCtx->widget),
                                           (PRTUTF16)pv, cb, atomTarget,
@@ -1505,9 +1514,9 @@
                                           pcLenReturn, piFormatReturn);
         if (RT_SUCCESS(rc))
-            clipTrimTrailingNul(*(XtPointer *)pValReturn, pcLenReturn, format);
+            clipTrimTrailingNul(*(XtPointer *)pValReturn, pcLenReturn, clipFormat);
 
         RTMemFree(pv);
     }
-    else if (   (format == BMP)
+    else if (   (clipFormat == BMP)
              && (pCtx->vboxFormats & VBOX_SHCL_FMT_BITMAP))
     {
@@ -1517,5 +1526,5 @@
         if (RT_SUCCESS(rc) && (cb == 0))
             rc = VERR_NO_DATA;
-        if (RT_SUCCESS(rc) && (format == BMP))
+        if (RT_SUCCESS(rc) && (clipFormat == BMP))
         {
             /* Create a full BMP from it */
@@ -1534,5 +1543,5 @@
         RTMemFree(pv);
     }
-    else if (  (format == HTML)
+    else if (  (clipFormat == HTML)
             && (pCtx->vboxFormats & VBOX_SHCL_FMT_HTML))
     {
@@ -1557,11 +1566,50 @@
                                            pcLenReturn, piFormatReturn);
             if (RT_SUCCESS(rc))
-                clipTrimTrailingNul(*(XtPointer *)pValReturn, pcLenReturn, format);
+                clipTrimTrailingNul(*(XtPointer *)pValReturn, pcLenReturn, clipFormat);
 
             RTMemFree(pv);
         }
     }
+#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
+    else if (pCtx->vboxFormats & VBOX_SHCL_FMT_URI_LIST)
+    {
+        switch (clipFormat)
+        {
+            case TEXT:
+                RT_FALL_THROUGH();
+            case UTF8:
+            {
+                void    *pv = NULL;
+                uint32_t cb = 0;
+                rc = clipReadVBoxShCl(pCtx, VBOX_SHCL_FMT_URI_LIST, &pv, &cb);
+
+                RTMemFree(pv);
+                break;
+            }
+
+            case URI_LIST:
+            {
+                break;
+            }
+
+            default:
+                rc = VERR_NOT_SUPPORTED;
+                break;
+        }
+    }
+#endif
     else
+    {
+        *atomTypeReturn = XT_CONVERT_FAIL;
+        *pValReturn     = (XtPointer)NULL;
+        *pcLenReturn    = 0;
+        *piFormatReturn = 0;
+
         rc = VERR_NOT_SUPPORTED;
+    }
+
+    if (RT_FAILURE(rc))
+        LogRel2(("Shared Clipboard: Converting format 0x%x for X11 (x11Format=%u, clipFormat=%u) failed, rc=%Rrc\n",
+                 pCtx->vboxFormats, x11Format, clipFormat, rc));
 
     LogFlowFuncLeaveRC(rc);
@@ -1587,8 +1635,8 @@
 
     if (!pCtx)
-        return false;
+        return False;
 
     if (!clipIsSupportedSelectionType(pCtx, *atomSelection))
-        return false;
+        return False;
 
     if (*atomTarget == clipGetAtom(pCtx, "TARGETS"))
@@ -1599,6 +1647,6 @@
                                      pValReturn, pcLenReturn, piFormatReturn);
 
-    LogFlowFunc(("returning, internal status code %Rrc\n", rc));
-    return RT_SUCCESS(rc);
+    LogFlowFunc(("returning %RTbool, internal status code %Rrc\n", RT_SUCCESS(rc), rc));
+    return RT_SUCCESS(rc) ? True : False;
 }
 
@@ -1611,5 +1659,5 @@
     CLIPBACKEND *pCtx;
     /** Formats supported by VBox. */
-    SHCLFORMATS  formats;
+    SHCLFORMATS  Formats;
 } CLIPNEWVBOXFORMATS, *PCLIPNEWVBOXFORMATS;
 
@@ -1627,10 +1675,12 @@
  * Takes possession of the X11 clipboard (and middle-button selection).
  */
-static void clipGrabX11CB(CLIPBACKEND *pCtx, uint32_t u32Formats)
-{
+static void clipGrabX11CB(CLIPBACKEND *pCtx, SHCLFORMATS Formats)
+{
+    LogFlowFuncEnter();
+
     if (XtOwnSelection(pCtx->widget, clipGetAtom(pCtx, "CLIPBOARD"),
                        CurrentTime, clipXtConvertSelectionProc, NULL, 0))
     {
-        pCtx->vboxFormats = u32Formats;
+        pCtx->vboxFormats = Formats;
         /* Grab the middle-button paste selection too. */
         XtOwnSelection(pCtx->widget, clipGetAtom(pCtx, "PRIMARY"),
@@ -1663,5 +1713,5 @@
     CLIPBACKEND *pCtx = pFormats->pCtx;
 
-    uint32_t fFormats = pFormats->formats;
+    uint32_t fFormats = pFormats->Formats;
 
     RTMemFree(pFormats);
@@ -1680,7 +1730,7 @@
  *
  * @returns VBox status code.
- * @param   u32Formats          Clipboard formats offered.
- */
-int ClipAnnounceFormatToX11(CLIPBACKEND *pCtx, uint32_t u32Formats)
+ * @param   Formats             Clipboard formats offered.
+ */
+int ClipAnnounceFormatToX11(CLIPBACKEND *pCtx, uint32_t Formats)
 {
     /*
@@ -1697,5 +1747,5 @@
     {
         pFormats->pCtx    = pCtx;
-        pFormats->formats = u32Formats;
+        pFormats->Formats = Formats;
 
         rc = clipQueueToEventThread(pCtx, clipAnnounceFormatToX11Worker,
@@ -2289,10 +2339,10 @@
  * @returns VBox status code.
  * @param  pCtx                 Context data for the clipboard backend.
- * @param  u32Format            The format that the VBox would like to receive the data in.
+ * @param  Format               The format that the VBox would like to receive the data in.
  * @param  pReq                 Read callback request to use. Must be free'd in the callback.
  *
  * @note   We allocate a request structure which must be freed by the worker.
  */
-int ClipReadDataFromX11(CLIPBACKEND *pCtx, uint32_t u32Format, CLIPREADCBREQ *pReq)
+int ClipReadDataFromX11(CLIPBACKEND *pCtx, SHCLFORMAT Format, CLIPREADCBREQ *pReq)
 {
     /*
@@ -2308,5 +2358,5 @@
     {
         pX11Req->mpCtx   = pCtx;
-        pX11Req->mFormat = u32Format;
+        pX11Req->mFormat = Format;
         pX11Req->mpReq   = pReq;
 
@@ -2386,7 +2436,7 @@
 
 /* Return the data in the simulated VBox clipboard. */
-DECLCALLBACK(int) ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, uint32_t u32Format, void **ppv, uint32_t *pcb)
-{
-    RT_NOREF(pCtx, u32Format);
+DECLCALLBACK(int) ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, uint32_t Format, void **ppv, uint32_t *pcb)
+{
+    RT_NOREF(pCtx, Format);
     *pcb = g_tstVBoxDataCb;
     if (g_tstVBoxDataPv != NULL)
@@ -2503,11 +2553,11 @@
 }
 
-/* The formats currently on offer from X11 via the shared clipboard */
+/* The formats currently on offer from X11 via the shared clipboard. */
 static uint32_t g_fX11Formats = 0;
 
-DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, uint32_t u32Formats)
+DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, SHCLFORMATS Formats)
 {
     RT_NOREF(pCtx);
-    g_fX11Formats = u32Formats;
+    g_fX11Formats = Formats;
 }
 
@@ -3145,13 +3195,13 @@
 # include <iprt/test.h>
 
-DECLCALLBACK(int) ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, uint32_t u32Format, void **ppv, uint32_t *pcb)
-{
-    RT_NOREF(pCtx, u32Format, ppv, pcb);
+DECLCALLBACK(int) ClipRequestDataForX11Callback(SHCLCONTEXT *pCtx, SHCLFORMAT Format, void **ppv, uint32_t *pcb)
+{
+    RT_NOREF(pCtx, Format, ppv, pcb);
     return VERR_NO_DATA;
 }
 
-DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, uint32_t u32Formats)
-{
-    RT_NOREF(pCtx, u32Formats);
+DECLCALLBACK(void) ClipReportX11FormatsCallback(SHCLCONTEXT *pCtx, SHCLFORMATS Formats)
+{
+    RT_NOREF(pCtx, Formats);
 }
 
Index: /trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-darwin.cpp
===================================================================
--- /trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-darwin.cpp	(revision 81842)
+++ /trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-darwin.cpp	(revision 81843)
@@ -74,5 +74,5 @@
         RT_ZERO(formatData);
 
-        formatData.uFormats = fFormats;
+        formatData.Formats = fFormats;
 
         rc = ShClSvcFormatsReport(pCtx->pClient, &formatData);
@@ -202,7 +202,7 @@
     RT_NOREF(pCmdCtx);
 
-    LogFlowFunc(("uFormats=%02X\n", pFormats->uFormats));
-
-    if (pFormats->uFormats == VBOX_SHCL_FMT_NONE)
+    LogFlowFunc(("uFormats=%02X\n", pFormats->Formats));
+
+    if (pFormats->Formats == VBOX_SHCL_FMT_NONE)
     {
         /* This is just an automatism, not a genuine announcement */
@@ -211,5 +211,5 @@
 
 #ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
-    if (pFormats->uFormats & VBOX_SHCL_FMT_URI_LIST) /* No transfer support yet. */
+    if (pFormats->Formats & VBOX_SHCL_FMT_URI_LIST) /* No transfer support yet. */
         return VINF_SUCCESS;
 #endif
@@ -218,5 +218,5 @@
     RT_ZERO(dataReq);
 
-    dataReq.uFmt   = pFormats->uFormats;
+    dataReq.uFmt   = pFormats->Formats;
     dataReq.cbSize = _64K; /** @todo Make this more dynamic. */
 
Index: /trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp
===================================================================
--- /trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp	(revision 81842)
+++ /trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp	(revision 81843)
@@ -595,5 +595,5 @@
         rc = SharedClipboardWinGetFormats(&pCtx->Win, &Formats);
         if (   RT_SUCCESS(rc)
-            && Formats.uFormats != VBOX_SHCL_FMT_NONE)
+            && Formats.Formats != VBOX_SHCL_FMT_NONE)
         {
             rc = ShClSvcFormatsReport(pCtx->pClient, &Formats);
@@ -726,5 +726,5 @@
     AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
 
-    LogFlowFunc(("uFormats=0x%x, hWnd=%p\n", pFormats->uFormats, pCtx->Win.hWnd));
+    LogFlowFunc(("uFormats=0x%x, hWnd=%p\n", pFormats->Formats, pCtx->Win.hWnd));
 
     /*
@@ -732,5 +732,5 @@
      */
     PostMessage(pCtx->Win.hWnd, SHCL_WIN_WM_REPORT_FORMATS,
-                0 /* wParam */, pFormats->uFormats /* lParam */);
+                0 /* wParam */, pFormats->Formats /* lParam */);
 
     rc = VINF_SUCCESS;
Index: /trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp
===================================================================
--- /trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp	(revision 81842)
+++ /trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp	(revision 81843)
@@ -119,5 +119,5 @@
     RT_ZERO(formatData);
 
-    formatData.uFormats = VBOX_SHCL_FMT_NONE;
+    formatData.Formats = VBOX_SHCL_FMT_NONE;
 
     return ShClSvcFormatsReport(pClient, &formatData);
@@ -161,5 +161,5 @@
     RT_NOREF(pCmdCtx);
 
-    int rc = ClipAnnounceFormatToX11(pClient->State.pCtx->pBackend, pFormats->uFormats);
+    int rc = ClipAnnounceFormatToX11(pClient->State.pCtx->pBackend, pFormats->Formats);
 
     LogFlowFuncLeaveRC(rc);
@@ -255,11 +255,11 @@
  *
  * @param  pCtx                 Opaque context pointer for the glue code.
- * @param  u32Formats           The formats available.
- */
-DECLCALLBACK(void) ClipReportX11FormatsCallback(PSHCLCONTEXT pCtx, uint32_t u32Formats)
-{
-    LogFlowFunc(("pCtx=%p, u32Formats=%02X\n", pCtx, u32Formats));
-
-    if (u32Formats == VBOX_SHCL_FMT_NONE) /* No formats to report? Bail out early. */
+ * @param  Formats              The formats available.
+ */
+DECLCALLBACK(void) ClipReportX11FormatsCallback(PSHCLCONTEXT pCtx, uint32_t Formats)
+{
+    LogFlowFunc(("pCtx=%p, Formats=%02X\n", pCtx, Formats));
+
+    if (Formats == VBOX_SHCL_FMT_NONE) /* No formats to report? Bail out early. */
         return;
 
@@ -267,5 +267,5 @@
     RT_ZERO(formatData);
 
-    formatData.uFormats = u32Formats;
+    formatData.Formats = Formats;
 
     int rc = ShClSvcFormatsReport(pCtx->pClient, &formatData);
@@ -322,5 +322,5 @@
  *
  * @param  pCtx      Pointer to the host clipboard structure.
- * @param  u32Format The format in which the data should be transferred
+ * @param  Format    The format in which the data should be transferred.
  * @param  ppv       On success and if pcb > 0, this will point to a buffer
  *                   to be freed with RTMemFree containing the data read.
@@ -328,7 +328,7 @@
  *                   returned.
  */
-DECLCALLBACK(int) ClipRequestDataForX11Callback(PSHCLCONTEXT pCtx, uint32_t u32Format, void **ppv, uint32_t *pcb)
-{
-    LogFlowFunc(("pCtx=%p, u32Format=%02X, ppv=%p\n", pCtx, u32Format, ppv));
+DECLCALLBACK(int) ClipRequestDataForX11Callback(PSHCLCONTEXT pCtx, SHCLFORMAT Format, void **ppv, uint32_t *pcb)
+{
+    LogFlowFunc(("pCtx=%p, Format=0x%x\n", pCtx, Format));
 
     if (pCtx->fShuttingDown)
@@ -339,27 +339,38 @@
     }
 
-    /* Request data from the guest. */
-    SHCLDATAREQ dataReq;
-    RT_ZERO(dataReq);
-
-    dataReq.uFmt   = u32Format;
-    dataReq.cbSize = _64K; /** @todo Make this more dynamic. */
-
-    SHCLEVENTID uEvent;
-    int rc = ShClSvcDataReadRequest(pCtx->pClient, &dataReq, &uEvent);
-    if (RT_SUCCESS(rc))
-    {
-        PSHCLEVENTPAYLOAD pPayload;
-        rc = ShClEventWait(&pCtx->pClient->Events, uEvent, 30 * 1000, &pPayload);
+    int rc;
+
+#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
+    if (Format == VBOX_SHCL_FMT_URI_LIST)
+    {
+        rc = 0;
+    }
+    else
+#endif
+    {
+        /* Request data from the guest. */
+        SHCLDATAREQ dataReq;
+        RT_ZERO(dataReq);
+
+        dataReq.uFmt   = Format;
+        dataReq.cbSize = _64K; /** @todo Make this more dynamic. */
+
+        SHCLEVENTID uEvent;
+        rc = ShClSvcDataReadRequest(pCtx->pClient, &dataReq, &uEvent);
         if (RT_SUCCESS(rc))
         {
-            *ppv = pPayload->pvData;
-            *pcb = pPayload->cbData;
-
-            /* Detach the payload, as the caller then will own the data. */
-            ShClEventPayloadDetach(&pCtx->pClient->Events, uEvent);
-        }
-
-        ShClEventUnregister(&pCtx->pClient->Events, uEvent);
+            PSHCLEVENTPAYLOAD pPayload;
+            rc = ShClEventWait(&pCtx->pClient->Events, uEvent, 30 * 1000, &pPayload);
+            if (RT_SUCCESS(rc))
+            {
+                *ppv = pPayload->pvData;
+                *pcb = pPayload->cbData;
+
+                /* Detach the payload, as the caller then will own the data. */
+                ShClEventPayloadDetach(&pCtx->pClient->Events, uEvent);
+            }
+
+            ShClEventUnregister(&pCtx->pClient->Events, uEvent);
+        }
     }
 
Index: /trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
===================================================================
--- /trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp	(revision 81842)
+++ /trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp	(revision 81843)
@@ -1209,5 +1209,5 @@
         HGCMSvcSetU64(&pMsg->paParms[0], VBOX_SHCL_CONTEXTID_MAKE(pClient->State.uSessionID,
                                                                   pClient->Events.uID, uEvent));
-        HGCMSvcSetU32(&pMsg->paParms[1], pFormats->uFormats);
+        HGCMSvcSetU32(&pMsg->paParms[1], pFormats->Formats);
         HGCMSvcSetU32(&pMsg->paParms[2], 0 /* fFlags */);
 
@@ -1218,5 +1218,5 @@
             /* If this is an URI list, create a transfer locally and also tell the guest to create
              * a transfer on the guest side. */
-            if (pFormats->uFormats & VBOX_SHCL_FMT_URI_LIST)
+            if (pFormats->Formats & VBOX_SHCL_FMT_URI_LIST)
             {
                 rc = shClSvcTransferStart(pClient, SHCLTRANSFERDIR_WRITE, SHCLSOURCE_LOCAL,
@@ -1354,6 +1354,6 @@
                 RT_ZERO(formatData);
 
-                formatData.uFormats = g_ExtState.uDelayedFormats;
-                Assert(formatData.uFormats != VBOX_SHCL_FMT_NONE); /* There better is *any* format here now. */
+                formatData.Formats = g_ExtState.uDelayedFormats;
+                Assert(formatData.Formats != VBOX_SHCL_FMT_NONE); /* There better is *any* format here now. */
 
                 int rc2 = ShClSvcFormatsReport(pClient, &formatData);
@@ -1811,6 +1811,6 @@
                         RT_ZERO(formatData);
 
-                        formatData.uFormats = uFormats;
-                        Assert(formatData.uFormats != VBOX_SHCL_FMT_NONE); /* Sanity. */
+                        formatData.Formats = uFormats;
+                        Assert(formatData.Formats != VBOX_SHCL_FMT_NONE); /* Sanity. */
 
                         rc = ShClSvcImplFormatAnnounce(pClient, &cmdCtx, &formatData);
@@ -2323,5 +2323,5 @@
                     RT_ZERO(formatData);
 
-                    formatData.uFormats = u32Format;
+                    formatData.Formats = u32Format;
 
                     rc = ShClSvcFormatsReport(pClient, &formatData);
