Index: /trunk/include/iprt/path.h
===================================================================
--- /trunk/include/iprt/path.h	(revision 78152)
+++ /trunk/include/iprt/path.h	(revision 78153)
@@ -357,7 +357,9 @@
  * @{ */
 /** Treat specified base directory as a root that cannot be ascended beyond.  */
-#define RTPATHABS_F_STOP_AT_BASE    RT_BIT_32(16)
+#define RTPATHABS_F_STOP_AT_BASE            RT_BIT_32(16)
 /** Treat CWD as a root that cannot be ascended beyond.  */
-#define RTPATHABS_F_STOP_AT_CWD     RT_BIT_32(17)
+#define RTPATHABS_F_STOP_AT_CWD             RT_BIT_32(17)
+/** Ensure trailing slash in the result. */
+#define RTPATHABS_F_ENSURE_TRAILING_SLASH   RT_BIT_32(18)
 /** @} */
 
Index: /trunk/src/VBox/Runtime/common/path/RTPathAbsDup.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/path/RTPathAbsDup.cpp	(revision 78152)
+++ /trunk/src/VBox/Runtime/common/path/RTPathAbsDup.cpp	(revision 78153)
@@ -32,8 +32,4 @@
 #include <iprt/path.h>
 
-#include <iprt/err.h>
-#include <iprt/param.h>
-#include <iprt/string.h>
-
 
 /**
@@ -46,28 +42,5 @@
 RTDECL(char *) RTPathAbsDup(const char *pszPath)
 {
-    /* Try with a static buffer first. */
-    char szPath[RTPATH_MAX];
-    int rc = RTPathAbs(pszPath, szPath, sizeof(szPath));
-    if (RT_SUCCESS(rc))
-        return RTStrDup(szPath);
-
-    /* If it looks like we ran out of buffer space, double the size until
-       we reach 64 KB. */
-    if (rc == VERR_FILENAME_TOO_LONG || rc == VERR_BUFFER_OVERFLOW)
-    {
-        size_t cbBuf = RTPATH_MAX;
-        do
-        {
-            cbBuf *= 2;
-            char *pszBuf = RTStrAlloc(cbBuf);
-            if (!pszBuf)
-                break;
-            rc = RTPathAbs(pszPath, pszBuf, cbBuf);
-            if (RT_SUCCESS(rc))
-                return pszBuf;
-            RTStrFree(pszBuf);
-        } while (cbBuf <= _32K);
-    }
-    return NULL;
+    return RTPathAbsExDup(NULL, pszPath, RTPATH_STR_F_STYLE_HOST);
 }
 
Index: /trunk/src/VBox/Runtime/common/path/RTPathAbsEx.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/path/RTPathAbsEx.cpp	(revision 78152)
+++ /trunk/src/VBox/Runtime/common/path/RTPathAbsEx.cpp	(revision 78153)
@@ -185,5 +185,7 @@
     {
         Assert(pBaseParsed->cComps > 1);
-        if (iLast >= 0 || (pParsed->fProps & RTPATH_PROP_DIR_SLASH))
+        if (   iLast >= 0
+            || (pParsed->fProps & RTPATH_PROP_DIR_SLASH)
+            || (fFlags & RTPATHABS_F_ENSURE_TRAILING_SLASH) )
             pBaseParsed->fProps |= RTPATH_PROP_DIR_SLASH;
         else
@@ -191,4 +193,9 @@
     }
 
+    /* Apply the trailing flash flag to the input path: */
+    if (   iLast >= 0
+        && (fFlags & RTPATHABS_F_ENSURE_TRAILING_SLASH))
+        pParsed->fProps |= RTPATH_PROP_DIR_SLASH;
+
     /*
      * Combine the two.  RTPathParsedReassemble can handle in place stuff, as
@@ -207,7 +214,11 @@
             rc = RTPathParsedReassemble(pszPath, pParsed, fFlags & RTPATH_STR_F_STYLE_MASK,
                                         &pszAbsPath[cchBaseInPlace], *pcbAbsPath - cchBaseInPlace);
-            *pcbAbsPath = cchBaseInPlace + pParsed->cchPath;
             if (RT_SUCCESS(rc))
+            {
+                *pcbAbsPath = cchBaseInPlace + pParsed->cchPath;
                 Assert(*pcbAbsPath == strlen(pszAbsPath));
+            }
+            else
+                *pcbAbsPath = cchBaseInPlace + pParsed->cchPath + 1;
         }
         else
@@ -219,8 +230,8 @@
         {
             RTPathParsedReassemble(pszPath, pParsed, fFlags & RTPATH_STR_F_STYLE_MASK, pszAbsPath, 0);
-            *pcbAbsPath = pBaseParsed->cchPath + pParsed->cchPath;
+            *pcbAbsPath = pBaseParsed->cchPath + pParsed->cchPath + 1;
         }
         else
-            *pcbAbsPath = pBaseParsed->cchPath;
+            *pcbAbsPath = pBaseParsed->cchPath + 1;
     }
 
@@ -448,4 +459,11 @@
         i++;
     }
+
+    /*
+     * Before we continue, ensure trailing slash if requested.
+     */
+    if (   (fFlags & RTPATHABS_F_ENSURE_TRAILING_SLASH)
+        && iLast > 0)
+        pParsed->fProps |= RTPATH_PROP_DIR_SLASH;
 
     /*
@@ -527,11 +545,11 @@
                 {
                     int rc2 = RTPathParsedReassemble(pszPath, pParsed, fFlags & RTPATH_STR_F_STYLE_MASK, pszAbsPath, 0);
-                    Assert(rc2 == VERR_BUFFER_OVERFLOW); RT_NOREF(rc2);
+                    Assert(rc2 == VERR_BUFFER_OVERFLOW);
 
                     char *pszTmp = (char *)RTMemTmpAlloc(RTPATH_BIG_MAX);
                     if (pszTmp)
                     {
-                        rc = RTPathGetCurrentDrive(pszTmp, RTPATH_BIG_MAX);
-                        if (RT_SUCCESS(rc))
+                        rc2 = RTPathGetCurrentDrive(pszTmp, RTPATH_BIG_MAX);
+                        if (RT_SUCCESS(rc2))
                             *pcbAbsPath = strlen(pszTmp) + pParsed->cchPath + 1;
                         else
@@ -570,4 +588,9 @@
                 pParsed->aComps[i].cch = 0;
     }
+
+    if (   (fFlags & RTPATHABS_F_ENSURE_TRAILING_SLASH)
+        && pParsed->cComps > 1)
+        pParsed->fProps |= RTPATH_PROP_DIR_SLASH;
+
     int rc = RTPathParsedReassemble(pszPath, pParsed, fFlags & RTPATH_STR_F_STYLE_MASK, pszAbsPath, *pcbAbsPath);
     *pcbAbsPath = pParsed->cchPath + (rc == VERR_BUFFER_OVERFLOW);
@@ -589,5 +612,5 @@
 
     AssertCompile(RTPATH_STR_F_STYLE_HOST == 0);
-    AssertReturn(   RTPATH_STR_F_IS_VALID(fFlags, RTPATHABS_F_STOP_AT_BASE | RTPATHABS_F_STOP_AT_CWD)
+    AssertReturn(   RTPATH_STR_F_IS_VALID(fFlags, RTPATHABS_F_STOP_AT_BASE | RTPATHABS_F_STOP_AT_CWD | RTPATHABS_F_ENSURE_TRAILING_SLASH)
                  && !(fFlags & RTPATH_STR_F_MIDDLE), VERR_INVALID_FLAGS);
     if ((fFlags & RTPATH_STR_F_STYLE_MASK) == RTPATH_STR_F_STYLE_HOST)
Index: /trunk/src/VBox/Runtime/common/path/RTPathAbsExDup.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/path/RTPathAbsExDup.cpp	(revision 78152)
+++ /trunk/src/VBox/Runtime/common/path/RTPathAbsExDup.cpp	(revision 78153)
@@ -39,29 +39,32 @@
 RTDECL(char *) RTPathAbsExDup(const char *pszBase, const char *pszPath, uint32_t fFlags)
 {
-    char szPath[RTPATH_MAX];
-    size_t cbPath = sizeof(szPath);
-    int rc = RTPathAbsEx(pszBase, pszPath, fFlags, szPath, &cbPath);
-    if (RT_SUCCESS(rc))
-        return RTStrDup(szPath);
+    unsigned    cTries    = 16;
+    size_t      cbAbsPath = RTPATH_MAX / 2;
+    for (;;)
+    {
+        char  *pszAbsPath = RTStrAlloc(cbAbsPath);
+        if (pszAbsPath)
+        {
+            size_t cbActual = cbAbsPath;
+            int rc = RTPathAbsEx(pszBase, pszPath, fFlags, pszAbsPath, &cbActual);
+            if (RT_SUCCESS(rc))
+            {
+                if (cbActual < cbAbsPath / 2)
+                    RTStrRealloc(&pszAbsPath, cbActual + 1);
+                return pszAbsPath;
+            }
 
-    if (rc == VERR_BUFFER_OVERFLOW)
-    {
-        size_t   cbPrevPath = sizeof(szPath);
-        uint32_t cTries = 8;
-        while (cTries-- > 0)
-        {
-            cbPath     = RT_MAX(RT_ALIGN_Z(cbPath + 16, 64), cbPrevPath + 256);
-            cbPrevPath = cbPath;
-            char *pszAbsPath = (char *)RTStrAlloc(cbPath);
-            if (pszAbsPath)
-            {
-                rc = RTPathAbsEx(pszBase, pszPath, fFlags, pszAbsPath, &cbPath);
-                if (RT_SUCCESS(rc))
-                    return pszAbsPath;
-                RTStrFree(pszAbsPath);
-            }
-            else
+            RTStrFree(pszAbsPath);
+
+            if (rc != VERR_BUFFER_OVERFLOW)
                 break;
+
+            if (--cTries == 0)
+                break;
+
+            cbAbsPath = RT_MAX(RT_ALIGN_Z(cbActual + 16, 64), cbAbsPath + 256);
         }
+        else
+            break;
     }
     return NULL;
Index: /trunk/src/VBox/Runtime/r3/dir.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/dir.cpp	(revision 78152)
+++ /trunk/src/VBox/Runtime/r3/dir.cpp	(revision 78153)
@@ -543,5 +543,5 @@
 
         cbFilter = cucFilter0 = 0;
-        pszAbsPath = RTPathAbsDup(pszPath);
+        pszAbsPath = RTPathAbsExDup(NULL, pszPath, RTPATHABS_F_ENSURE_TRAILING_SLASH);
     }
     else
@@ -557,15 +557,14 @@
                 return VERR_NO_MEMORY;
             pszTmp[pszFilter - pszPath] = '\0';
-            pszAbsPath = RTPathAbsDup(pszTmp);
+            pszAbsPath = RTPathAbsExDup(NULL, pszTmp, RTPATHABS_F_ENSURE_TRAILING_SLASH);
             RTStrFree(pszTmp);
         }
         else
-            pszAbsPath = RTPathAbsDup(".");
+            pszAbsPath = RTPathAbsExDup(NULL, ".", RTPATHABS_F_ENSURE_TRAILING_SLASH);
         fDirSlash = true;
     }
     if (!pszAbsPath)
         return VERR_NO_MEMORY;
-
-
+    Assert(strchr(pszAbsPath, '\0')[-1] == RTPATH_SLASH);
 
     /*
@@ -576,10 +575,9 @@
      */
     size_t const cchAbsPath      = strlen(pszAbsPath);
-    size_t const cchAbsPathExtra = !RTPATH_IS_SEP(pszAbsPath[cchAbsPath - 1]) ? 1 : 0; /* add trailing '/' if missing */
     size_t const cbDir           = rtDirNativeGetStructSize(pszAbsPath);
     size_t const cbAllocated     = cbDir
                                  + cucFilter0 * sizeof(RTUNICP)
                                  + cbFilter
-                                 + cchAbsPath + cchAbsPathExtra + 1 + 4;
+                                 + cchAbsPath + 1 + 4;
     PRTDIRINTERNAL pDir = (PRTDIRINTERNAL)RTMemAllocZ(cbAllocated);
     if (!pDir)
@@ -627,9 +625,8 @@
             break;
     }
-    pDir->cchPath       = cchAbsPath + cchAbsPathExtra;
+    pDir->cchPath       = cchAbsPath;
     pDir->pszPath       = (char *)memcpy(pb, pszAbsPath, cchAbsPath);
-    pb[cchAbsPath]                   = RTPATH_SLASH;
-    pb[cchAbsPath + cchAbsPathExtra] = '\0';
-    Assert(pb - (uint8_t *)pDir + cchAbsPath + cchAbsPathExtra + 1 <= cbAllocated);
+    pb[cchAbsPath]      = '\0';
+    Assert(pb - (uint8_t *)pDir + cchAbsPath + 1 <= cbAllocated);
     pDir->pszName       = NULL;
     pDir->cchName       = 0;
Index: /trunk/src/VBox/Runtime/r3/win/path-win.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/win/path-win.cpp	(revision 78152)
+++ /trunk/src/VBox/Runtime/r3/win/path-win.cpp	(revision 78153)
@@ -671,19 +671,24 @@
     int rc;
 
-    /*
-     * GetCurrentDirectory may in some cases omit the drive letter, according
-     * to MSDN, thus the GetFullPathName call.
-     */
-    RTUTF16 wszCurPath[RTPATH_MAX];
-    if (GetCurrentDirectoryW(RTPATH_MAX, wszCurPath))
-    {
-        RTUTF16 wszFullPath[RTPATH_MAX];
-        if (GetFullPathNameW(wszCurPath, RTPATH_MAX, wszFullPath, NULL))
-            rc = RTUtf16ToUtf8Ex(&wszFullPath[0], RTSTR_MAX, &pszPath, cchPath, NULL);
+    if (cchPath > 0)
+    {
+        /*
+         * GetCurrentDirectory may in some cases omit the drive letter, according
+         * to MSDN, thus the GetFullPathName call.
+         */
+        RTUTF16 wszCurPath[RTPATH_MAX];
+        if (GetCurrentDirectoryW(RTPATH_MAX, wszCurPath))
+        {
+            RTUTF16 wszFullPath[RTPATH_MAX];
+            if (GetFullPathNameW(wszCurPath, RTPATH_MAX, wszFullPath, NULL))
+                rc = RTUtf16ToUtf8Ex(&wszFullPath[0], RTSTR_MAX, &pszPath, cchPath, NULL);
+            else
+                rc = RTErrConvertFromWin32(GetLastError());
+        }
         else
             rc = RTErrConvertFromWin32(GetLastError());
     }
     else
-        rc = RTErrConvertFromWin32(GetLastError());
+        rc = VERR_BUFFER_OVERFLOW;
     return rc;
 }
@@ -724,15 +729,19 @@
 RTDECL(int) RTPathGetCurrentOnDrive(char chDrive, char *pszPath, size_t cbPath)
 {
-    WCHAR wszInput[4];
-    wszInput[0] = chDrive;
-    wszInput[1] = ':';
-    wszInput[2] = '\0';
-
     int rc;
-    RTUTF16 wszFullPath[RTPATH_MAX];
-    if (GetFullPathNameW(wszInput, RTPATH_MAX, wszFullPath, NULL))
-        rc = RTUtf16ToUtf8Ex(&wszFullPath[0], RTSTR_MAX, &pszPath, cbPath, NULL);
+    if (cbPath > 0)
+    {
+        WCHAR wszInput[4];
+        wszInput[0] = chDrive;
+        wszInput[1] = ':';
+        wszInput[2] = '\0';
+        RTUTF16 wszFullPath[RTPATH_MAX];
+        if (GetFullPathNameW(wszInput, RTPATH_MAX, wszFullPath, NULL))
+            rc = RTUtf16ToUtf8Ex(&wszFullPath[0], RTSTR_MAX, &pszPath, cbPath, NULL);
+        else
+            rc = RTErrConvertFromWin32(GetLastError());
+    }
     else
-        rc = RTErrConvertFromWin32(GetLastError());
+        rc = VERR_BUFFER_OVERFLOW;
     return rc;
 }
Index: /trunk/src/VBox/Runtime/testcase/tstRTPath.cpp
===================================================================
--- /trunk/src/VBox/Runtime/testcase/tstRTPath.cpp	(revision 78152)
+++ /trunk/src/VBox/Runtime/testcase/tstRTPath.cpp	(revision 78153)
@@ -279,5 +279,5 @@
         const char *pcszOutput;
     }
-    s_aRTPathAbsExExTests[] =
+    s_aRTPathAbsExTests[] =
     {
         { RTPATH_STR_F_STYLE_HOST,  NULL, "", VERR_PATH_ZERO_LENGTH, NULL },
@@ -337,19 +337,25 @@
         { RTPATH_STR_F_STYLE_UNIX,  "/temp", "..", VINF_SUCCESS, "/" },
     };
-    for (unsigned i = 0; i < RT_ELEMENTS(s_aRTPathAbsExExTests); ++ i)
-    {
-        if (RT_FAILURE(s_aRTPathAbsExExTests[i].rc))
+
+    char *pszGuardedBuf = NULL;
+    rc = RTTestGuardedAlloc(hTest, RTPATH_MAX, 0, false /*fHead*/, (void **)&pszGuardedBuf);
+    if (RT_FAILURE(rc))
+        pszGuardedBuf = szPath;
+
+    for (unsigned i = 0; i < RT_ELEMENTS(s_aRTPathAbsExTests); ++ i)
+    {
+        if (RT_FAILURE(s_aRTPathAbsExTests[i].rc))
             RTTestDisableAssertions(hTest);
 
         size_t cbAbsPath = sizeof(szPath);
-        rc = RTPathAbsEx(s_aRTPathAbsExExTests[i].pcszInputBase,
-                         s_aRTPathAbsExExTests[i].pcszInputPath,
-                         s_aRTPathAbsExExTests[i].fFlags,
+        rc = RTPathAbsEx(s_aRTPathAbsExTests[i].pcszInputBase,
+                         s_aRTPathAbsExTests[i].pcszInputPath,
+                         s_aRTPathAbsExTests[i].fFlags,
                          szPath, &cbAbsPath);
 
-        if (RT_FAILURE(s_aRTPathAbsExExTests[i].rc))
+        if (RT_FAILURE(s_aRTPathAbsExTests[i].rc))
             RTTestRestoreAssertions(hTest);
 
-        if (rc != s_aRTPathAbsExExTests[i].rc)
+        if (rc != s_aRTPathAbsExTests[i].rc)
         {
             RTTestIFailed("#%u: unexpected result code!\n"
@@ -361,9 +367,9 @@
                           "  expected rc: %Rrc",
                           i,
-                          s_aRTPathAbsExExTests[i].fFlags,
-                          s_aRTPathAbsExExTests[i].pcszInputBase,
-                          s_aRTPathAbsExExTests[i].pcszInputPath,
+                          s_aRTPathAbsExTests[i].fFlags,
+                          s_aRTPathAbsExTests[i].pcszInputBase,
+                          s_aRTPathAbsExTests[i].pcszInputPath,
                           szPath, rc,
-                          s_aRTPathAbsExExTests[i].rc);
+                          s_aRTPathAbsExTests[i].rc);
             continue;
         }
@@ -371,7 +377,7 @@
         char szTmp[RTPATH_MAX];
         char *pszExpected = NULL;
-        if (s_aRTPathAbsExExTests[i].pcszOutput != NULL)
-        {
-            if (s_aRTPathAbsExExTests[i].pcszOutput[0] == '%')
+        if (s_aRTPathAbsExTests[i].pcszOutput != NULL)
+        {
+            if (s_aRTPathAbsExTests[i].pcszOutput[0] == '%')
             {
                 RTTESTI_CHECK_RC(rc = RTPathGetCurrent(szTmp, sizeof(szTmp)), VINF_SUCCESS);
@@ -381,15 +387,15 @@
                 pszExpected = szTmp;
 
-                if (s_aRTPathAbsExExTests[i].pcszOutput[1] == 'p')
+                if (s_aRTPathAbsExTests[i].pcszOutput[1] == 'p')
                 {
                     cch = strlen(szTmp);
-                    if (cch + strlen(s_aRTPathAbsExExTests[i].pcszOutput) - 2 <= sizeof(szTmp))
-                        strcpy(szTmp + cch, s_aRTPathAbsExExTests[i].pcszOutput + 2);
+                    if (cch + strlen(s_aRTPathAbsExTests[i].pcszOutput) - 2 <= sizeof(szTmp))
+                        strcpy(szTmp + cch, s_aRTPathAbsExTests[i].pcszOutput + 2);
                 }
 #if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS)
-                else if (s_aRTPathAbsExExTests[i].pcszOutput[1] == 'd')
+                else if (s_aRTPathAbsExTests[i].pcszOutput[1] == 'd')
                 {
-                    if (2 + strlen(s_aRTPathAbsExExTests[i].pcszOutput) - 2 <= sizeof(szTmp))
-                        strcpy(szTmp + 2, s_aRTPathAbsExExTests[i].pcszOutput + 2);
+                    if (2 + strlen(s_aRTPathAbsExTests[i].pcszOutput) - 2 <= sizeof(szTmp))
+                        strcpy(szTmp + 2, s_aRTPathAbsExTests[i].pcszOutput + 2);
                 }
 #endif
@@ -397,5 +403,5 @@
             else
             {
-                strcpy(szTmp, s_aRTPathAbsExExTests[i].pcszOutput);
+                strcpy(szTmp, s_aRTPathAbsExTests[i].pcszOutput);
                 pszExpected = szTmp;
             }
@@ -412,13 +418,114 @@
                               "    cchResult: %#x, actual %#x",
                               i,
-                              s_aRTPathAbsExExTests[i].fFlags,
-                              s_aRTPathAbsExExTests[i].pcszInputBase,
-                              s_aRTPathAbsExExTests[i].pcszInputPath,
+                              s_aRTPathAbsExTests[i].fFlags,
+                              s_aRTPathAbsExTests[i].pcszInputBase,
+                              s_aRTPathAbsExTests[i].pcszInputPath,
                               szPath,
-                              pszExpected, s_aRTPathAbsExExTests[i].pcszOutput,
+                              pszExpected, s_aRTPathAbsExTests[i].pcszOutput,
                               cbAbsPath, strlen(szPath));
+                continue;
             }
-        }
-    }
+
+            if (RT_SUCCESS(s_aRTPathAbsExTests[i].rc))
+            {
+                /* Test the RTPATHABS_F_ENSURE_TRAILING_SLASH flag: */
+                cbAbsPath = sizeof(szPath);
+                rc = RTPathAbsEx(s_aRTPathAbsExTests[i].pcszInputBase,
+                                 s_aRTPathAbsExTests[i].pcszInputPath,
+                                 s_aRTPathAbsExTests[i].fFlags | RTPATHABS_F_ENSURE_TRAILING_SLASH,
+                                 szPath, &cbAbsPath);
+                char chSlash = (s_aRTPathAbsExTests[i].fFlags & RTPATH_STR_F_STYLE_MASK) == RTPATH_STR_F_STYLE_DOS  ? '\\'
+                             : (s_aRTPathAbsExTests[i].fFlags & RTPATH_STR_F_STYLE_MASK) == RTPATH_STR_F_STYLE_UNIX ? '/'
+                             : RTPATH_SLASH;
+                if (   RT_FAILURE(rc)
+                    || strlen(szPath) != cbAbsPath
+                    || szPath[cbAbsPath - 1] != chSlash)
+                   RTTestIFailed("#%u: Unexpected RTPATHABS_F_ENSURE_TRAILING_SLASH result: %Rrc\n"
+                                 "        flags: %#x | RTPATHABS_F_ENSURE_TRAILING_SLASH\n"
+                                 "   input base: '%s'\n"
+                                 "   input path: '%s'\n"
+                                 "       output: '%s' ('%c' vs '%c')\n"
+                                 "    cchResult: %#x, actual %#x",
+                                 i, rc,
+                                 s_aRTPathAbsExTests[i].fFlags,
+                                 s_aRTPathAbsExTests[i].pcszInputBase,
+                                 s_aRTPathAbsExTests[i].pcszInputPath,
+                                 szPath, szPath[cbAbsPath - 1], chSlash,
+                                 cbAbsPath, strlen(szPath));
+
+                /* Do overflow testing: */
+                size_t const cbNeeded = strlen(pszExpected) + 1;
+                for (size_t cbBuf = 0; cbBuf < cbNeeded + 64; cbBuf++)
+                {
+                    char *pszBuf = &pszGuardedBuf[RTPATH_MAX - cbBuf];
+                    memset(pszBuf, 0x33, cbBuf);
+                    cbAbsPath = cbBuf;
+                    rc = RTPathAbsEx(s_aRTPathAbsExTests[i].pcszInputBase, s_aRTPathAbsExTests[i].pcszInputPath,
+                                     s_aRTPathAbsExTests[i].fFlags, pszBuf, &cbAbsPath);
+                    if (   cbBuf < cbNeeded
+                        && (   rc != VERR_BUFFER_OVERFLOW
+                            || cbAbsPath < cbNeeded))
+                        RTTestIFailed("#%u: Unexpected overflow result: %Rrc%s\n"
+                                      "        flags: %#x\n"
+                                      "   input base: '%s'\n"
+                                      "   input path: '%s'\n"
+                                      "    cbBuf[in]: %#x\n"
+                                      "   cbBuf[out]: %#x\n"
+                                      "     cbNeeded: %#x\n",
+                                      i, rc, rc != VERR_BUFFER_OVERFLOW ? " - expected VERR_BUFFER_OVERFLOW" : "",
+                                      s_aRTPathAbsExTests[i].fFlags,
+                                      s_aRTPathAbsExTests[i].pcszInputBase,
+                                      s_aRTPathAbsExTests[i].pcszInputPath,
+                                      cbBuf,
+                                      cbAbsPath,
+                                      cbNeeded);
+                    else if (   cbBuf >= cbNeeded
+                             && (   rc != s_aRTPathAbsExTests[i].rc
+                                 || cbAbsPath != cbNeeded - 1
+                                 || strcmp(pszBuf, pszExpected)
+                                 || strlen(pszBuf) != cbAbsPath))
+                        RTTestIFailed("#%u: Unexpected result: %Rrc (expected %Rrc)\n"
+                                      "        flags: %#x\n"
+                                      "   input base: '%s'\n"
+                                      "   input path: '%s'\n"
+                                      "    cbBuf[in]: %#x\n"
+                                      "   cbBuf[out]: %#x\n"
+                                      "     cbNeeded: %#x\n",
+                                      i, rc, s_aRTPathAbsExTests[i].rc,
+                                      s_aRTPathAbsExTests[i].fFlags,
+                                      s_aRTPathAbsExTests[i].pcszInputBase,
+                                      s_aRTPathAbsExTests[i].pcszInputPath,
+                                      cbBuf,
+                                      cbAbsPath,
+                                      cbNeeded);
+
+                }
+            }
+
+            /* RTPathAbsExDup */
+            char *pszDup = RTPathAbsExDup(s_aRTPathAbsExTests[i].pcszInputBase,
+                                          s_aRTPathAbsExTests[i].pcszInputPath,
+                                          s_aRTPathAbsExTests[i].fFlags);
+            if (   (RT_SUCCESS(s_aRTPathAbsExTests[i].rc) ? pszDup == NULL : pszDup != NULL)
+                || RTStrCmp(pszDup, pszExpected))
+                RTTestIFailed("#%u: Unexpected RTPathAbsExDup result: %p%s\n"
+                              "        flags: %#x\n"
+                              "   input base: '%s'\n"
+                              "   input path: '%s'\n"
+                              "       output: '%s'\n"
+                              "     expected: '%s' ('%s')\n",
+                              i, pszDup,
+                              (RT_SUCCESS(s_aRTPathAbsExTests[i].rc) ? pszDup == NULL : pszDup != NULL) ? pszDup ? "NULL" : "!NULL" : "",
+                              s_aRTPathAbsExTests[i].fFlags,
+                              s_aRTPathAbsExTests[i].pcszInputBase,
+                              s_aRTPathAbsExTests[i].pcszInputPath,
+                              pszDup,
+                              pszExpected, s_aRTPathAbsExTests[i].pcszOutput);
+            RTStrFree(pszDup);
+        }
+    }
+
+    if (pszGuardedBuf != szPath)
+        RTTestGuardedFree(hTest, pszGuardedBuf);
 
 
