VirtualBox

Ignore:
Timestamp:
Mar 17, 2022 1:29:52 PM (3 years ago)
Author:
vboxsync
Message:

IPRT,Storage: Adding RTVfsQueryLabel and internally a generic pfnQueryInfoEx method to the RTVFSOBJOPS function table. Untested implementation of the latter for iso/udf. bugref:9781

Location:
trunk/src/VBox/Runtime/common/vfs
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/vfs/vfsbase.cpp

    r93115 r94291  
    7272        AssertPtr((a_pObjOps)->pfnClose); \
    7373        AssertPtr((a_pObjOps)->pfnQueryInfo); \
     74        AssertPtrNull((a_pObjOps)->pfnQueryInfoEx); \
    7475        Assert((a_pObjOps)->uEndMarker == RTVFSOBJOPS_VERSION); \
    7576    } while (0)
     
    23082309
    23092310
     2311RTDECL(int) RTVfsQueryLabel(RTVFS hVfs, char *pszLabel, size_t cbLabel, size_t *pcbActual)
     2312{
     2313    RTVFSINTERNAL *pThis = hVfs;
     2314    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     2315    AssertReturn(pThis->uMagic == RTVFS_MAGIC, VERR_INVALID_HANDLE);
     2316
     2317    if (cbLabel > 0)
     2318        AssertPtrReturn(pszLabel, VERR_INVALID_POINTER);
     2319
     2320    int rc;
     2321    if (pThis->pOps->Obj.pfnQueryInfoEx)
     2322    {
     2323        size_t cbActualIgn;
     2324        if (!pcbActual)
     2325            pcbActual = &cbActualIgn;
     2326
     2327        RTVfsLockAcquireRead(pThis->Base.hLock);
     2328        rc = pThis->pOps->Obj.pfnQueryInfoEx(pThis->Base.pvThis, RTVFSQIEX_VOL_LABEL, pszLabel, cbLabel, pcbActual);
     2329        RTVfsLockReleaseRead(pThis->Base.hLock);
     2330    }
     2331    else
     2332        rc = VERR_NOT_SUPPORTED;
     2333    return rc;
     2334}
     2335
    23102336
    23112337
  • trunk/src/VBox/Runtime/common/vfs/vfsfss2dir.cpp

    r93115 r94291  
    284284        rtVfsFssToDir_Close,
    285285        rtVfsFssToDir_QueryInfo,
     286        NULL,
    286287        RTVFSOBJOPS_VERSION
    287288    },
  • trunk/src/VBox/Runtime/common/vfs/vfsmemory.cpp

    r93115 r94291  
    731731            rtVfsMemFile_Close,
    732732            rtVfsMemFile_QueryInfo,
     733            NULL,
    733734            RTVFSOBJOPS_VERSION
    734735        },
  • trunk/src/VBox/Runtime/common/vfs/vfsprogress.cpp

    r93115 r94291  
    308308        rtVfsProgressFile_Close,
    309309        rtVfsProgressFile_QueryInfo,
     310        NULL,
    310311        RTVFSOBJOPS_VERSION
    311312    },
     
    439440            rtVfsProgressFile_Close,
    440441            rtVfsProgressFile_QueryInfo,
     442            NULL,
    441443            RTVFSOBJOPS_VERSION
    442444        },
  • trunk/src/VBox/Runtime/common/vfs/vfsreadahead.cpp

    r93115 r94291  
    535535        rtVfsReadAhead_Close,
    536536        rtVfsReadAhead_QueryInfo,
     537        NULL,
    537538        RTVFSOBJOPS_VERSION
    538539    },
     
    562563            rtVfsReadAhead_Close,
    563564            rtVfsReadAhead_QueryInfo,
     565            NULL,
    564566            RTVFSOBJOPS_VERSION
    565567        },
  • trunk/src/VBox/Runtime/common/vfs/vfsstddir.cpp

    r93115 r94291  
    166166        rtVfsStdSym_Close,
    167167        rtVfsStdSym_QueryInfo,
     168        NULL,
    168169        RTVFSOBJOPS_VERSION
    169170    },
     
    668669        rtVfsStdDir_Close,
    669670        rtVfsStdDir_QueryInfo,
     671        NULL,
    670672        RTVFSOBJOPS_VERSION
    671673    },
  • trunk/src/VBox/Runtime/common/vfs/vfsstdfile.cpp

    r93115 r94291  
    451451            rtVfsStdFile_Close,
    452452            rtVfsStdFile_QueryInfo,
     453            NULL,
    453454            RTVFSOBJOPS_VERSION
    454455        },
  • trunk/src/VBox/Runtime/common/vfs/vfsstdpipe.cpp

    r93115 r94291  
    256256        rtVfsStdPipe_Close,
    257257        rtVfsStdPipe_QueryInfo,
     258        NULL,
    258259        RTVFSOBJOPS_VERSION
    259260    },
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