VirtualBox

Changeset 68694 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Sep 7, 2017 2:51:09 PM (7 years ago)
Author:
vboxsync
Message:

isovfs.cpp: More UDF code (disabled).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/fs/isovfs.cpp

    r68510 r68694  
    11/* $Id$ */
    22/** @file
    3  * IPRT - ISO 9660 Virtual Filesystem.
     3 * IPRT - ISO 9660 and UDF Virtual Filesystem (read only).
    44 */
    55
     
    5353*   Structures and Typedefs                                                                                                      *
    5454*********************************************************************************************************************************/
    55 /** Pointer to an ISO 9660 volume (VFS instance data). */
    56 typedef struct RTFSISO9660VOL *PRTFSISO9660VOL;
    57 /** Pointer to a const ISO 9660 volume (VFS instance data). */
    58 typedef struct RTFSISO9660VOL const *PCRTFSISO9660VOL;
    59 
    60 /** Pointer to a ISO 9660 directory instance. */
    61 typedef struct RTFSISO9660DIRSHRD *PRTFSISO9660DIRSHRD;
    62 
    63 
    64 
    65 /**
    66  * ISO 9660 extent (internal to the VFS not a disk structure).
    67  */
    68 typedef struct RTFSISO9660EXTENT
     55/** Pointer to an ISO volume (VFS instance data). */
     56typedef struct RTFSISOVOL *PRTFSISOVOL;
     57/** Pointer to a const ISO volume (VFS instance data). */
     58typedef struct RTFSISOVOL const *PCRTFSISOVOL;
     59
     60/** Pointer to a ISO directory instance. */
     61typedef struct RTFSISODIRSHRD *PRTFSISODIRSHRD;
     62
     63
     64
     65/**
     66 * ISO extent (internal to the VFS not a disk structure).
     67 */
     68typedef struct RTFSISOEXTENT
    6969{
    7070    /** The disk offset. */
     
    7272    /** The size of the extent in bytes. */
    7373    uint64_t            cbExtent;
    74 } RTFSISO9660EXTENT;
     74} RTFSISOEXTENT;
    7575/** Pointer to an ISO 9660 extent. */
    76 typedef RTFSISO9660EXTENT *PRTFSISO9660EXTENT;
     76typedef RTFSISOEXTENT *PRTFSISOEXTENT;
    7777/** Pointer to a const ISO 9660 extent. */
    78 typedef RTFSISO9660EXTENT const *PCRTFSISO9660EXTENT;
    79 
    80 
    81 /**
    82  * ISO 9660 file system object, shared part.
    83  */
    84 typedef struct RTFSISO9660CORE
    85 {
    86     /** The parent directory keeps a list of open objects (RTFSISO9660CORE). */
     78typedef RTFSISOEXTENT const *PCRTFSISOEXTENT;
     79
     80
     81/**
     82 * ISO file system object, shared part.
     83 */
     84typedef struct RTFSISOCORE
     85{
     86    /** The parent directory keeps a list of open objects (RTFSISOCORE). */
    8787    RTLISTNODE          Entry;
    8888    /** Reference counter.   */
    8989    uint32_t volatile   cRefs;
    9090    /** The parent directory (not released till all children are close). */
    91     PRTFSISO9660DIRSHRD pParentDir;
     91    PRTFSISODIRSHRD    pParentDir;
    9292    /** The byte offset of the first directory record. */
    9393    uint64_t            offDirRec;
     
    105105    RTTIMESPEC          BirthTime;
    106106    /** Pointer to the volume. */
    107     PRTFSISO9660VOL     pVol;
     107    PRTFSISOVOL         pVol;
    108108    /** The version number. */
    109109    uint32_t            uVersion;
     
    111111    uint32_t            cExtents;
    112112    /** The first extent. */
    113     RTFSISO9660EXTENT   FirstExtent;
     113    RTFSISOEXTENT       FirstExtent;
    114114    /** Array of additional extents. */
    115     PRTFSISO9660EXTENT  paExtents;
    116 } RTFSISO9660CORE;
    117 typedef RTFSISO9660CORE *PRTFSISO9660CORE;
    118 
    119 /**
    120  * ISO 9660 file, shared data.
    121  */
    122 typedef struct RTFSISO9660FILESHRD
     115    PRTFSISOEXTENT      paExtents;
     116} RTFSISOCORE;
     117typedef RTFSISOCORE *PRTFSISOCORE;
     118
     119/**
     120 * ISO file, shared data.
     121 */
     122typedef struct RTFSISOFILESHRD
    123123{
    124124    /** Core ISO9660 object info.  */
    125     RTFSISO9660CORE     Core;
    126 } RTFSISO9660FILESHRD;
     125    RTFSISOCORE         Core;
     126} RTFSISOFILESHRD;
    127127/** Pointer to a ISO 9660 file object. */
    128 typedef RTFSISO9660FILESHRD *PRTFSISO9660FILESHRD;
    129 
    130 
    131 /**
    132  * ISO 9660 directory, shared data.
     128typedef RTFSISOFILESHRD *PRTFSISOFILESHRD;
     129
     130
     131/**
     132 * ISO directory, shared data.
    133133 *
    134134 * We will always read in the whole directory just to keep things really simple.
    135135 */
    136 typedef struct RTFSISO9660DIRSHRD
     136typedef struct RTFSISODIRSHRD
    137137{
    138138    /** Core ISO 9660 object info.  */
    139     RTFSISO9660CORE     Core;
    140     /** Open child objects (RTFSISO9660CORE). */
     139    RTFSISOCORE         Core;
     140    /** Open child objects (RTFSISOCORE). */
    141141    RTLISTNODE          OpenChildren;
    142142
     
    145145    /** The size of the directory content (duplicate of Core.cbObject). */
    146146    uint32_t            cbDir;
    147 } RTFSISO9660DIRSHRD;
    148 /** Pointer to a ISO 9660 directory instance. */
    149 typedef RTFSISO9660DIRSHRD *PRTFSISO9660DIRSHRD;
     147} RTFSISODIRSHRD;
     148/** Pointer to a ISO directory instance. */
     149typedef RTFSISODIRSHRD *PRTFSISODIRSHRD;
    150150
    151151
     
    153153 * Private data for a VFS file object.
    154154 */
    155 typedef struct RTFSISO9660FILEOBJ
     155typedef struct RTFSISOFILEOBJ
    156156{
    157157    /** Pointer to the shared data. */
    158     PRTFSISO9660FILESHRD    pShared;
     158    PRTFSISOFILESHRD    pShared;
    159159    /** The current file offset. */
    160     uint64_t                offFile;
    161 } RTFSISO9660FILEOBJ;
    162 typedef RTFSISO9660FILEOBJ *PRTFSISO9660FILEOBJ;
     160    uint64_t            offFile;
     161} RTFSISOFILEOBJ;
     162typedef RTFSISOFILEOBJ *PRTFSISOFILEOBJ;
    163163
    164164/**
    165165 * Private data for a VFS directory object.
    166166 */
    167 typedef struct RTFSISO9660DIROBJ
     167typedef struct RTFSISODIROBJ
    168168{
    169169    /** Pointer to the shared data. */
    170     PRTFSISO9660DIRSHRD     pShared;
     170    PRTFSISODIRSHRD     pShared;
    171171    /** The current directory offset. */
    172     uint32_t                offDir;
    173 } RTFSISO9660DIROBJ;
    174 typedef RTFSISO9660DIROBJ *PRTFSISO9660DIROBJ;
    175 
    176 
    177 /**
    178  * A ISO 9660 volume.
    179  */
    180 typedef struct RTFSISO9660VOL
     172    uint32_t            offDir;
     173} RTFSISODIROBJ;
     174typedef RTFSISODIROBJ *PRTFSISODIROBJ;
     175
     176
     177/**
     178 * A ISO volume.
     179 */
     180typedef struct RTFSISOVOL
    181181{
    182182    /** Handle to itself. */
    183     RTVFS                   hVfsSelf;
     183    RTVFS               hVfsSelf;
    184184    /** The file, partition, or whatever backing the ISO 9660 volume. */
    185     RTVFSFILE               hVfsBacking;
     185    RTVFSFILE           hVfsBacking;
    186186    /** The size of the backing thingy. */
    187     uint64_t                cbBacking;
     187    uint64_t            cbBacking;
     188    /** The size of the backing thingy in sectors (cbSector). */
     189    uint64_t            cBackingSectors;
    188190    /** Flags. */
    189     uint32_t                fFlags;
     191    uint32_t            fFlags;
    190192    /** The sector size (in bytes). */
    191     uint32_t                cbSector;
     193    uint32_t            cbSector;
    192194
    193195    /** @name ISO 9660 specific data
    194196     *  @{ */
    195197    /** The size of a logical block in bytes. */
    196     uint32_t                cbBlock;
     198    uint32_t            cbBlock;
    197199    /** The primary volume space size in blocks. */
    198     uint32_t                cBlocksInPrimaryVolumeSpace;
     200    uint32_t            cBlocksInPrimaryVolumeSpace;
    199201    /** The primary volume space size in bytes. */
    200     uint64_t                cbPrimaryVolumeSpace;
     202    uint64_t            cbPrimaryVolumeSpace;
    201203    /** The number of volumes in the set. */
    202     uint32_t                cVolumesInSet;
     204    uint32_t            cVolumesInSet;
    203205    /** The primary volume sequence ID. */
    204     uint32_t                idPrimaryVol;
     206    uint32_t            idPrimaryVol;
    205207    /** Set if using UTF16-2 (joliet). */
    206     bool                    fIsUtf16;
     208    bool                fIsUtf16;
    207209    /** @} */
    208210
     211    /** @name UDF specific data.
     212     * @{ */
     213    /** Offset of the Anchor volume descriptor sequence. */
     214    uint64_t            offAvdp;
     215    /** Length of the anchor volume descriptor sequence. */
     216    uint32_t            cbAvdp;
     217    /** @} */
     218
    209219    /** The root directory shared data. */
    210     PRTFSISO9660DIRSHRD     pRootDir;
    211 } RTFSISO9660VOL;
     220    PRTFSISODIRSHRD     pRootDir;
     221} RTFSISOVOL;
    212222
    213223
     
    221231*   Internal Functions                                                                                                           *
    222232*********************************************************************************************************************************/
    223 static void rtFsIso9660DirShrd_AddOpenChild(PRTFSISO9660DIRSHRD pDir, PRTFSISO9660CORE pChild);
    224 static void rtFsIso9660DirShrd_RemoveOpenChild(PRTFSISO9660DIRSHRD pDir, PRTFSISO9660CORE pChild);
    225 static int  rtFsIso9660Dir_New(PRTFSISO9660VOL pThis, PRTFSISO9660DIRSHRD pParentDir, PCISO9660DIRREC pDirRec,
    226                                uint32_t cDirRecs, uint64_t offDirRec, PRTVFSDIR phVfsDir);
    227 static PRTFSISO9660CORE rtFsIso9660Dir_LookupShared(PRTFSISO9660DIRSHRD pThis, uint64_t offDirRec);
     233static void rtFsIsoDirShrd_AddOpenChild(PRTFSISODIRSHRD pDir, PRTFSISOCORE pChild);
     234static void rtFsIsoDirShrd_RemoveOpenChild(PRTFSISODIRSHRD pDir, PRTFSISOCORE pChild);
     235static int  rtFsIsoDir_New9660(PRTFSISOVOL pThis, PRTFSISODIRSHRD pParentDir, PCISO9660DIRREC pDirRec,
     236                           uint32_t cDirRecs, uint64_t offDirRec, PRTVFSDIR phVfsDir);
     237static PRTFSISOCORE rtFsIsoDir_LookupShared(PRTFSISODIRSHRD pThis, uint64_t offDirRec);
    228238
    229239
     
    417427
    418428/**
    419  * Initialization of a RTFSISO9660CORE structure from a directory record.
    420  *
    421  * @note    The RTFSISO9660CORE::pParentDir and RTFSISO9660CORE::Clusters members are
     429 * Initialization of a RTFSISOCORE structure from a directory record.
     430 *
     431 * @note    The RTFSISOCORE::pParentDir and RTFSISOCORE::Clusters members are
    422432 *          properly initialized elsewhere.
    423433 *
     
    431441 * @param   pVol            The volume.
    432442 */
    433 static int rtFsIso9660Core_InitFromDirRec(PRTFSISO9660CORE pCore, PCISO9660DIRREC pDirRec, uint32_t cDirRecs,
    434                                           uint64_t offDirRec, uint32_t uVersion, PRTFSISO9660VOL pVol)
     443static int rtFsIsoCore_InitFrom9660DirRec(PRTFSISOCORE pCore, PCISO9660DIRREC pDirRec, uint32_t cDirRecs,
     444                                          uint64_t offDirRec, uint32_t uVersion, PRTFSISOVOL pVol)
    435445{
    436446    RTListInit(&pCore->Entry);
     
    462472    else
    463473    {
    464         PRTFSISO9660EXTENT pCurExtent = &pCore->FirstExtent;
     474        PRTFSISOEXTENT pCurExtent = &pCore->FirstExtent;
    465475        while (cDirRecs > 1)
    466476        {
     
    479489                    void *pvNew = RTMemRealloc(pCore->paExtents, pCore->cExtents * sizeof(pCore->paExtents[0]));
    480490                    if (pvNew)
    481                         pCore->paExtents = (PRTFSISO9660EXTENT)pvNew;
     491                        pCore->paExtents = (PRTFSISOEXTENT)pvNew;
    482492                    else
    483493                    {
     
    505515
    506516/**
    507  * Worker for rtFsIso9660File_QueryInfo and rtFsIso9660Dir_QueryInfo.
    508  */
    509 static int rtFsIso9660Core_QueryInfo(PRTFSISO9660CORE pCore, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr)
     517 * Worker for rtFsIsoFile_QueryInfo and rtFsIsoDir_QueryInfo.
     518 */
     519static int rtFsIsoCore_QueryInfo(PRTFSISOCORE pCore, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr)
    510520{
    511521    pObjInfo->cbObject              = pCore->cbObject;
     
    550560
    551561/**
    552  * Worker for rtFsIso9660File_Close and rtFsIso9660Dir_Close that does common work.
     562 * Worker for rtFsIsoFile_Close and rtFsIsoDir_Close that does common work.
    553563 *
    554564 * @param   pCore           The common shared structure.
    555565 */
    556 static void rtFsIso9660Core_Destroy(PRTFSISO9660CORE pCore)
     566static void rtFsIsoCore_Destroy(PRTFSISOCORE pCore)
    557567{
    558568    if (pCore->pParentDir)
    559         rtFsIso9660DirShrd_RemoveOpenChild(pCore->pParentDir, pCore);
     569        rtFsIsoDirShrd_RemoveOpenChild(pCore->pParentDir, pCore);
    560570    if (pCore->paExtents)
    561571    {
     
    569579 * @interface_method_impl{RTVFSOBJOPS,pfnClose}
    570580 */
    571 static DECLCALLBACK(int) rtFsIso9660File_Close(void *pvThis)
    572 {
    573     PRTFSISO9660FILEOBJ  pThis   = (PRTFSISO9660FILEOBJ)pvThis;
    574     LogFlow(("rtFsIso9660File_Close(%p/%p)\n", pThis, pThis->pShared));
    575 
    576     PRTFSISO9660FILESHRD pShared = pThis->pShared;
     581static DECLCALLBACK(int) rtFsIsoFile_Close(void *pvThis)
     582{
     583    PRTFSISOFILEOBJ  pThis   = (PRTFSISOFILEOBJ)pvThis;
     584    LogFlow(("rtFsIsoFile_Close(%p/%p)\n", pThis, pThis->pShared));
     585
     586    PRTFSISOFILESHRD pShared = pThis->pShared;
    577587    pThis->pShared = NULL;
    578588    if (pShared)
     
    580590        if (ASMAtomicDecU32(&pShared->Core.cRefs) == 0)
    581591        {
    582             LogFlow(("rtFsIso9660File_Close: Destroying shared structure %p\n", pShared));
    583             rtFsIso9660Core_Destroy(&pShared->Core);
     592            LogFlow(("rtFsIsoFile_Close: Destroying shared structure %p\n", pShared));
     593            rtFsIsoCore_Destroy(&pShared->Core);
    584594            RTMemFree(pShared);
    585595        }
     
    592602 * @interface_method_impl{RTVFSOBJOPS,pfnQueryInfo}
    593603 */
    594 static DECLCALLBACK(int) rtFsIso9660File_QueryInfo(void *pvThis, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr)
    595 {
    596     PRTFSISO9660FILEOBJ pThis = (PRTFSISO9660FILEOBJ)pvThis;
    597     return rtFsIso9660Core_QueryInfo(&pThis->pShared->Core, pObjInfo, enmAddAttr);
     604static DECLCALLBACK(int) rtFsIsoFile_QueryInfo(void *pvThis, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr)
     605{
     606    PRTFSISOFILEOBJ pThis = (PRTFSISOFILEOBJ)pvThis;
     607    return rtFsIsoCore_QueryInfo(&pThis->pShared->Core, pObjInfo, enmAddAttr);
    598608}
    599609
     
    602612 * @interface_method_impl{RTVFSIOSTREAMOPS,pfnRead}
    603613 */
    604 static DECLCALLBACK(int) rtFsIso9660File_Read(void *pvThis, RTFOFF off, PCRTSGBUF pSgBuf, bool fBlocking, size_t *pcbRead)
    605 {
    606     PRTFSISO9660FILEOBJ  pThis   = (PRTFSISO9660FILEOBJ)pvThis;
    607     PRTFSISO9660FILESHRD pShared = pThis->pShared;
     614static DECLCALLBACK(int) rtFsIsoFile_Read(void *pvThis, RTFOFF off, PCRTSGBUF pSgBuf, bool fBlocking, size_t *pcbRead)
     615{
     616    PRTFSISOFILEOBJ  pThis   = (PRTFSISOFILEOBJ)pvThis;
     617    PRTFSISOFILESHRD pShared = pThis->pShared;
    608618    AssertReturn(pSgBuf->cSegs != 0, VERR_INTERNAL_ERROR_3);
    609619    RT_NOREF(fBlocking);
     
    670680 * @interface_method_impl{RTVFSIOSTREAMOPS,pfnWrite}
    671681 */
    672 static DECLCALLBACK(int) rtFsIso9660File_Write(void *pvThis, RTFOFF off, PCRTSGBUF pSgBuf, bool fBlocking, size_t *pcbWritten)
     682static DECLCALLBACK(int) rtFsIsoFile_Write(void *pvThis, RTFOFF off, PCRTSGBUF pSgBuf, bool fBlocking, size_t *pcbWritten)
    673683{
    674684    RT_NOREF(pvThis, off, pSgBuf, fBlocking, pcbWritten);
     
    680690 * @interface_method_impl{RTVFSIOSTREAMOPS,pfnFlush}
    681691 */
    682 static DECLCALLBACK(int) rtFsIso9660File_Flush(void *pvThis)
     692static DECLCALLBACK(int) rtFsIsoFile_Flush(void *pvThis)
    683693{
    684694    RT_NOREF(pvThis);
     
    690700 * @interface_method_impl{RTVFSIOSTREAMOPS,pfnPollOne}
    691701 */
    692 static DECLCALLBACK(int) rtFsIso9660File_PollOne(void *pvThis, uint32_t fEvents, RTMSINTERVAL cMillies, bool fIntr,
     702static DECLCALLBACK(int) rtFsIsoFile_PollOne(void *pvThis, uint32_t fEvents, RTMSINTERVAL cMillies, bool fIntr,
    693703                                                 uint32_t *pfRetEvents)
    694704{
     
    720730 * @interface_method_impl{RTVFSIOSTREAMOPS,pfnTell}
    721731 */
    722 static DECLCALLBACK(int) rtFsIso9660File_Tell(void *pvThis, PRTFOFF poffActual)
    723 {
    724     PRTFSISO9660FILEOBJ pThis = (PRTFSISO9660FILEOBJ)pvThis;
     732static DECLCALLBACK(int) rtFsIsoFile_Tell(void *pvThis, PRTFOFF poffActual)
     733{
     734    PRTFSISOFILEOBJ pThis = (PRTFSISOFILEOBJ)pvThis;
    725735    *poffActual = pThis->offFile;
    726736    return VINF_SUCCESS;
     
    731741 * @interface_method_impl{RTVFSOBJSETOPS,pfnMode}
    732742 */
    733 static DECLCALLBACK(int) rtFsIso9660File_SetMode(void *pvThis, RTFMODE fMode, RTFMODE fMask)
     743static DECLCALLBACK(int) rtFsIsoFile_SetMode(void *pvThis, RTFMODE fMode, RTFMODE fMask)
    734744{
    735745    RT_NOREF(pvThis, fMode, fMask);
     
    741751 * @interface_method_impl{RTVFSOBJSETOPS,pfnSetTimes}
    742752 */
    743 static DECLCALLBACK(int) rtFsIso9660File_SetTimes(void *pvThis, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
     753static DECLCALLBACK(int) rtFsIsoFile_SetTimes(void *pvThis, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
    744754                                                 PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime)
    745755{
     
    752762 * @interface_method_impl{RTVFSOBJSETOPS,pfnSetOwner}
    753763 */
    754 static DECLCALLBACK(int) rtFsIso9660File_SetOwner(void *pvThis, RTUID uid, RTGID gid)
     764static DECLCALLBACK(int) rtFsIsoFile_SetOwner(void *pvThis, RTUID uid, RTGID gid)
    755765{
    756766    RT_NOREF(pvThis, uid, gid);
     
    762772 * @interface_method_impl{RTVFSFILEOPS,pfnSeek}
    763773 */
    764 static DECLCALLBACK(int) rtFsIso9660File_Seek(void *pvThis, RTFOFF offSeek, unsigned uMethod, PRTFOFF poffActual)
    765 {
    766     PRTFSISO9660FILEOBJ pThis = (PRTFSISO9660FILEOBJ)pvThis;
     774static DECLCALLBACK(int) rtFsIsoFile_Seek(void *pvThis, RTFOFF offSeek, unsigned uMethod, PRTFOFF poffActual)
     775{
     776    PRTFSISOFILEOBJ pThis = (PRTFSISOFILEOBJ)pvThis;
    767777    RTFOFF offNew;
    768778    switch (uMethod)
     
    797807 * @interface_method_impl{RTVFSFILEOPS,pfnQuerySize}
    798808 */
    799 static DECLCALLBACK(int) rtFsIso9660File_QuerySize(void *pvThis, uint64_t *pcbFile)
    800 {
    801     PRTFSISO9660FILEOBJ pThis = (PRTFSISO9660FILEOBJ)pvThis;
     809static DECLCALLBACK(int) rtFsIsoFile_QuerySize(void *pvThis, uint64_t *pcbFile)
     810{
     811    PRTFSISOFILEOBJ pThis = (PRTFSISOFILEOBJ)pvThis;
    802812    *pcbFile = pThis->pShared->Core.cbObject;
    803813    return VINF_SUCCESS;
     
    815825            RTVFSOBJTYPE_FILE,
    816826            "FatFile",
    817             rtFsIso9660File_Close,
    818             rtFsIso9660File_QueryInfo,
     827            rtFsIsoFile_Close,
     828            rtFsIsoFile_QueryInfo,
    819829            RTVFSOBJOPS_VERSION
    820830        },
    821831        RTVFSIOSTREAMOPS_VERSION,
    822832        RTVFSIOSTREAMOPS_FEAT_NO_SG,
    823         rtFsIso9660File_Read,
    824         rtFsIso9660File_Write,
    825         rtFsIso9660File_Flush,
    826         rtFsIso9660File_PollOne,
    827         rtFsIso9660File_Tell,
     833        rtFsIsoFile_Read,
     834        rtFsIsoFile_Write,
     835        rtFsIsoFile_Flush,
     836        rtFsIsoFile_PollOne,
     837        rtFsIsoFile_Tell,
    828838        NULL /*pfnSkip*/,
    829839        NULL /*pfnZeroFill*/,
     
    835845        RTVFSOBJSETOPS_VERSION,
    836846        RT_OFFSETOF(RTVFSFILEOPS, Stream.Obj) - RT_OFFSETOF(RTVFSFILEOPS, ObjSet),
    837         rtFsIso9660File_SetMode,
    838         rtFsIso9660File_SetTimes,
    839         rtFsIso9660File_SetOwner,
     847        rtFsIsoFile_SetMode,
     848        rtFsIsoFile_SetTimes,
     849        rtFsIsoFile_SetOwner,
    840850        RTVFSOBJSETOPS_VERSION
    841851    },
    842     rtFsIso9660File_Seek,
    843     rtFsIso9660File_QuerySize,
     852    rtFsIsoFile_Seek,
     853    rtFsIsoFile_QuerySize,
    844854    RTVFSFILEOPS_VERSION
    845855};
     
    847857
    848858/**
    849  * Instantiates a new directory.
     859 * Instantiates a new directory, from 9660.
    850860 *
    851861 * @returns IPRT status code.
     
    863873 * @param   phVfsFile       Where to return the file handle.
    864874 */
    865 static int rtFsIso9660File_New(PRTFSISO9660VOL pThis, PRTFSISO9660DIRSHRD pParentDir, PCISO9660DIRREC pDirRec, uint32_t cDirRecs,
     875static int rtFsIsoFile_New9660(PRTFSISOVOL pThis, PRTFSISODIRSHRD pParentDir, PCISO9660DIRREC pDirRec, uint32_t cDirRecs,
    866876                               uint64_t offDirRec, uint64_t fOpen, uint32_t uVersion, PRTVFSFILE phVfsFile)
    867877{
     
    871881     * Create a VFS object.
    872882     */
    873     PRTFSISO9660FILEOBJ pNewFile;
     883    PRTFSISOFILEOBJ pNewFile;
    874884    int rc = RTVfsNewFile(&g_rtFsIos9660FileOps, sizeof(*pNewFile), fOpen, pThis->hVfsSelf, NIL_RTVFSLOCK /*use volume lock*/,
    875885                          phVfsFile, (void **)&pNewFile);
     
    879889         * Look for existing shared object, create a new one if necessary.
    880890         */
    881         PRTFSISO9660FILESHRD pShared = (PRTFSISO9660FILESHRD)rtFsIso9660Dir_LookupShared(pParentDir, offDirRec);
     891        PRTFSISOFILESHRD pShared = (PRTFSISOFILESHRD)rtFsIsoDir_LookupShared(pParentDir, offDirRec);
    882892        if (!pShared)
    883893        {
    884             pShared = (PRTFSISO9660FILESHRD)RTMemAllocZ(sizeof(*pShared));
     894            pShared = (PRTFSISOFILESHRD)RTMemAllocZ(sizeof(*pShared));
    885895            if (pShared)
    886896            {
    887897                /*
    888                  * Initialize it all so rtFsIso9660File_Close doesn't trip up in anyway.
     898                 * Initialize it all so rtFsIsoFile_Close doesn't trip up in anyway.
    889899                 */
    890                 rc = rtFsIso9660Core_InitFromDirRec(&pShared->Core, pDirRec, cDirRecs, offDirRec, uVersion, pThis);
     900                rc = rtFsIsoCore_InitFrom9660DirRec(&pShared->Core, pDirRec, cDirRecs, offDirRec, uVersion, pThis);
    891901                if (RT_SUCCESS(rc))
    892                     rtFsIso9660DirShrd_AddOpenChild(pParentDir, &pShared->Core);
     902                    rtFsIsoDirShrd_AddOpenChild(pParentDir, &pShared->Core);
    893903                else
    894904                {
     
    900910        if (pShared)
    901911        {
    902             LogFlow(("rtFsIso9660File_New: cbObject=%#RX64 First Extent: off=%#RX64 cb=%#RX64\n",
     912            LogFlow(("rtFsIsoFile_New9660: cbObject=%#RX64 First Extent: off=%#RX64 cb=%#RX64\n",
    903913                     pShared->Core.cbObject, pShared->Core.FirstExtent.offDisk, pShared->Core.FirstExtent.cbExtent));
    904914            pNewFile->offFile = 0;
     
    921931 * @param   offDirRec       The directory record offset of the child.
    922932 */
    923 static PRTFSISO9660CORE rtFsIso9660Dir_LookupShared(PRTFSISO9660DIRSHRD pThis, uint64_t offDirRec)
    924 {
    925     PRTFSISO9660CORE pCur;
    926     RTListForEach(&pThis->OpenChildren, pCur, RTFSISO9660CORE, Entry)
     933static PRTFSISOCORE rtFsIsoDir_LookupShared(PRTFSISODIRSHRD pThis, uint64_t offDirRec)
     934{
     935    PRTFSISOCORE pCur;
     936    RTListForEach(&pThis->OpenChildren, pCur, RTFSISOCORE, Entry)
    927937    {
    928938        if (pCur->offDirRec == offDirRec)
     
    946956 * @param   pNext       The directory record alleged to be the next extent.
    947957 */
    948 DECLINLINE(bool) rtFsIso9660Dir_IsDirRecNextExtent(PCISO9660DIRREC pFirst, PCISO9660DIRREC pNext)
     958DECLINLINE(bool) rtFsIsoDir_Is9660DirRecNextExtent(PCISO9660DIRREC pFirst, PCISO9660DIRREC pNext)
    949959{
    950960    if (RT_LIKELY(pNext->bFileIdLength == pFirst->bFileIdLength))
     
    962972
    963973/**
    964  * Worker for rtFsIso9660Dir_FindEntry that compares a UTF-16BE name with a
     974 * Worker for rtFsIsoDir_FindEntry that compares a UTF-16BE name with a
    965975 * directory record.
    966976 *
     
    973983 * @param   puVersion           Where to return any file version number.
    974984 */
    975 DECL_FORCE_INLINE(bool) rtFsIso9660Dir_IsEntryEqualUtf16Big(PCISO9660DIRREC pDirRec, PCRTUTF16 pwszEntry, size_t cbEntry,
    976                                                             size_t cwcEntry, uint32_t *puVersion)
     985DECL_FORCE_INLINE(bool) rtFsIsoDir_IsEntryEqualUtf16Big(PCISO9660DIRREC pDirRec, PCRTUTF16 pwszEntry, size_t cbEntry,
     986                                                        size_t cwcEntry, uint32_t *puVersion)
    977987{
    978988    /* ASSUME directories cannot have any version tags. */
     
    10191029
    10201030/**
    1021  * Worker for rtFsIso9660Dir_FindEntry that compares an ASCII name with a
     1031 * Worker for rtFsIsoDir_FindEntry that compares an ASCII name with a
    10221032 * directory record.
    10231033 *
     
    10281038 * @param   puVersion           Where to return any file version number.
    10291039 */
    1030 DECL_FORCE_INLINE(bool) rtFsIso9660Dir_IsEntryEqualAscii(PCISO9660DIRREC pDirRec, const char *pszEntry, size_t cchEntry,
     1040DECL_FORCE_INLINE(bool) rtFsIsoDir_IsEntryEqualAscii(PCISO9660DIRREC pDirRec, const char *pszEntry, size_t cchEntry,
    10311041                                                         uint32_t *puVersion)
    10321042{
     
    10891099 * @param   puVersion       Where to return the file version number.
    10901100 */
    1091 static int rtFsIso9660Dir_FindEntry(PRTFSISO9660DIRSHRD pThis, const char *pszEntry,  uint64_t *poffDirRec,
    1092                                     PCISO9660DIRREC *ppDirRec, uint32_t *pcDirRecs, PRTFMODE pfMode, uint32_t *puVersion)
     1101static int rtFsIsoDir_FindEntry(PRTFSISODIRSHRD pThis, const char *pszEntry,  uint64_t *poffDirRec,
     1102                                PCISO9660DIRREC *ppDirRec, uint32_t *pcDirRecs, PRTFMODE pfMode, uint32_t *puVersion)
    10931103{
    10941104    /* Set return values. */
     
    11521162            if (fIsUtf16)
    11531163            {
    1154                 if (RT_LIKELY(!rtFsIso9660Dir_IsEntryEqualUtf16Big(pDirRec, uBuf.wszEntry, cbEntry, cwcEntry, puVersion)))
     1164                if (RT_LIKELY(!rtFsIsoDir_IsEntryEqualUtf16Big(pDirRec, uBuf.wszEntry, cbEntry, cwcEntry, puVersion)))
    11551165                {
    11561166                    /* Advance */
     
    11611171            else
    11621172            {
    1163                 if (RT_LIKELY(!rtFsIso9660Dir_IsEntryEqualAscii(pDirRec, uBuf.s.szUpper, cchUpper, puVersion)))
     1173                if (RT_LIKELY(!rtFsIsoDir_IsEntryEqualAscii(pDirRec, uBuf.s.szUpper, cchUpper, puVersion)))
    11641174                {
    11651175                    /** @todo check rock. */
     
    11941204                    if (pDirRec2->cbDirRec != 0)
    11951205                    {
    1196                         Assert(rtFsIso9660Dir_IsDirRecNextExtent(pDirRec, pDirRec2));
     1206                        Assert(rtFsIsoDir_Is9660DirRecNextExtent(pDirRec, pDirRec2));
    11971207                        cDirRecs++;
    11981208                        if (!(pDirRec2->fFileFlags & ISO9660_FILE_FLAGS_MULTI_EXTENT))
     
    12191229 * @param   pShared             The shared directory structure.
    12201230 */
    1221 static void rtFsIso9660DirShrd_Release(PRTFSISO9660DIRSHRD pShared)
     1231static void rtFsIsoDirShrd_Release(PRTFSISODIRSHRD pShared)
    12221232{
    12231233    uint32_t cRefs = ASMAtomicDecU32(&pShared->Core.cRefs);
     
    12251235    if (cRefs == 0)
    12261236    {
    1227         LogFlow(("rtFsIso9660DirShrd_Release: Destroying shared structure %p\n", pShared));
     1237        LogFlow(("rtFsIsoDirShrd_Release: Destroying shared structure %p\n", pShared));
    12281238        Assert(pShared->Core.cRefs == 0);
    12291239        if (pShared->pbDir)
     
    12321242            pShared->pbDir = NULL;
    12331243        }
    1234         rtFsIso9660Core_Destroy(&pShared->Core);
     1244        rtFsIsoCore_Destroy(&pShared->Core);
    12351245        RTMemFree(pShared);
    12361246    }
     
    12431253 * @param   pShared             The shared directory structure.
    12441254 */
    1245 static void rtFsIso9660DirShrd_Retain(PRTFSISO9660DIRSHRD pShared)
     1255static void rtFsIsoDirShrd_Retain(PRTFSISODIRSHRD pShared)
    12461256{
    12471257    uint32_t cRefs = ASMAtomicIncU32(&pShared->Core.cRefs);
     
    12541264 * @interface_method_impl{RTVFSOBJOPS,pfnClose}
    12551265 */
    1256 static DECLCALLBACK(int) rtFsIso9660Dir_Close(void *pvThis)
    1257 {
    1258     PRTFSISO9660DIROBJ pThis = (PRTFSISO9660DIROBJ)pvThis;
    1259     LogFlow(("rtFsIso9660Dir_Close(%p/%p)\n", pThis, pThis->pShared));
    1260 
    1261     PRTFSISO9660DIRSHRD pShared = pThis->pShared;
     1266static DECLCALLBACK(int) rtFsIsoDir_Close(void *pvThis)
     1267{
     1268    PRTFSISODIROBJ pThis = (PRTFSISODIROBJ)pvThis;
     1269    LogFlow(("rtFsIsoDir_Close(%p/%p)\n", pThis, pThis->pShared));
     1270
     1271    PRTFSISODIRSHRD pShared = pThis->pShared;
    12621272    pThis->pShared = NULL;
    12631273    if (pShared)
    1264         rtFsIso9660DirShrd_Release(pShared);
     1274        rtFsIsoDirShrd_Release(pShared);
    12651275    return VINF_SUCCESS;
    12661276}
     
    12701280 * @interface_method_impl{RTVFSOBJOPS,pfnQueryInfo}
    12711281 */
    1272 static DECLCALLBACK(int) rtFsIso9660Dir_QueryInfo(void *pvThis, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr)
    1273 {
    1274     PRTFSISO9660DIROBJ pThis = (PRTFSISO9660DIROBJ)pvThis;
    1275     return rtFsIso9660Core_QueryInfo(&pThis->pShared->Core, pObjInfo, enmAddAttr);
     1282static DECLCALLBACK(int) rtFsIsoDir_QueryInfo(void *pvThis, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr)
     1283{
     1284    PRTFSISODIROBJ pThis = (PRTFSISODIROBJ)pvThis;
     1285    return rtFsIsoCore_QueryInfo(&pThis->pShared->Core, pObjInfo, enmAddAttr);
    12761286}
    12771287
     
    12801290 * @interface_method_impl{RTVFSOBJSETOPS,pfnMode}
    12811291 */
    1282 static DECLCALLBACK(int) rtFsIso9660Dir_SetMode(void *pvThis, RTFMODE fMode, RTFMODE fMask)
     1292static DECLCALLBACK(int) rtFsIsoDir_SetMode(void *pvThis, RTFMODE fMode, RTFMODE fMask)
    12831293{
    12841294    RT_NOREF(pvThis, fMode, fMask);
     
    12901300 * @interface_method_impl{RTVFSOBJSETOPS,pfnSetTimes}
    12911301 */
    1292 static DECLCALLBACK(int) rtFsIso9660Dir_SetTimes(void *pvThis, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
     1302static DECLCALLBACK(int) rtFsIsoDir_SetTimes(void *pvThis, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
    12931303                                                 PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime)
    12941304{
     
    13011311 * @interface_method_impl{RTVFSOBJSETOPS,pfnSetOwner}
    13021312 */
    1303 static DECLCALLBACK(int) rtFsIso9660Dir_SetOwner(void *pvThis, RTUID uid, RTGID gid)
     1313static DECLCALLBACK(int) rtFsIsoDir_SetOwner(void *pvThis, RTUID uid, RTGID gid)
    13041314{
    13051315    RT_NOREF(pvThis, uid, gid);
     
    13111321 * @interface_method_impl{RTVFSOBJOPS,pfnTraversalOpen}
    13121322 */
    1313 static DECLCALLBACK(int) rtFsIso9660Dir_TraversalOpen(void *pvThis, const char *pszEntry, PRTVFSDIR phVfsDir,
    1314                                                       PRTVFSSYMLINK phVfsSymlink, PRTVFS phVfsMounted)
     1323static DECLCALLBACK(int) rtFsIsoDir_TraversalOpen(void *pvThis, const char *pszEntry, PRTVFSDIR phVfsDir,
     1324                                                  PRTVFSSYMLINK phVfsSymlink, PRTVFS phVfsMounted)
    13151325{
    13161326    /*
     
    13281338            *phVfsDir = NIL_RTVFSDIR;
    13291339
    1330         PRTFSISO9660DIROBJ  pThis = (PRTFSISO9660DIROBJ)pvThis;
    1331         PRTFSISO9660DIRSHRD pShared = pThis->pShared;
     1340        PRTFSISODIROBJ      pThis = (PRTFSISODIROBJ)pvThis;
     1341        PRTFSISODIRSHRD    pShared = pThis->pShared;
    13321342        PCISO9660DIRREC     pDirRec;
    13331343        uint64_t            offDirRec;
     
    13351345        RTFMODE             fMode;
    13361346        uint32_t            uVersion;
    1337         rc = rtFsIso9660Dir_FindEntry(pShared, pszEntry, &offDirRec, &pDirRec, &cDirRecs, &fMode, &uVersion);
    1338         Log2(("rtFsIso9660Dir_TraversalOpen: FindEntry(,%s,) -> %Rrc\n", pszEntry, rc));
     1347        rc = rtFsIsoDir_FindEntry(pShared, pszEntry, &offDirRec, &pDirRec, &cDirRecs, &fMode, &uVersion);
     1348        Log2(("rtFsIsoDir_TraversalOpen: FindEntry(,%s,) -> %Rrc\n", pszEntry, rc));
    13391349        if (RT_SUCCESS(rc))
    13401350        {
     
    13431353                case RTFS_TYPE_DIRECTORY:
    13441354                    if (phVfsDir)
    1345                         rc = rtFsIso9660Dir_New(pShared->Core.pVol, pShared, pDirRec, cDirRecs, offDirRec, phVfsDir);
     1355                        rc = rtFsIsoDir_New9660(pShared->Core.pVol, pShared, pDirRec, cDirRecs, offDirRec, phVfsDir);
    13461356                    else
    13471357                        rc = VERR_NOT_SYMLINK;
     
    13761386 * @interface_method_impl{RTVFSDIROPS,pfnOpenFile}
    13771387 */
    1378 static DECLCALLBACK(int) rtFsIso9660Dir_OpenFile(void *pvThis, const char *pszFilename, uint32_t fOpen, PRTVFSFILE phVfsFile)
    1379 {
    1380     PRTFSISO9660DIROBJ  pThis   = (PRTFSISO9660DIROBJ)pvThis;
    1381     PRTFSISO9660DIRSHRD pShared = pThis->pShared;
     1388static DECLCALLBACK(int) rtFsIsoDir_OpenFile(void *pvThis, const char *pszFilename, uint32_t fOpen, PRTVFSFILE phVfsFile)
     1389{
     1390    PRTFSISODIROBJ  pThis   = (PRTFSISODIROBJ)pvThis;
     1391    PRTFSISODIRSHRD pShared = pThis->pShared;
    13821392
    13831393    /*
     
    13961406    RTFMODE         fMode;
    13971407    uint32_t        uVersion;
    1398     int rc = rtFsIso9660Dir_FindEntry(pShared, pszFilename, &offDirRec, &pDirRec, &cDirRecs, &fMode, &uVersion);
    1399     Log2(("rtFsIso9660Dir_OpenFile: FindEntry(,%s,) -> %Rrc\n", pszFilename, rc));
     1408    int rc = rtFsIsoDir_FindEntry(pShared, pszFilename, &offDirRec, &pDirRec, &cDirRecs, &fMode, &uVersion);
     1409    Log2(("rtFsIsoDir_OpenFile: FindEntry(,%s,) -> %Rrc\n", pszFilename, rc));
    14001410    if (RT_SUCCESS(rc))
    14011411    {
     
    14031413        {
    14041414            case RTFS_TYPE_FILE:
    1405                 rc = rtFsIso9660File_New(pShared->Core.pVol, pShared, pDirRec, cDirRecs, offDirRec, fOpen, uVersion, phVfsFile);
     1415                rc = rtFsIsoFile_New9660(pShared->Core.pVol, pShared, pDirRec, cDirRecs, offDirRec, fOpen, uVersion, phVfsFile);
    14061416                break;
    14071417
     
    14311441 * @interface_method_impl{RTVFSDIROPS,pfnOpenDir}
    14321442 */
    1433 static DECLCALLBACK(int) rtFsIso9660Dir_OpenDir(void *pvThis, const char *pszSubDir, uint32_t fFlags, PRTVFSDIR phVfsDir)
    1434 {
    1435     PRTFSISO9660DIROBJ  pThis   = (PRTFSISO9660DIROBJ)pvThis;
    1436     PRTFSISO9660DIRSHRD pShared = pThis->pShared;
     1443static DECLCALLBACK(int) rtFsIsoDir_OpenDir(void *pvThis, const char *pszSubDir, uint32_t fFlags, PRTVFSDIR phVfsDir)
     1444{
     1445    PRTFSISODIROBJ  pThis   = (PRTFSISODIROBJ)pvThis;
     1446    PRTFSISODIRSHRD pShared = pThis->pShared;
    14371447    AssertReturn(!fFlags, VERR_INVALID_FLAGS);
    14381448
     
    14451455    RTFMODE         fMode;
    14461456    uint32_t        uVersion;
    1447     int rc = rtFsIso9660Dir_FindEntry(pShared, pszSubDir, &offDirRec, &pDirRec, &cDirRecs, &fMode, &uVersion);
    1448     Log2(("rtFsIso9660Dir_OpenDir: FindEntry(,%s,) -> %Rrc\n", pszSubDir, rc));
     1457    int rc = rtFsIsoDir_FindEntry(pShared, pszSubDir, &offDirRec, &pDirRec, &cDirRecs, &fMode, &uVersion);
     1458    Log2(("rtFsIsoDir_OpenDir: FindEntry(,%s,) -> %Rrc\n", pszSubDir, rc));
    14491459    if (RT_SUCCESS(rc))
    14501460    {
     
    14521462        {
    14531463            case RTFS_TYPE_DIRECTORY:
    1454                 rc = rtFsIso9660Dir_New(pShared->Core.pVol, pShared, pDirRec, cDirRecs, offDirRec, phVfsDir);
     1464                rc = rtFsIsoDir_New9660(pShared->Core.pVol, pShared, pDirRec, cDirRecs, offDirRec, phVfsDir);
    14551465                break;
    14561466
     
    14771487 * @interface_method_impl{RTVFSDIROPS,pfnCreateDir}
    14781488 */
    1479 static DECLCALLBACK(int) rtFsIso9660Dir_CreateDir(void *pvThis, const char *pszSubDir, RTFMODE fMode, PRTVFSDIR phVfsDir)
     1489static DECLCALLBACK(int) rtFsIsoDir_CreateDir(void *pvThis, const char *pszSubDir, RTFMODE fMode, PRTVFSDIR phVfsDir)
    14801490{
    14811491    RT_NOREF(pvThis, pszSubDir, fMode, phVfsDir);
     
    14871497 * @interface_method_impl{RTVFSDIROPS,pfnOpenSymlink}
    14881498 */
    1489 static DECLCALLBACK(int) rtFsIso9660Dir_OpenSymlink(void *pvThis, const char *pszSymlink, PRTVFSSYMLINK phVfsSymlink)
     1499static DECLCALLBACK(int) rtFsIsoDir_OpenSymlink(void *pvThis, const char *pszSymlink, PRTVFSSYMLINK phVfsSymlink)
    14901500{
    14911501    RT_NOREF(pvThis, pszSymlink, phVfsSymlink);
     
    14981508 * @interface_method_impl{RTVFSDIROPS,pfnCreateSymlink}
    14991509 */
    1500 static DECLCALLBACK(int) rtFsIso9660Dir_CreateSymlink(void *pvThis, const char *pszSymlink, const char *pszTarget,
    1501                                                       RTSYMLINKTYPE enmType, PRTVFSSYMLINK phVfsSymlink)
     1510static DECLCALLBACK(int) rtFsIsoDir_CreateSymlink(void *pvThis, const char *pszSymlink, const char *pszTarget,
     1511                                                  RTSYMLINKTYPE enmType, PRTVFSSYMLINK phVfsSymlink)
    15021512{
    15031513    RT_NOREF(pvThis, pszSymlink, pszTarget, enmType, phVfsSymlink);
     
    15091519 * @interface_method_impl{RTVFSDIROPS,pfnQueryEntryInfo}
    15101520 */
    1511 static DECLCALLBACK(int) rtFsIso9660Dir_QueryEntryInfo(void *pvThis, const char *pszEntry,
    1512                                                        PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr)
     1521static DECLCALLBACK(int) rtFsIsoDir_QueryEntryInfo(void *pvThis, const char *pszEntry,
     1522                                                   PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr)
    15131523{
    15141524    /*
    15151525     * Try locate the entry.
    15161526     */
    1517     PRTFSISO9660DIROBJ  pThis   = (PRTFSISO9660DIROBJ)pvThis;
    1518     PRTFSISO9660DIRSHRD pShared = pThis->pShared;
     1527    PRTFSISODIROBJ      pThis   = (PRTFSISODIROBJ)pvThis;
     1528    PRTFSISODIRSHRD    pShared = pThis->pShared;
    15191529    PCISO9660DIRREC     pDirRec;
    15201530    uint64_t            offDirRec;
     
    15221532    RTFMODE             fMode;
    15231533    uint32_t            uVersion;
    1524     int rc = rtFsIso9660Dir_FindEntry(pShared, pszEntry, &offDirRec, &pDirRec, &cDirRecs, &fMode, &uVersion);
    1525     Log2(("rtFsIso9660Dir_QueryEntryInfo: FindEntry(,%s,) -> %Rrc\n", pszEntry, rc));
     1534    int rc = rtFsIsoDir_FindEntry(pShared, pszEntry, &offDirRec, &pDirRec, &cDirRecs, &fMode, &uVersion);
     1535    Log2(("rtFsIsoDir_QueryEntryInfo: FindEntry(,%s,) -> %Rrc\n", pszEntry, rc));
    15261536    if (RT_SUCCESS(rc))
    15271537    {
    15281538        /*
    1529          * To avoid duplicating code in rtFsIso9660Core_InitFromDirRec and
    1530          * rtFsIso9660Core_QueryInfo, we create a dummy RTFSISO9660CORE on the stack.
     1539         * To avoid duplicating code in rtFsIsoCore_InitFrom9660DirRec and
     1540         * rtFsIsoCore_QueryInfo, we create a dummy RTFSISOCORE on the stack.
    15311541         */
    1532         RTFSISO9660CORE TmpObj;
     1542        RTFSISOCORE TmpObj;
    15331543        RT_ZERO(TmpObj);
    1534         rc = rtFsIso9660Core_InitFromDirRec(&TmpObj, pDirRec, cDirRecs, offDirRec, uVersion, pShared->Core.pVol);
     1544        rc = rtFsIsoCore_InitFrom9660DirRec(&TmpObj, pDirRec, cDirRecs, offDirRec, uVersion, pShared->Core.pVol);
    15351545        if (RT_SUCCESS(rc))
    15361546        {
    1537             rc = rtFsIso9660Core_QueryInfo(&TmpObj, pObjInfo, enmAddAttr);
     1547            rc = rtFsIsoCore_QueryInfo(&TmpObj, pObjInfo, enmAddAttr);
    15381548            RTMemFree(TmpObj.paExtents);
    15391549        }
     
    15461556 * @interface_method_impl{RTVFSDIROPS,pfnUnlinkEntry}
    15471557 */
    1548 static DECLCALLBACK(int) rtFsIso9660Dir_UnlinkEntry(void *pvThis, const char *pszEntry, RTFMODE fType)
     1558static DECLCALLBACK(int) rtFsIsoDir_UnlinkEntry(void *pvThis, const char *pszEntry, RTFMODE fType)
    15491559{
    15501560    RT_NOREF(pvThis, pszEntry, fType);
     
    15561566 * @interface_method_impl{RTVFSDIROPS,pfnRenameEntry}
    15571567 */
    1558 static DECLCALLBACK(int) rtFsIso9660Dir_RenameEntry(void *pvThis, const char *pszEntry, RTFMODE fType, const char *pszNewName)
     1568static DECLCALLBACK(int) rtFsIsoDir_RenameEntry(void *pvThis, const char *pszEntry, RTFMODE fType, const char *pszNewName)
    15591569{
    15601570    RT_NOREF(pvThis, pszEntry, fType, pszNewName);
     
    15661576 * @interface_method_impl{RTVFSDIROPS,pfnRewindDir}
    15671577 */
    1568 static DECLCALLBACK(int) rtFsIso9660Dir_RewindDir(void *pvThis)
    1569 {
    1570     PRTFSISO9660DIROBJ pThis = (PRTFSISO9660DIROBJ)pvThis;
     1578static DECLCALLBACK(int) rtFsIsoDir_RewindDir(void *pvThis)
     1579{
     1580    PRTFSISODIROBJ pThis = (PRTFSISODIROBJ)pvThis;
    15711581    pThis->offDir = 0;
    15721582    return VINF_SUCCESS;
     
    15771587 * @interface_method_impl{RTVFSDIROPS,pfnReadDir}
    15781588 */
    1579 static DECLCALLBACK(int) rtFsIso9660Dir_ReadDir(void *pvThis, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry,
    1580                                                 RTFSOBJATTRADD enmAddAttr)
    1581 {
    1582     PRTFSISO9660DIROBJ  pThis   = (PRTFSISO9660DIROBJ)pvThis;
    1583     PRTFSISO9660DIRSHRD pShared = pThis->pShared;
     1589static DECLCALLBACK(int) rtFsIsoDir_ReadDir(void *pvThis, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry,
     1590                                            RTFSOBJATTRADD enmAddAttr)
     1591{
     1592    PRTFSISODIROBJ  pThis   = (PRTFSISODIROBJ)pvThis;
     1593    PRTFSISODIRSHRD pShared = pThis->pShared;
    15841594
    15851595    while (pThis->offDir + RT_UOFFSETOF(ISO9660DIRREC, achFileId) <= pShared->cbDir)
     
    16021612                {
    16031613                    *pcbDirEntry = RT_UOFFSETOF(RTDIRENTRYEX, szName) + 2;
    1604                     Log3(("rtFsIso9660Dir_ReadDir: VERR_BUFFER_OVERFLOW (dot)\n"));
     1614                    Log3(("rtFsIsoDir_ReadDir: VERR_BUFFER_OVERFLOW (dot)\n"));
    16051615                    return VERR_BUFFER_OVERFLOW;
    16061616                }
     
    16151625                {
    16161626                    *pcbDirEntry = RT_UOFFSETOF(RTDIRENTRYEX, szName) + 3;
    1617                     Log3(("rtFsIso9660Dir_ReadDir: VERR_BUFFER_OVERFLOW (dot-dot)\n"));
     1627                    Log3(("rtFsIsoDir_ReadDir: VERR_BUFFER_OVERFLOW (dot-dot)\n"));
    16181628                    return VERR_BUFFER_OVERFLOW;
    16191629                }
     
    16391649                {
    16401650                    *pcbDirEntry = RT_UOFFSETOF(RTDIRENTRYEX, szName) + cchNeeded + 1;
    1641                     Log3(("rtFsIso9660Dir_ReadDir: VERR_BUFFER_OVERFLOW - cbDst=%zu cchNeeded=%zu (UTF-16BE)\n", cbDst, cchNeeded));
     1651                    Log3(("rtFsIsoDir_ReadDir: VERR_BUFFER_OVERFLOW - cbDst=%zu cchNeeded=%zu (UTF-16BE)\n", cbDst, cchNeeded));
    16421652                    return VERR_BUFFER_OVERFLOW;
    16431653                }
     
    16631673                if (*pcbDirEntry < cbNeeded)
    16641674                {
    1665                     Log3(("rtFsIso9660Dir_ReadDir: VERR_BUFFER_OVERFLOW - cbDst=%zu cbNeeded=%zu (ASCII)\n", *pcbDirEntry, cbNeeded));
     1675                    Log3(("rtFsIsoDir_ReadDir: VERR_BUFFER_OVERFLOW - cbDst=%zu cbNeeded=%zu (ASCII)\n", *pcbDirEntry, cbNeeded));
    16661676                    *pcbDirEntry = cbNeeded;
    16671677                    return VERR_BUFFER_OVERFLOW;
     
    16781688
    16791689            /*
    1680              * To avoid duplicating code in rtFsIso9660Core_InitFromDirRec and
    1681              * rtFsIso9660Core_QueryInfo, we create a dummy RTFSISO9660CORE on the stack.
     1690             * To avoid duplicating code in rtFsIsoCore_InitFrom9660DirRec and
     1691             * rtFsIsoCore_QueryInfo, we create a dummy RTFSISOCORE on the stack.
    16821692             */
    1683             RTFSISO9660CORE TmpObj;
     1693            RTFSISOCORE TmpObj;
    16841694            RT_ZERO(TmpObj);
    1685             rtFsIso9660Core_InitFromDirRec(&TmpObj, pDirRec, 1 /* cDirRecs - see below why 1 */,
     1695            rtFsIsoCore_InitFrom9660DirRec(&TmpObj, pDirRec, 1 /* cDirRecs - see below why 1 */,
    16861696                                           pThis->offDir + pShared->Core.FirstExtent.offDisk, uVersion, pShared->Core.pVol);
    1687             int rc = rtFsIso9660Core_QueryInfo(&TmpObj, &pDirEntry->Info, enmAddAttr);
     1697            int rc = rtFsIsoCore_QueryInfo(&TmpObj, &pDirEntry->Info, enmAddAttr);
    16881698
    16891699            /*
     
    16911701             *
    16921702             * Multi extent records only affect the file size and the directory location,
    1693              * so we deal with it here instead of involving * rtFsIso9660Core_InitFromDirRec
     1703             * so we deal with it here instead of involving * rtFsIsoCore_InitFrom9660DirRec
    16941704             * which would potentially require freeing memory and such.
    16951705             */
    16961706            if (!(pDirRec->fFileFlags & ISO9660_FILE_FLAGS_MULTI_EXTENT))
    16971707            {
    1698                 Log3(("rtFsIso9660Dir_ReadDir: offDir=%#07x: %s (rc=%Rrc)\n", pThis->offDir, pDirEntry->szName, rc));
     1708                Log3(("rtFsIsoDir_ReadDir: offDir=%#07x: %s (rc=%Rrc)\n", pThis->offDir, pDirEntry->szName, rc));
    16991709                pThis->offDir += pDirRec->cbDirRec;
    17001710            }
     
    17171727                        offDir = (offDir + pShared->Core.pVol->cbSector) & ~(pShared->Core.pVol->cbSector - 1U);
    17181728                }
    1719                 Log3(("rtFsIso9660Dir_ReadDir: offDir=%#07x, %u extents ending at %#07x: %s (rc=%Rrc)\n",
     1729                Log3(("rtFsIsoDir_ReadDir: offDir=%#07x, %u extents ending at %#07x: %s (rc=%Rrc)\n",
    17201730                      pThis->offDir, cExtents, offDir, pDirEntry->szName, rc));
    17211731                pThis->offDir = offDir;
     
    17261736    }
    17271737
    1728     Log3(("rtFsIso9660Dir_ReadDir: offDir=%#07x: VERR_NO_MORE_FILES\n", pThis->offDir));
     1738    Log3(("rtFsIsoDir_ReadDir: offDir=%#07x: VERR_NO_MORE_FILES\n", pThis->offDir));
    17291739    return VERR_NO_MORE_FILES;
    17301740}
     
    17341744 * FAT file operations.
    17351745 */
    1736 static const RTVFSDIROPS g_rtFsIso9660DirOps =
     1746static const RTVFSDIROPS g_rtFsIsoDirOps =
    17371747{
    17381748    { /* Obj */
     
    17401750        RTVFSOBJTYPE_DIR,
    17411751        "ISO 9660 Dir",
    1742         rtFsIso9660Dir_Close,
    1743         rtFsIso9660Dir_QueryInfo,
     1752        rtFsIsoDir_Close,
     1753        rtFsIsoDir_QueryInfo,
    17441754        RTVFSOBJOPS_VERSION
    17451755    },
     
    17491759        RTVFSOBJSETOPS_VERSION,
    17501760        RT_OFFSETOF(RTVFSDIROPS, Obj) - RT_OFFSETOF(RTVFSDIROPS, ObjSet),
    1751         rtFsIso9660Dir_SetMode,
    1752         rtFsIso9660Dir_SetTimes,
    1753         rtFsIso9660Dir_SetOwner,
     1761        rtFsIsoDir_SetMode,
     1762        rtFsIsoDir_SetTimes,
     1763        rtFsIsoDir_SetOwner,
    17541764        RTVFSOBJSETOPS_VERSION
    17551765    },
    1756     rtFsIso9660Dir_TraversalOpen,
    1757     rtFsIso9660Dir_OpenFile,
    1758     rtFsIso9660Dir_OpenDir,
    1759     rtFsIso9660Dir_CreateDir,
    1760     rtFsIso9660Dir_OpenSymlink,
    1761     rtFsIso9660Dir_CreateSymlink,
    1762     rtFsIso9660Dir_QueryEntryInfo,
    1763     rtFsIso9660Dir_UnlinkEntry,
    1764     rtFsIso9660Dir_RenameEntry,
    1765     rtFsIso9660Dir_RewindDir,
    1766     rtFsIso9660Dir_ReadDir,
     1766    rtFsIsoDir_TraversalOpen,
     1767    rtFsIsoDir_OpenFile,
     1768    rtFsIsoDir_OpenDir,
     1769    rtFsIsoDir_CreateDir,
     1770    rtFsIsoDir_OpenSymlink,
     1771    rtFsIsoDir_CreateSymlink,
     1772    rtFsIsoDir_QueryEntryInfo,
     1773    rtFsIsoDir_UnlinkEntry,
     1774    rtFsIsoDir_RenameEntry,
     1775    rtFsIsoDir_RewindDir,
     1776    rtFsIsoDir_ReadDir,
    17671777    RTVFSDIROPS_VERSION,
    17681778};
     
    17781788 * @param   pDir        The directory.
    17791789 * @param   pChild      The child being opened.
    1780  * @sa      rtFsIso9660DirShrd_RemoveOpenChild
    1781  */
    1782 static void rtFsIso9660DirShrd_AddOpenChild(PRTFSISO9660DIRSHRD pDir, PRTFSISO9660CORE pChild)
    1783 {
    1784     rtFsIso9660DirShrd_Retain(pDir);
     1790 * @sa      rtFsIsoDirShrd_RemoveOpenChild
     1791 */
     1792static void rtFsIsoDirShrd_AddOpenChild(PRTFSISODIRSHRD pDir, PRTFSISOCORE pChild)
     1793{
     1794    rtFsIsoDirShrd_Retain(pDir);
    17851795
    17861796    RTListAppend(&pDir->OpenChildren, &pChild->Entry);
     
    17981808 *          objects to be released recursively (parent dir and the volume).
    17991809 *
    1800  * @sa      rtFsIso9660DirShrd_AddOpenChild
    1801  */
    1802 static void rtFsIso9660DirShrd_RemoveOpenChild(PRTFSISO9660DIRSHRD pDir, PRTFSISO9660CORE pChild)
     1810 * @sa      rtFsIsoDirShrd_AddOpenChild
     1811 */
     1812static void rtFsIsoDirShrd_RemoveOpenChild(PRTFSISODIRSHRD pDir, PRTFSISOCORE pChild)
    18031813{
    18041814    AssertReturnVoid(pChild->pParentDir == pDir);
     
    18061816    pChild->pParentDir = NULL;
    18071817
    1808     rtFsIso9660DirShrd_Release(pDir);
     1818    rtFsIsoDirShrd_Release(pDir);
    18091819}
    18101820
     
    18141824 * Logs the content of a directory.
    18151825 */
    1816 static void rtFsIso9660DirShrd_LogContent(PRTFSISO9660DIRSHRD pThis)
     1826static void rtFsIsoDirShrd_Log9660Content(PRTFSISODIRSHRD pThis)
    18171827{
    18181828    if (LogIs2Enabled())
     
    18821892
    18831893/**
    1884  * Instantiates a new shared directory structure.
     1894 * Instantiates a new shared directory structure, given 9660 records.
    18851895 *
    18861896 * @returns IPRT status code.
     
    18941904 * @param   ppShared        Where to return the shared directory structure.
    18951905 */
    1896 static int rtFsIso9660DirShrd_New(PRTFSISO9660VOL pThis, PRTFSISO9660DIRSHRD pParentDir, PCISO9660DIRREC pDirRec,
    1897                                   uint32_t cDirRecs, uint64_t offDirRec, PRTFSISO9660DIRSHRD *ppShared)
     1906static int rtFsIsoDirShrd_New9660(PRTFSISOVOL pThis, PRTFSISODIRSHRD pParentDir, PCISO9660DIRREC pDirRec,
     1907                                  uint32_t cDirRecs, uint64_t offDirRec, PRTFSISODIRSHRD *ppShared)
    18981908{
    18991909    /*
     
    19011911     */
    19021912    int rc = VERR_NO_MEMORY;
    1903     PRTFSISO9660DIRSHRD pShared = (PRTFSISO9660DIRSHRD)RTMemAllocZ(sizeof(*pShared));
     1913    PRTFSISODIRSHRD pShared = (PRTFSISODIRSHRD)RTMemAllocZ(sizeof(*pShared));
    19041914    if (pShared)
    19051915    {
    1906         rc = rtFsIso9660Core_InitFromDirRec(&pShared->Core, pDirRec, cDirRecs, offDirRec, 0 /*uVersion*/, pThis);
     1916        rc = rtFsIsoCore_InitFrom9660DirRec(&pShared->Core, pDirRec, cDirRecs, offDirRec, 0 /*uVersion*/, pThis);
    19071917        if (RT_SUCCESS(rc))
    19081918        {
     
    19161926                {
    19171927#ifdef LOG_ENABLED
    1918                     rtFsIso9660DirShrd_LogContent(pShared);
     1928                    rtFsIsoDirShrd_Log9660Content(pShared);
    19191929#endif
    19201930
     
    19241934                     */
    19251935                    if (pParentDir)
    1926                         rtFsIso9660DirShrd_AddOpenChild(pParentDir, &pShared->Core);
     1936                        rtFsIsoDirShrd_AddOpenChild(pParentDir, &pShared->Core);
    19271937                    *ppShared = pShared;
    19281938                    return VINF_SUCCESS;
     
    19461956 * @param   phVfsDir        Where to return the directory handle.
    19471957 */
    1948 static int rtFsIso9660Dir_NewWithShared(PRTFSISO9660VOL pThis, PRTFSISO9660DIRSHRD pShared, PRTVFSDIR phVfsDir)
     1958static int rtFsIsoDir_NewWithShared(PRTFSISOVOL pThis, PRTFSISODIRSHRD pShared, PRTVFSDIR phVfsDir)
    19491959{
    19501960    /*
    19511961     * Create VFS object around the shared structure.
    19521962     */
    1953     PRTFSISO9660DIROBJ pNewDir;
    1954     int rc = RTVfsNewDir(&g_rtFsIso9660DirOps, sizeof(*pNewDir), 0 /*fFlags*/, pThis->hVfsSelf,
     1963    PRTFSISODIROBJ pNewDir;
     1964    int rc = RTVfsNewDir(&g_rtFsIsoDirOps, sizeof(*pNewDir), 0 /*fFlags*/, pThis->hVfsSelf,
    19551965                         NIL_RTVFSLOCK /*use volume lock*/, phVfsDir, (void **)&pNewDir);
    19561966    if (RT_SUCCESS(rc))
     
    19651975    }
    19661976
    1967     rtFsIso9660DirShrd_Release(pShared);
     1977    rtFsIsoDirShrd_Release(pShared);
    19681978    *phVfsDir = NIL_RTVFSDIR;
    19691979    return rc;
     
    19731983
    19741984/**
    1975  * Instantiates a new directory VFS instance, creating the shared structure as
    1976  * necessary.
     1985 * Instantiates a new directory VFS instance for ISO 9660, creating the shared
     1986 * structure as necessary.
    19771987 *
    19781988 * @returns IPRT status code.
     
    19851995 * @param   phVfsDir        Where to return the directory handle.
    19861996 */
    1987 static int  rtFsIso9660Dir_New(PRTFSISO9660VOL pThis, PRTFSISO9660DIRSHRD pParentDir, PCISO9660DIRREC pDirRec,
     1997static int  rtFsIsoDir_New9660(PRTFSISOVOL pThis, PRTFSISODIRSHRD pParentDir, PCISO9660DIRREC pDirRec,
    19881998                               uint32_t cDirRecs, uint64_t offDirRec, PRTVFSDIR phVfsDir)
    19891999{
     
    19912001     * Look for existing shared object, create a new one if necessary.
    19922002     */
    1993     int                 rc      = VINF_SUCCESS;
    1994     PRTFSISO9660DIRSHRD pShared = (PRTFSISO9660DIRSHRD)rtFsIso9660Dir_LookupShared(pParentDir, offDirRec);
     2003    PRTFSISODIRSHRD pShared = (PRTFSISODIRSHRD)rtFsIsoDir_LookupShared(pParentDir, offDirRec);
    19952004    if (!pShared)
    19962005    {
    1997         rc = rtFsIso9660DirShrd_New(pThis, pParentDir, pDirRec, cDirRecs, offDirRec, &pShared);
     2006        int rc = rtFsIsoDirShrd_New9660(pThis, pParentDir, pDirRec, cDirRecs, offDirRec, &pShared);
    19982007        if (RT_FAILURE(rc))
    19992008        {
     
    20022011        }
    20032012    }
    2004     return rtFsIso9660Dir_NewWithShared(pThis, pShared, phVfsDir);
     2013    return rtFsIsoDir_NewWithShared(pThis, pShared, phVfsDir);
    20052014}
    20062015
     
    20102019 * @interface_method_impl{RTVFSOBJOPS::Obj,pfnClose}
    20112020 */
    2012 static DECLCALLBACK(int) rtFsIso9660Vol_Close(void *pvThis)
    2013 {
    2014     PRTFSISO9660VOL pThis = (PRTFSISO9660VOL)pvThis;
    2015     Log(("rtFsIso9660Vol_Close(%p)\n", pThis));
     2021static DECLCALLBACK(int) rtFsIsoVol_Close(void *pvThis)
     2022{
     2023    PRTFSISOVOL pThis = (PRTFSISOVOL)pvThis;
     2024    Log(("rtFsIsoVol_Close(%p)\n", pThis));
    20162025
    20172026    if (pThis->pRootDir)
     
    20192028        Assert(RTListIsEmpty(&pThis->pRootDir->OpenChildren));
    20202029        Assert(pThis->pRootDir->Core.cRefs == 1);
    2021         rtFsIso9660DirShrd_Release(pThis->pRootDir);
     2030        rtFsIsoDirShrd_Release(pThis->pRootDir);
    20222031        pThis->pRootDir = NULL;
    20232032    }
     
    20332042 * @interface_method_impl{RTVFSOBJOPS::Obj,pfnQueryInfo}
    20342043 */
    2035 static DECLCALLBACK(int) rtFsIso9660Vol_QueryInfo(void *pvThis, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr)
     2044static DECLCALLBACK(int) rtFsIsoVol_QueryInfo(void *pvThis, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr)
    20362045{
    20372046    RT_NOREF(pvThis, pObjInfo, enmAddAttr);
     
    20432052 * @interface_method_impl{RTVFSOPS,pfnOpenRoo}
    20442053 */
    2045 static DECLCALLBACK(int) rtFsIso9660Vol_OpenRoot(void *pvThis, PRTVFSDIR phVfsDir)
    2046 {
    2047     PRTFSISO9660VOL pThis = (PRTFSISO9660VOL)pvThis;
    2048 
    2049     rtFsIso9660DirShrd_Retain(pThis->pRootDir); /* consumed by the next call */
    2050     return rtFsIso9660Dir_NewWithShared(pThis, pThis->pRootDir, phVfsDir);
     2054static DECLCALLBACK(int) rtFsIsoVol_OpenRoot(void *pvThis, PRTVFSDIR phVfsDir)
     2055{
     2056    PRTFSISOVOL pThis = (PRTFSISOVOL)pvThis;
     2057
     2058    rtFsIsoDirShrd_Retain(pThis->pRootDir); /* consumed by the next call */
     2059    return rtFsIsoDir_NewWithShared(pThis, pThis->pRootDir, phVfsDir);
    20512060}
    20522061
     
    20552064 * @interface_method_impl{RTVFSOPS,pfnIsRangeInUse}
    20562065 */
    2057 static DECLCALLBACK(int) rtFsIso9660Vol_IsRangeInUse(void *pvThis, RTFOFF off, size_t cb, bool *pfUsed)
     2066static DECLCALLBACK(int) rtFsIsoVol_IsRangeInUse(void *pvThis, RTFOFF off, size_t cb, bool *pfUsed)
    20582067{
    20592068    RT_NOREF(pvThis, off, cb, pfUsed);
     
    20622071
    20632072
    2064 DECL_HIDDEN_CONST(const RTVFSOPS) g_rtFsIso9660VolOps =
     2073DECL_HIDDEN_CONST(const RTVFSOPS) g_rtFsIsoVolOps =
    20652074{
    20662075    { /* Obj */
    20672076        RTVFSOBJOPS_VERSION,
    20682077        RTVFSOBJTYPE_VFS,
    2069         "ISO 9660",
    2070         rtFsIso9660Vol_Close,
    2071         rtFsIso9660Vol_QueryInfo,
     2078        "ISO 9660/UDF",
     2079        rtFsIsoVol_Close,
     2080        rtFsIsoVol_QueryInfo,
    20722081        RTVFSOBJOPS_VERSION
    20732082    },
    20742083    RTVFSOPS_VERSION,
    20752084    0 /* fFeatures */,
    2076     rtFsIso9660Vol_OpenRoot,
    2077     rtFsIso9660Vol_IsRangeInUse,
     2085    rtFsIsoVol_OpenRoot,
     2086    rtFsIsoVol_IsRangeInUse,
    20782087    RTVFSOPS_VERSION
    20792088};
    20802089
    20812090
     2091static int rtFsIsoVolValidateUdfDescTag(PCUDFTAG pTag, uint16_t idTag, uint32_t offTag, PRTERRINFO pErrInfo)
     2092{
     2093    /*
     2094     * Checksum the tag first.
     2095     */
     2096    const uint8_t *pbTag     = (const uint8_t *)pTag;
     2097    uint8_t const  bChecksum = pbTag[0]
     2098                             + pbTag[1]
     2099                             + pbTag[2]
     2100                             + pbTag[3]
     2101                             + pbTag[5] /* skipping byte 4 as that's the checksum. */
     2102                             + pbTag[6]
     2103                             + pbTag[7]
     2104                             + pbTag[8]
     2105                             + pbTag[9]
     2106                             + pbTag[10]
     2107                             + pbTag[11]
     2108                             + pbTag[12]
     2109                             + pbTag[13]
     2110                             + pbTag[14]
     2111                             + pbTag[15];
     2112    if (pTag->uChecksum == bChecksum)
     2113    {
     2114        /*
     2115         * Do the matching.
     2116         */
     2117        if (   pTag->uVersion == 3
     2118            || pTag->uVersion == 2)
     2119        {
     2120            if (   pTag->idTag == idTag
     2121                || idTag == UINT16_MAX)
     2122            {
     2123                if (pTag->offTag == offTag)
     2124                    return VINF_SUCCESS;
     2125
     2126                Log(("rtFsIsoVolValidateUdfDescTag(,%#x,%#010RX32,): Sector mismatch: %#RX32 (%.*Rhxs)\n",
     2127                     idTag, offTag, pTag->offTag, sizeof(*pTag), pTag));
     2128                return RTErrInfoSetF(pErrInfo, VERR_MISMATCH, "Descriptor tag sector number mismatch: %#x, expected %#x (%.*Rhxs)",
     2129                                     pTag->offTag, offTag, sizeof(*pTag), pTag);
     2130            }
     2131            Log(("rtFsIsoVolValidateUdfDescTag(,%#x,%#010RX32,): Tag ID mismatch: %#x (%.*Rhxs)\n",
     2132                 idTag, offTag, pTag->idTag, sizeof(*pTag), pTag));
     2133            return RTErrInfoSetF(pErrInfo, VERR_MISMATCH, "Descriptor tag ID mismatch: %#x, expected %#x (%.*Rhxs)",
     2134                                 pTag->idTag, idTag, sizeof(*pTag), pTag);
     2135        }
     2136        Log(("rtFsIsoVolValidateUdfDescTag(,%#x,%#010RX32,): Unsupported version: %#x (%.*Rhxs)\n",
     2137             idTag, offTag, pTag->uVersion, sizeof(*pTag), pTag));
     2138        return RTErrInfoSetF(pErrInfo, VERR_MISMATCH, "Unsupported descriptor tag version: %#x, expected 2 or 3 (%.*Rhxs)",
     2139                             pTag->uVersion, sizeof(*pTag), pTag);
     2140    }
     2141    Log(("rtFsIsoVolValidateUdfDescTag(,%#x,%#010RX32,): checksum error: %#x, calc %#x (%.*Rhxs)\n",
     2142         idTag, offTag, pTag->uChecksum, bChecksum, sizeof(*pTag), pTag));
     2143    return RTErrInfoSetF(pErrInfo, VERR_MISMATCH,
     2144                         "Descriptor tag checksum error: %#x, calculated %#x (%.*Rhxs)",
     2145                         pTag->uChecksum, bChecksum, sizeof(*pTag), pTag);
     2146}
     2147
     2148typedef struct RTFSISOSEENSEQENCES
     2149{
     2150    /** Number of sequences we've seen thus far. */
     2151    uint32_t cSequences;
     2152    /** The per sequence data. */
     2153    struct
     2154    {
     2155        uint64_t off;   /**< Byte offset of the sequence. */
     2156        uint32_t cb;    /**< Size of the sequence. */
     2157    } aSequences[8];
     2158} RTFSISOSEENSEQENCES;
     2159typedef RTFSISOSEENSEQENCES *PRTFSISOSEENSEQENCES;
     2160
     2161
     2162/**
     2163 * Process a VDS sequence, recursively dealing with volume descriptor pointers.
     2164 *
     2165 * @returns
     2166 * @param   pThis           .
     2167 * @param   offSeq          .
     2168 * @param   cbSeq           .
     2169 * @param   pbBuf           .
     2170 * @param   cbBuf           .
     2171 * @param   cNestings       The VDS nesting depth.
     2172 * @param   pErrInfo        .
     2173 */
     2174static int rtFsIsoVolReadAndProcessUdfVdsSeq(PRTFSISOVOL pThis, uint64_t offSeq, uint32_t cbSeq, uint8_t *pbBuf, size_t cbBuf,
     2175                                             uint32_t cNestings, PRTERRINFO pErrInfo)
     2176{
     2177    Assert(cbBuf >= _2K);
     2178
     2179    /*
     2180     * Check nesting depth.
     2181     */
     2182    if (cNestings > 5)
     2183        return RTErrInfoSet(pErrInfo, VERR_TOO_MUCH_DATA, "The volume descriptor sequence (VDS) is nested too deeply.");
     2184
     2185
     2186    /*
     2187     * Do the processing sector by sector to keep things simple.
     2188     */
     2189    uint32_t offInSeq = 0;
     2190    while (offInSeq < cbSeq)
     2191    {
     2192        int rc;
     2193
     2194        /*
     2195         * Read the next sector.  Zero pad if less that a sector.
     2196         */
     2197        Assert((offInSeq & (pThis->cbSector - 1)) == 0);
     2198        rc = RTVfsFileReadAt(pThis->hVfsBacking, offSeq + offInSeq, pbBuf, pThis->cbSector, NULL);
     2199        if (RT_FAILURE(rc))
     2200            return RTErrInfoSetF(pErrInfo, rc, "Error reading VDS content at %RX64 (LB %#x): %Rrc",
     2201                                 offSeq + offInSeq, pThis->cbSector, rc);
     2202        if (cbSeq - offInSeq < pThis->cbSector)
     2203            memset(&pbBuf[cbSeq - offInSeq], 0, pThis->cbSector - (cbSeq - offInSeq));
     2204
     2205        /*
     2206         * Check tag.
     2207         */
     2208        PCUDFTAG pTag = (PCUDFTAG)pbBuf;
     2209        rc = rtFsIsoVolValidateUdfDescTag(pTag, UINT16_MAX, (offSeq + offInSeq) / pThis->cbSector, pErrInfo);
     2210        if (RT_FAILURE(rc))
     2211            return rc;
     2212
     2213        switch (pTag->idTag)
     2214        {
     2215            case UDF_TAG_ID_PRIMARY_VOL_DESC:                 /* UDFPRIMARYVOLUMEDESC */
     2216                break;
     2217            case UDF_TAG_ID_ANCHOR_VOLUME_DESC_PTR:           /* UDFANCHORVOLUMEDESCPTR */
     2218                break;
     2219            case UDF_TAG_ID_VOLUME_DESC_PTR:                  /* UDFVOLUMEDESCPTR */
     2220                break;
     2221            case UDF_TAG_ID_IMPLEMENATION_USE_VOLUME_DESC:    /* UDFIMPLEMENTATIONUSEVOLUMEDESC */
     2222                break;
     2223            case UDF_TAG_ID_PARTITION_DESC:                   /* UDFPARTITIONDESC */
     2224                break;
     2225            case UDF_TAG_ID_LOGICAL_VOLUME_DESC:              /* UDFLOGICALVOLUMEDESC */
     2226                break;
     2227            case UDF_TAG_ID_UNALLOCATED_SPACE_DESC:           /* UDFUNALLOCATEDSPACEDESC */
     2228                break;
     2229            case UDF_TAG_ID_TERMINATING_DESC:                 /* UDFTERMINATINGDESC */
     2230                break;
     2231            case UDF_TAG_ID_LOGICAL_VOLUME_INTEGRITY_DESC:    /* UDFLOGICALVOLINTEGRITYDESC */
     2232                break;
     2233
     2234        }
     2235
     2236        /*
     2237         * Advance.
     2238         */
     2239        offInSeq += pThis->cbSector;
     2240    }
     2241
     2242    return VINF_SUCCESS;
     2243}
     2244
     2245
     2246
     2247/**
     2248 * Processes a volume descriptor sequence (VDS).
     2249 *
     2250 * @returns IPRT status code.
     2251 * @param   pThis           The instance.
     2252 * @param   offSeq          The byte offset of the sequence.
     2253 * @param   cbSeq           The length of the sequence.
     2254 * @param   pSeenSequences  Structure where to keep track of VDSes we've already
     2255 *                          processed, to avoid redoing one that we don't
     2256 *                          understand.
     2257 * @param   pbBuf           Read buffer.
     2258 * @param   cbBuf           Size of the read buffer.  This is at least one
     2259 *                          sector big.
     2260 * @param   pErrInfo        Where to report extended error information.
     2261 */
     2262static int rtFsIsoVolReadAndProcessUdfVds(PRTFSISOVOL pThis, uint64_t offSeq, uint32_t cbSeq,
     2263                                          PRTFSISOSEENSEQENCES pSeenSequences, uint8_t *pbBuf, size_t cbBuf,
     2264                                          PRTERRINFO pErrInfo)
     2265{
     2266    /*
     2267     * Skip if already seen.
     2268     */
     2269    uint32_t i = pSeenSequences->cSequences;
     2270    while (i-- > 0)
     2271        if (   pSeenSequences->aSequences[i].off == offSeq
     2272            && pSeenSequences->aSequences[i].cb  == cbSeq)
     2273            return VERR_NOT_FOUND;
     2274
     2275    /* Not seen, so add it. */
     2276    Assert(pSeenSequences->cSequences + 1 <= RT_ELEMENTS(pSeenSequences->aSequences));
     2277    pSeenSequences->aSequences[pSeenSequences->cSequences].cb = cbSeq;
     2278    pSeenSequences->aSequences[pSeenSequences->cSequences].off = offSeq;
     2279    pSeenSequences->cSequences++;
     2280
     2281    LogFlow(("ISO/UDF: Processing anchor volume descriptor sequence at %#RX64 LB %#RX32\n", offSeq, cbSeq));
     2282
     2283    /*
     2284     * Reset the state before we start processing the descriptors.
     2285     */
     2286
     2287    NOREF(pThis); NOREF(pbBuf); NOREF(cbBuf); NOREF(pErrInfo);
     2288    return VINF_SUCCESS;
     2289}
     2290
     2291
     2292static int rtFsIsoVolReadAndHandleUdfAvdp(PRTFSISOVOL pThis, uint64_t offAvdp, uint8_t *pbBuf, size_t cbBuf,
     2293                                          PRTFSISOSEENSEQENCES pSeenSequences, PRTERRINFO pErrInfo)
     2294{
     2295    /*
     2296     * Try read the descriptor and validate its tag.
     2297     */
     2298    PUDFANCHORVOLUMEDESCPTR pAvdp = (PUDFANCHORVOLUMEDESCPTR)pbBuf;
     2299    size_t cbAvdpRead = RT_MIN(pThis->cbSector, cbBuf);
     2300    int rc = RTVfsFileReadAt(pThis->hVfsBacking, offAvdp, pAvdp, cbAvdpRead, NULL);
     2301    if (RT_SUCCESS(rc))
     2302    {
     2303        rc = rtFsIsoVolValidateUdfDescTag(&pAvdp->Tag, UDF_TAG_ID_ANCHOR_VOLUME_DESC_PTR, offAvdp / pThis->cbSector, pErrInfo);
     2304        if (RT_SUCCESS(rc))
     2305        {
     2306            Log2(("ISO/UDF: AVDP: MainVolumeDescSeq=%#RX32 LB %#RX32, ReserveVolumeDescSeq=%#RX32 LB %#RX32\n",
     2307                  pAvdp->MainVolumeDescSeq.off, pAvdp->MainVolumeDescSeq.cb,
     2308                  pAvdp->ReserveVolumeDescSeq.off, pAvdp->ReserveVolumeDescSeq.cb));
     2309
     2310            /*
     2311             * Try the main sequence if it looks sane.
     2312             */
     2313            UDFEXTENTAD const ReserveVolumeDescSeq = pAvdp->ReserveVolumeDescSeq;
     2314            if (   pAvdp->MainVolumeDescSeq.off < pThis->cBackingSectors
     2315                &&     (uint64_t)pAvdp->MainVolumeDescSeq.off
     2316                     + (pAvdp->MainVolumeDescSeq.cb + pThis->cbSector - 1) / pThis->cbSector
     2317                   <= pThis->cBackingSectors)
     2318            {
     2319                rc = rtFsIsoVolReadAndProcessUdfVds(pThis, (uint64_t)pAvdp->MainVolumeDescSeq.off * pThis->cbSector,
     2320                                                    pAvdp->MainVolumeDescSeq.cb, pSeenSequences, pbBuf, cbBuf, pErrInfo);
     2321                if (RT_SUCCESS(rc))
     2322                    return rc;
     2323            }
     2324            else
     2325                rc = RTErrInfoSetF(pErrInfo, VERR_NOT_FOUND,
     2326                                   "MainVolumeDescSeq is out of bounds: sector %#RX32 LB %#RX32 bytes, image is %#RX64 sectors",
     2327                                   pAvdp->MainVolumeDescSeq.off, pAvdp->MainVolumeDescSeq.cb, pThis->cBackingSectors);
     2328            if (ReserveVolumeDescSeq.cb > 0)
     2329            {
     2330                if (   ReserveVolumeDescSeq.off < pThis->cBackingSectors
     2331                    &&     (uint64_t)ReserveVolumeDescSeq.off
     2332                         + (ReserveVolumeDescSeq.cb + pThis->cbSector - 1) / pThis->cbSector
     2333                       <= pThis->cBackingSectors)
     2334                {
     2335                    rc = rtFsIsoVolReadAndProcessUdfVds(pThis, (uint64_t)ReserveVolumeDescSeq.off * pThis->cbSector,
     2336                                                        ReserveVolumeDescSeq.cb, pSeenSequences, pbBuf, cbBuf, pErrInfo);
     2337                    if (RT_SUCCESS(rc))
     2338                        return rc;
     2339                }
     2340                else if (RT_SUCCESS(rc))
     2341                    rc = RTErrInfoSetF(pErrInfo, VERR_NOT_FOUND,
     2342                                       "ReserveVolumeDescSeq is out of bounds: sector %#RX32 LB %#RX32 bytes, image is %#RX64 sectors",
     2343                                       ReserveVolumeDescSeq.off, ReserveVolumeDescSeq.cb, pThis->cBackingSectors);
     2344            }
     2345        }
     2346    }
     2347    else
     2348        rc = RTErrInfoSetF(pErrInfo, rc,
     2349                           "Error reading sector at offset %#RX64 (anchor volume descriptor pointer): %Rrc", offAvdp, rc);
     2350
     2351    return rc;
     2352}
     2353
     2354
     2355/**
     2356 * Goes looking for UDF when we've seens a volume recognition sequence.
     2357 *
     2358 * @returns IPRT status code.
     2359 * @param   pThis               The volume instance data.
     2360 * @param   puUdfLevel          The UDF level indicated by the VRS.
     2361 * @param   offUdfBootVolDesc   The offset of the BOOT2 descriptor, UINT64_MAX
     2362 *                              if not encountered.
     2363 * @param   pbBuf               Buffer for reading into.
     2364 * @param   cbBuf               The size of the buffer.  At least one sector.
     2365 * @param   pErrInfo            Where to return extended error info.
     2366 */
     2367static int rtFsIsoVolHandleUdfDetection(PRTFSISOVOL pThis, uint8_t *puUdfLevel, uint64_t offUdfBootVolDesc,
     2368                                        uint8_t *pbBuf, size_t cbBuf, PRTERRINFO pErrInfo)
     2369{
     2370    NOREF(offUdfBootVolDesc);
     2371
     2372    /*
     2373     * There are up to three anchor volume descriptor pointers that can give us
     2374     * two different descriptor sequences each.  Usually, the different AVDP
     2375     * structures points to the same two sequences.  The idea here is that
     2376     * sectors may deteriorate and become unreadable, and we're supposed to try
     2377     * out alternative sectors to get the job done.  If we really took this
     2378     * seriously, we could try read all sequences in parallel and use the
     2379     * sectors that are good.  However, we'll try keep things reasonably simple
     2380     * since we'll most likely be reading from hard disks rather than optical
     2381     * media.
     2382     *
     2383     * We keep track of which sequences we've processed so we don't try to do it
     2384     * again when alternative AVDP sectors points to the same sequences.
     2385     */
     2386    RTFSISOSEENSEQENCES SeenSequences = { 0 };
     2387    int rc = rtFsIsoVolReadAndHandleUdfAvdp(pThis, 256 * pThis->cbSector, pbBuf, cbBuf,
     2388                                            &SeenSequences, pErrInfo);
     2389    if (RT_FAILURE(rc))
     2390        rc = rtFsIsoVolReadAndHandleUdfAvdp(pThis,  pThis->cbBacking - 256 * pThis->cbSector,
     2391                                            pbBuf, cbBuf, &SeenSequences, pErrInfo);
     2392    if (RT_FAILURE(rc))
     2393        rc = rtFsIsoVolReadAndHandleUdfAvdp(pThis,  pThis->cbBacking - pThis->cbSector,
     2394                                            pbBuf, cbBuf, &SeenSequences, pErrInfo);
     2395    if (RT_SUCCESS(rc))
     2396        return rc;
     2397    *puUdfLevel = 0;
     2398    return VINF_SUCCESS;
     2399}
     2400
     2401
    20822402
    20832403#ifdef LOG_ENABLED
    20842404
    20852405/** Logging helper. */
    2086 static size_t rtFsIso9660VolGetStrippedLength(const char *pachField, size_t cchField)
     2406static size_t rtFsIsoVolGetStrippedLength(const char *pachField, size_t cchField)
    20872407{
    20882408    while (cchField > 0 && pachField[cchField - 1] == ' ')
     
    20922412
    20932413/** Logging helper. */
    2094 static char *rtFsIso9660VolGetMaybeUtf16Be(const char *pachField, size_t cchField, char *pszDst, size_t cbDst)
     2414static char *rtFsIsoVolGetMaybeUtf16Be(const char *pachField, size_t cchField, char *pszDst, size_t cbDst)
    20952415{
    20962416    /* Check the format by looking for zero bytes.  ISO-9660 doesn't allow zeros.
     
    22022522 * @param   pVolDesc            The descriptor.
    22032523 */
    2204 static void rtFsIso9660VolLogPrimarySupplementaryVolDesc(PCISO9660SUPVOLDESC pVolDesc)
     2524static void rtFsIsoVolLogPrimarySupplementaryVolDesc(PCISO9660SUPVOLDESC pVolDesc)
    22052525{
    22062526    if (LogIs2Enabled())
     
    22082528        char szTmp[384];
    22092529        Log2(("ISO9660:  fVolumeFlags:              %#RX8\n", pVolDesc->fVolumeFlags));
    2210         Log2(("ISO9660:  achSystemId:               %s\n", rtFsIso9660VolGetMaybeUtf16Be(pVolDesc->achSystemId, sizeof(pVolDesc->achSystemId), szTmp, sizeof(szTmp)) ));
    2211         Log2(("ISO9660:  achVolumeId:               %s\n", rtFsIso9660VolGetMaybeUtf16Be(pVolDesc->achVolumeId, sizeof(pVolDesc->achVolumeId), szTmp, sizeof(szTmp)) ));
     2530        Log2(("ISO9660:  achSystemId:               %s\n", rtFsIsoVolGetMaybeUtf16Be(pVolDesc->achSystemId, sizeof(pVolDesc->achSystemId), szTmp, sizeof(szTmp)) ));
     2531        Log2(("ISO9660:  achVolumeId:               %s\n", rtFsIsoVolGetMaybeUtf16Be(pVolDesc->achVolumeId, sizeof(pVolDesc->achVolumeId), szTmp, sizeof(szTmp)) ));
    22122532        Log2(("ISO9660:  Unused73:                  {%#RX32,%#RX32}\n", RT_BE2H_U32(pVolDesc->Unused73.be), RT_LE2H_U32(pVolDesc->Unused73.le)));
    22132533        Log2(("ISO9660:  VolumeSpaceSize:           {%#RX32,%#RX32}\n", RT_BE2H_U32(pVolDesc->VolumeSpaceSize.be), RT_LE2H_U32(pVolDesc->VolumeSpaceSize.le)));
    2214         Log2(("ISO9660:  abEscapeSequences:         '%.*s'\n", rtFsIso9660VolGetStrippedLength((char *)pVolDesc->abEscapeSequences, sizeof(pVolDesc->abEscapeSequences)), pVolDesc->abEscapeSequences));
     2534        Log2(("ISO9660:  abEscapeSequences:         '%.*s'\n", rtFsIsoVolGetStrippedLength((char *)pVolDesc->abEscapeSequences, sizeof(pVolDesc->abEscapeSequences)), pVolDesc->abEscapeSequences));
    22152535        Log2(("ISO9660:  cVolumesInSet:             {%#RX16,%#RX16}\n", RT_BE2H_U16(pVolDesc->cVolumesInSet.be), RT_LE2H_U16(pVolDesc->cVolumesInSet.le)));
    22162536        Log2(("ISO9660:  VolumeSeqNo:               {%#RX16,%#RX16}\n", RT_BE2H_U16(pVolDesc->VolumeSeqNo.be), RT_LE2H_U16(pVolDesc->VolumeSeqNo.le)));
     
    22212541        Log2(("ISO9660:  offTypeMPathTable:         %#RX32\n", RT_BE2H_U32(pVolDesc->offTypeMPathTable)));
    22222542        Log2(("ISO9660:  offOptionalTypeMPathTable: %#RX32\n", RT_BE2H_U32(pVolDesc->offOptionalTypeMPathTable)));
    2223         Log2(("ISO9660:  achVolumeSetId:            %s\n", rtFsIso9660VolGetMaybeUtf16Be(pVolDesc->achVolumeSetId, sizeof(pVolDesc->achVolumeSetId), szTmp, sizeof(szTmp)) ));
    2224         Log2(("ISO9660:  achPublisherId:            %s\n", rtFsIso9660VolGetMaybeUtf16Be(pVolDesc->achPublisherId, sizeof(pVolDesc->achPublisherId), szTmp, sizeof(szTmp)) ));
    2225         Log2(("ISO9660:  achDataPreparerId:         %s\n", rtFsIso9660VolGetMaybeUtf16Be(pVolDesc->achDataPreparerId, sizeof(pVolDesc->achDataPreparerId), szTmp, sizeof(szTmp)) ));
    2226         Log2(("ISO9660:  achApplicationId:          %s\n", rtFsIso9660VolGetMaybeUtf16Be(pVolDesc->achApplicationId, sizeof(pVolDesc->achApplicationId), szTmp, sizeof(szTmp)) ));
    2227         Log2(("ISO9660:  achCopyrightFileId:        %s\n", rtFsIso9660VolGetMaybeUtf16Be(pVolDesc->achCopyrightFileId, sizeof(pVolDesc->achCopyrightFileId), szTmp, sizeof(szTmp)) ));
    2228         Log2(("ISO9660:  achAbstractFileId:         %s\n", rtFsIso9660VolGetMaybeUtf16Be(pVolDesc->achAbstractFileId, sizeof(pVolDesc->achAbstractFileId), szTmp, sizeof(szTmp)) ));
    2229         Log2(("ISO9660:  achBibliographicFileId:    %s\n", rtFsIso9660VolGetMaybeUtf16Be(pVolDesc->achBibliographicFileId, sizeof(pVolDesc->achBibliographicFileId), szTmp, sizeof(szTmp)) ));
     2543        Log2(("ISO9660:  achVolumeSetId:            %s\n", rtFsIsoVolGetMaybeUtf16Be(pVolDesc->achVolumeSetId, sizeof(pVolDesc->achVolumeSetId), szTmp, sizeof(szTmp)) ));
     2544        Log2(("ISO9660:  achPublisherId:            %s\n", rtFsIsoVolGetMaybeUtf16Be(pVolDesc->achPublisherId, sizeof(pVolDesc->achPublisherId), szTmp, sizeof(szTmp)) ));
     2545        Log2(("ISO9660:  achDataPreparerId:         %s\n", rtFsIsoVolGetMaybeUtf16Be(pVolDesc->achDataPreparerId, sizeof(pVolDesc->achDataPreparerId), szTmp, sizeof(szTmp)) ));
     2546        Log2(("ISO9660:  achApplicationId:          %s\n", rtFsIsoVolGetMaybeUtf16Be(pVolDesc->achApplicationId, sizeof(pVolDesc->achApplicationId), szTmp, sizeof(szTmp)) ));
     2547        Log2(("ISO9660:  achCopyrightFileId:        %s\n", rtFsIsoVolGetMaybeUtf16Be(pVolDesc->achCopyrightFileId, sizeof(pVolDesc->achCopyrightFileId), szTmp, sizeof(szTmp)) ));
     2548        Log2(("ISO9660:  achAbstractFileId:         %s\n", rtFsIsoVolGetMaybeUtf16Be(pVolDesc->achAbstractFileId, sizeof(pVolDesc->achAbstractFileId), szTmp, sizeof(szTmp)) ));
     2549        Log2(("ISO9660:  achBibliographicFileId:    %s\n", rtFsIsoVolGetMaybeUtf16Be(pVolDesc->achBibliographicFileId, sizeof(pVolDesc->achBibliographicFileId), szTmp, sizeof(szTmp)) ));
    22302550        Log2(("ISO9660:  BirthTime:                 %.4s-%.2s-%.2s %.2s:%.2s:%.2s.%.2s%+03d\n",
    22312551              pVolDesc->BirthTime.achYear,
     
    23062626 * @param   pErrInfo        Where to return additional error info.  Can be NULL.
    23072627 */
    2308 static int rtFsIso9660VolHandleRootDir(PRTFSISO9660VOL pThis, PCISO9660DIRREC pRootDir,
    2309                                        PISO9660DIRREC pDstRootDir, PRTERRINFO pErrInfo)
     2628static int rtFsIsoVolHandleRootDir(PRTFSISOVOL pThis, PCISO9660DIRREC pRootDir,
     2629                                   PISO9660DIRREC pDstRootDir, PRTERRINFO pErrInfo)
    23102630{
    23112631    if (pRootDir->cbDirRec < RT_OFFSETOF(ISO9660DIRREC, achFileId))
     
    23572677 * @param   pErrInfo        Where to return additional error info.  Can be NULL.
    23582678 */
    2359 static int rtFsIso9660VolHandlePrimaryVolDesc(PRTFSISO9660VOL pThis, PCISO9660PRIMARYVOLDESC pVolDesc, uint32_t offVolDesc,
    2360                                               PISO9660DIRREC pRootDir, uint64_t *poffRootDirRec, PRTERRINFO pErrInfo)
     2679static int rtFsIsoVolHandlePrimaryVolDesc(PRTFSISOVOL pThis, PCISO9660PRIMARYVOLDESC pVolDesc, uint32_t offVolDesc,
     2680                                          PISO9660DIRREC pRootDir, uint64_t *poffRootDirRec, PRTERRINFO pErrInfo)
    23612681{
    23622682    if (pVolDesc->bFileStructureVersion != ISO9660_FILE_STRUCTURE_VERSION)
     
    24122732     */
    24132733    *poffRootDirRec = offVolDesc + RT_OFFSETOF(ISO9660PRIMARYVOLDESC, RootDir.DirRec);
    2414     return rtFsIso9660VolHandleRootDir(pThis, &pVolDesc->RootDir.DirRec, pRootDir, pErrInfo);
     2734    return rtFsIsoVolHandleRootDir(pThis, &pVolDesc->RootDir.DirRec, pRootDir, pErrInfo);
    24152735}
    24162736
     
    24302750 * @param   pErrInfo        Where to return additional error info.  Can be NULL.
    24312751 */
    2432 static int rtFsIso9660VolHandleSupplementaryVolDesc(PRTFSISO9660VOL pThis, PCISO9660SUPVOLDESC pVolDesc, uint32_t offVolDesc,
    2433                                                     uint8_t *pbUcs2Level, PISO9660DIRREC pRootDir, uint64_t *poffRootDirRec,
    2434                                                     PRTERRINFO pErrInfo)
     2752static int rtFsIsoVolHandleSupplementaryVolDesc(PRTFSISOVOL pThis, PCISO9660SUPVOLDESC pVolDesc, uint32_t offVolDesc,
     2753                                                uint8_t *pbUcs2Level, PISO9660DIRREC pRootDir, uint64_t *poffRootDirRec,
     2754                                                PRTERRINFO pErrInfo)
    24352755{
    24362756    if (pVolDesc->bFileStructureVersion != ISO9660_FILE_STRUCTURE_VERSION)
     
    24852805     * Switch to the joliet root dir as it has UTF-16 stuff in it.
    24862806     */
    2487     int rc = rtFsIso9660VolHandleRootDir(pThis, &pVolDesc->RootDir.DirRec, pRootDir, pErrInfo);
     2807    int rc = rtFsIsoVolHandleRootDir(pThis, &pVolDesc->RootDir.DirRec, pRootDir, pErrInfo);
    24882808    if (RT_SUCCESS(rc))
    24892809    {
     
    25022822 *
    25032823 * @returns IPRT status code.
    2504  * @param   pThis           The FAT VFS instance to initialize.
    2505  * @param   hVfsSelf        The FAT VFS handle (no reference consumed).
     2824 * @param   pThis           The ISO VFS instance to initialize.
     2825 * @param   hVfsSelf        The ISO VFS handle (no reference consumed).
    25062826 * @param   hVfsBacking     The file backing the alleged FAT file system.
    2507  *                          Reference is consumed (via rtFsIso9660Vol_Close).
    2508  * @param   fFlags          Flags, MBZ.
     2827 *                          Reference is consumed (via rtFsIsoVol_Close).
     2828 * @param   fFlags          Flags, RTFSISO9660_F_XXX.
    25092829 * @param   pErrInfo        Where to return additional error info.  Can be NULL.
    25102830 */
    2511 static int rtFsIso9660VolTryInit(PRTFSISO9660VOL pThis, RTVFS hVfsSelf, RTVFSFILE hVfsBacking, uint32_t fFlags, PRTERRINFO pErrInfo)
     2831static int rtFsIsoVolTryInit(PRTFSISOVOL pThis, RTVFS hVfsSelf, RTVFSFILE hVfsBacking, uint32_t fFlags, PRTERRINFO pErrInfo)
    25122832{
    25132833    uint32_t const cbSector = 2048;
    25142834
    25152835    /*
    2516      * First initialize the state so that rtFsIso9660Vol_Destroy won't trip up.
     2836     * First initialize the state so that rtFsIsoVol_Destroy won't trip up.
    25172837     */
    25182838    pThis->hVfsSelf                     = hVfsSelf;
    2519     pThis->hVfsBacking                  = hVfsBacking; /* Caller referenced it for us, we consume it; rtFsIso9660Vol_Destroy releases it. */
     2839    pThis->hVfsBacking                  = hVfsBacking; /* Caller referenced it for us, we consume it; rtFsIsoVol_Destroy releases it. */
    25202840    pThis->cbBacking                    = 0;
     2841    pThis->cBackingSectors              = 0;
    25212842    pThis->fFlags                       = fFlags;
    25222843    pThis->cbSector                     = cbSector;
     
    25332854     */
    25342855    int rc = RTVfsFileGetSize(hVfsBacking, &pThis->cbBacking);
    2535     if (RT_FAILURE(rc))
     2856    if (RT_SUCCESS(rc))
     2857        pThis->cBackingSectors = pThis->cbBacking / pThis->cbSector;
     2858    else
    25362859        return rc;
    25372860
     
    26152938                                         "Unsupported primary volume descriptor version: %#x", Buf.VolDescHdr.bDescVersion);
    26162939#ifdef LOG_ENABLED
    2617                 rtFsIso9660VolLogPrimarySupplementaryVolDesc(&Buf.SupVolDesc);
     2940                rtFsIsoVolLogPrimarySupplementaryVolDesc(&Buf.SupVolDesc);
    26182941#endif
    26192942                if (cPrimaryVolDescs > 1)
    26202943                    return RTErrInfoSet(pErrInfo, VERR_VFS_UNSUPPORTED_FORMAT, "More than one primary volume descriptor");
    2621                 rc = rtFsIso9660VolHandlePrimaryVolDesc(pThis, &Buf.PrimaryVolDesc, offVolDesc, &RootDir, &offRootDirRec, pErrInfo);
     2944                rc = rtFsIsoVolHandlePrimaryVolDesc(pThis, &Buf.PrimaryVolDesc, offVolDesc, &RootDir, &offRootDirRec, pErrInfo);
    26222945            }
    26232946            else if (Buf.VolDescHdr.bDescType == ISO9660VOLDESC_TYPE_SUPPLEMENTARY)
     
    26282951                                         "Unsupported supplemental volume descriptor version: %#x", Buf.VolDescHdr.bDescVersion);
    26292952#ifdef LOG_ENABLED
    2630                 rtFsIso9660VolLogPrimarySupplementaryVolDesc(&Buf.SupVolDesc);
     2953                rtFsIsoVolLogPrimarySupplementaryVolDesc(&Buf.SupVolDesc);
    26312954#endif
    2632                 rc = rtFsIso9660VolHandleSupplementaryVolDesc(pThis, &Buf.SupVolDesc, offVolDesc, &bJolietUcs2Level, &JolietRootDir,
    2633                                                               &offJolietRootDirRec, pErrInfo);
     2955                rc = rtFsIsoVolHandleSupplementaryVolDesc(pThis, &Buf.SupVolDesc, offVolDesc, &bJolietUcs2Level, &JolietRootDir,
     2956                                                          &offJolietRootDirRec, pErrInfo);
    26342957            }
    26352958            else if (Buf.VolDescHdr.bDescType == ISO9660VOLDESC_TYPE_BOOT_RECORD)
     
    27063029     * If we found a UDF VRS and are interested in UDF, we have more work to do here.
    27073030     */
    2708     if (uUdfLevel > 0)
    2709     {
    2710         Log(("rtFsIso9660VolTryInit: uUdfLevel=%d - TODO\n", uUdfLevel));
     3031    if (uUdfLevel > 0 && !(fFlags & RTFSISO9660_F_NO_UDF) && /* Just disable this code for now: */ (fFlags & RT_BIT(24)))
     3032    {
     3033        Log(("rtFsIsoVolTryInit: uUdfLevel=%d\n", uUdfLevel));
     3034        rc = rtFsIsoVolHandleUdfDetection(pThis, &uUdfLevel, offUdfBootVolDesc, Buf.ab, sizeof(Buf), pErrInfo);
     3035        if (RT_FAILURE(rc))
     3036            return rc;
    27113037    }
    27123038
     
    27243050    {
    27253051        pThis->fIsUtf16 = true;
    2726         return rtFsIso9660DirShrd_New(pThis, NULL, &JolietRootDir, 1, offJolietRootDirRec, &pThis->pRootDir);
    2727     }
    2728     return rtFsIso9660DirShrd_New(pThis, NULL, &RootDir, 1, offRootDirRec, &pThis->pRootDir);
     3052        return rtFsIsoDirShrd_New9660(pThis, NULL, &JolietRootDir, 1, offJolietRootDirRec, &pThis->pRootDir);
     3053    }
     3054    return rtFsIsoDirShrd_New9660(pThis, NULL, &RootDir, 1, offRootDirRec, &pThis->pRootDir);
    27293055}
    27303056
     
    27563082    RTVFS hVfs   = NIL_RTVFS;
    27573083    void *pvThis = NULL;
    2758     int rc = RTVfsNew(&g_rtFsIso9660VolOps, sizeof(RTFSISO9660VOL), NIL_RTVFS, RTVFSLOCK_CREATE_RW, &hVfs, &pvThis);
     3084    int rc = RTVfsNew(&g_rtFsIsoVolOps, sizeof(RTFSISOVOL), NIL_RTVFS, RTVFSLOCK_CREATE_RW, &hVfs, &pvThis);
    27593085    if (RT_SUCCESS(rc))
    27603086    {
    2761         rc = rtFsIso9660VolTryInit((PRTFSISO9660VOL)pvThis, hVfs, hVfsFileIn, fFlags, pErrInfo);
     3087        rc = rtFsIsoVolTryInit((PRTFSISOVOL)pvThis, hVfs, hVfsFileIn, fFlags, pErrInfo);
    27623088        if (RT_SUCCESS(rc))
    27633089            *phVfs = hVfs;
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