Index: trunk/src/VBox/Additions/common/VBoxGuest/lib/Makefile.kmk
===================================================================
--- trunk/src/VBox/Additions/common/VBoxGuest/lib/Makefile.kmk	(revision 79444)
+++ trunk/src/VBox/Additions/common/VBoxGuest/lib/Makefile.kmk	(revision 79497)
@@ -152,5 +152,4 @@
  ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
  VBoxGuestR3Lib_SOURCES   += \
-	$(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/ClipboardMetaData.cpp \
 	$(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/ClipboardMIME.cpp
  endif
Index: trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp
===================================================================
--- trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp	(revision 79444)
+++ trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibClipboard.cpp	(revision 79497)
@@ -50,7 +50,4 @@
 *   Prototypes                                                                                                                   *
 *********************************************************************************************************************************/
-#ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
-static int vbglR3ClipboardWriteErrorInternal(HGCMCLIENTID idClient, int rcErr);
-#endif
 
 
@@ -67,4 +64,6 @@
     if (rc == VERR_HGCM_SERVICE_NOT_FOUND)
         rc = VINF_PERMISSION_DENIED;
+
+    LogFlowFuncLeaveRC(rc);
     return rc;
 }
@@ -84,5 +83,8 @@
 
 /**
- * Get a host message.
+ * Get a host message, old version.
+ *
+ * Note: This is the old message which still is being used for the non-URI Shared Clipboard transfers,
+ *       to not break compatibility with older additions / VBox versions.
  *
  * This will block until a message becomes available.
@@ -93,9 +95,11 @@
  * @param   pfFormats       Where to store the format(s) the message applies to.
  */
-VBGLR3DECL(int) VbglR3ClipboardGetHostMsg(HGCMCLIENTID idClient, uint32_t *pidMsg, uint32_t *pfFormats)
-{
-    VBoxClipboardGetHostMsg Msg;
-
-    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, VBOX_SHARED_CLIPBOARD_GUEST_FN_GET_HOST_MSG, VBOX_SHARED_CLIPBOARD_CPARMS_GET_HOST_MSG);
+VBGLR3DECL(int) VbglR3ClipboardGetHostMsgOld(HGCMCLIENTID idClient, uint32_t *pidMsg, uint32_t *pfFormats)
+{
+    VBoxClipboardGetHostMsgOld Msg;
+
+    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient,
+                       VBOX_SHARED_CLIPBOARD_GUEST_FN_GET_HOST_MSG_OLD, VBOX_SHARED_CLIPBOARD_CPARMS_GET_HOST_MSG_OLD);
+
     VbglHGCMParmUInt32Set(&Msg.msg, 0);
     VbglHGCMParmUInt32Set(&Msg.formats, 0);
@@ -157,120 +161,487 @@
 }
 
-#ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
-/**
- * Reads a (meta) data header from the host.
- *
- * @returns IPRT status code.
- * @param   idClient            The client id returned by VbglR3ClipboardConnect().
- * @param   pDataHdr            Where to store the read meta data header.
- */
-VBGLR3DECL(int) VbglR3ClipboardReadDataHdr(HGCMCLIENTID idClient, PVBOXCLIPBOARDDATAHDR pDataHdr)
-{
-    AssertPtrReturn(pDataHdr, VERR_INVALID_POINTER);
-
-    VBoxClipboardReadDataHdrMsg Msg;
-    RT_ZERO(Msg);
-    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient,
-                       VBOX_SHARED_CLIPBOARD_GUEST_FN_READ_DATA_HDR, VBOX_SHARED_CLIPBOARD_CPARMS_READ_DATA_HDR);
-    Msg.uContext.SetUInt32(0);
-    Msg.uFlags.SetUInt32(0);
-    Msg.uScreenId.SetUInt32(0);
-    Msg.cbTotal.SetUInt64(0);
-    Msg.cbMeta.SetUInt32(0);
-    Msg.cbMetaFmt.SetUInt32(0);
-    Msg.pvMetaFmt.SetPtr(pDataHdr->pvMetaFmt, pDataHdr->cbMetaFmt);
-    Msg.cObjects.SetUInt64(0);
+static int vbglR3ClipboardGetNextMsgType(HGCMCLIENTID idClient, uint32_t *puMsg, uint32_t *pcParms, bool fWait)
+{
+    AssertPtrReturn(puMsg,   VERR_INVALID_POINTER);
+    AssertPtrReturn(pcParms, VERR_INVALID_POINTER);
+
+    VBoxClipboardGetHostMsg Msg;
+    RT_ZERO(Msg);
+
+    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient,
+                       VBOX_SHARED_CLIPBOARD_GUEST_FN_GET_HOST_MSG, VBOX_SHARED_CLIPBOARD_CPARMS_GET_HOST_MSG);
+
+    Msg.uMsg.SetUInt32(0);
+    Msg.cParms.SetUInt32(0);
+    Msg.fBlock.SetUInt32(fWait ? 1 : 0);
+
+    int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
+    if (RT_SUCCESS(rc))
+    {
+        rc = Msg.uMsg.GetUInt32(puMsg);
+        if (RT_SUCCESS(rc))
+            rc = Msg.cParms.GetUInt32(pcParms);
+    }
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
+}
+
+static int vbglR3ClipboardRecvListOpen(HGCMCLIENTID idClient, PVBOXCLIPBOARDLISTHDR pListHdr)
+{
+    AssertPtrReturn(pListHdr, VERR_INVALID_POINTER);
+
+    VBoxClipboardListOpenMsg Msg;
+    RT_ZERO(Msg);
+
+    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient,
+                       VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_OPEN, VBOX_SHARED_CLIPBOARD_CPARMS_LIST_OPEN);
+
+    Msg.uContext.SetUInt32(0); /** @todo Context ID not used yet. */
+    Msg.uHandle.SetUInt64(0);
+    Msg.fList.SetUInt32(0);
+    Msg.fFeatures.SetUInt32(0);
+    Msg.cbFilter.SetUInt32(0);
+    Msg.pvFilter.SetPtr(pListHdr->pszFilter, pListHdr->cbFilter);
+
+    int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
+    if (RT_SUCCESS(rc))
+    {
+        rc = Msg.fList.GetUInt32(&pListHdr->fList);         AssertRC(rc);
+        rc = Msg.fFeatures.GetUInt32(&pListHdr->fFeatures); AssertRC(rc);
+    }
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
+}
+
+static int vbglR3ClipboardRecvListClose(HGCMCLIENTID idClient, PVBOXCLIPBOARDLISTHANDLE phList)
+{
+    AssertPtrReturn(phList, VERR_INVALID_POINTER);
+
+    VBoxClipboardListCloseMsg Msg;
+    RT_ZERO(Msg);
+
+    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient,
+                       VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_CLOSE, VBOX_SHARED_CLIPBOARD_CPARMS_LIST_CLOSE);
+
+    Msg.uContext.SetUInt32(0); /** @todo Context ID not used yet. */
+    Msg.uHandle.SetUInt64(0);
+
+    int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
+    if (RT_SUCCESS(rc))
+    {
+        rc = Msg.uHandle.GetUInt64(phList); AssertRC(rc);
+    }
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
+}
+
+static int vbglR3ClipboardRecvListHdrRead(HGCMCLIENTID idClient, PVBOXCLIPBOARDLISTHANDLE phList, PVBOXCLIPBOARDLISTHDR pListHdr)
+{
+    AssertPtrReturn(pListHdr, VERR_INVALID_POINTER);
+    AssertPtrReturn(phList,   VERR_INVALID_POINTER);
+
+    VBoxClipboardListHdrReadMsg Msg;
+    RT_ZERO(Msg);
+
+    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient,
+                       VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_HDR_READ, VBOX_SHARED_CLIPBOARD_CPARMS_LIST_HDR_READ);
+
+    Msg.uContext.SetUInt32(0); /** @todo Context ID not used yet. */
+    Msg.uHandle.SetUInt64(0);
+    Msg.cTotalObjects.SetUInt64(0);
+    Msg.cbTotalSize.SetUInt64(0);
     Msg.enmCompression.SetUInt32(0);
     Msg.enmChecksumType.SetUInt32(0);
-    Msg.pvChecksum.SetPtr(pDataHdr->pvChecksum, pDataHdr->cbChecksum);
-    Msg.cbChecksum.SetUInt32(0);
-
-    int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
-    if (RT_SUCCESS(rc))
-    {
-        /* Msg.uContext not needed here. */
-        Msg.uFlags.GetUInt32(&pDataHdr->uFlags);
-        Msg.uScreenId.GetUInt32(&pDataHdr->uScreenId);
-        Msg.cbTotal.GetUInt64(&pDataHdr->cbTotal);
-        Msg.cbMeta.GetUInt32(&pDataHdr->cbMeta);
-        Msg.cbMetaFmt.GetUInt32(&pDataHdr->cbMetaFmt);
-        Msg.cObjects.GetUInt64(&pDataHdr->cObjects);
-        Msg.enmCompression.GetUInt32(&pDataHdr->enmCompression);
-        Msg.enmChecksumType.GetUInt32((uint32_t *)&pDataHdr->enmChecksumType);
-        Msg.cbChecksum.GetUInt32(&pDataHdr->cbChecksum);
-
-        AssertReturn(SharedClipboardURIDataHdrIsValid(pDataHdr), VERR_INVALID_PARAMETER);
-    }
-
-    LogFlowFuncLeaveRC(rc);
-    return rc;
-}
-
-/**
- * Sends a guest clipboard data header to the host.
- *
- * This is usually called in reply to a VBOX_SHARED_CLIPBOARD_HOST_READ_DATA message from the host
- * (if URI format is specified).
+
+    int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
+    if (RT_SUCCESS(rc))
+    {
+        rc = Msg.uHandle.GetUInt64(phList); AssertRC(rc);
+    }
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
+}
+
+static int vbglR3ClipboardRecvListEntryRead(HGCMCLIENTID idClient, PVBOXCLIPBOARDLISTHANDLE phList,
+                                            PVBOXCLIPBOARDLISTENTRY pListEntry)
+{
+    AssertPtrReturn(pListEntry, VERR_INVALID_POINTER);
+    AssertPtrReturn(phList,     VERR_INVALID_POINTER);
+
+    VBoxClipboardListEntryReadMsg Msg;
+    RT_ZERO(Msg);
+
+    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient,
+                       VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_ENTRY_READ, VBOX_SHARED_CLIPBOARD_CPARMS_LIST_ENTRY_READ);
+
+    Msg.uContext.SetUInt32(0); /** @todo Context ID not used yet. */
+    Msg.uHandle.SetUInt64(0);
+    Msg.fInfo.SetUInt32(0);
+    Msg.cbInfo.SetUInt32(0);
+    Msg.pvInfo.SetPtr(pListEntry->pvInfo, pListEntry->cbInfo);
+
+    int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
+    if (RT_SUCCESS(rc))
+    {
+        rc = Msg.uHandle.GetUInt64(phList);             AssertRC(rc);
+        rc = Msg.fInfo.GetUInt32(&pListEntry->fInfo);   AssertRC(rc);
+        rc = Msg.cbInfo.GetUInt32(&pListEntry->cbInfo); AssertRC(rc);
+    }
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
+}
+
+VBGLR3DECL(int) VbglR3ClipboardEventGetNext(HGCMCLIENTID idClient, PSHAREDCLIPBOARDURITRANSFER pTransfer,
+                                            PVBGLR3CLIPBOARDEVENT *ppEvent)
+{
+    AssertPtrReturn(pTransfer, VERR_INVALID_POINTER);
+    AssertPtrReturn(ppEvent,   VERR_INVALID_POINTER);
+
+    PVBGLR3CLIPBOARDEVENT pEvent = (PVBGLR3CLIPBOARDEVENT)RTMemAllocZ(sizeof(VBGLR3CLIPBOARDEVENT));
+    if (!pEvent)
+        return VERR_NO_MEMORY;
+
+    uint32_t uMsg   = 0;
+    uint32_t cParms = 0;
+    int rc = vbglR3ClipboardGetNextMsgType(idClient, &uMsg, &cParms, true /* fWait */);
+    if (RT_SUCCESS(rc))
+    {
+        /** @todo Check for VM session change. */
+    }
+
+#if 0
+    typedef struct _
+    {
+        union
+        {
+            struct Dir
+            {
+                RTDIR hDir;
+            };
+        } u;
+    };
+#endif
+
+    if (RT_SUCCESS(rc))
+    {
+        LogFunc(("Handling uMsg=%RU32\n", uMsg));
+
+        switch (uMsg)
+        {
+#ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
+            case VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_OPEN:
+            {
+                LogFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_OPEN\n"));
+
+                VBOXCLIPBOARDLISTHDR listHdr;
+                rc = SharedClipboardURIListHdrInit(&listHdr);
+                if (RT_SUCCESS(rc))
+                {
+                    rc = vbglR3ClipboardRecvListOpen(idClient, &listHdr);
+                    if (RT_SUCCESS(rc))
+                    {
+                        rc = SharedClipboardURITransferListOpen(pTransfer, &listHdr, NULL /* phList */);
+                    }
+
+                    SharedClipboardURIListHdrDestroy(&listHdr);
+                }
+
+                break;
+            }
+
+            case VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_CLOSE:
+            {
+                LogFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_CLOSE\n"));
+
+                VBOXCLIPBOARDLISTHANDLE hList;
+                rc = vbglR3ClipboardRecvListClose(idClient, &hList);
+                if (RT_SUCCESS(rc))
+                {
+                    rc = SharedClipboardURITransferListClose(pTransfer, hList);
+                }
+
+                break;
+            }
+
+            case VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_HDR_READ:
+            {
+                LogFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_HDR_READ\n"));
+
+                /** @todo Handle filter + list features. */
+
+                VBOXCLIPBOARDLISTHDR listHdr;
+                rc = SharedClipboardURIListHdrInit(&listHdr);
+                if (RT_SUCCESS(rc))
+                {
+                    VBOXCLIPBOARDLISTHANDLE hList;
+                    rc = vbglR3ClipboardRecvListHdrRead(idClient, &hList, &listHdr);
+                    if (RT_SUCCESS(rc))
+                    {
+                        if (SharedClipboardURITransferListHandleIsValid(pTransfer, hList))
+                        {
+                            rc = VbglR3ClipboardSendListHdrWrite(idClient, hList, &listHdr);
+                        }
+                        else
+                            rc = VERR_INVALID_HANDLE;
+                    }
+
+                    SharedClipboardURIListHdrDestroy(&listHdr);
+                }
+
+                break;
+            }
+
+            case VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_HDR_WRITE:
+            {
+                LogFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_HDR_WRITE\n"));
+                pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_URI_LIST_HDR_WRITE;
+                break;
+            }
+
+            case VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_ENTRY_READ:
+            {
+                LogFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_ENTRY_READ\n"));
+
+                VBOXCLIPBOARDLISTENTRY listEntry;
+                rc = SharedClipboardURIListEntryInit(&listEntry);
+                if (RT_SUCCESS(rc))
+                {
+                    VBOXCLIPBOARDLISTHANDLE hList;
+                    rc = vbglR3ClipboardRecvListEntryRead(idClient, &hList, &listEntry);
+                    if (RT_SUCCESS(rc))
+                    {
+                        if (SharedClipboardURITransferListHandleIsValid(pTransfer, hList))
+                        {
+                            rc = VbglR3ClipboardSendListEntryWrite(idClient, hList, &listEntry);
+                        }
+                        else
+                            rc = VERR_INVALID_HANDLE;
+                    }
+
+                    SharedClipboardURIListEntryDestroy(&listEntry);
+                }
+                break;
+            }
+
+            case VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_ENTRY_WRITE:
+            {
+                LogFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_LIST_ENTRY_WRITE\n"));
+                pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_URI_LIST_ENTRY_WRITE;
+                break;
+            }
+
+            case VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_OBJ_OPEN:
+            {
+                LogFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_OBJ_OPEN\n"));
+                pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_URI_OBJ_OPEN;
+                break;
+            }
+
+            case VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_OBJ_CLOSE:
+            {
+                LogFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_OBJ_CLOSE\n"));
+                pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_URI_OBJ_CLOSE;
+                break;
+            }
+
+            case VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_OBJ_READ:
+            {
+                LogFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_OBJ_READ\n"));
+                pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_URI_OBJ_READ;
+                break;
+            }
+
+            case VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_OBJ_WRITE:
+            {
+                LogFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_URI_OBJ_WRITE\n"));
+                pEvent->enmType = VBGLR3CLIPBOARDEVENTTYPE_URI_OBJ_WRITE;
+                break;
+            }
+#endif /* VBOX_WITH_SHARED_CLIPBOARD_URI_LIST */
+
+            default:
+                rc = VERR_NOT_SUPPORTED;
+                break;
+        }
+    }
+
+
+    if (RT_SUCCESS(rc))
+    {
+        if (pEvent->enmType != VBGLR3CLIPBOARDEVENTTYPE_INVALID)
+        {
+            *ppEvent = pEvent;
+        }
+        else
+            VbglR3ClipboardEventFree(pEvent);
+    }
+    else
+    {
+        /* Report error back to the host. */
+        VbglR3ClipboardWriteError(idClient, rc);
+
+        VbglR3ClipboardEventFree(pEvent);
+    }
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
+}
+
+/**
+ * Frees (destroys) a formerly allocated Shared Clipboard event.
+ *
+ * @returns IPRT status code.
+ * @param   pEvent              Event to free (destroy).
+ */
+VBGLR3DECL(void) VbglR3ClipboardEventFree(PVBGLR3CLIPBOARDEVENT pEvent)
+{
+    if (!pEvent)
+        return;
+
+    /* Some messages require additional cleanup. */
+    switch (pEvent->enmType)
+    {
+        default:
+            break;
+    }
+
+    RTMemFree(pEvent);
+    pEvent = NULL;
+}
+
+#ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
+/**
+ * Sends a list header to the host.
  *
  * @returns VBox status code.
  * @param   idClient        The client id returned by VbglR3ClipboardConnect().
- * @param   pDataHdr        Pointer to data header to send.
- */
-VBGLR3DECL(int) VbglR3ClipboardWriteDataHdr(HGCMCLIENTID idClient, const PVBOXCLIPBOARDDATAHDR pDataHdr)
-{
-    VBoxClipboardWriteDataHdrMsg Msg;
-    RT_ZERO(Msg);
-
-    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, VBOX_SHARED_CLIPBOARD_GUEST_FN_WRITE_DATA_HDR, VBOX_SHARED_CLIPBOARD_CPARMS_WRITE_DATA_HDR);
-
-    AssertReturn(SharedClipboardURIDataHdrIsValid(pDataHdr), VERR_INVALID_PARAMETER);
-
-    Msg.uContext.SetUInt32(0);                                          /** @todo Not used yet. */
-    Msg.uFlags.SetUInt32(pDataHdr->uFlags);                             /** @todo Not used yet. */
-    Msg.uScreenId.SetUInt32(pDataHdr->uScreenId);                       /** @todo Not used yet. */
-    Msg.cbTotal.SetUInt64(pDataHdr->cbTotal);
-    Msg.cbMeta.SetUInt32(pDataHdr->cbMeta);
-    Msg.cbMetaFmt.SetUInt32(pDataHdr->cbMetaFmt);
-    Msg.pvMetaFmt.SetPtr(pDataHdr->pvMetaFmt, pDataHdr->cbMetaFmt);
-    Msg.cObjects.SetUInt64(pDataHdr->cObjects);
-    Msg.enmCompression.SetUInt32(pDataHdr->enmCompression);             /** @todo Not used yet. */
-    Msg.enmChecksumType.SetUInt32(RTDIGESTTYPE_INVALID);                /** @todo Not used yet. */
-    Msg.cbChecksum.SetUInt32(0);                                        /** @todo Not used yet. */
-    Msg.pvChecksum.SetPtr(NULL, 0);                                     /** @todo Not used yet. */
-
-    int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
-
-    LogFlowFunc(("cbTotal=%RU64, cbMeta=%RU32, pvMetaFmt=%p (%RU32), cObjects=%RU64, rc=%Rrc\n",
-                 pDataHdr->cbTotal, pDataHdr->cbMeta, pDataHdr->pvMetaFmt, pDataHdr->cbMetaFmt, pDataHdr->cObjects, rc));
-
-    LogFlowFuncLeaveRC(rc);
-    return rc;
-}
-
-/**
- * Reads a (meta) data chunk from the host.
+ * @param   hList           List handle to send header for.
+ * @param   pListHdr        List header to send.
+ */
+VBGLR3DECL(int) VbglR3ClipboardSendListHdrWrite(HGCMCLIENTID idClient,
+                                                VBOXCLIPBOARDLISTHANDLE hList, PVBOXCLIPBOARDLISTHDR pListHdr)
+{
+    VBoxClipboardListHdrWriteMsg Msg;
+    RT_ZERO(Msg);
+
+    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient,
+                       VBOX_SHARED_CLIPBOARD_GUEST_FN_LIST_HDR_WRITE, VBOX_SHARED_CLIPBOARD_CPARMS_LIST_HDR_WRITE);
+
+    Msg.uContext.SetUInt32(0); /** @todo Not used yet. */
+    Msg.uHandle.SetUInt64(hList);
+    Msg.cTotalObjects.SetUInt64(pListHdr->cTotalObjects);
+    Msg.cbTotalSize.SetUInt64(pListHdr->cbTotalSize);
+    Msg.enmCompression.SetUInt32(pListHdr->enmCompression);
+    Msg.enmChecksumType.SetUInt32(RTDIGESTTYPE_INVALID);
+
+    int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
+}
+
+/**
+ * Sends a list entry to the host.
  *
  * @returns IPRT status code.
- * @param   idClient            The client id returned by VbglR3ClipboardConnect().
- * @param   pDataHdr            Data header to use. Need for accounting and stuff.
- * @param   pvData              Where to store the received data from the host.
- * @param   cbData              Size (in bytes) of where to store the received data.
- * @param   pcbDataRecv         Where to store the received amount of data (in bytes).
- */
-static int vbglR3ClipboardReadDataChunk(HGCMCLIENTID idClient, PVBOXCLIPBOARDDATAHDR pDataHdr,
-                                        void *pvData, uint32_t cbData, uint32_t *pcbDataRecv)
-{
-    AssertPtrReturn(pDataHdr,        VERR_INVALID_POINTER);
-    AssertPtrReturn(pvData,          VERR_INVALID_POINTER);
-    AssertReturn(cbData,             VERR_INVALID_PARAMETER);
-    AssertPtrNullReturn(pcbDataRecv, VERR_INVALID_POINTER);
-
-    LogFlowFunc(("pvDate=%p, cbData=%RU32\n", pvData, cbData));
-
-    VBoxClipboardReadDataChunkMsg Msg;
-    RT_ZERO(Msg);
-
-    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient,
-                       VBOX_SHARED_CLIPBOARD_GUEST_FN_READ_DATA_CHUNK, VBOX_SHARED_CLIPBOARD_CPARMS_READ_DATA_CHUNK);
+ * @param   idClient            The client id returned by VbglR3ClipboardConnect()
+ * @param   hList               List handle to send entry for.
+ * @param   pListEntry          List entry to send.
+ */
+VBGLR3DECL(int) VbglR3ClipboardSendListEntryWrite(HGCMCLIENTID idClient,
+                                                  VBOXCLIPBOARDLISTHANDLE hList, PVBOXCLIPBOARDLISTENTRY pListEntry)
+{
+    AssertPtrReturn(pListEntry, VERR_INVALID_POINTER);
+
+    VBoxClipboardListEntryWriteMsg Msg;
+    RT_ZERO(Msg);
+
+    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient,
+                       VBOX_SHARED_CLIPBOARD_GUEST_FN_LIST_ENTRY_WRITE, VBOX_SHARED_CLIPBOARD_CPARMS_LIST_ENTRY_WRITE);
+
+    Msg.uContext.SetUInt32(0); /** @todo Not used yet. */
+    Msg.uHandle.SetUInt64(hList);
+    Msg.fInfo.SetUInt32(pListEntry->fInfo);
+    Msg.cbInfo.SetUInt32(pListEntry->cbInfo);
+    Msg.pvInfo.SetPtr(pListEntry->pvInfo, pListEntry->cbInfo);
+
+    int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
+}
+
+VBGLR3DECL(int) VbglR3ClipboardObjOpen(HGCMCLIENTID idClient,
+                                       const char *pszPath, PVBOXCLIPBOARDCREATEPARMS pCreateParms,
+                                       PSHAREDCLIPBOARDOBJHANDLE phObj)
+{
+    AssertPtrReturn(pszPath, VERR_INVALID_POINTER);
+    AssertPtrReturn(pCreateParms, VERR_INVALID_POINTER);
+    AssertPtrReturn(phObj, VERR_INVALID_POINTER);
+
+    VBoxClipboardObjOpenMsg Msg;
+    RT_ZERO(Msg);
+
+    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient,
+                       VBOX_SHARED_CLIPBOARD_GUEST_FN_OBJ_OPEN, VBOX_SHARED_CLIPBOARD_CPARMS_OBJ_OPEN);
+
+    int rc;
+
+    char *pszPathTmp = RTStrDup(pszPath);
+    if (pszPathTmp)
+    {
+        Msg.szPath.SetPtr((void *)pszPathTmp, (uint32_t)strlen(pszPathTmp) + 1 /* Include terminating zero */);
+        Msg.parms.SetPtr(pCreateParms, sizeof(VBOXCLIPBOARDCREATEPARMS));
+
+        rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
+        if (RT_SUCCESS(rc))
+        {
+            *phObj = pCreateParms->uHandle;
+        }
+
+        RTStrFree(pszPathTmp);
+    }
+    else
+        rc = VERR_NO_MEMORY;
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
+}
+
+VBGLR3DECL(int) VbglR3ClipboardObjClose(HGCMCLIENTID idClient, SHAREDCLIPBOARDOBJHANDLE hObj)
+{
+    VBoxClipboardObjCloseMsg Msg;
+    RT_ZERO(Msg);
+
+    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient,
+                       VBOX_SHARED_CLIPBOARD_GUEST_FN_OBJ_CLOSE, VBOX_SHARED_CLIPBOARD_CPARMS_OBJ_CLOSE);
+
+    Msg.uHandle.SetUInt64(hObj);
+
+    int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
+}
+
+VBGLR3DECL(int) VbglR3ClipboardObjRead(HGCMCLIENTID idClient, SHAREDCLIPBOARDOBJHANDLE hObj,
+                                       void *pvData, uint32_t cbData, uint32_t *pcbRead)
+{
+    AssertPtrReturn(pvData,  VERR_INVALID_POINTER);
+    AssertReturn(cbData,     VERR_INVALID_PARAMETER);
+    /* pcbRead is optional. */
+
+    VBoxClipboardObjReadWriteMsg Msg;
+    RT_ZERO(Msg);
+
+    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, VBOX_SHARED_CLIPBOARD_GUEST_FN_OBJ_READ, VBOX_SHARED_CLIPBOARD_CPARMS_OBJ_READ);
+
+    Msg.uContext.SetUInt32(0);
+    Msg.uHandle.SetUInt64(hObj);
     Msg.pvData.SetPtr(pvData, cbData);
     Msg.cbData.SetUInt32(0);
@@ -281,446 +652,35 @@
     if (RT_SUCCESS(rc))
     {
-        uint32_t cbDataRecv;
-        rc = Msg.cbData.GetUInt32(&cbDataRecv);
-        AssertRC(rc);
-        if (RT_SUCCESS(rc))
+        /** @todo Context ID not used yet. */
+        /** @todo Add checksum support. */
+
+        if (pcbRead)
         {
-            /** @todo Use checksum for validating the received data. */
-            if (pcbDataRecv)
-                *pcbDataRecv = cbDataRecv;
-            LogFlowFuncLeaveRC(rc);
-            return rc;
+            rc = Msg.cbData.GetUInt32(pcbRead); AssertRC(rc);
+            AssertReturn(cbData >= *pcbRead, VERR_TOO_MUCH_DATA);
         }
     }
 
-    /* failure */
-    LogFlowFuncLeaveRC(rc);
-    return rc;
-}
-
-/**
- * Helper function for reading the actual clipboard (meta) data from the host. Do not call directly.
- *
- * @returns IPRT status code.
- * @param   idClient            The client id returned by VbglR3ClipboardConnect().
- * @param   pDataHdr            Pointer to data header to use.
- * @param   pvMeta              Where to store the received meta data.
- * @param   cbMeta              Size (in bytes) of meta data buffer.
- * @param   pcbRead             How much bytes were read on success. Optional.
- */
-static int vbglR3ClipboardReadMetaDataLoop(HGCMCLIENTID idClient, PVBOXCLIPBOARDDATAHDR pDataHdr,
-                                           void *pvMeta, uint32_t cbMeta, uint32_t *pcbRead)
-{
-    AssertPtrReturn(pDataHdr, VERR_INVALID_POINTER);
-    AssertPtrReturn(pvMeta,   VERR_INVALID_POINTER);
-
-    LogFlowFuncEnter();
-
-    int rc = VINF_SUCCESS;
-
-    uint32_t cbReadTotal = 0;
-
-    LogFlowFunc(("cbTotal=%RU64, cbMeta=%RU32, cObjects=%RU32\n", pDataHdr->cbTotal, pDataHdr->cbMeta, pDataHdr->cObjects));
-    if (pDataHdr->cbMeta)
-    {
-        uint32_t cbToRead = RT_MIN(cbMeta, pDataHdr->cbMeta);
-        while (cbToRead)
-        {
-            uint32_t cbRead;
-            rc = vbglR3ClipboardReadDataChunk(idClient, pDataHdr,
-                                              (uint8_t *)pvMeta + cbReadTotal, cbToRead, &cbRead);
-            if (RT_FAILURE(rc))
-                break;
-
-            Assert(cbToRead >= cbRead);
-            cbToRead -= cbRead;
-
-            cbReadTotal += cbRead;
-        }
-    }
-
-    if (RT_SUCCESS(rc))
-    {
-        if (pcbRead)
-            *pcbRead = cbReadTotal;
-    }
-
-    LogFlowFuncLeaveRC(rc);
-    return rc;
-}
-
-/**
- * Reads the actual meta data from the host, internal version.
- *
- * @returns IPRT status code.
- * @param   idClient            The client id returned by VbglR3ClipboardConnect().
- * @param   pDataHdr            Pointer to data header to use.
- * @param   pvMeta              Where to store the received meta data.
- * @param   cbMeta              Size (in bytes) of meta data buffer.
- * @param   pcbRead             How much bytes were read on success. Optional.
- */
-static int vbglR3ClipboardReadMetaDataInternal(HGCMCLIENTID idClient, PVBOXCLIPBOARDDATAHDR pDataHdr,
-                                               void *pvMeta, uint32_t cbMeta, uint32_t *pcbRead)
-{
-   LogFlowFuncEnter();
-
-    int rc = vbglR3ClipboardReadMetaDataLoop(idClient, pDataHdr, pvMeta, cbMeta, pcbRead);
-
-    LogFlowFuncLeaveRC(rc);
-    return rc;
-}
-
-/**
- * Reads the actual meta data from the host, extended version.
- *
- * @returns IPRT status code.
- * @param   idClient            The client id returned by VbglR3ClipboardConnect().
- * @param   pvMeta              Where to store the received meta data.
- * @param   cbMeta              Size (in bytes) of meta data buffer.
- * @param   pcbRead             How much bytes were read on success. Optional.
- */
-VBGLR3DECL(int) VbglR3ClipboardReadMetaDataEx(HGCMCLIENTID idClient, PVBOXCLIPBOARDDATAHDR pDataHdr,
-                                              void *pvMeta, uint32_t cbMeta, uint32_t *pcbRead)
-{
-    return vbglR3ClipboardReadMetaDataInternal(idClient, pDataHdr, pvMeta, cbMeta, pcbRead);
-}
-
-/**
- * Reads the actual meta data from the host.
- *
- * @returns IPRT status code.
- * @param   idClient            The client id returned by VbglR3ClipboardConnect().
- * @param   pvMeta              Where to store the received meta data.
- * @param   cbMeta              Size (in bytes) of meta data buffer.
- * @param   pcbRead             How much bytes were read on success. Optional.
- */
-VBGLR3DECL(int) VbglR3ClipboardReadMetaData(HGCMCLIENTID idClient, PVBOXCLIPBOARDDATAHDR pDataHdr,
-                                            void *pvMeta, uint32_t cbMeta, uint32_t *pcbRead)
-{
-    return VbglR3ClipboardReadMetaDataEx(idClient, pDataHdr, pvMeta, cbMeta, pcbRead);
-}
-
-/**
- * Writes a (meta) data chunk to the host.
- *
- * @returns IPRT status code.
- * @param   idClient            The client id returned by VbglR3ClipboardConnect().
- * @param   pDataHdr            Data header to use. Need for accounting and stuff.
- * @param   pvData              Where to store the received data from the host.
- * @param   cbData              Size (in bytes) of where to store the received data.
- * @param   pcbDataWritten      Where to store the written amount of data (in bytes).
- */
-static int vbglR3ClipboardWriteDataChunk(HGCMCLIENTID idClient, PVBOXCLIPBOARDDATAHDR pDataHdr,
-                                         void *pvData, uint32_t cbData, uint32_t *pcbDataWritten)
-{
-    AssertPtrReturn(pDataHdr,        VERR_INVALID_POINTER);
-    AssertPtrReturn(pvData,          VERR_INVALID_POINTER);
-    AssertReturn(cbData,             VERR_INVALID_PARAMETER);
-    AssertPtrNullReturn(pcbDataWritten, VERR_INVALID_POINTER);
-
-    LogFlowFunc(("pvDate=%p, cbData=%RU32\n", pvData, cbData));
-
-    VBoxClipboardReadDataChunkMsg Msg;
-    RT_ZERO(Msg);
-
-    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient,
-                       VBOX_SHARED_CLIPBOARD_GUEST_FN_WRITE_DATA_CHUNK, VBOX_SHARED_CLIPBOARD_CPARMS_WRITE_DATA_CHUNK);
-
-    Msg.uContext.SetUInt32(0);                                          /** @todo Not used yet. */
+    LogFlowFuncLeaveRC(rc);
+    return rc;
+}
+
+VBGLR3DECL(int) VbglR3ClipboardObjWrite(HGCMCLIENTID idClient,
+                                        SHAREDCLIPBOARDOBJHANDLE hObj,
+                                        void *pvData, uint32_t cbData, uint32_t *pcbWritten)
+{
+    AssertPtrReturn(pvData, VERR_INVALID_POINTER);
+    AssertReturn(cbData, VERR_INVALID_PARAMETER);
+    /* pcbWritten is optional. */
+
+    VBoxClipboardObjReadWriteMsg Msg;
+    RT_ZERO(Msg);
+
+    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, VBOX_SHARED_CLIPBOARD_GUEST_FN_OBJ_WRITE, VBOX_SHARED_CLIPBOARD_CPARMS_OBJ_WRITE);
+
+    Msg.uContext.SetUInt32(0);
+    Msg.uHandle.SetUInt64(hObj);
+    Msg.pvData.SetPtr(pvData, cbData);
     Msg.cbData.SetUInt32(cbData);
-    Msg.pvData.SetPtr(pvData, cbData);
-    Msg.cbChecksum.SetUInt32(0);
-    Msg.pvChecksum.SetPtr(NULL, 0);
-
-    int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
-    if (RT_SUCCESS(rc))
-    {
-        if (pcbDataWritten)
-            *pcbDataWritten = cbData;
-    }
-
-    /* failure */
-    LogFlowFuncLeaveRC(rc);
-    return rc;
-}
-
-/**
- * Writes the actual meta data to the host, internal version.
- *
- * @returns IPRT status code.
- * @param   idClient            The client id returned by VbglR3ClipboardConnect().
- * @param   pDataHdr            Pointer to data header to use.
- * @param   pvMeta              Meta data buffer to write.
- * @param   cbMeta              Size (in bytes) of meta data buffer.
- * @param   pcbWritten          How much bytes were written on success. Optional.
- */
-static int vbglR3ClipboardWriteMetaDataInternal(HGCMCLIENTID idClient, PVBOXCLIPBOARDDATAHDR pDataHdr,
-                                                const void *pvMeta, uint32_t cbMeta, uint32_t *pcbWritten)
-{
-    AssertPtrReturn(pDataHdr, VERR_INVALID_POINTER);
-    AssertPtrReturn(pvMeta,   VERR_INVALID_POINTER);
-
-    LogFlowFuncEnter();
-
-    int rc = VINF_SUCCESS;
-
-    uint32_t cbWrittenTotal = 0;
-
-    LogFlowFunc(("cbTotal=%RU64, cbMeta=%RU32, cObjects=%RU32\n", pDataHdr->cbTotal, pDataHdr->cbMeta, pDataHdr->cObjects));
-    if (pDataHdr->cbMeta)
-    {
-        uint32_t cbToWrite = RT_MIN(cbMeta, pDataHdr->cbMeta);
-        while (cbToWrite)
-        {
-            uint32_t cbWritten;
-            rc = vbglR3ClipboardWriteDataChunk(idClient, pDataHdr,
-                                               (uint8_t *)pvMeta + cbWrittenTotal, cbToWrite, &cbWritten);
-            if (RT_FAILURE(rc))
-                break;
-
-            Assert(cbToWrite >= cbWritten);
-            cbToWrite -= cbWritten;
-
-            cbWrittenTotal += cbWritten;
-        }
-    }
-
-    if (RT_SUCCESS(rc))
-    {
-        if (pcbWritten)
-            *pcbWritten = cbWrittenTotal;
-    }
-
-    LogFlowFunc(("cbWrittenTotal=%RU32, rc=%Rrc\n", cbWrittenTotal, rc));
-    return rc;
-}
-
-/**
- * Writes the actual meta data to the host, extended version.
- *
- * @returns IPRT status code.
- * @param   idClient            The client id returned by VbglR3ClipboardConnect().
- * @param   pDataHdr            Pointer to data header to use.
- * @param   pvMeta              Pointer to meta data buffer.
- * @param   cbMeta              Size (in bytes) of meta data buffer.
- * @param   pcbWritten          How much bytes were written on success. Optional.
- */
-VBGLR3DECL(int) VbglR3ClipboardWriteMetaDataEx(HGCMCLIENTID idClient, PVBOXCLIPBOARDDATAHDR pDataHdr,
-                                               const void *pvMeta, uint32_t cbMeta, uint32_t *pcbWritten)
-{
-    int rc = vbglR3ClipboardWriteMetaDataInternal(idClient, pDataHdr, pvMeta, cbMeta, pcbWritten);
-
-    LogFlowFuncLeaveRC(rc);
-    return rc;
-}
-
-/**
- * Writes the actual meta data to the host.
- *
- * @returns IPRT status code.
- * @param   idClient            The client id returned by VbglR3ClipboardConnect().
- * @param   pDataHdr            Pointer to data header to use.
- * @param   pvMeta              Pointer to meta data buffer.
- * @param   cbMeta              Size (in bytes) of meta data buffer.
- * @param   pcbWritten          How much bytes were written on success. Optional.
- */
-VBGLR3DECL(int) VbglR3ClipboardWriteMetaData(HGCMCLIENTID idClient, PVBOXCLIPBOARDDATAHDR pDataHdr,
-                                             const void *pvMeta, uint32_t cbMeta, uint32_t *pcbWritten)
-{
-    return VbglR3ClipboardWriteMetaDataEx(idClient, pDataHdr, pvMeta, cbMeta, pcbWritten);
-}
-
-/**
- * Reads a directory entry from the host.
- *
- * @returns IPRT status code.
- * @param   idClient            The client id returned by VbglR3ClipboardConnect().
- * @param   pszDirname          Where to store the directory name of the directory being created.
- * @param   cbDirname           Size (in bytes) of where to store the directory name of the directory being created.
- * @param   pcbDirnameRecv      Size (in bytes) of the actual directory name received.
- * @param   pfMode              Where to store the directory creation mode.
- */
-VBGLR3DECL(int) VbglR3ClipboardReadDir(HGCMCLIENTID idClient,
-                                       char     *pszDirname,
-                                       uint32_t  cbDirname,
-                                       uint32_t *pcbDirnameRecv,
-                                       uint32_t *pfMode)
-{
-    AssertPtrReturn(pszDirname,     VERR_INVALID_POINTER);
-    AssertReturn(cbDirname,         VERR_INVALID_PARAMETER);
-    AssertPtrReturn(pcbDirnameRecv, VERR_INVALID_POINTER);
-    AssertPtrReturn(pfMode,         VERR_INVALID_POINTER);
-
-    VBoxClipboardReadDirMsg Msg;
-    RT_ZERO(Msg);
-
-    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, VBOX_SHARED_CLIPBOARD_GUEST_FN_READ_DIR, VBOX_SHARED_CLIPBOARD_CPARMS_READ_DIR);
-    /** @todo Context ID not used yet. */
-    Msg.uContext.SetUInt32(0);
-    Msg.pvName.SetPtr(pszDirname, cbDirname);
-    Msg.cbName.SetUInt32(cbDirname);
-    Msg.fMode.SetUInt32(0);
-
-    int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
-    if (RT_SUCCESS(rc))
-    {
-        /** @todo Context ID not used yet. */
-        rc = Msg.cbName.GetUInt32(pcbDirnameRecv); AssertRC(rc);
-        rc = Msg.fMode.GetUInt32(pfMode);          AssertRC(rc);
-
-        AssertReturn(cbDirname >= *pcbDirnameRecv, VERR_TOO_MUCH_DATA);
-    }
-
-    return rc;
-}
-
-/**
- * Writes a guest directory to the host.
- *
- * @returns IPRT status code.
- * @param   idClient        The client id returned by VbglR3ClipboardConnect().
- * @param   pszPath         Directory path.
- * @param   cbPath          Size (in bytes) of directory path.
- * @param   fMode           File mode for directory (IPRT-style).
- */
-VBGLR3DECL(int) VbglR3ClipboardWriteDir(HGCMCLIENTID idClient,
-                                        const char  *pszPath,
-                                        uint32_t     cbPath,
-                                        uint32_t     fMode)
-{
-    const size_t cchDir = strlen(pszPath);
-
-    if (   !cchDir
-        ||  cchDir >  RTPATH_MAX
-        ||  cchDir != cbPath) /* UTF-8 */
-        return VERR_INVALID_PARAMETER;
-
-    const uint32_t cbPathSz = (uint32_t)cchDir + 1; /* Include termination. */
-
-    VBoxClipboardWriteDirMsg Msg;
-    RT_ZERO(Msg);
-
-    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, VBOX_SHARED_CLIPBOARD_GUEST_FN_WRITE_DIR, VBOX_SHARED_CLIPBOARD_CPARMS_WRITE_DIR);
-    /** @todo Context ID not used yet. */
-    Msg.pvName.SetPtr((void *)pszPath, (uint32_t)cbPathSz);
-    Msg.cbName.SetUInt32(cbPathSz);
-    Msg.fMode.SetUInt32(fMode);
-
-    return VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
-}
-
-/**
- * Receives a file header from the host.
- *
- * @returns IPRT status code.
- * @param   idClient            The client id returned by VbglR3ClipboardConnect().
- * @param   pszFilename         Where to store the file name of the file being transferred.
- * @param   cbFilename          Size (in bytes) of where to store the file name of the file being transferred.
- * @param   puFlags             File transfer flags. Currently not being used.
- * @param   pfMode              Where to store the file creation mode.
- * @param   pcbTotal            Where to store the file size (in bytes).
- */
-VBGLR3DECL(int) VbglR3ClipboardReadFileHdr(HGCMCLIENTID  idClient,
-                                           char         *pszFilename,
-                                           uint32_t      cbFilename,
-                                           uint32_t     *puFlags,
-                                           uint32_t     *pfMode,
-                                           uint64_t     *pcbTotal)
-{
-    AssertPtrReturn(pszFilename, VERR_INVALID_POINTER);
-    AssertReturn(cbFilename,     VERR_INVALID_PARAMETER);
-    AssertPtrReturn(puFlags,     VERR_INVALID_POINTER);
-    AssertPtrReturn(pfMode,      VERR_INVALID_POINTER);
-    AssertReturn(pcbTotal,       VERR_INVALID_POINTER);
-
-    VBoxClipboardReadFileHdrMsg Msg;
-    RT_ZERO(Msg);
-
-    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient,
-                       VBOX_SHARED_CLIPBOARD_GUEST_FN_READ_FILE_HDR, VBOX_SHARED_CLIPBOARD_CPARMS_READ_FILE_HDR);
-    Msg.uContext.SetUInt32(0); /** @todo Not used yet. */
-    Msg.pvName.SetPtr(pszFilename, cbFilename);
-    Msg.cbName.SetUInt32(cbFilename);
-    Msg.uFlags.SetUInt32(0);
-    Msg.fMode.SetUInt32(0);
-    Msg.cbTotal.SetUInt64(0);
-
-    int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
-    if (RT_SUCCESS(rc))
-    {
-        /** @todo Get context ID. */
-        rc = Msg.uFlags.GetUInt32(puFlags);   AssertRC(rc);
-        rc = Msg.fMode.GetUInt32(pfMode);     AssertRC(rc);
-        rc = Msg.cbTotal.GetUInt64(pcbTotal); AssertRC(rc);
-    }
-
-    return rc;
-}
-
-/**
- * Writes a file header from the guest to the host.
- *
- * @returns VBox status code.
- * @param   idClient            The client id returned by VbglR3ClipboardConnect().
- * @param   pszFilename         File name this header belong to.
- * @param   cbFilename          Size (in bytes) of file name.
- * @param   fFlags              Transfer flags; not being used and will be ignored.
- * @param   fMode               File mode.
- * @param   cbTotal             File size (in bytes).
- */
-VBGLR3DECL(int) VbglR3ClipboardWriteFileHdr(HGCMCLIENTID idClient, const char *pszFilename, uint32_t cbFilename,
-                                            uint32_t fFlags, uint32_t fMode, uint64_t cbTotal)
-{
-    RT_NOREF(fFlags);
-
-    const size_t cchFile = strlen(pszFilename);
-
-    if (   !cchFile
-        ||  cchFile >  RTPATH_MAX
-        ||  cchFile != cbFilename)
-        return VERR_INVALID_PARAMETER;
-
-    const uint32_t cbFileSz = (uint32_t)cchFile + 1; /* Include termination. */
-
-    VBoxClipboardWriteFileHdrMsg MsgHdr;
-    RT_ZERO(MsgHdr);
-
-    VBGL_HGCM_HDR_INIT(&MsgHdr.hdr, idClient, VBOX_SHARED_CLIPBOARD_GUEST_FN_WRITE_FILE_HDR, VBOX_SHARED_CLIPBOARD_CPARMS_WRITE_FILE_HDR);
-    MsgHdr.uContext.SetUInt32(0);                                                    /* Context ID; unused at the moment. */
-    MsgHdr.cbName.SetUInt32(cbFileSz);
-    MsgHdr.pvName.SetPtr((void *)pszFilename, (uint32_t)(cbFileSz));
-    MsgHdr.uFlags.SetUInt32(0);                                                      /* Flags; unused at the moment. */
-    MsgHdr.fMode.SetUInt32(fMode);                                                   /* File mode */
-    MsgHdr.cbTotal.SetUInt64(cbTotal);                                               /* File size (in bytes). */
-
-    return VbglR3HGCMCall(&MsgHdr.hdr, sizeof(MsgHdr));
-}
-
-/**
- * Reads a file data chunk from the host.
- *
- * @returns IPRT status code.
- * @param   idClient            The client id returned by VbglR3ClipboardConnect().
- * @param   pvData              Where to store the file data chunk.
- * @param   cbData              Size (in bytes) of where to store the data chunk.
- * @param   pcbRead             Size (in bytes) of the actual data chunk size read.
- */
-VBGLR3DECL(int) VbglR3ClipboardReadFileData(HGCMCLIENTID          idClient,
-                                            void                 *pvData,
-                                            uint32_t              cbData,
-                                            uint32_t             *pcbRead)
-{
-    AssertPtrReturn(pvData,  VERR_INVALID_POINTER);
-    AssertReturn(cbData,     VERR_INVALID_PARAMETER);
-    AssertPtrReturn(pcbRead, VERR_INVALID_POINTER);
-
-    VBoxClipboardReadFileDataMsg Msg;
-    RT_ZERO(Msg);
-
-    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient,
-                       VBOX_SHARED_CLIPBOARD_GUEST_FN_READ_FILE_DATA, VBOX_SHARED_CLIPBOARD_CPARMS_READ_FILE_DATA);
-    Msg.uContext.SetUInt32(0);
-    Msg.pvData.SetPtr(pvData, cbData);
-    Msg.cbData.SetUInt32(0);
     Msg.pvChecksum.SetPtr(NULL, 0);
     Msg.cbChecksum.SetUInt32(0);
@@ -729,44 +689,9 @@
     if (RT_SUCCESS(rc))
     {
-        /** @todo Context ID not used yet. */
-        rc = Msg.cbData.GetUInt32(pcbRead); AssertRC(rc);
-        AssertReturn(cbData >= *pcbRead, VERR_TOO_MUCH_DATA);
-        /** @todo Add checksum support. */
-    }
-
-    return rc;
-}
-
-/**
- * Writes a file data chunk to the host.
- *
- * @returns VBox status code.
- * @param   idClient            The client id returned by VbglR3ClipboardConnect().
- * @param   pvData              Data chunk to write.
- * @param   cbData              Size (in bytes) of data chunk to write.
- * @param   pcbWritten          Returns how many bytes written.
- */
-VBGLR3DECL(int) VbglR3ClipboardWriteFileData(HGCMCLIENTID idClient, void *pvData, uint32_t cbData, uint32_t *pcbWritten)
-{
-    AssertPtrReturn(pvData,     VERR_INVALID_POINTER);
-    AssertReturn(cbData,        VERR_INVALID_PARAMETER);
-    AssertPtrReturn(pcbWritten, VERR_INVALID_POINTER);
-
-    VBoxClipboardWriteFileDataMsg MsgData;
-    RT_ZERO(MsgData);
-
-    VBGL_HGCM_HDR_INIT(&MsgData.hdr, idClient, VBOX_SHARED_CLIPBOARD_GUEST_FN_WRITE_FILE_DATA, VBOX_SHARED_CLIPBOARD_CPARMS_READ_FILE_DATA);
-    MsgData.uContext.SetUInt32(0);                                                    /* Context ID; unused at the moment. */
-    MsgData.pvData.SetPtr(pvData, cbData);
-    MsgData.cbData.SetUInt32(cbData);
-    MsgData.pvChecksum.SetPtr(NULL, 0);
-    MsgData.cbChecksum.SetUInt32(0);
-
-    int rc = VbglR3HGCMCall(&MsgData.hdr, sizeof(MsgData));
-    if (RT_SUCCESS(rc))
-    {
-        *pcbWritten = cbData;
-    }
-
+        if (pcbWritten)
+            *pcbWritten = cbData;
+    }
+
+    LogFlowFuncLeaveRC(rc);
     return rc;
 }
@@ -827,12 +752,4 @@
 {
     int rc  = vbglR3ClipboardWriteDataRaw(idClient, fFormat, pv, cb);
-#ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
-    if (RT_FAILURE(rc))
-    {
-        int rc2 = vbglR3ClipboardWriteErrorInternal(idClient, rc);
-        if (RT_FAILURE(rc2))
-            LogFlowFunc(("Unable to send error (%Rrc) to host, rc=%Rrc\n", rc, rc2));
-    }
-#endif
 
     return rc;
@@ -847,10 +764,11 @@
  * @param   rcErr               Error (IPRT-style) to send.
  */
-static int vbglR3ClipboardWriteErrorInternal(HGCMCLIENTID idClient, int rcErr)
+VBGLR3DECL(int) VbglR3ClipboardWriteError(HGCMCLIENTID idClient, int rcErr)
 {
     VBoxClipboardWriteErrorMsg Msg;
     RT_ZERO(Msg);
 
-    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, VBOX_SHARED_CLIPBOARD_GUEST_FN_WRITE_ERROR, 2);
+    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, VBOX_SHARED_CLIPBOARD_GUEST_FN_ERROR, VBOX_SHARED_CLIPBOARD_CPARMS_ERROR);
+
     /** @todo Context ID not used yet. */
     Msg.uContext.SetUInt32(0);
@@ -859,13 +777,4 @@
     int rc = VbglR3HGCMCall(&Msg.hdr, sizeof(Msg));
 
-    /*
-     * Never return an error if the host did not accept the error at the current
-     * time.  This can be due to the host not having any appropriate callbacks
-     * set which would handle that error.
-     *
-     * bird: Looks like VERR_NOT_SUPPORTED is what the host will return if it
-     *       doesn't an appropriate callback.  The code used to ignore ALL errors
-     *       the host would return, also relevant ones.
-     */
     if (RT_FAILURE(rc))
         LogFlowFunc(("Sending error %Rrc failed with rc=%Rrc\n", rcErr, rc));
@@ -873,17 +782,9 @@
         rc = VINF_SUCCESS;
 
-    return rc;
-}
-
-/**
- * Writes an error back to the host.
- *
- * @returns IPRT status code.
- * @param   idClient            The client id returned by VbglR3ClipboardConnect().
- * @param   rcErr               Error (IPRT-style) to send.
- */
-VBGLR3DECL(int) vbglR3ClipboardWriteError(HGCMCLIENTID idClient, int rcErr)
-{
-    return vbglR3ClipboardWriteErrorInternal(idClient, rcErr);
+    if (RT_FAILURE(rc))
+        LogRel(("Shared Clipboard: Reporting error %Rrc to the host failed with %Rrc\n", rcErr, rc));
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
 }
 #endif /* VBOX_WITH_SHARED_CLIPBOARD_URI_LIST */
Index: trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp
===================================================================
--- trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp	(revision 79444)
+++ trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDragAndDrop.cpp	(revision 79497)
@@ -359,20 +359,20 @@
  * @returns IPRT status code.
  * @param   pCtx                DnD context to use.
- * @param   pDataHdr            DnD data header to use. Needed for accounting.
+ * @param   pListHdr            DnD data header to use. Needed for accounting.
  * @param   pDroppedFiles       Dropped files object to use for maintaining the file creation / locking.
  */
-static int vbglR3DnDHGRecvURIData(PVBGLR3GUESTDNDCMDCTX pCtx, PVBOXDNDSNDDATAHDR pDataHdr, DnDDroppedFiles *pDroppedFiles)
+static int vbglR3DnDHGRecvURIData(PVBGLR3GUESTDNDCMDCTX pCtx, PVBOXDNDSNDListHdr pListHdr, DnDDroppedFiles *pDroppedFiles)
 {
     AssertPtrReturn(pCtx,          VERR_INVALID_POINTER);
-    AssertPtrReturn(pDataHdr,      VERR_INVALID_POINTER);
+    AssertPtrReturn(pListHdr,      VERR_INVALID_POINTER);
     AssertPtrReturn(pDroppedFiles, VERR_INVALID_POINTER);
 
     /* Only count the raw data minus the already received meta data. */
-    Assert(pDataHdr->cbTotal >= pDataHdr->cbMeta);
-    uint64_t cbToRecvBytes = pDataHdr->cbTotal - pDataHdr->cbMeta;
-    uint64_t cToRecvObjs   = pDataHdr->cObjects;
+    Assert(pListHdr->cbTotal >= pListHdr->cbMeta);
+    uint64_t cbToRecvBytes = pListHdr->cbTotal - pListHdr->cbMeta;
+    uint64_t cToRecvObjs   = pListHdr->cObjects;
 
     LogFlowFunc(("cbToRecvBytes=%RU64, cToRecvObjs=%RU64, (cbTotal=%RU64, cbMeta=%RU32)\n",
-                 cbToRecvBytes, cToRecvObjs, pDataHdr->cbTotal, pDataHdr->cbMeta));
+                 cbToRecvBytes, cToRecvObjs, pListHdr->cbTotal, pListHdr->cbMeta));
 
     /* Anything to do at all? */
@@ -641,14 +641,14 @@
  * @returns IPRT status code.
  * @param   pCtx                DnD context to use.
- * @param   pDataHdr            DnD data header to use. Need for accounting and stuff.
+ * @param   pListHdr            DnD data header to use. Need for accounting and stuff.
  * @param   pvData              Where to store the received data from the host.
  * @param   cbData              Size (in bytes) of where to store the received data.
  * @param   pcbDataRecv         Where to store the received amount of data (in bytes).
  */
-static int vbglR3DnDHGRecvDataRaw(PVBGLR3GUESTDNDCMDCTX pCtx, PVBOXDNDSNDDATAHDR pDataHdr,
+static int vbglR3DnDHGRecvDataRaw(PVBGLR3GUESTDNDCMDCTX pCtx, PVBOXDNDSNDListHdr pListHdr,
                                   void *pvData, uint32_t cbData, uint32_t *pcbDataRecv)
 {
     AssertPtrReturn(pCtx,            VERR_INVALID_POINTER);
-    AssertPtrReturn(pDataHdr,        VERR_INVALID_POINTER);
+    AssertPtrReturn(pListHdr,        VERR_INVALID_POINTER);
     AssertPtrReturn(pvData,          VERR_INVALID_POINTER);
     AssertReturn(cbData,             VERR_INVALID_PARAMETER);
@@ -694,14 +694,14 @@
  * @returns IPRT status code.
  * @param   pCtx                DnD context to use.
- * @param   pDataHdr            Where to store the receivd DnD data header.
- */
-static int vbglR3DnDHGRecvDataHdr(PVBGLR3GUESTDNDCMDCTX pCtx, PVBOXDNDSNDDATAHDR pDataHdr)
+ * @param   pListHdr            Where to store the receivd DnD data header.
+ */
+static int vbglR3DnDHGRecvListHdr(PVBGLR3GUESTDNDCMDCTX pCtx, PVBOXDNDSNDListHdr pListHdr)
 {
     AssertPtrReturn(pCtx,     VERR_INVALID_POINTER);
-    AssertPtrReturn(pDataHdr, VERR_INVALID_POINTER);
+    AssertPtrReturn(pListHdr, VERR_INVALID_POINTER);
 
     Assert(pCtx->uProtocol >= 3); /* Only for protocol v3 and up. */
 
-    VBOXDNDHGSENDDATAHDRMSG Msg;
+    VBOXDNDHGSENDListHdrMSG Msg;
     RT_ZERO(Msg);
     VBGL_HGCM_HDR_INIT(&Msg.hdr, pCtx->uClientID, HOST_DND_HG_SND_DATA_HDR, 12);
@@ -711,10 +711,10 @@
     Msg.cbTotal.SetUInt64(0);
     Msg.cbMeta.SetUInt32(0);
-    Msg.pvMetaFmt.SetPtr(pDataHdr->pvMetaFmt, pDataHdr->cbMetaFmt);
+    Msg.pvMetaFmt.SetPtr(pListHdr->pvMetaFmt, pListHdr->cbMetaFmt);
     Msg.cbMetaFmt.SetUInt32(0);
     Msg.cObjects.SetUInt64(0);
     Msg.enmCompression.SetUInt32(0);
     Msg.enmChecksumType.SetUInt32(0);
-    Msg.pvChecksum.SetPtr(pDataHdr->pvChecksum, pDataHdr->cbChecksum);
+    Msg.pvChecksum.SetPtr(pListHdr->pvChecksum, pListHdr->cbChecksum);
     Msg.cbChecksum.SetUInt32(0);
 
@@ -723,13 +723,13 @@
     {
         /* Msg.uContext not needed here. */
-        Msg.uFlags.GetUInt32(&pDataHdr->uFlags);
-        Msg.uScreenId.GetUInt32(&pDataHdr->uScreenId);
-        Msg.cbTotal.GetUInt64(&pDataHdr->cbTotal);
-        Msg.cbMeta.GetUInt32(&pDataHdr->cbMeta);
-        Msg.cbMetaFmt.GetUInt32(&pDataHdr->cbMetaFmt);
-        Msg.cObjects.GetUInt64(&pDataHdr->cObjects);
-        Msg.enmCompression.GetUInt32(&pDataHdr->enmCompression);
-        Msg.enmChecksumType.GetUInt32((uint32_t *)&pDataHdr->enmChecksumType);
-        Msg.cbChecksum.GetUInt32(&pDataHdr->cbChecksum);
+        Msg.uFlags.GetUInt32(&pListHdr->uFlags);
+        Msg.uScreenId.GetUInt32(&pListHdr->uScreenId);
+        Msg.cbTotal.GetUInt64(&pListHdr->cbTotal);
+        Msg.cbMeta.GetUInt32(&pListHdr->cbMeta);
+        Msg.cbMetaFmt.GetUInt32(&pListHdr->cbMetaFmt);
+        Msg.cObjects.GetUInt64(&pListHdr->cObjects);
+        Msg.enmCompression.GetUInt32(&pListHdr->enmCompression);
+        Msg.enmChecksumType.GetUInt32((uint32_t *)&pListHdr->enmChecksumType);
+        Msg.cbChecksum.GetUInt32(&pListHdr->cbChecksum);
     }
 
@@ -744,13 +744,13 @@
  * @returns IPRT status code.
  * @param   pCtx                DnD context to use.
- * @param   pDataHdr            Where to store the data header data.
+ * @param   pListHdr            Where to store the data header data.
  * @param   ppvData             Returns the received meta data. Needs to be free'd by the caller.
  * @param   pcbData             Where to store the size (in bytes) of the received meta data.
  */
-static int vbglR3DnDHGRecvDataLoop(PVBGLR3GUESTDNDCMDCTX pCtx, PVBOXDNDSNDDATAHDR pDataHdr,
+static int vbglR3DnDHGRecvDataLoop(PVBGLR3GUESTDNDCMDCTX pCtx, PVBOXDNDSNDListHdr pListHdr,
                                    void **ppvData, uint64_t *pcbData)
 {
     AssertPtrReturn(pCtx,     VERR_INVALID_POINTER);
-    AssertPtrReturn(pDataHdr, VERR_INVALID_POINTER);
+    AssertPtrReturn(pListHdr, VERR_INVALID_POINTER);
     AssertPtrReturn(ppvData,  VERR_INVALID_POINTER);
     AssertPtrReturn(pcbData,  VERR_INVALID_POINTER);
@@ -761,13 +761,13 @@
     LogFlowFuncEnter();
 
-    rc = vbglR3DnDHGRecvDataHdr(pCtx, pDataHdr);
+    rc = vbglR3DnDHGRecvListHdr(pCtx, pListHdr);
     if (RT_FAILURE(rc))
         return rc;
 
-    LogFlowFunc(("cbTotal=%RU64, cbMeta=%RU32, cObjects=%RU32\n", pDataHdr->cbTotal, pDataHdr->cbMeta, pDataHdr->cObjects));
-    if (pDataHdr->cbMeta)
+    LogFlowFunc(("cbTotal=%RU64, cbMeta=%RU32, cObjects=%RU32\n", pListHdr->cbTotal, pListHdr->cbMeta, pListHdr->cObjects));
+    if (pListHdr->cbMeta)
     {
         uint64_t cbDataTmp = 0;
-        void    *pvDataTmp = RTMemAlloc(pDataHdr->cbMeta);
+        void    *pvDataTmp = RTMemAlloc(pListHdr->cbMeta);
         if (!pvDataTmp)
             rc = VERR_NO_MEMORY;
@@ -776,13 +776,13 @@
         {
             uint8_t *pvDataOff = (uint8_t *)pvDataTmp;
-            while (cbDataTmp < pDataHdr->cbMeta)
+            while (cbDataTmp < pListHdr->cbMeta)
             {
-                rc = vbglR3DnDHGRecvDataRaw(pCtx, pDataHdr,
-                                            pvDataOff, RT_MIN(pDataHdr->cbMeta - cbDataTmp, pCtx->cbMaxChunkSize),
+                rc = vbglR3DnDHGRecvDataRaw(pCtx, pListHdr,
+                                            pvDataOff, RT_MIN(pListHdr->cbMeta - cbDataTmp, pCtx->cbMaxChunkSize),
                                             &cbDataRecv);
                 if (RT_SUCCESS(rc))
                 {
                     LogFlowFunc(("cbDataRecv=%RU32, cbDataTmp=%RU64\n", cbDataRecv, cbDataTmp));
-                    Assert(cbDataTmp + cbDataRecv <= pDataHdr->cbMeta);
+                    Assert(cbDataTmp + cbDataRecv <= pListHdr->cbMeta);
                     cbDataTmp += cbDataRecv;
                     pvDataOff += cbDataRecv;
@@ -794,5 +794,5 @@
             if (RT_SUCCESS(rc))
             {
-                Assert(cbDataTmp == pDataHdr->cbMeta);
+                Assert(cbDataTmp == pListHdr->cbMeta);
 
                 LogFlowFunc(("Received %RU64 bytes of data\n", cbDataTmp));
@@ -833,12 +833,12 @@
     /* The rest is optional. */
 
-    VBOXDNDDATAHDR dataHdr;
-    RT_ZERO(dataHdr);
+    VBOXDNDListHdr ListHdr;
+    RT_ZERO(ListHdr);
 
     AssertMsg(pCtx->cbMaxChunkSize, ("Maximum chunk size must not be 0\n"));
 
-    dataHdr.cbMetaFmt = pCtx->cbMaxChunkSize;
-    dataHdr.pvMetaFmt = RTMemAlloc(dataHdr.cbMetaFmt);
-    if (!dataHdr.pvMetaFmt)
+    ListHdr.cbMetaFmt = pCtx->cbMaxChunkSize;
+    ListHdr.pvMetaFmt = RTMemAlloc(ListHdr.cbMetaFmt);
+    if (!ListHdr.pvMetaFmt)
         return VERR_NO_MEMORY;
 
@@ -849,5 +849,5 @@
     uint64_t cbData = 0;
 
-    int rc = vbglR3DnDHGRecvDataLoop(pCtx, &dataHdr, &pvData, &cbData);
+    int rc = vbglR3DnDHGRecvDataLoop(pCtx, &ListHdr, &pvData, &cbData);
     if (RT_SUCCESS(rc))
     {
@@ -860,7 +860,7 @@
          * VBoxTray) small by not having too much redundant code.
          */
-        Assert(dataHdr.cbMetaFmt);
-        AssertPtr(dataHdr.pvMetaFmt);
-        if (DnDMIMEHasFileURLs((char *)dataHdr.pvMetaFmt, dataHdr.cbMetaFmt)) /* URI data. */
+        Assert(ListHdr.cbMetaFmt);
+        AssertPtr(ListHdr.pvMetaFmt);
+        if (DnDMIMEHasFileURLs((char *)ListHdr.pvMetaFmt, ListHdr.cbMetaFmt)) /* URI data. */
         {
             AssertPtr(pvData);
@@ -869,5 +869,5 @@
             rc = lstURI.SetFromURIData(pvData, cbData, 0 /* fFlags */);
             if (RT_SUCCESS(rc))
-                rc = vbglR3DnDHGRecvURIData(pCtx, &dataHdr, &droppedFiles);
+                rc = vbglR3DnDHGRecvURIData(pCtx, &ListHdr, &droppedFiles);
 
             if (RT_SUCCESS(rc)) /** @todo Remove this block as soon as we hand in DnDURIList. */
@@ -905,6 +905,6 @@
     }
 
-    if (dataHdr.pvMetaFmt)
-        RTMemFree(dataHdr.pvMetaFmt);
+    if (ListHdr.pvMetaFmt)
+        RTMemFree(ListHdr.pvMetaFmt);
 
     if (RT_SUCCESS(rc))
@@ -1480,15 +1480,15 @@
  * @param   pvData              Data block to send.
  * @param   cbData              Size (in bytes) of data block to send.
- * @param   pDataHdr            Data header to use -- needed for accounting.
+ * @param   pListHdr            Data header to use -- needed for accounting.
  */
 static int vbglR3DnDGHSendDataInternal(PVBGLR3GUESTDNDCMDCTX pCtx,
-                                       void *pvData, uint64_t cbData, PVBOXDNDSNDDATAHDR pDataHdr)
+                                       void *pvData, uint64_t cbData, PVBOXDNDSNDListHdr pListHdr)
 {
     AssertPtrReturn(pCtx,     VERR_INVALID_POINTER);
     AssertPtrReturn(pvData,   VERR_INVALID_POINTER);
     AssertReturn(cbData,      VERR_INVALID_PARAMETER);
-    AssertPtrReturn(pDataHdr, VERR_INVALID_POINTER);
-
-    VBOXDNDGHSENDDATAHDRMSG MsgHdr;
+    AssertPtrReturn(pListHdr, VERR_INVALID_POINTER);
+
+    VBOXDNDGHSENDListHdrMSG MsgHdr;
     RT_ZERO(MsgHdr);
 
@@ -1497,9 +1497,9 @@
     MsgHdr.uFlags.SetUInt32(0);                             /** @todo Not used yet. */
     MsgHdr.uScreenId.SetUInt32(0);                          /** @todo Not used for guest->host (yet). */
-    MsgHdr.cbTotal.SetUInt64(pDataHdr->cbTotal);
-    MsgHdr.cbMeta.SetUInt32(pDataHdr->cbMeta);
-    MsgHdr.pvMetaFmt.SetPtr(pDataHdr->pvMetaFmt, pDataHdr->cbMetaFmt);
-    MsgHdr.cbMetaFmt.SetUInt32(pDataHdr->cbMetaFmt);
-    MsgHdr.cObjects.SetUInt64(pDataHdr->cObjects);
+    MsgHdr.cbTotal.SetUInt64(pListHdr->cbTotal);
+    MsgHdr.cbMeta.SetUInt32(pListHdr->cbMeta);
+    MsgHdr.pvMetaFmt.SetPtr(pListHdr->pvMetaFmt, pListHdr->cbMetaFmt);
+    MsgHdr.cbMetaFmt.SetUInt32(pListHdr->cbMetaFmt);
+    MsgHdr.cObjects.SetUInt64(pListHdr->cObjects);
     MsgHdr.enmCompression.SetUInt32(0);                     /** @todo Not used yet. */
     MsgHdr.enmChecksumType.SetUInt32(RTDIGESTTYPE_INVALID); /** @todo Not used yet. */
@@ -1510,5 +1510,5 @@
 
     LogFlowFunc(("cbTotal=%RU64, cbMeta=%RU32, cObjects=%RU64, rc=%Rrc\n",
-                 pDataHdr->cbTotal, pDataHdr->cbMeta, pDataHdr->cObjects, rc));
+                 pListHdr->cbTotal, pListHdr->cbMeta, pListHdr->cObjects, rc));
 
     if (RT_SUCCESS(rc))
@@ -1733,11 +1733,11 @@
     /* cbData can be 0. */
 
-    VBOXDNDDATAHDR dataHdr;
-    RT_ZERO(dataHdr);
+    VBOXDNDListHdr ListHdr;
+    RT_ZERO(ListHdr);
 
     /* For raw data only the total size is required to be specified. */
-    dataHdr.cbTotal = cbData;
-
-    return vbglR3DnDGHSendDataInternal(pCtx, pvData, cbData, &dataHdr);
+    ListHdr.cbTotal = cbData;
+
+    return vbglR3DnDGHSendDataInternal(pCtx, pvData, cbData, &ListHdr);
 }
 
@@ -1786,14 +1786,14 @@
             const uint32_t cbMetaFmt   = (uint32_t)strlen(szMetaFmt) + 1; /* Include termination. */
 
-            VBOXDNDDATAHDR dataHdr;
-            dataHdr.uFlags    = 0; /* Flags not used yet. */
-            dataHdr.cbTotal   = cbTotal;
-            dataHdr.cbMeta    = cbURLIist;
-            dataHdr.pvMetaFmt = (void *)szMetaFmt;
-            dataHdr.cbMetaFmt = cbMetaFmt;
-            dataHdr.cObjects  = lstURI.GetTotalCount();
+            VBOXDNDListHdr ListHdr;
+            ListHdr.uFlags    = 0; /* Flags not used yet. */
+            ListHdr.cbTotal   = cbTotal;
+            ListHdr.cbMeta    = cbURLIist;
+            ListHdr.pvMetaFmt = (void *)szMetaFmt;
+            ListHdr.cbMetaFmt = cbMetaFmt;
+            ListHdr.cObjects  = lstURI.GetTotalCount();
 
             rc = vbglR3DnDGHSendDataInternal(pCtx,
-                                             pvURIList, cbURLIist, &dataHdr);
+                                             pvURIList, cbURLIist, &ListHdr);
         }
         else
Index: trunk/src/VBox/Additions/common/VBoxService/VBoxServiceClipboard-os2.cpp
===================================================================
--- trunk/src/VBox/Additions/common/VBoxService/VBoxServiceClipboard-os2.cpp	(revision 79444)
+++ trunk/src/VBox/Additions/common/VBoxService/VBoxServiceClipboard-os2.cpp	(revision 79497)
@@ -884,5 +884,5 @@
                 uint32_t Msg;
                 uint32_t fFormats;
-                rc = VbglR3ClipboardGetHostMsg(g_u32ClientId, &Msg, &fFormats);
+                rc = VbglR3ClipboardGetHostMsgOld(g_u32ClientId, &Msg, &fFormats);
                 if (RT_SUCCESS(rc))
                 {
