Index: /trunk/include/iprt/mangling.h
===================================================================
--- /trunk/include/iprt/mangling.h	(revision 45399)
+++ /trunk/include/iprt/mangling.h	(revision 45400)
@@ -939,4 +939,5 @@
 # define RTPathJoinEx                                   RT_MANGLER(RTPathJoinEx)
 # define RTPathParse                                    RT_MANGLER(RTPathParse)
+# define RTPathParsedReassemble                         RT_MANGLER(RTPathParsedReassemble)
 # define RTPathParseSimple                              RT_MANGLER(RTPathParseSimple)
 # define RTPathQueryInfo                                RT_MANGLER(RTPathQueryInfo)
@@ -956,4 +957,5 @@
 # define RTPathSplitATag                                RT_MANGLER(RTPathSplitATag)
 # define RTPathSplitFree                                RT_MANGLER(RTPathSplitFree)
+# define RTPathSplitReassemble                          RT_MANGLER(RTPathSplitReassemble)
 # define RTPathStartsWith                               RT_MANGLER(RTPathStartsWith)
 # define RTPathStartsWithRoot                           RT_MANGLER(RTPathStartsWithRoot)
Index: /trunk/include/iprt/path.h
===================================================================
--- /trunk/include/iprt/path.h	(revision 45399)
+++ /trunk/include/iprt/path.h	(revision 45400)
@@ -611,5 +611,27 @@
  * @sa      RTPathSplit, RTPathSplitA.
  */
-RTDECL(int) RTPathParse(const char *pszPath,  PRTPATHPARSED pParsed, size_t cbParsed, uint32_t fFlags);
+RTDECL(int) RTPathParse(const char *pszPath, PRTPATHPARSED pParsed, size_t cbParsed, uint32_t fFlags);
+
+/**
+ * Reassembles a path parsed by RTPathParse.
+ *
+ * This will be more useful as more APIs manipulating the RTPATHPARSED output
+ * are added.
+ *
+ * @returns IPRT status code.
+ * @retval  VERR_BUFFER_OVERFLOW if @a cbDstPath is less than or equal to
+ *          RTPATHPARSED::cchPath.
+ *
+ * @param   pszSrcPath          The source path.
+ * @param   pParsed             The parser output for @a pszSrcPath.
+ * @param   fFlags              Combination of RTPATH_STR_F_STYLE_XXX.
+ *                              Most users will pass 0.
+ * @param   pszDstPath          Pointer to the buffer where the path is to be
+ *                              reassembled.
+ * @param   cbDstPath           The size of the output buffer.
+ */
+RTDECL(int) RTPathParsedReassemble(const char *pszSrcPath, PRTPATHPARSED pParsed, uint32_t fFlags,
+                                   char *pszDstPath, size_t cbDstPath);
+
 
 /**
@@ -691,5 +713,5 @@
  * @sa      RTPathSplitFree, RTPathSplit, RTPathParse.
  */
-#define  RTPathSplitA(pszPath, ppSplit, fFlags)     RTPathSplitATag(pszPath, ppSplit, fFlags, RTPATH_TAG)
+#define RTPathSplitA(pszPath, ppSplit, fFlags)      RTPathSplitATag(pszPath, ppSplit, fFlags, RTPATH_TAG)
 
 /**
@@ -720,4 +742,22 @@
 RTDECL(void) RTPathSplitFree(PRTPATHSPLIT pSplit);
 
+/**
+ * Reassembles a path parsed by RTPathSplit.
+ *
+ * This will be more useful as more APIs manipulating the RTPATHSPLIT output are
+ * added.
+ *
+ * @returns IPRT status code.
+ * @retval  VERR_BUFFER_OVERFLOW if @a cbDstPath is less than or equal to
+ *          RTPATHSPLIT::cchPath.
+ *
+ * @param   pParsed             The parser output for @a pszSrcPath.
+ * @param   fFlags              Combination of RTPATH_STR_F_STYLE_XXX.
+ *                              Most users will pass 0.
+ * @param   pszDstPath          Pointer to the buffer where the path is to be
+ *                              reassembled.
+ * @param   cbDstPath           The size of the output buffer.
+ */
+RTDECL(int) RTPathSplitReassemble(PRTPATHSPLIT pSplit, uint32_t fFlags, char *pszDstPath, size_t cbDstPath);
 
 /**
Index: /trunk/src/VBox/Runtime/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Runtime/Makefile.kmk	(revision 45399)
+++ /trunk/src/VBox/Runtime/Makefile.kmk	(revision 45400)
@@ -363,4 +363,5 @@
 	common/path/RTPathJoinEx.cpp \
 	common/path/RTPathParse.cpp \
+	common/path/RTPathParsedReassemble.cpp \
 	common/path/RTPathParseSimple.cpp \
 	common/path/RTPathRealDup.cpp \
@@ -368,4 +369,5 @@
 	common/path/RTPathSplit.cpp \
 	common/path/RTPathSplitA.cpp \
+	common/path/RTPathSplitReassemble.cpp \
 	common/path/RTPathStartsWithRoot.cpp \
 	common/path/RTPathStripExt.cpp \
Index: /trunk/src/VBox/Runtime/common/path/RTPathParsedReassemble.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/path/RTPathParsedReassemble.cpp	(revision 45400)
+++ /trunk/src/VBox/Runtime/common/path/RTPathParsedReassemble.cpp	(revision 45400)
@@ -0,0 +1,124 @@
+/* $Id$ */
+/** @file
+ * IPRT - RTPathParsedReassemble.
+ */
+
+/*
+ * Copyright (C) 2013 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
+#include "internal/iprt.h"
+#include <iprt/path.h>
+
+#include <iprt/assert.h>
+#include <iprt/err.h>
+#include <iprt/string.h>
+
+
+RTDECL(int) RTPathParsedReassemble(const char *pszSrcPath, PRTPATHPARSED pParsed, uint32_t fFlags,
+                                   char *pszDstPath, size_t cbDstPath)
+{
+    /*
+     * Input validation.
+     */
+    AssertPtrReturn(pszSrcPath, VERR_INVALID_POINTER);
+    AssertPtrReturn(pParsed, VERR_INVALID_POINTER);
+    AssertReturn(pParsed->cComps > 0, VERR_INVALID_PARAMETER);
+    AssertReturn(RTPATH_STR_F_IS_VALID(fFlags, 0) && !(fFlags & RTPATH_STR_F_MIDDLE), VERR_INVALID_FLAGS);
+    AssertPtrReturn(pszDstPath, VERR_INVALID_POINTER);
+    AssertReturn(cbDstPath > pParsed->cchPath, VERR_BUFFER_OVERFLOW);
+
+    /*
+     * Figure which slash to use.
+     */
+    char chSlash;
+    switch (fFlags & RTPATH_STR_F_STYLE_MASK)
+    {
+#if PATH_STYLE == RTPATH_STR_F_STYLE_DOS
+        case RTPATH_STR_F_STYLE_HOST:
+#endif
+        case RTPATH_STR_F_STYLE_DOS:
+            chSlash = '\\';
+            break;
+
+#if PATH_STYLE == RTPATH_STR_F_STYLE_UNIX
+        case RTPATH_STR_F_STYLE_HOST:
+#endif
+        case RTPATH_STR_F_STYLE_UNIX:
+            chSlash = '/';
+            break;
+
+        default:
+            AssertFailedReturn(VERR_INVALID_FLAGS); /* impossible */
+    }
+
+    /*
+     * Do the joining.
+     */
+    uint32_t const  cchOrgPath = pParsed->cchPath;
+    uint32_t        cchDstPath = 0;
+    uint32_t const  cComps     = pParsed->cComps;
+    uint32_t        idxComp    = 0;
+    char           *pszDst     = pszDstPath;
+    uint32_t        cchComp;
+
+    if (RTPATH_PROP_HAS_ROOT_SPEC(pParsed->fProps))
+    {
+        cchComp = pParsed->aComps[0].cch;
+        cchDstPath += cchComp;
+        AssertReturn(cchDstPath <= cchOrgPath, VERR_INVALID_PARAMETER);
+        memcpy(pszDst, &pszSrcPath[pParsed->aComps[0].off], cchComp);
+
+        /* fix the slashes */
+        char chOtherSlash = chSlash == '\\' ? '/' : '\\';
+        while (cchComp-- > 0)
+        {
+            if (*pszDst == chOtherSlash)
+                *pszDst = chSlash;
+            pszDst++;
+        }
+        idxComp = 1;
+    }
+
+    while (idxComp < cComps)
+    {
+        cchComp = pParsed->aComps[idxComp].cch;
+        cchDstPath += cchComp;
+        AssertReturn(cchDstPath <= cchOrgPath, VERR_INVALID_PARAMETER);
+        memcpy(pszDst, &pszSrcPath[pParsed->aComps[idxComp].off], cchComp);
+        pszDst += cchComp;
+        idxComp++;
+        if (idxComp != cComps || (pParsed->fProps & RTPATH_PROP_DIR_SLASH))
+        {
+            cchDstPath++;
+            AssertReturn(cchDstPath <= cchOrgPath, VERR_INVALID_PARAMETER);
+            *pszDst++ = chSlash;
+        }
+    }
+
+    *pszDst = '\0';
+
+    return VINF_SUCCESS;
+}
+
Index: /trunk/src/VBox/Runtime/common/path/RTPathSplitReassemble.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/path/RTPathSplitReassemble.cpp	(revision 45400)
+++ /trunk/src/VBox/Runtime/common/path/RTPathSplitReassemble.cpp	(revision 45400)
@@ -0,0 +1,123 @@
+/* $Id$ */
+/** @file
+ * IPRT - RTPathSplitReassemble.
+ */
+
+/*
+ * Copyright (C) 2013 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
+#include "internal/iprt.h"
+#include <iprt/path.h>
+
+#include <iprt/assert.h>
+#include <iprt/err.h>
+#include <iprt/string.h>
+
+
+RTDECL(int) RTPathSplitReassemble(PRTPATHSPLIT pSplit, uint32_t fFlags, char *pszDstPath, size_t cbDstPath)
+{
+    /*
+     * Input validation.
+     */
+    AssertPtrReturn(pSplit, VERR_INVALID_POINTER);
+    AssertReturn(pSplit->cComps > 0, VERR_INVALID_PARAMETER);
+    AssertReturn(RTPATH_STR_F_IS_VALID(fFlags, 0) && !(fFlags & RTPATH_STR_F_MIDDLE), VERR_INVALID_FLAGS);
+    AssertPtrReturn(pszDstPath, VERR_INVALID_POINTER);
+    AssertReturn(cbDstPath > pSplit->cchPath, VERR_BUFFER_OVERFLOW);
+
+    /*
+     * Figure which slash to use.
+     */
+    char chSlash;
+    switch (fFlags & RTPATH_STR_F_STYLE_MASK)
+    {
+#if PATH_STYLE == RTPATH_STR_F_STYLE_DOS
+        case RTPATH_STR_F_STYLE_HOST:
+#endif
+        case RTPATH_STR_F_STYLE_DOS:
+            chSlash = '\\';
+            break;
+
+#if PATH_STYLE == RTPATH_STR_F_STYLE_UNIX
+        case RTPATH_STR_F_STYLE_HOST:
+#endif
+        case RTPATH_STR_F_STYLE_UNIX:
+            chSlash = '/';
+            break;
+
+        default:
+            AssertFailedReturn(VERR_INVALID_FLAGS); /* impossible */
+    }
+
+    /*
+     * Do the joining.
+     */
+    uint32_t const  cchOrgPath = pSplit->cchPath;
+    uint32_t        cchDstPath = 0;
+    uint32_t const  cComps     = pSplit->cComps;
+    uint32_t        idxComp    = 0;
+    char           *pszDst     = pszDstPath;
+    size_t          cchComp;
+
+    if (RTPATH_PROP_HAS_ROOT_SPEC(pSplit->fProps))
+    {
+        cchComp = strlen(pSplit->apszComps[0]);
+        cchDstPath += cchComp;
+        AssertReturn(cchDstPath <= cchOrgPath, VERR_INVALID_PARAMETER);
+        memcpy(pszDst, pSplit->apszComps[0], cchComp);
+
+        /* fix the slashes */
+        char chOtherSlash = chSlash == '\\' ? '/' : '\\';
+        while (cchComp-- > 0)
+        {
+            if (*pszDst == chOtherSlash)
+                *pszDst = chSlash;
+            pszDst++;
+        }
+        idxComp = 1;
+    }
+
+    while (idxComp < cComps)
+    {
+        cchComp = strlen(pSplit->apszComps[idxComp]);
+        cchDstPath += cchComp;
+        AssertReturn(cchDstPath <= cchOrgPath, VERR_INVALID_PARAMETER);
+        memcpy(pszDst, pSplit->apszComps[idxComp], cchComp);
+        pszDst += cchComp;
+        idxComp++;
+        if (idxComp != cComps || (pSplit->fProps & RTPATH_PROP_DIR_SLASH))
+        {
+            cchDstPath++;
+            AssertReturn(cchDstPath <= cchOrgPath, VERR_INVALID_PARAMETER);
+            *pszDst++ = chSlash;
+        }
+    }
+
+    *pszDst = '\0';
+
+    return VINF_SUCCESS;
+}
+
+
Index: /trunk/src/VBox/Runtime/testcase/tstRTPath.cpp
===================================================================
--- /trunk/src/VBox/Runtime/testcase/tstRTPath.cpp	(revision 45399)
+++ /trunk/src/VBox/Runtime/testcase/tstRTPath.cpp	(revision 45400)
@@ -87,4 +87,5 @@
     };
 
+    char szPath1[RTPATH_MAX];
     union
     {
@@ -116,4 +117,18 @@
                                  s_aTests[i].offSuffix, u.Parsed.offSuffix,
                                  s_aTests[i].cchPath,   u.Parsed.cchPath);
+        }
+        else
+        {
+            rc = RTPathParsedReassemble(s_aTests[i].pszPath, &u.Parsed, s_aTests[i].fFlags & ~RTPATH_STR_F_MIDDLE,
+                                        szPath1, sizeof(szPath1));
+            if (rc == VINF_SUCCESS)
+            {
+                RTTESTI_CHECK_MSG(strlen(szPath1) == s_aTests[i].cchPath, ("%s\n", szPath1));
+                if (   !(u.Parsed.fProps & RTPATH_PROP_EXTRA_SLASHES)
+                    && (s_aTests[i].fFlags & RTPATH_STR_F_STYLE_MASK) != RTPATH_STR_F_STYLE_DOS)
+                    RTTESTI_CHECK_MSG(strcmp(szPath1, s_aTests[i].pszPath) == 0, ("%s\n", szPath1));
+            }
+            else
+                RTTestIFailed("RTPathParsedReassemble -> %Rrc", rc);
         }
     }
@@ -162,4 +177,15 @@
                 RTPathSplitFree(pSplit);
             }
+
+            rc = RTPathSplitReassemble(&u.Split, s_aTests[i].fFlags & ~RTPATH_STR_F_MIDDLE, szPath1, sizeof(szPath1));
+            if (rc == VINF_SUCCESS)
+            {
+                RTTESTI_CHECK_MSG(strlen(szPath1) == s_aTests[i].cchPath, ("%s\n", szPath1));
+                if (   !(u.Parsed.fProps & RTPATH_PROP_EXTRA_SLASHES)
+                    && (s_aTests[i].fFlags & RTPATH_STR_F_STYLE_MASK) != RTPATH_STR_F_STYLE_DOS)
+                    RTTESTI_CHECK_MSG(strcmp(szPath1, s_aTests[i].pszPath) == 0, ("%s\n", szPath1));
+            }
+            else
+                RTTestIFailed("RTPathSplitReassemble -> %Rrc", rc);
         }
     }
