VirtualBox

Changeset 96861 in vbox


Ignore:
Timestamp:
Sep 26, 2022 10:52:54 AM (2 years ago)
Author:
vboxsync
Message:

IPRT/Vfs,Main/Unattended: Detect fedora ISOs, various code cleanups. Added a parameter to RTVfsQueryLabel so we can get the primary volume ID of an ISO (required for fedora ISOs, as the joliet version is truncated). bugref:9781

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/vfs.h

    r96407 r96861  
    203203 *
    204204 * @returns IPRT status code.
    205  * @param   hVfs        VFS handle.
    206  * @param   pszLabel    Where to store the lable.
    207  * @param   cbLabel     Size of the buffer @a pszLable points at.
    208  * @param   pcbActual   Where to return the label length, including the
    209  *                      terminator.  In case of VERR_BUFFER_OVERFLOW returns,
    210  *                      this will be set to the required buffer size.  Optional.
    211  */
    212 RTDECL(int) RTVfsQueryLabel(RTVFS hVfs, char *pszLabel, size_t cbLabel, size_t *pcbActual);
     205 * @param   hVfs            VFS handle.
     206 * @param   fAlternative    For use with ISO files to retrieve the primary lable
     207 *                          rather than the joliet / UDF one that the mount
     208 *                          options would indicate.  For other file systems, as
     209 *                          well for ISO not mounted in joliet / UDF mode, the
     210 *                          flag is ignored.
     211 * @param   pszLabel        Where to store the lable.
     212 * @param   cbLabel         Size of the buffer @a pszLable points at.
     213 * @param   pcbActual       Where to return the label length, including the
     214 *                          terminator.  In case of VERR_BUFFER_OVERFLOW
     215 *                          returns, this will be set to the required buffer
     216 *                          size.  Optional.
     217 */
     218RTDECL(int) RTVfsQueryLabel(RTVFS hVfs, bool fAlternative, char *pszLabel, size_t cbLabel, size_t *pcbActual);
    213219
    214220
  • trunk/include/iprt/vfslowlevel.h

    r96407 r96861  
    182182     * Returns a UTF-8 string. */
    183183    RTVFSQIEX_VOL_LABEL,
     184    /** Alternative volume label, the primary one for ISOs, otherwise treated same
     185     * as RTVFSQIEX_VOL_LABEL. */
     186    RTVFSQIEX_VOL_LABEL_ALT,
    184187    /** Volume serial number.
    185188     * Returns a uint32_t, uint64_t or RTUUID. */
  • trunk/src/VBox/Main/include/UnattendedImpl.h

    r96407 r96861  
    266266    HRESULT i_innerDetectIsoOSWindows(RTVFS hVfsIso, DETECTBUFFER *puBuf);
    267267    HRESULT i_innerDetectIsoOSLinux(RTVFS hVfsIso, DETECTBUFFER *puBuf);
     268    HRESULT i_innerDetectIsoOSLinuxFedora(RTVFS hVfsIso, DETECTBUFFER *puBuf, char *pszVolId);
    268269    HRESULT i_innerDetectIsoOSOs2(RTVFS hVfsIso, DETECTBUFFER *puBuf);
    269270    HRESULT i_innerDetectIsoOSFreeBsd(RTVFS hVfsIso, DETECTBUFFER *puBuf);
  • trunk/src/VBox/Main/src-server/UnattendedImpl.cpp

    r96721 r96861  
    4646#include <iprt/ctype.h>
    4747#include <iprt/file.h>
     48#ifndef RT_OS_WINDOWS
     49# include <iprt/formats/mz.h>
     50# include <iprt/formats/pecoff.h>
     51#endif
    4852#include <iprt/formats/wim.h>
    4953#include <iprt/fsvfs.h>
     
    960964                if (   RTStrNICmp(pBuf->sz, RT_STR_TUPLE("vista")) == 0
    961965                    || RTStrNICmp(pBuf->sz, RT_STR_TUPLE("winmain_beta")) == 0)
    962                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_WinVista);
     966                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_WinVista);
    963967                else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("lh_sp2rtm")) == 0)
    964968                {
    965                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_WinVista);
     969                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_WinVista);
    966970                    pszVersion = "sp2";
    967971                }
    968972                else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("longhorn_rtm")) == 0)
    969973                {
    970                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_WinVista);
     974                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_WinVista);
    971975                    pszVersion = "sp1";
    972976                }
    973977                else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("win7")) == 0)
    974                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win7);
     978                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win7);
    975979                else if (   RTStrNICmp(pBuf->sz, RT_STR_TUPLE("winblue")) == 0
    976980                         || RTStrNICmp(pBuf->sz, RT_STR_TUPLE("winmain_blue")) == 0
    977981                         || RTStrNICmp(pBuf->sz, RT_STR_TUPLE("win81")) == 0 /* not seen, but just in case its out there */ )
    978                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win81);
     982                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win81);
    979983                else if (   RTStrNICmp(pBuf->sz, RT_STR_TUPLE("win8")) == 0
    980984                         || RTStrNICmp(pBuf->sz, RT_STR_TUPLE("winmain_win8")) == 0 )
    981                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win8);
     985                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win8);
    982986                else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("th1")) == 0)
    983987                {
    984988                    pszVersion = "1507";    // aka. GA, retroactively 1507
    985                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);
     989                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win10);
    986990                }
    987991                else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("th2")) == 0)
    988992                {
    989993                    pszVersion = "1511";    // aka. threshold 2
    990                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);
     994                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win10);
    991995                }
    992996                else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("rs1_release")) == 0)
    993997                {
    994998                    pszVersion = "1607";    // aka. anniversay update; rs=redstone
    995                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);
     999                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win10);
    9961000                }
    9971001                else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("rs2_release")) == 0)
    9981002                {
    9991003                    pszVersion = "1703";    // aka. creators update
    1000                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);
     1004                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win10);
    10011005                }
    10021006                else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("rs3_release")) == 0)
    10031007                {
    10041008                    pszVersion = "1709";    // aka. fall creators update
    1005                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);
     1009                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win10);
    10061010                }
    10071011                else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("rs4_release")) == 0)
    10081012                {
    10091013                    pszVersion = "1803";
    1010                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);
     1014                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win10);
    10111015                }
    10121016                else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("rs5_release")) == 0)
    10131017                {
    10141018                    pszVersion = "1809";
    1015                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);
     1019                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win10);
    10161020                }
    10171021                else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("19h1_release")) == 0)
    10181022                {
    10191023                    pszVersion = "1903";
    1020                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);
     1024                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win10);
    10211025                }
    10221026                else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("19h2_release")) == 0)
    10231027                {
    10241028                    pszVersion = "1909";    // ??
    1025                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);
     1029                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win10);
    10261030                }
    10271031                else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("20h1_release")) == 0)
    10281032                {
    10291033                    pszVersion = "2003";    // ??
    1030                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);
     1034                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win10);
    10311035                }
    10321036                else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("vb_release")) == 0)
    10331037                {
    10341038                    pszVersion = "2004";    // ?? vb=Vibranium
    1035                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);
     1039                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win10);
    10361040                }
    10371041                else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("20h2_release")) == 0)
    10381042                {
    10391043                    pszVersion = "2009";    // ??
    1040                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);
     1044                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win10);
    10411045                }
    10421046                else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("21h1_release")) == 0)
    10431047                {
    10441048                    pszVersion = "2103";    // ??
    1045                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);
     1049                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win10);
    10461050                }
    10471051                else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("21h2_release")) == 0)
    10481052                {
    10491053                    pszVersion = "2109";    // ??
    1050                     mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win10);
     1054                    mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win10);
    10511055                }
    10521056                else if (RTStrNICmp(pBuf->sz, RT_STR_TUPLE("co_release")) == 0)
     
    10951099                    {
    10961100                        fClarifyProd = true;
    1097                         mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win2k3);
     1101                        mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win2k3);
    10981102                        if (RTStrVersionCompare(psz, "5.2.3790.3959") >= 0)
    10991103                            pszVersion = "sp2";
     
    11031107                    else if (RTStrVersionCompare(psz, "5.1.0") >= 0) /* XP */
    11041108                    {
    1105                         mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_WinXP);
     1109                        mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_WinXP);
    11061110                        if (RTStrVersionCompare(psz, "5.1.2600.5512") >= 0)
    11071111                            pszVersion = "sp3";
     
    11131117                    else if (RTStrVersionCompare(psz, "5.0.0") >= 0)
    11141118                    {
    1115                         mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win2k);
     1119                        mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win2k);
    11161120                        if (RTStrVersionCompare(psz, "5.0.2195.6717") >= 0)
    11171121                            pszVersion = "sp4";
     
    11611165                        vrc = RTIniFileQueryValue(hIniFile, "Product Specification", "Product", pBuf->sz, sizeof(*pBuf), NULL);
    11621166                        if (RT_SUCCESS(vrc) && RTStrNICmp(pBuf->sz, RT_STR_TUPLE("Windows XP")) == 0)
    1163                             mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_WinXP);
     1167                            mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_WinXP);
    11641168                        else if (RT_SUCCESS(vrc) && RTStrNICmp(pBuf->sz, RT_STR_TUPLE("Windows Server 2003")) == 0)
    1165                             mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win2k3);
     1169                            mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win2k3);
    11661170                        else
    1167                             mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Win2k);
     1171                            mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Win2k);
    11681172
    11691173                        if (RT_SUCCESS(vrc) && (strstr(pBuf->sz, "Server") || strstr(pBuf->sz, "server")))
     
    12911295
    12921296/**
     1297 * Architecture strings for Linux and the like.
     1298 */
     1299static struct { const char *pszArch; uint32_t cchArch; VBOXOSTYPE fArch; } const g_aLinuxArches[] =
     1300{
     1301    { RT_STR_TUPLE("amd64"),  VBOXOSTYPE_x64 },
     1302    { RT_STR_TUPLE("x86_64"), VBOXOSTYPE_x64 },
     1303    { RT_STR_TUPLE("x86-64"), VBOXOSTYPE_x64 }, /* just in case */
     1304    { RT_STR_TUPLE("x64"),    VBOXOSTYPE_x64 }, /* ditto */
     1305
     1306    { RT_STR_TUPLE("x86"),    VBOXOSTYPE_x86 },
     1307    { RT_STR_TUPLE("i386"),   VBOXOSTYPE_x86 },
     1308    { RT_STR_TUPLE("i486"),   VBOXOSTYPE_x86 },
     1309    { RT_STR_TUPLE("i586"),   VBOXOSTYPE_x86 },
     1310    { RT_STR_TUPLE("i686"),   VBOXOSTYPE_x86 },
     1311    { RT_STR_TUPLE("i786"),   VBOXOSTYPE_x86 },
     1312    { RT_STR_TUPLE("i886"),   VBOXOSTYPE_x86 },
     1313    { RT_STR_TUPLE("i986"),   VBOXOSTYPE_x86 },
     1314};
     1315
     1316/**
    12931317 * Detects linux architecture.
    12941318 *
     
    13001324static bool detectLinuxArch(const char *pszArch, VBOXOSTYPE *penmOsType, VBOXOSTYPE enmBaseOsType)
    13011325{
    1302     if (   RTStrNICmp(pszArch, RT_STR_TUPLE("amd64"))  == 0
    1303         || RTStrNICmp(pszArch, RT_STR_TUPLE("x86_64")) == 0
    1304         || RTStrNICmp(pszArch, RT_STR_TUPLE("x86-64")) == 0 /* just in case */
    1305         || RTStrNICmp(pszArch, RT_STR_TUPLE("x64"))    == 0 /* ditto */ )
    1306     {
    1307         *penmOsType = (VBOXOSTYPE)(enmBaseOsType | VBOXOSTYPE_x64);
    1308         return true;
    1309     }
    1310 
    1311     if (   RTStrNICmp(pszArch, RT_STR_TUPLE("x86")) == 0
    1312         || RTStrNICmp(pszArch, RT_STR_TUPLE("i386")) == 0
    1313         || RTStrNICmp(pszArch, RT_STR_TUPLE("i486")) == 0
    1314         || RTStrNICmp(pszArch, RT_STR_TUPLE("i586")) == 0
    1315         || RTStrNICmp(pszArch, RT_STR_TUPLE("i686")) == 0
    1316         || RTStrNICmp(pszArch, RT_STR_TUPLE("i786")) == 0
    1317         || RTStrNICmp(pszArch, RT_STR_TUPLE("i886")) == 0
    1318         || RTStrNICmp(pszArch, RT_STR_TUPLE("i986")) == 0)
    1319     {
    1320         *penmOsType = enmBaseOsType;
    1321         return true;
    1322     }
    1323 
     1326    for (size_t i = 0; i < RT_ELEMENTS(g_aLinuxArches); i++)
     1327        if (RTStrNICmp(pszArch, g_aLinuxArches[i].pszArch, g_aLinuxArches[i].cchArch) == 0)
     1328        {
     1329            *penmOsType = (VBOXOSTYPE)(enmBaseOsType | g_aLinuxArches[i].fArch);
     1330            return true;
     1331        }
    13241332    /** @todo check for 'noarch' since source CDs have been seen to use that. */
    13251333    return false;
     
    13331341 * @param   penmOsType          Where to return the arch and type on success.
    13341342 * @param   enmBaseOsType       The base (x86) OS type to return.
     1343 * @param   ppszHit             Where to return the pointer to the architecture
     1344 *                              specifier. Optional.
     1345 * @param   ppszNext            Where to return the pointer to the char
     1346 *                              following the architecuture specifier. Optional.
    13351347 */
    1336 static bool detectLinuxArchII(const char *pszArch, VBOXOSTYPE *penmOsType, VBOXOSTYPE enmBaseOsType)
    1337 {
    1338     if (   RTStrIStr(pszArch, "amd64")  != NULL
    1339         || RTStrIStr(pszArch, "x86_64") != NULL
    1340         || RTStrIStr(pszArch, "x86-64") != NULL /* just in case */
    1341         || RTStrIStr(pszArch, "x64")    != NULL /* ditto */ )
    1342     {
    1343         *penmOsType = (VBOXOSTYPE)(enmBaseOsType | VBOXOSTYPE_x64);
    1344         return true;
    1345     }
    1346 
    1347     if (   RTStrIStr(pszArch, "x86") != NULL
    1348         || RTStrIStr(pszArch, "i386") != NULL
    1349         || RTStrIStr(pszArch, "i486") != NULL
    1350         || RTStrIStr(pszArch, "i586") != NULL
    1351         || RTStrIStr(pszArch, "i686") != NULL
    1352         || RTStrIStr(pszArch, "i786") != NULL
    1353         || RTStrIStr(pszArch, "i886") != NULL
    1354         || RTStrIStr(pszArch, "i986") != NULL)
    1355     {
    1356         *penmOsType = enmBaseOsType;
    1357         return true;
     1348static bool detectLinuxArchII(const char *pszArch, VBOXOSTYPE *penmOsType, VBOXOSTYPE enmBaseOsType,
     1349                              char **ppszHit = NULL, char **ppszNext = NULL)
     1350{
     1351    for (size_t i = 0; i < RT_ELEMENTS(g_aLinuxArches); i++)
     1352    {
     1353        const char *pszHit = RTStrIStr(pszArch, g_aLinuxArches[i].pszArch);
     1354        if (pszHit != NULL)
     1355        {
     1356            if (ppszHit)
     1357                *ppszHit = (char *)pszHit;
     1358            if (ppszNext)
     1359                *ppszNext = (char *)pszHit + g_aLinuxArches[i].cchArch;
     1360            *penmOsType = (VBOXOSTYPE)(enmBaseOsType | g_aLinuxArches[i].fArch);
     1361            return true;
     1362        }
    13581363    }
    13591364    return false;
     
    13721377            && !RT_C_IS_ALNUM(pszOsAndVersion[3]))
    13731378        {
    1374             *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_RedHat);
     1379            *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_RedHat);
    13751380            pszOsAndVersion = RTStrStripL(pszOsAndVersion + 3);
    13761381        }
     
    13811386             && !RT_C_IS_ALNUM(pszOsAndVersion[8]))
    13821387    {
    1383         *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_OpenSUSE);
     1388        *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_OpenSUSE);
    13841389        pszOsAndVersion = RTStrStripL(pszOsAndVersion + 8);
    13851390    }
     
    13871392             && !RT_C_IS_ALNUM(pszOsAndVersion[6]))
    13881393    {
    1389         *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Oracle);
     1394        *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Oracle);
    13901395        pszOsAndVersion = RTStrStripL(pszOsAndVersion + 6);
    13911396    }
     
    13931398             && !RT_C_IS_ALNUM(pszOsAndVersion[6]))
    13941399    {
    1395         *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_RedHat);
     1400        *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_RedHat);
    13961401        pszOsAndVersion = RTStrStripL(pszOsAndVersion + 6);
    13971402    }
     
    13991404             && !RT_C_IS_ALNUM(pszOsAndVersion[6]))
    14001405    {
    1401         *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_FedoraCore);
     1406        *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_FedoraCore);
    14021407        pszOsAndVersion = RTStrStripL(pszOsAndVersion + 6);
    14031408    }
     
    14051410             && !RT_C_IS_ALNUM(pszOsAndVersion[6]))
    14061411    {
    1407         *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Ubuntu);
     1412        *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Ubuntu);
    14081413        pszOsAndVersion = RTStrStripL(pszOsAndVersion + 6);
    14091414    }
     
    14111416             && !RT_C_IS_ALNUM(pszOsAndVersion[10]))
    14121417    {
    1413         *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Ubuntu);
     1418        *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Ubuntu);
    14141419        pszOsAndVersion = RTStrStripL(pszOsAndVersion + 10);
    14151420    }
     
    14191424             && !RT_C_IS_ALNUM(pszOsAndVersion[7]))
    14201425    {
    1421         *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Ubuntu);
     1426        *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Ubuntu);
    14221427        pszOsAndVersion = RTStrStripL(pszOsAndVersion + 7);
    14231428    }
     
    14251430             && !RT_C_IS_ALNUM(pszOsAndVersion[6]))
    14261431    {
    1427         *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Debian);
     1432        *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Debian);
    14281433        pszOsAndVersion = RTStrStripL(pszOsAndVersion + 6);
    14291434    }
     
    14531458    if (   RTStrIStr(pszOsAndVersion, "RedHat")  != NULL
    14541459        || RTStrIStr(pszOsAndVersion, "Red Hat") != NULL)
    1455             *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_RedHat);
     1460        *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_RedHat);
    14561461    else if (RTStrIStr(pszOsAndVersion, "Oracle") != NULL)
    1457         *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Oracle);
     1462        *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Oracle);
    14581463    else if (RTStrIStr(pszOsAndVersion, "CentOS") != NULL)
    1459         *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_RedHat);
     1464        *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_RedHat);
    14601465    else if (RTStrIStr(pszOsAndVersion, "Fedora") != NULL)
    1461         *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_FedoraCore);
     1466        *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_FedoraCore);
    14621467    else if (RTStrIStr(pszOsAndVersion, "Ubuntu") != NULL)
    1463         *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Ubuntu);
     1468        *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Ubuntu);
    14641469    else if (RTStrIStr(pszOsAndVersion, "Mint") != NULL)
    1465         *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Ubuntu);
     1470        *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Ubuntu);
    14661471    else if (RTStrIStr(pszOsAndVersion, "Debian"))
    1467         *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Debian);
     1472        *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_Debian);
    14681473    else
    14691474        fRet = false;
     
    14921497 *
    14931498 * @returns true if detected, false if not.
    1494  * @param   pszDiskName          Name of the disk as it is read from .disk/info or README.diskdefines file.
    1495  * @param   cchVersionPosition   String position where first numerical character is found. We use substring upto this position as OS flavor
     1499 * @param   pszDiskName Name of the disk as it is read from .disk/info or
     1500 *                      README.diskdefines file.
     1501 * @param   poffVersion String position where first numerical character is
     1502 *                      found. We use substring upto this position as OS flavor
    14961503 */
    1497 static bool detectLinuxDistroFlavor(const char *pszDiskName, size_t *cchVersionPosition)
    1498 {
    1499     if (!pszDiskName || !cchVersionPosition)
     1504static bool detectLinuxDistroFlavor(const char *pszDiskName, size_t *poffVersion)
     1505{
     1506    Assert(poffVersion);
     1507    if (!pszDiskName)
    15001508        return false;
    1501     while (*pszDiskName != '\0' && !RT_C_IS_DIGIT(*pszDiskName))
     1509    char ch;
     1510    while ((ch = *pszDiskName) != '\0' && !RT_C_IS_DIGIT(ch))
    15021511    {
    15031512        ++pszDiskName;
    1504         ++(*cchVersionPosition);
     1513        *poffVersion += 1;
    15051514    }
    15061515    return true;
     
    15591568                        {
    15601569                            LogRel(("Unattended: .treeinfo: Unknown: name/family='%s', assuming Red Hat\n", pBuf->sz));
    1561                             mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_RedHat);
     1570                            mEnmOsType = (VBOXOSTYPE)((mEnmOsType & VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_RedHat);
    15621571                        }
    15631572                    }
     
    18441853
    18451854    /*
    1846      * All of the debian based distro versions I checked have a single line ./disk/info file.
    1847      * Only info I could find related to .disk folder is: https://lists.debian.org/debian-cd/2004/01/msg00069.html
     1855     * All of the debian based distro versions I checked have a single line ./disk/info
     1856     * file.  Only info I could find related to .disk folder is:
     1857     *      https://lists.debian.org/debian-cd/2004/01/msg00069.html
     1858     *
    18481859     * Some example content from several install ISOs is as follows:
    1849      * Ubuntu 4.10 "Warty Warthog" - Preview amd64 Binary-1 (20041020)
    1850      * Linux Mint 20.3 "Una" - Release amd64 20220104
    1851      * Debian GNU/Linux 11.2.0 "Bullseye" - Official amd64 NETINST 20211218-11:12
    1852      * Debian GNU/Linux 9.13.0 "Stretch" - Official amd64 DVD Binary-1 20200718-11:07
    1853      * Xubuntu 20.04.2.0 LTS "Focal Fossa" - Release amd64 (20210209.1)
    1854      * Ubuntu 17.10 "Artful Aardvark" - Release amd64 (20180105.1)
    1855      * Ubuntu 16.04.6 LTS "Xenial Xerus" - Release i386 (20190227.1)
    1856      * Debian GNU/Linux 8.11.1 "Jessie" - Official amd64 CD Binary-1 20190211-02:10
    1857      * Kali GNU/Linux 2021.3a "Kali-last-snapshot" - Official amd64 BD Binary-1 with firmware 20211015-16:55
    1858      * Official Debian GNU/Linux Live 10.10.0 cinnamon 2021-06-19T12:13
     1860     *   Ubuntu 4.10 "Warty Warthog" - Preview amd64 Binary-1 (20041020)
     1861     *   Linux Mint 20.3 "Una" - Release amd64 20220104
     1862     *   Debian GNU/Linux 11.2.0 "Bullseye" - Official amd64 NETINST 20211218-11:12
     1863     *   Debian GNU/Linux 9.13.0 "Stretch" - Official amd64 DVD Binary-1 20200718-11:07
     1864     *   Xubuntu 20.04.2.0 LTS "Focal Fossa" - Release amd64 (20210209.1)
     1865     *   Ubuntu 17.10 "Artful Aardvark" - Release amd64 (20180105.1)
     1866     *   Ubuntu 16.04.6 LTS "Xenial Xerus" - Release i386 (20190227.1)
     1867     *   Debian GNU/Linux 8.11.1 "Jessie" - Official amd64 CD Binary-1 20190211-02:10
     1868     *   Kali GNU/Linux 2021.3a "Kali-last-snapshot" - Official amd64 BD Binary-1 with firmware 20211015-16:55
     1869     *   Official Debian GNU/Linux Live 10.10.0 cinnamon 2021-06-19T12:13
    18591870     */
    18601871    vrc = RTVfsFileOpen(hVfsIso, ".disk/info", RTFILE_O_READ | RTFILE_O_DENY_NONE | RTFILE_O_OPEN, &hVfsFile);
     
    18881899        {
    18891900            char szVolumeId[128];
    1890             size_t cchVolumeId;
    1891             vrc = RTVfsQueryLabel(hVfsIso, szVolumeId, 128, &cchVolumeId);
     1901            vrc = RTVfsQueryLabel(hVfsIso, false /*fAlternative*/, szVolumeId, sizeof(szVolumeId), NULL);
    18921902            if (RT_SUCCESS(vrc))
    18931903            {
     
    19301940    }
    19311941
     1942    /*
     1943     * Fedora live iso should be recognizable from the primary volume ID (the
     1944     * joliet one is usually truncated).  We set fAlternative = true here to
     1945     * get the primary volume ID.
     1946     */
     1947    char szVolumeId[128];
     1948    vrc = RTVfsQueryLabel(hVfsIso, true /*fAlternative*/, szVolumeId, sizeof(szVolumeId), NULL);
     1949    if (RT_SUCCESS(vrc) && RTStrStartsWith(szVolumeId, "Fedora-"))
     1950        return i_innerDetectIsoOSLinuxFedora(hVfsIso, pBuf, &szVolumeId[sizeof("Fedora-") - 1]);
    19321951    return S_FALSE;
     1952}
     1953
     1954
     1955/**
     1956 * Continues working a Fedora ISO image after the caller found a "Fedora-*"
     1957 * volume ID.
     1958 *
     1959 * Sample Volume IDs:
     1960 *  - Fedora-WS-Live-34-1-2  (joliet: Fedora-WS-Live-3)
     1961 *  - Fedora-S-dvd-x86_64-34 (joliet: Fedora-S-dvd-x86)
     1962 *  - Fedora-WS-dvd-i386-25  (joliet: Fedora-WS-dvd-i3)
     1963 */
     1964HRESULT Unattended::i_innerDetectIsoOSLinuxFedora(RTVFS hVfsIso, DETECTBUFFER *pBuf, char *pszVolId)
     1965{
     1966    char * const pszFlavor = pszVolId;
     1967    char *       psz       = pszVolId;
     1968
     1969    /* The volume id may or may not include an arch, component.
     1970       We ASSUME that it includes a numeric part with the version, or at least
     1971       part of it. */
     1972    char *pszVersion = NULL;
     1973    char *pszArch    = NULL;
     1974    if (detectLinuxArchII(psz, &mEnmOsType, VBOXOSTYPE_FedoraCore, &pszArch, &pszVersion))
     1975        *pszArch = '\0';
     1976    else
     1977    {
     1978        mEnmOsType = (VBOXOSTYPE)(VBOXOSTYPE_FedoraCore | VBOXOSTYPE_UnknownArch);
     1979
     1980        char ch;
     1981        while ((ch = *psz) != '\0' && (!RT_C_IS_DIGIT(ch) || !RT_C_IS_PUNCT(psz[-1])))
     1982            psz++;
     1983        if (ch != '\0')
     1984            pszVersion = psz;
     1985    }
     1986
     1987    /*
     1988     * Replace '-' with '.' in the version part and use it as the version.
     1989     */
     1990    if (pszVersion)
     1991    {
     1992        psz = pszVersion;
     1993        while ((psz = strchr(psz, '-')) != NULL)
     1994            *psz++ = '.';
     1995        try { mStrDetectedOSVersion = RTStrStrip(pszVersion); }
     1996        catch (std::bad_alloc &) { return E_OUTOFMEMORY; }
     1997
     1998        *pszVersion = '\0'; /* don't include in flavor */
     1999    }
     2000
     2001    /*
     2002     * Split up the pre-arch/version bits into words and use them as the flavor.
     2003     */
     2004    psz = pszFlavor;
     2005    while ((psz = strchr(psz, '-')) != NULL)
     2006        *psz++ = ' ';
     2007    try { mStrDetectedOSFlavor = RTStrStrip(pszFlavor); }
     2008    catch (std::bad_alloc &) { return E_OUTOFMEMORY; }
     2009
     2010    /*
     2011     * If we don't have an architecture, we look at the vmlinuz file as the x86
     2012     * and AMD64 versions starts with a MZ+PE header giving the architecture.
     2013     */
     2014    if ((mEnmOsType & VBOXOSTYPE_ArchitectureMask) == VBOXOSTYPE_UnknownArch)
     2015    {
     2016        static const char * const s_apszVmLinuz[] = { "images/pxeboot/vmlinuz", "isolinux/vmlinuz" };
     2017        for (size_t i = 0; i < RT_ELEMENTS(s_apszVmLinuz); i++)
     2018        {
     2019            RTVFSFILE hVfsFileLinuz = NIL_RTVFSFILE;
     2020            int vrc = RTVfsFileOpen(hVfsIso, s_apszVmLinuz[i], RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE,
     2021                                    &hVfsFileLinuz);
     2022            if (RT_SUCCESS(vrc))
     2023            {
     2024                /* DOS signature: */
     2025                PIMAGE_DOS_HEADER pDosHdr = (PIMAGE_DOS_HEADER)&pBuf->ab[0];
     2026                AssertCompile(sizeof(*pBuf) > sizeof(*pDosHdr));
     2027                vrc = RTVfsFileReadAt(hVfsFileLinuz, 0, pDosHdr, sizeof(*pDosHdr), NULL);
     2028                if (RT_SUCCESS(vrc) && pDosHdr->e_magic == IMAGE_DOS_SIGNATURE)
     2029                {
     2030                    /* NT signature - only need magic + file header, so use the 64 version for better debugging: */
     2031                    PIMAGE_NT_HEADERS64 pNtHdrs = (PIMAGE_NT_HEADERS64)&pBuf->ab[0];
     2032                    vrc = RTVfsFileReadAt(hVfsFileLinuz, pDosHdr->e_lfanew, pNtHdrs, sizeof(*pNtHdrs), NULL);
     2033                    AssertCompile(sizeof(*pBuf) > sizeof(*pNtHdrs));
     2034                    if (RT_SUCCESS(vrc) && pNtHdrs->Signature == IMAGE_NT_SIGNATURE)
     2035                    {
     2036                        if (pNtHdrs->FileHeader.Machine == IMAGE_FILE_MACHINE_I386)
     2037                            mEnmOsType = (VBOXOSTYPE)((mEnmOsType & ~VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_x86);
     2038                        else if (pNtHdrs->FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64)
     2039                            mEnmOsType = (VBOXOSTYPE)((mEnmOsType & ~VBOXOSTYPE_ArchitectureMask) | VBOXOSTYPE_x64);
     2040                        else
     2041                            AssertFailed();
     2042                    }
     2043                }
     2044
     2045                RTVfsFileRelease(hVfsFileLinuz);
     2046                if ((mEnmOsType & VBOXOSTYPE_ArchitectureMask) != VBOXOSTYPE_UnknownArch)
     2047                    break;
     2048            }
     2049        }
     2050    }
     2051
     2052    /*
     2053     * If that failed, look for other files that gives away the arch.
     2054     */
     2055    if ((mEnmOsType & VBOXOSTYPE_ArchitectureMask) == VBOXOSTYPE_UnknownArch)
     2056    {
     2057        static struct { const char *pszFile; VBOXOSTYPE fArch; } const s_aArchSpecificFiles[] =
     2058        {
     2059            { "EFI/BOOT/grubaa64.efi", VBOXOSTYPE_arm64 },
     2060            { "EFI/BOOT/BOOTAA64.EFI", VBOXOSTYPE_arm64 },
     2061        };
     2062        PRTFSOBJINFO pObjInfo = (PRTFSOBJINFO)&pBuf->ab[0];
     2063        AssertCompile(sizeof(*pBuf) > sizeof(*pObjInfo));
     2064        for (size_t i = 0; i < RT_ELEMENTS(s_aArchSpecificFiles); i++)
     2065        {
     2066            int vrc = RTVfsQueryPathInfo(hVfsIso, s_aArchSpecificFiles[i].pszFile, pObjInfo,
     2067                                         RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);
     2068            if (RT_SUCCESS(vrc) && RTFS_IS_FILE(pObjInfo->Attr.fMode))
     2069            {
     2070                mEnmOsType = (VBOXOSTYPE)((mEnmOsType & ~VBOXOSTYPE_ArchitectureMask) | s_aArchSpecificFiles[i].fArch);
     2071                break;
     2072            }
     2073        }
     2074    }
     2075
     2076    /*
     2077     * If we like, we could parse grub.conf to look for fullly spelled out
     2078     * flavor, though the menu items typically only contains the major version
     2079     * number, so little else to add, really.
     2080     */
     2081
     2082    return (mEnmOsType & VBOXOSTYPE_ArchitectureMask) != VBOXOSTYPE_UnknownArch ? S_OK : S_FALSE;
    19332083}
    19342084
     
    22602410            char szVolumeId[128];
    22612411            size_t cchVolumeId;
    2262             vrc = RTVfsQueryLabel(hVfsIso, szVolumeId, 128, &cchVolumeId);
     2412            vrc = RTVfsQueryLabel(hVfsIso, false /*fAlternative*/, szVolumeId, 128, &cchVolumeId);
    22632413            if (RT_SUCCESS(vrc))
    22642414            {
     
    38363986        return S_OK;
    38373987
     3988    /* Fredora ISOs cannot be installed at present. */
     3989    if (enmOsTypeMasked == VBOXOSTYPE_FedoraCore)
     3990        return S_OK;
     3991
    38383992    /*
    38393993     * Assume the rest works.
  • trunk/src/VBox/Runtime/common/fs/isovfs.cpp

    r96407 r96861  
    50605060    {
    50615061        case RTVFSQIEX_VOL_LABEL:
    5062         {
    5063             if (pThis->enmType == RTFSISOVOLTYPE_UDF)
     5062        case RTVFSQIEX_VOL_LABEL_ALT:
     5063        {
     5064            if (pThis->enmType == RTFSISOVOLTYPE_UDF
     5065                && (   enmInfo == RTVFSQIEX_VOL_LABEL
     5066                    || pThis->offPrimaryVolDesc == 0))
    50645067                return rtFsIsoVol_ReturnUdfDString(pThis->Udf.VolInfo.achLogicalVolumeID,
    50655068                                                   sizeof(pThis->Udf.VolInfo.achLogicalVolumeID), pvInfo, cbInfo, pcbRet);
     5069
     5070            bool const fPrimary = enmInfo == RTVFSQIEX_VOL_LABEL_ALT
     5071                               || pThis->enmType == RTFSISOVOLTYPE_ISO9960;
     5072
    50665073            int rc = RTVfsFileReadAt(pThis->hVfsBacking,
    5067                                      pThis->enmType == RTFSISOVOLTYPE_ISO9960
    5068                                      ? pThis->offPrimaryVolDesc : pThis->offSecondaryVolDesc,
     5074                                     fPrimary ? pThis->offPrimaryVolDesc : pThis->offSecondaryVolDesc,
    50695075                                     uBuf.ab, RT_MAX(RT_MIN(pThis->cbSector, sizeof(uBuf)), sizeof(uBuf.PriVolDesc)), NULL);
    50705076            AssertRCReturn(rc, rc);
    5071             switch (enmInfo)
    5072             {
    5073                 case RTVFSQIEX_VOL_LABEL:
    5074                     if (pThis->enmType == RTFSISOVOLTYPE_ISO9960)
    5075                         return rtFsIsoVol_ReturnIso9660DString(uBuf.PriVolDesc.achVolumeId, sizeof(uBuf.PriVolDesc.achVolumeId),
    5076                                                                pvInfo, cbInfo, pcbRet);
    5077                     return rtFsIsoVol_ReturnIso9660D1String(uBuf.SupVolDesc.achVolumeId, sizeof(uBuf.SupVolDesc.achVolumeId),
    5078                                                             pvInfo, cbInfo, pcbRet);
    5079                 default:
    5080                     AssertFailedReturn(VERR_INTERNAL_ERROR);
    5081             }
    5082             break;
     5077
     5078            if (fPrimary)
     5079                return rtFsIsoVol_ReturnIso9660DString(uBuf.PriVolDesc.achVolumeId, sizeof(uBuf.PriVolDesc.achVolumeId),
     5080                                                       pvInfo, cbInfo, pcbRet);
     5081            return rtFsIsoVol_ReturnIso9660D1String(uBuf.SupVolDesc.achVolumeId, sizeof(uBuf.SupVolDesc.achVolumeId),
     5082                                                    pvInfo, cbInfo, pcbRet);
    50835083        }
    50845084
  • trunk/src/VBox/Runtime/common/vfs/vfsbase.cpp

    r96407 r96861  
    23192319
    23202320
    2321 RTDECL(int) RTVfsQueryLabel(RTVFS hVfs, char *pszLabel, size_t cbLabel, size_t *pcbActual)
     2321RTDECL(int) RTVfsQueryLabel(RTVFS hVfs, bool fAlternative, char *pszLabel, size_t cbLabel, size_t *pcbActual)
    23222322{
    23232323    RTVFSINTERNAL *pThis = hVfs;
     
    23362336
    23372337        RTVfsLockAcquireRead(pThis->Base.hLock);
    2338         rc = pThis->pOps->Obj.pfnQueryInfoEx(pThis->Base.pvThis, RTVFSQIEX_VOL_LABEL, pszLabel, cbLabel, pcbActual);
     2338        rc = pThis->pOps->Obj.pfnQueryInfoEx(pThis->Base.pvThis, !fAlternative ? RTVFSQIEX_VOL_LABEL : RTVFSQIEX_VOL_LABEL_ALT,
     2339                                             pszLabel, cbLabel, pcbActual);
    23392340        RTVfsLockReleaseRead(pThis->Base.hLock);
    23402341    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette