889f8d29a8325ed741d1466074c5371910a1fd63vboxsync/* $Id$ */
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync/** @file
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * IPRT - RTPathParse - Code Template.
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync *
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * This file included multiple times with different path style macros.
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync */
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync/*
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * Copyright (C) 2006-2013 Oracle Corporation
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync *
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * available from http://www.virtualbox.org. This file is free software;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * you can redistribute it and/or modify it under the terms of the GNU
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * General Public License (GPL) as published by the Free Software
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync *
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * The contents of this file may alternatively be used under the terms
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * of the Common Development and Distribution License Version 1.0
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * VirtualBox OSE distribution, in which case the provisions of the
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * CDDL are applicable instead of those of the GPL.
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync *
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * You may elect to license modified versions of this file under the
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * terms and conditions of either the GPL or the CDDL or both.
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync */
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync/**
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * @copydoc RTPathParse
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync */
889f8d29a8325ed741d1466074c5371910a1fd63vboxsyncstatic int RTPATH_STYLE_FN(rtPathParse)(const char *pszPath, PRTPATHPARSED pParsed, size_t cbParsed, uint32_t fFlags)
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync{
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync /*
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * Parse the root specification if present and initialize the parser state
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * (keep it on the stack for speed).
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync */
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync uint32_t const cMaxComps = cbParsed < RT_UOFFSETOF(RTPATHPARSED, aComps[0xfff0])
5275fe5125a59c491175a758d05e9b1884928396vboxsync ? (uint32_t)((cbParsed - RT_UOFFSETOF(RTPATHPARSED, aComps)) / sizeof(pParsed->aComps[0]))
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync : 0xfff0;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync uint32_t idxComp = 0;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync uint32_t cchPath;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync uint32_t offCur;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync uint16_t fProps;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync if (RTPATH_IS_SLASH(pszPath[0]))
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
e5dc0696566fc781da74690258b826515e7d496evboxsync if (fFlags & RTPATH_STR_F_NO_START)
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync offCur = 1;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync while (RTPATH_IS_SLASH(pszPath[offCur]))
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync offCur++;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync if (!pszPath[offCur])
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync return VERR_PATH_ZERO_LENGTH;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync fProps = RTPATH_PROP_RELATIVE | RTPATH_PROP_EXTRA_SLASHES;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync cchPath = 0;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
e5dc0696566fc781da74690258b826515e7d496evboxsync#if RTPATH_STYLE == RTPATH_STR_F_STYLE_DOS
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync else if ( RTPATH_IS_SLASH(pszPath[1])
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync && !RTPATH_IS_SLASH(pszPath[2])
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync && pszPath[2])
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync /* UNC - skip to the end of the potential namespace or computer name. */
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync offCur = 2;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync while (!RTPATH_IS_SLASH(pszPath[offCur]) && pszPath[offCur])
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync offCur++;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync /* If there is another slash, we considered it a valid UNC path, if
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync not it's just a root path with an extra slash thrown in. */
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync if (RTPATH_IS_SLASH(pszPath[offCur]))
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync fProps = RTPATH_PROP_ROOT_SLASH | RTPATH_PROP_UNC | RTPATH_PROP_ABSOLUTE;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync offCur++;
c5ed12eaa2298c6cd7f84f548a8540e09f4705b1vboxsync cchPath = offCur;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync else
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync fProps = RTPATH_PROP_ROOT_SLASH | RTPATH_PROP_RELATIVE;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync offCur = 1;
c5ed12eaa2298c6cd7f84f548a8540e09f4705b1vboxsync cchPath = 1;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync#endif
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync else
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
e5dc0696566fc781da74690258b826515e7d496evboxsync#if RTPATH_STYLE == RTPATH_STR_F_STYLE_DOS
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync fProps = RTPATH_PROP_ROOT_SLASH | RTPATH_PROP_RELATIVE;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync#else
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync fProps = RTPATH_PROP_ROOT_SLASH | RTPATH_PROP_ABSOLUTE;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync#endif
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync offCur = 1;
c5ed12eaa2298c6cd7f84f548a8540e09f4705b1vboxsync cchPath = 1;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
e5dc0696566fc781da74690258b826515e7d496evboxsync#if RTPATH_STYLE == RTPATH_STR_F_STYLE_DOS
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync else if (RT_C_IS_ALPHA(pszPath[0]) && pszPath[1] == ':')
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync if (!RTPATH_IS_SLASH(pszPath[2]))
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync fProps = RTPATH_PROP_VOLUME | RTPATH_PROP_RELATIVE;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync offCur = 2;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync else
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync fProps = RTPATH_PROP_VOLUME | RTPATH_PROP_ROOT_SLASH | RTPATH_PROP_ABSOLUTE;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync offCur = 3;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
c5ed12eaa2298c6cd7f84f548a8540e09f4705b1vboxsync cchPath = offCur;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync#endif
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync else
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync fProps = RTPATH_PROP_RELATIVE;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync offCur = 0;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync cchPath = 0;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync
c5ed12eaa2298c6cd7f84f548a8540e09f4705b1vboxsync /* Add it to the component array . */
e5dc0696566fc781da74690258b826515e7d496evboxsync if (offCur && !(fFlags & RTPATH_STR_F_NO_START))
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync cchPath = offCur;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync if (idxComp < cMaxComps)
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync pParsed->aComps[idxComp].off = 0;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync pParsed->aComps[idxComp].cch = offCur;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync idxComp++;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync /* Skip unnecessary slashes following the root-spec. */
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync if (RTPATH_IS_SLASH(pszPath[offCur]))
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync fProps |= RTPATH_PROP_EXTRA_SLASHES;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync do
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync offCur++;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync while (RTPATH_IS_SLASH(pszPath[offCur]));
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync /*
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * Parse the rest.
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync */
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync if (pszPath[offCur])
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync for (;;)
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync Assert(!RTPATH_IS_SLASH(pszPath[offCur]));
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync /* Find the end of the component. */
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync uint32_t offStart = offCur;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync char ch;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync while ((ch = pszPath[offCur]) != '\0' && !RTPATH_IS_SLASH(ch))
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync offCur++;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync if (offCur >= _64K)
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync return VERR_FILENAME_TOO_LONG;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync /* Add it. */
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync uint32_t cchComp = offCur - offStart;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync if (idxComp < cMaxComps)
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync pParsed->aComps[idxComp].off = offStart;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync pParsed->aComps[idxComp].cch = cchComp;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync idxComp++;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync cchPath += cchComp;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync /* Look for '.' and '..' references. */
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync if (cchComp == 1 && pszPath[offCur - 1] == '.')
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync fProps |= RTPATH_PROP_DOT_REFS;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync else if (cchComp == 2 && pszPath[offCur - 1] == '.' && pszPath[offCur - 2] == '.')
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync fProps &= ~RTPATH_PROP_ABSOLUTE;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync fProps |= RTPATH_PROP_DOTDOT_REFS | RTPATH_PROP_RELATIVE;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync /* Skip unnecessary slashes. Leave ch unchanged! */
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync char ch2 = ch;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync if (ch2)
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync ch2 = pszPath[++offCur];
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync if (RTPATH_IS_SLASH(ch2))
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync fProps |= RTPATH_PROP_EXTRA_SLASHES;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync do
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync ch2 = pszPath[++offCur];
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync while (RTPATH_IS_SLASH(ch2));
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync /* The end? */
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync if (ch2 == '\0')
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync pParsed->offSuffix = offCur;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync pParsed->cchSuffix = 0;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync if (ch)
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
e5dc0696566fc781da74690258b826515e7d496evboxsync if (!(fFlags & RTPATH_STR_F_NO_END))
cda4a68d59969f27d3063ff91c9c3f887d34c8f9vboxsync {
cda4a68d59969f27d3063ff91c9c3f887d34c8f9vboxsync fProps |= RTPATH_PROP_DIR_SLASH; /* (not counted in component, but in cchPath) */
cda4a68d59969f27d3063ff91c9c3f887d34c8f9vboxsync cchPath++;
cda4a68d59969f27d3063ff91c9c3f887d34c8f9vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync else
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync fProps |= RTPATH_PROP_EXTRA_SLASHES;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
e5dc0696566fc781da74690258b826515e7d496evboxsync else if (!(fFlags & RTPATH_STR_F_NO_END))
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync fProps |= RTPATH_PROP_FILENAME;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync /* look for an ? */
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync uint16_t cDots = 0;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync uint32_t offSuffix = offStart + cchComp;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync while (offSuffix-- > offStart)
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync if (pszPath[offSuffix] == '.')
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync uint32_t cchSuffix = offStart + cchComp - offSuffix;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync if (cchSuffix > 1 && offStart != offSuffix)
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync pParsed->cchSuffix = cchSuffix;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync pParsed->offSuffix = offSuffix;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync fProps |= RTPATH_PROP_SUFFIX;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync break;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync break;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync /* No, not the end. Account for an separator before we restart the loop. */
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync cchPath += sizeof(RTPATH_SLASH_STR) - 1;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync else
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync {
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync pParsed->offSuffix = offCur;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync pParsed->cchSuffix = 0;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync }
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync if (offCur >= _64K)
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync return VERR_FILENAME_TOO_LONG;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync /*
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync * Store the remainder of the state and we're done.
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync */
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync pParsed->fProps = fProps;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync pParsed->cchPath = cchPath;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync pParsed->cComps = idxComp;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync return idxComp <= cMaxComps ? VINF_SUCCESS : VERR_BUFFER_OVERFLOW;
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync}
889f8d29a8325ed741d1466074c5371910a1fd63vboxsync