Index: /trunk/src/VBox/Additions/os2/VBoxSF/VBoxSF.cpp
===================================================================
--- /trunk/src/VBox/Additions/os2/VBoxSF/VBoxSF.cpp	(revision 75404)
+++ /trunk/src/VBox/Additions/os2/VBoxSF/VBoxSF.cpp	(revision 75405)
@@ -359,12 +359,14 @@
  * @returns VBox status code.
  * @param   pName       The name of the folder to map.
+ * @param   pszTag      Folder tag (for the VBoxService automounter).  Optional.
  * @param   ppFolder    Where to return the folder structure on success.
  *
  * @remarks Caller owns g_MtxFolder exclusively!
  */
-static int vboxSfOs2MapFolder(PSHFLSTRING pName, PVBOXSFFOLDER *ppFolder)
+static int vboxSfOs2MapFolder(PSHFLSTRING pName, const char *pszTag, PVBOXSFFOLDER *ppFolder)
 {
     int rc;
-    PVBOXSFFOLDER pNew = (PVBOXSFFOLDER)RTMemAlloc(RT_UOFFSETOF_DYN(VBOXSFFOLDER, szName[pName->u16Length + 1]));
+    size_t const  cbTag = pszTag ? strlen(pszTag) + 1 :  NULL;
+    PVBOXSFFOLDER pNew  = (PVBOXSFFOLDER)RTMemAlloc(RT_UOFFSETOF_DYN(VBOXSFFOLDER, szName[pName->u16Length + 1 + cbTag]));
     if (pNew != NULL)
     {
@@ -375,7 +377,11 @@
         RT_ZERO(pNew->hHostFolder);
         pNew->hVpb          = 0;
+        pNew->cbNameAndTag  = pName->u16Length + (uint16_t)cbTag;
+        pNew->cchName       = (uint8_t)pName->u16Length;
         pNew->cchName       = (uint8_t)pName->u16Length;
         memcpy(pNew->szName, pName->String.utf8, pName->u16Length);
         pNew->szName[pName->u16Length] = '\0';
+        if (cbTag)
+            memcpy(&pNew->szName[pName->u16Length + 1], pszTag, cbTag);
 
         rc = VbglR0SfMapFolder(&g_SfClient, pName, &pNew->hHostFolder);
@@ -552,5 +558,5 @@
              * Do the attaching.
              */
-            rc = vboxSfOs2MapFolder(pStrName, ppFolder);
+            rc = vboxSfOs2MapFolder(pStrName, NULL, ppFolder);
             vboxSfOs2StrFree(pStrName);
             if (RT_SUCCESS(rc))
@@ -764,6 +770,8 @@
     }
 
-    /* Make sure it's only ascii and contains not weird stuff. */
-    unsigned off = pStrName->u16Length;
+    /* Make sure it's only ascii and contains not weird stuff.
+       Note! There could be a 2nd tag string, so identify that one. */
+    const char *pszTag = NULL;
+    unsigned    off = pStrName->u16Length;
     while (off-- > 0)
     {
@@ -771,8 +779,18 @@
         if (ch < 0x20 || ch >= 0x7f || ch == ':' || ch == '\\' || ch == '/')
         {
-            LogRel(("vboxSfOs2Attach: Malformed folder name: %.*Rhxs (off %#x)\n", pStrName->u16Length, pStrName->String.utf8, off));
-            return ERROR_INVALID_PARAMETER;
-        }
-    }
+            if (ch == '\0' && !pszTag && off + 1 < pStrName->u16Length && off > 0)
+            {
+                pszTag = &pStrName->String.ach[off + 1];
+                pStrName->u16Length = (uint16_t)off;
+            }
+            else
+            {
+                LogRel(("vboxSfOs2Attach: Malformed folder name: %.*Rhxs (off %#x)\n", pStrName->u16Length, pStrName->String.utf8, off));
+                return ERROR_INVALID_PARAMETER;
+            }
+        }
+    }
+
+    /* Is there a tag following the name? */
 
     if (!pVpFsd)
@@ -794,5 +812,5 @@
             rc = vboxSfOs2EnsureConnected();
             if (RT_SUCCESS(rc))
-                rc = vboxSfOs2MapFolder(pStrName, &pFolder);
+                rc = vboxSfOs2MapFolder(pStrName, pszTag, &pFolder);
         }
         if (pFolder && RT_SUCCESS(rc))
@@ -919,11 +937,11 @@
 
         /* Try copy out the data. */
-        if (cbParam >= sizeof(USHORT) + pFolder->cchName + 1)
-        {
-            *pcbParam = (uint16_t)sizeof(USHORT) + pFolder->cchName + 1;
+        if (cbParam >= sizeof(USHORT) + pFolder->cbNameAndTag)
+        {
+            *pcbParam = (uint16_t)sizeof(USHORT) + pFolder->cbNameAndTag;
             cbParam = pFolder->cchName + 1;
             rc = KernCopyOut(pbData, &cbParam, sizeof(cbParam));
             if (rc != NO_ERROR)
-                rc = KernCopyOut(pbData + sizeof(USHORT), pFolder->szName, pFolder->cchName + 1);
+                rc = KernCopyOut(pbData + sizeof(USHORT), pFolder->szName, pFolder->cbNameAndTag);
         }
         else
Index: /trunk/src/VBox/Additions/os2/VBoxSF/VBoxSFInternal.h
===================================================================
--- /trunk/src/VBox/Additions/os2/VBoxSF/VBoxSFInternal.h	(revision 75404)
+++ /trunk/src/VBox/Additions/os2/VBoxSF/VBoxSFInternal.h	(revision 75405)
@@ -78,7 +78,9 @@
     USHORT              hVpb;
 
+    /** The length of the name and tag, including zero terminators and such. */
+    uint16_t            cbNameAndTag;
     /** The length of the folder name. */
     uint8_t             cchName;
-    /** The shared folder name. */
+    /** The shared folder name.  If there is a tag it follows as a second string. */
     char                szName[RT_FLEXIBLE_ARRAY];
 } VBOXSFFOLDER;
