Index: /trunk/include/VBox/HostServices/DragAndDropSvc.h
===================================================================
--- /trunk/include/VBox/HostServices/DragAndDropSvc.h	(revision 58229)
+++ /trunk/include/VBox/HostServices/DragAndDropSvc.h	(revision 58230)
@@ -726,4 +726,5 @@
 enum
 {
+    CB_MAGIC_DND_CONNECT                   = 0x25161155,
     CB_MAGIC_DND_HG_GET_NEXT_HOST_MSG      = 0x19820126,
     CB_MAGIC_DND_HG_GET_NEXT_HOST_MSG_DATA = 0x19850630,
@@ -747,4 +748,12 @@
     uint32_t                    u32ContextID;
 } VBOXDNDCBHEADERDATA, *PVBOXDNDCBHEADERDATA;
+
+typedef struct VBOXDNDCBCONNECTMSGDATA
+{
+    /** Callback data header. */
+    VBOXDNDCBHEADERDATA         hdr;
+    uint32_t                    uProtocol;
+    uint32_t                    uFlags;
+} VBOXDNDCBCONNECTMSGDATA, *PVBOXDNDCBCONNECTMSGDATA;
 
 typedef struct VBOXDNDCBHGGETNEXTHOSTMSG
Index: /trunk/src/VBox/HostServices/DragAndDrop/service.cpp
===================================================================
--- /trunk/src/VBox/HostServices/DragAndDrop/service.cpp	(revision 58229)
+++ /trunk/src/VBox/HostServices/DragAndDrop/service.cpp	(revision 58230)
@@ -382,16 +382,16 @@
                 if (cParms == 2)
                 {
-                    uint32_t uProtocol;
-                    rc = paParms[0].getUInt32(&uProtocol); /* Get protocol version. */
-                    if (RT_SUCCESS(rc))
-                        rc = pClient->setProtocol(uProtocol);
+                    VBOXDNDCBCONNECTMSGDATA data;
+                    data.hdr.u32Magic = CB_MAGIC_DND_CONNECT;
+                    rc = paParms[0].getUInt32(&data.uProtocol);
+                    if (RT_SUCCESS(rc))
+                        rc = paParms[1].getUInt32(&data.uFlags);
+                    if (RT_SUCCESS(rc))
+                        rc = pClient->setProtocol(data.uProtocol);
                     if (RT_SUCCESS(rc))
                     {
                         LogFlowFunc(("Client %RU32 is now using protocol v%RU32\n", pClient->clientId(), pClient->protocol()));
-                        /** @todo Handle connection flags (paParms[1]). */
+                        DO_HOST_CALLBACK();
                     }
-
-                    /* Note: Does not reach the host; the client's protocol version
-                     *       is only kept in this service. */
                 }
                 break;
Index: /trunk/src/VBox/Main/include/GuestDnDPrivate.h
===================================================================
--- /trunk/src/VBox/Main/include/GuestDnDPrivate.h	(revision 58229)
+++ /trunk/src/VBox/Main/include/GuestDnDPrivate.h	(revision 58230)
@@ -151,8 +151,8 @@
         if (strData.isNotEmpty())
         {
-            const size_t cbData = strData.length() + 1; /* Include terminating zero. */
-            rc = resize(cbData);
+            const size_t cbStrData = strData.length() + 1; /* Include terminating zero. */
+            rc = resize(cbStrData);
             if (RT_SUCCESS(rc))
-                memcpy(pvData, strData.c_str(), cbData);
+                memcpy(pvData, strData.c_str(), cbStrData);
         }
 
Index: /trunk/src/VBox/Main/include/GuestImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/GuestImpl.h	(revision 58229)
+++ /trunk/src/VBox/Main/include/GuestImpl.h	(revision 58230)
@@ -100,4 +100,5 @@
         return setErrorInternal(aResultCode, getStaticClassIID(), getStaticComponentName(), aText, false, true);
     }
+    uint32_t    i_getAdditionsRevision(void) { return mData.mAdditionsRevision; }
     uint32_t    i_getAdditionsVersion(void) { return mData.mAdditionsVersionFull; }
     VBOXOSTYPE  i_getGuestOSType(void) { return mData.mOSType; }
Index: /trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp	(revision 58229)
+++ /trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp	(revision 58230)
@@ -362,4 +362,11 @@
     switch (u32Function)
     {
+        case DragAndDropSvc::GUEST_DND_CONNECT:
+        {
+            /* Not used in here (yet). */
+            rc = VINF_SUCCESS;
+            break;
+        }
+
         case DragAndDropSvc::GUEST_DND_HG_ACK_OP:
         {
@@ -743,4 +750,5 @@
     /* Initialzie private stuff. */
     mDataBase.m_cTransfersPending = 0;
+    mDataBase.m_uProtocolVersion  = 0;
 }
 
@@ -795,4 +803,14 @@
 }
 
+/**
+ * Tries to guess the DnD protocol version to use on the guest, based on the
+ * installed Guest Additions version + revision.
+ *
+ * If unable to retrieve the protocol version, VERR_NOT_FOUND is returned along
+ * with protocol version 1.
+ *
+ * @return  IPRT status code.
+ * @param   puProto                 Where to store the protocol version.
+ */
 int GuestDnDBase::getProtocolVersion(uint32_t *puProto)
 {
@@ -801,27 +819,34 @@
     int rc;
 
-    uint32_t uProto        = 1; /* Use protocol v1 as a fallback. */
+    uint32_t uProto        = 0;
     uint32_t uVerAdditions = 0;
+    uint32_t uRevAdditions = 0;
     if (   m_pGuest
-        && (uVerAdditions = m_pGuest->i_getAdditionsVersion()) > 0)
-    {
-#if 1
+        && (uVerAdditions = m_pGuest->i_getAdditionsVersion())  > 0
+        && (uRevAdditions = m_pGuest->i_getAdditionsRevision()) > 0)
+    {
+#ifdef _DEBUG
+# if 0
         /* Hardcode the to-used protocol version; nice for testing side effects. */
         uProto = 3;
-#else
-        if (uVerAdditions >= VBOX_FULL_VERSION_MAKE(5, 0, 0))
-        {
-            if (uVerAdditions >= VBOX_FULL_VERSION_MAKE(5, 0, 8))
+# endif
+#endif
+        if (!uProto) /* Protocol not set yet? */
+        {
+            if (uVerAdditions >= VBOX_FULL_VERSION_MAKE(5, 0, 0))
             {
-                uProto = 3; /* Since VBox 5.0.8: Protocol v3. */
+                if (uRevAdditions >= 103344) /* Since r103344: Protocol v3. */
+                {
+                    uProto = 3;
+                }
+                else
+                    uProto = 2; /* VBox 5.0.0 - 5.0.6: Protocol v2. */
             }
-            else
-                uProto = 2; /* VBox 5.0.0 - 5.0.6: Protocol v2. */
-        }
-#endif
-        LogRel3(("DnD: uVerAdditions=%RU32 (%RU32.%RU32.%RU32)\n",
-                 uVerAdditions, VBOX_FULL_VERSION_GET_MAJOR(uVerAdditions), VBOX_FULL_VERSION_GET_MINOR(uVerAdditions),
-                                VBOX_FULL_VERSION_GET_BUILD(uVerAdditions)));
-        rc = VINF_SUCCESS;
+
+            LogFlowFunc(("uVerAdditions=%RU32 (%RU32.%RU32.%RU32), r%RU32\n",
+                         uVerAdditions, VBOX_FULL_VERSION_GET_MAJOR(uVerAdditions), VBOX_FULL_VERSION_GET_MINOR(uVerAdditions),
+                                        VBOX_FULL_VERSION_GET_BUILD(uVerAdditions), uRevAdditions));
+            rc = VINF_SUCCESS;
+        }
     }
     else
@@ -831,5 +856,5 @@
     }
 
-    LogRel3(("DnD: uProto=%RU32, rc=%Rrc\n", uProto, rc));
+    LogRel2(("DnD: Guest is using protocol v%RU32, rc=%Rrc\n", uProto, rc));
 
     *puProto = uProto;
Index: /trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp	(revision 58229)
+++ /trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp	(revision 58230)
@@ -804,7 +804,7 @@
         Msg.setNextUInt32(pData->getFmtSize());                                            /* cbFormat */
         Msg.setNextPointer(pData->getMeta().getDataMutable(), pData->getMeta().getSize()); /* pvData */
-        /* Note1: Fill in the total data to send.
-         * Note2: Only supports uint32_t. */
-        Msg.setNextUInt32((uint32_t)pData->getTotal());                                    /* cbData */
+        /* Fill in the current data block size to send.
+         * Note: Only supports uint32_t. */
+        Msg.setNextUInt32((uint32_t)pData->getMeta().getSize());                           /* cbData */
     }
     else
