VirtualBox

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


Ignore:
Timestamp:
May 10, 2011 11:23:44 AM (14 years ago)
Author:
vboxsync
Message:

iprt/dvm: use static, changed prefix of internal functions.

Location:
trunk/src/VBox/Runtime
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/Makefile.kmk

    r36817 r37024  
    22962296                                -e '/^g_enmProcessPriority/d'\
    22972297                                -e '/^g_hDbgModStrCache/d'\
    2298                                 -e '/^g_DvmFmtGpt/d'\
    2299                                 -e '/^g_DvmFmtMbr/d'\
    23002298                                \
    23012299                                -e '/^RTDBusLoadLib/d' \
  • trunk/src/VBox/Runtime/common/dvm/dvm.cpp

    r36868 r37024  
    2525 */
    2626
     27
     28/*******************************************************************************
     29*   Header Files                                                               *
     30*******************************************************************************/
    2731#include <iprt/types.h>
    2832#include <iprt/assert.h>
     
    7781*  Global variables                                                            *
    7882*******************************************************************************/
    79 extern RTDVMFMTOPS g_DvmFmtMbr;
    80 extern RTDVMFMTOPS g_DvmFmtGpt;
     83extern RTDVMFMTOPS g_rtDvmFmtMbr;
     84extern RTDVMFMTOPS g_rtDvmFmtGpt;
    8185
    8286/**
     
    8589static PCRTDVMFMTOPS g_aDvmFmts[] =
    8690{
    87     &g_DvmFmtMbr,
    88     &g_DvmFmtGpt
     91    &g_rtDvmFmtMbr,
     92    &g_rtDvmFmtGpt
    8993};
    9094
    9195/**
    9296 * Descriptions of the volume types.
     97 *
     98 * This is indexed by RTDVMVOLTYPE.
    9399 */
    94100static const char * g_apcszDvmVolTypes[] =
     
    468474RTDECL(const char *) RTDvmVolumeTypeGetDescr(RTDVMVOLTYPE enmVolType)
    469475{
    470     AssertReturn(enmVolType >= RTDVMVOLTYPE_INVALID && enmVolType < RTDVMVOLTYPE_32BIT_HACK, NULL);
     476    AssertReturn(enmVolType >= RTDVMVOLTYPE_INVALID && enmVolType < RTDVMVOLTYPE_END, NULL);
    471477
    472478    return g_apcszDvmVolTypes[enmVolType];
  • trunk/src/VBox/Runtime/common/dvm/dvmgpt.cpp

    r36868 r37024  
    2525 */
    2626
     27
     28/*******************************************************************************
     29*   Header Files                                                               *
     30*******************************************************************************/
    2731#include <iprt/types.h>
    2832#include <iprt/assert.h>
     
    3337#include "internal/dvm.h"
    3438
     39
     40/*******************************************************************************
     41*   Structures and Typedefs                                                    *
     42*******************************************************************************/
    3543/** The GPT signature. */
    3644#define RTDVM_GPT_SIGNATURE "EFI PART"
     
    178186#define RTDVM_GPT_BYTE2LBA(lba, disk) ((lba) / (disk)->cbSector)
    179187
     188
     189/*******************************************************************************
     190*   Global Variables                                                           *
     191*******************************************************************************/
    180192/**
    181193 * Mapping of partition types to DVM volume types.
     
    216228};
    217229
    218 DECLCALLBACK(int) dvmFmtGptProbe(PCRTDVMDISK pDisk, uint32_t *puScore)
     230static DECLCALLBACK(int) rtDvmFmtGptProbe(PCRTDVMDISK pDisk, uint32_t *puScore)
    219231{
    220232    int rc = VINF_SUCCESS;
     
    223235    *puScore = RTDVM_MATCH_SCORE_UNSUPPORTED;
    224236
    225     if (dvmDiskGetSectors(pDisk) >= 2)
     237    if (rtDvmDiskGetSectors(pDisk) >= 2)
    226238    {
    227239        /* Read from the disk and check for the signature. */
    228         rc = dvmDiskRead(pDisk, RTDVM_GPT_LBA2BYTE(1, pDisk), &Hdr, sizeof(GptHdr));
     240        rc = rtDvmDiskRead(pDisk, RTDVM_GPT_LBA2BYTE(1, pDisk), &Hdr, sizeof(GptHdr));
    229241        if (   RT_SUCCESS(rc)
    230242            && !strncmp(&Hdr.abSignature[0], RTDVM_GPT_SIGNATURE, RT_ELEMENTS(Hdr.abSignature))
     
    237249}
    238250
    239 DECLCALLBACK(int) dvmFmtGptOpen(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt)
     251static DECLCALLBACK(int) rtDvmFmtGptOpen(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt)
    240252{
    241253    int rc = VINF_SUCCESS;
     
    249261
    250262        /* Read the complete GPT header and convert to host endianess. */
    251         rc = dvmDiskRead(pDisk, RTDVM_GPT_LBA2BYTE(1, pDisk), &pThis->HdrRev1, sizeof(pThis->HdrRev1));
     263        rc = rtDvmDiskRead(pDisk, RTDVM_GPT_LBA2BYTE(1, pDisk), &pThis->HdrRev1, sizeof(pThis->HdrRev1));
    252264        if (RT_SUCCESS(rc))
    253265        {
     
    270282                if (VALID_PTR(pThis->paGptEntries))
    271283                {
    272                     rc = dvmDiskRead(pDisk, RTDVM_GPT_LBA2BYTE(pThis->HdrRev1.u64LbaPartitionEntries, pDisk),
     284                    rc = rtDvmDiskRead(pDisk, RTDVM_GPT_LBA2BYTE(pThis->HdrRev1.u64LbaPartitionEntries, pDisk),
    273285                                     pThis->paGptEntries, pThis->HdrRev1.cPartitionEntries * pThis->HdrRev1.cbPartitionEntry);
    274286                    if (RT_SUCCESS(rc))
     
    311323}
    312324
    313 DECLCALLBACK(int) dvmFmtGptInitialize(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt)
     325static DECLCALLBACK(int) rtDvmFmtGptInitialize(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt)
    314326{
    315327    return VERR_NOT_IMPLEMENTED;
    316328}
    317329
    318 DECLCALLBACK(void) dvmFmtGptClose(RTDVMFMT hVolMgrFmt)
     330static DECLCALLBACK(void) rtDvmFmtGptClose(RTDVMFMT hVolMgrFmt)
    319331{
    320332    PRTDVMFMTINTERNAL pThis = hVolMgrFmt;
     
    328340}
    329341
    330 DECLCALLBACK(uint32_t) dvmFmtGptGetValidVolumes(RTDVMFMT hVolMgrFmt)
     342static DECLCALLBACK(uint32_t) rtDvmFmtGptGetValidVolumes(RTDVMFMT hVolMgrFmt)
    331343{
    332344    PRTDVMFMTINTERNAL pThis = hVolMgrFmt;
     
    335347}
    336348
    337 DECLCALLBACK(uint32_t) dvmFmtGptGetMaxVolumes(RTDVMFMT hVolMgrFmt)
     349static DECLCALLBACK(uint32_t) rtDvmFmtGptGetMaxVolumes(RTDVMFMT hVolMgrFmt)
    338350{
    339351    PRTDVMFMTINTERNAL pThis = hVolMgrFmt;
     
    351363 * @param   phVolFmt      Where to store the volume data on success.
    352364 */
    353 static int dvmFmtMbrVolumeCreate(PRTDVMFMTINTERNAL pThis, PGptEntry pGptEntry,
     365static int rtDvmFmtMbrVolumeCreate(PRTDVMFMTINTERNAL pThis, PGptEntry pGptEntry,
    354366                                 uint32_t idx, PRTDVMVOLUMEFMT phVolFmt)
    355367{
     
    373385}
    374386
    375 DECLCALLBACK(int) dvmFmtGptQueryFirstVolume(RTDVMFMT hVolMgrFmt, PRTDVMVOLUMEFMT phVolFmt)
     387static DECLCALLBACK(int) rtDvmFmtGptQueryFirstVolume(RTDVMFMT hVolMgrFmt, PRTDVMVOLUMEFMT phVolFmt)
    376388{
    377389    int rc = VINF_SUCCESS;
     
    387399            if (!RTUuidIsNull(&pGptEntry->UuidType))
    388400            {
    389                 rc = dvmFmtMbrVolumeCreate(pThis, pGptEntry, i, phVolFmt);
     401                rc = rtDvmFmtMbrVolumeCreate(pThis, pGptEntry, i, phVolFmt);
    390402                break;
    391403            }
     
    399411}
    400412
    401 DECLCALLBACK(int) dvmFmtGptQueryNextVolume(RTDVMFMT hVolMgrFmt, RTDVMVOLUMEFMT hVolFmt, PRTDVMVOLUMEFMT phVolFmtNext)
     413static DECLCALLBACK(int) rtDvmFmtGptQueryNextVolume(RTDVMFMT hVolMgrFmt, RTDVMVOLUMEFMT hVolFmt, PRTDVMVOLUMEFMT phVolFmtNext)
    402414{
    403415    int rc = VERR_DVM_MAP_NO_VOLUME;
     
    410422        if (!RTUuidIsNull(&pGptEntry->UuidType))
    411423        {
    412             rc = dvmFmtMbrVolumeCreate(pThis, pGptEntry, i, phVolFmtNext);
     424            rc = rtDvmFmtMbrVolumeCreate(pThis, pGptEntry, i, phVolFmtNext);
    413425            break;
    414426        }
     
    419431}
    420432
    421 DECLCALLBACK(void) dvmFmtGptVolumeClose(RTDVMVOLUMEFMT hVolFmt)
     433static DECLCALLBACK(void) rtDvmFmtGptVolumeClose(RTDVMVOLUMEFMT hVolFmt)
    422434{
    423435    PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt;
     
    431443}
    432444
    433 DECLCALLBACK(uint64_t) dvmFmtGptVolumeGetSize(RTDVMVOLUMEFMT hVolFmt)
     445static DECLCALLBACK(uint64_t) rtDvmFmtGptVolumeGetSize(RTDVMVOLUMEFMT hVolFmt)
    434446{
    435447    PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt;
     
    438450}
    439451
    440 DECLCALLBACK(int) dvmFmtGptVolumeQueryName(RTDVMVOLUMEFMT hVolFmt, char **ppszVolName)
     452static DECLCALLBACK(int) rtDvmFmtGptVolumeQueryName(RTDVMVOLUMEFMT hVolFmt, char **ppszVolName)
    441453{
    442454    PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt;
     
    450462}
    451463
    452 DECLCALLBACK(RTDVMVOLTYPE) dvmFmtGptVolumeGetType(RTDVMVOLUMEFMT hVolFmt)
     464static DECLCALLBACK(RTDVMVOLTYPE) rtDvmFmtGptVolumeGetType(RTDVMVOLUMEFMT hVolFmt)
    453465{
    454466    RTDVMVOLTYPE enmVolType = RTDVMVOLTYPE_UNKNOWN;
     
    465477}
    466478
    467 DECLCALLBACK(uint64_t) dvmFmtGptVolumeGetFlags(RTDVMVOLUMEFMT hVolFmt)
     479static DECLCALLBACK(uint64_t) rtDvmFmtGptVolumeGetFlags(RTDVMVOLUMEFMT hVolFmt)
    468480{
    469481    NOREF(hVolFmt); /* No supported flags for now. */
     
    471483}
    472484
    473 DECLCALLBACK(int) dvmFmtGptVolumeRead(RTDVMVOLUMEFMT hVolFmt, uint64_t off, void *pvBuf, size_t cbRead)
     485static DECLCALLBACK(int) rtDvmFmtGptVolumeRead(RTDVMVOLUMEFMT hVolFmt, uint64_t off, void *pvBuf, size_t cbRead)
    474486{
    475487    PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt;
    476488    AssertReturn(off + cbRead <= pVol->cbVolume, VERR_INVALID_PARAMETER);
    477489
    478     return dvmDiskRead(pVol->pVolMgr->pDisk, pVol->offStart + off, pvBuf, cbRead);
    479 }
    480 
    481 DECLCALLBACK(int) dvmFmtGptVolumeWrite(RTDVMVOLUMEFMT hVolFmt, uint64_t off, const void *pvBuf, size_t cbWrite)
     490    return rtDvmDiskRead(pVol->pVolMgr->pDisk, pVol->offStart + off, pvBuf, cbRead);
     491}
     492
     493static DECLCALLBACK(int) rtDvmFmtGptVolumeWrite(RTDVMVOLUMEFMT hVolFmt, uint64_t off, const void *pvBuf, size_t cbWrite)
    482494{
    483495    PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt;
    484496    AssertReturn(off + cbWrite <= pVol->cbVolume, VERR_INVALID_PARAMETER);
    485497
    486     return dvmDiskWrite(pVol->pVolMgr->pDisk, pVol->offStart + off, pvBuf, cbWrite);
    487 }
    488 
    489 RTDVMFMTOPS g_DvmFmtGpt =
     498    return rtDvmDiskWrite(pVol->pVolMgr->pDisk, pVol->offStart + off, pvBuf, cbWrite);
     499}
     500
     501RTDVMFMTOPS g_rtDvmFmtGpt =
    490502{
    491503    /* pcszFmt */
    492504    "GPT",
    493505    /* pfnProbe */
    494     dvmFmtGptProbe,
     506    rtDvmFmtGptProbe,
    495507    /* pfnOpen */
    496     dvmFmtGptOpen,
     508    rtDvmFmtGptOpen,
    497509    /* pfnInitialize */
    498     dvmFmtGptInitialize,
     510    rtDvmFmtGptInitialize,
    499511    /* pfnClose */
    500     dvmFmtGptClose,
     512    rtDvmFmtGptClose,
    501513    /* pfnGetValidVolumes */
    502     dvmFmtGptGetValidVolumes,
     514    rtDvmFmtGptGetValidVolumes,
    503515    /* pfnGetMaxVolumes */
    504     dvmFmtGptGetMaxVolumes,
     516    rtDvmFmtGptGetMaxVolumes,
    505517    /* pfnQueryFirstVolume */
    506     dvmFmtGptQueryFirstVolume,
     518    rtDvmFmtGptQueryFirstVolume,
    507519    /* pfnQueryNextVolume */
    508     dvmFmtGptQueryNextVolume,
     520    rtDvmFmtGptQueryNextVolume,
    509521    /* pfnVolumeClose */
    510     dvmFmtGptVolumeClose,
     522    rtDvmFmtGptVolumeClose,
    511523    /* pfnVolumeGetSize */
    512     dvmFmtGptVolumeGetSize,
     524    rtDvmFmtGptVolumeGetSize,
    513525    /* pfnVolumeQueryName */
    514     dvmFmtGptVolumeQueryName,
     526    rtDvmFmtGptVolumeQueryName,
    515527    /* pfnVolumeGetType */
    516     dvmFmtGptVolumeGetType,
     528    rtDvmFmtGptVolumeGetType,
    517529    /* pfnVolumeGetFlags */
    518     dvmFmtGptVolumeGetFlags,
     530    rtDvmFmtGptVolumeGetFlags,
    519531    /* pfnVolumeRead */
    520     dvmFmtGptVolumeRead,
     532    rtDvmFmtGptVolumeRead,
    521533    /* pfnVolumeWrite */
    522     dvmFmtGptVolumeWrite
     534    rtDvmFmtGptVolumeWrite
    523535};
    524536
  • trunk/src/VBox/Runtime/common/dvm/dvmmbr.cpp

    r37023 r37024  
    8989typedef RTDVMMBRFS2VOLTYPE *PRTDVMMBRFS2VOLTYPE;
    9090
     91
     92/*******************************************************************************
     93*   Global Variables                                                           *
     94*******************************************************************************/
    9195/**
    9296 * Mapping of FS types to DVM volume types.
     
    111115};
    112116
    113 DECLCALLBACK(int) dvmFmtMbrProbe(PCRTDVMDISK pDisk, uint32_t *puScore)
     117static DECLCALLBACK(int) rtDvmFmtMbrProbe(PCRTDVMDISK pDisk, uint32_t *puScore)
    114118{
    115119    int rc = VINF_SUCCESS;
     
    121125    {
    122126        /* Read from the disk and check for the 0x55aa signature at the end. */
    123         rc = dvmDiskRead(pDisk, 0, &abMbr[0], sizeof(abMbr));
     127        rc = rtDvmDiskRead(pDisk, 0, &abMbr[0], sizeof(abMbr));
    124128        if (   RT_SUCCESS(rc)
    125129            && abMbr[510] == 0x55
     
    131135}
    132136
    133 DECLCALLBACK(int) dvmFmtMbrOpen(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt)
     137static DECLCALLBACK(int) rtDvmFmtMbrOpen(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt)
    134138{
    135139    int rc = VINF_SUCCESS;
     
    143147
    144148        /* Read the MBR and count the valid partition entries. */
    145         rc = dvmDiskRead(pDisk, 0, &pThis->abMbr[0], sizeof(pThis->abMbr));
     149        rc = rtDvmDiskRead(pDisk, 0, &pThis->abMbr[0], sizeof(pThis->abMbr));
    146150        if (RT_SUCCESS(rc))
    147151        {
     
    168172}
    169173
    170 DECLCALLBACK(int) dvmFmtMbrInitialize(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt)
     174static DECLCALLBACK(int) rtDvmFmtMbrInitialize(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt)
    171175{
    172176    int rc = VINF_SUCCESS;
     
    181185        pThis->abMbr[511] = 0xaa;
    182186
    183         rc = dvmDiskWrite(pDisk, 0, &pThis->abMbr[0], sizeof(pThis->abMbr));
     187        rc = rtDvmDiskWrite(pDisk, 0, &pThis->abMbr[0], sizeof(pThis->abMbr));
    184188
    185189        if (RT_SUCCESS(rc))
     
    198202}
    199203
    200 DECLCALLBACK(void) dvmFmtMbrClose(RTDVMFMT hVolMgrFmt)
     204static DECLCALLBACK(void) rtDvmFmtMbrClose(RTDVMFMT hVolMgrFmt)
    201205{
    202206    PRTDVMFMTINTERNAL pThis = hVolMgrFmt;
     
    208212}
    209213
    210 DECLCALLBACK(uint32_t) dvmFmtMbrGetValidVolumes(RTDVMFMT hVolMgrFmt)
     214static DECLCALLBACK(uint32_t) rtDvmFmtMbrGetValidVolumes(RTDVMFMT hVolMgrFmt)
    211215{
    212216    PRTDVMFMTINTERNAL pThis = hVolMgrFmt;
     
    215219}
    216220
    217 DECLCALLBACK(uint32_t) dvmFmtMbrGetMaxVolumes(RTDVMFMT hVolMgrFmt)
     221static DECLCALLBACK(uint32_t) rtDvmFmtMbrGetMaxVolumes(RTDVMFMT hVolMgrFmt)
    218222{
    219223    NOREF(hVolMgrFmt);
     
    230234 * @param   phVolFmt      Where to store the volume data on success.
    231235 */
    232 static int dvmFmtMbrVolumeCreate(PRTDVMFMTINTERNAL pThis, uint8_t *pbMbrEntry,
     236static int rtDvmFmtMbrVolumeCreate(PRTDVMFMTINTERNAL pThis, uint8_t *pbMbrEntry,
    233237                                 uint32_t idx, PRTDVMVOLUMEFMT phVolFmt)
    234238{
     
    252256}
    253257
    254 DECLCALLBACK(int) dvmFmtMbrQueryFirstVolume(RTDVMFMT hVolMgrFmt, PRTDVMVOLUMEFMT phVolFmt)
     258static DECLCALLBACK(int) rtDvmFmtMbrQueryFirstVolume(RTDVMFMT hVolMgrFmt, PRTDVMVOLUMEFMT phVolFmt)
    255259{
    256260    int rc = VINF_SUCCESS;
     
    266270            if (pbMbrEntry[0x04] != 0x00)
    267271            {
    268                 rc = dvmFmtMbrVolumeCreate(pThis, pbMbrEntry, i, phVolFmt);
     272                rc = rtDvmFmtMbrVolumeCreate(pThis, pbMbrEntry, i, phVolFmt);
    269273                break;
    270274            }
     
    278282}
    279283
    280 DECLCALLBACK(int) dvmFmtMbrQueryNextVolume(RTDVMFMT hVolMgrFmt, RTDVMVOLUMEFMT hVolFmt, PRTDVMVOLUMEFMT phVolFmtNext)
     284static DECLCALLBACK(int) rtDvmFmtMbrQueryNextVolume(RTDVMFMT hVolMgrFmt, RTDVMVOLUMEFMT hVolFmt, PRTDVMVOLUMEFMT phVolFmtNext)
    281285{
    282286    int rc = VERR_DVM_MAP_NO_VOLUME;
     
    289293        if (pbMbrEntry[0x04] != 0x00)
    290294        {
    291             rc = dvmFmtMbrVolumeCreate(pThis, pbMbrEntry, i, phVolFmtNext);
     295            rc = rtDvmFmtMbrVolumeCreate(pThis, pbMbrEntry, i, phVolFmtNext);
    292296            break;
    293297        }
     
    298302}
    299303
    300 DECLCALLBACK(void) dvmFmtMbrVolumeClose(RTDVMVOLUMEFMT hVolFmt)
     304static DECLCALLBACK(void) rtDvmFmtMbrVolumeClose(RTDVMVOLUMEFMT hVolFmt)
    301305{
    302306    PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt;
     
    310314}
    311315
    312 DECLCALLBACK(uint64_t) dvmFmtMbrVolumeGetSize(RTDVMVOLUMEFMT hVolFmt)
     316static DECLCALLBACK(uint64_t) rtDvmFmtMbrVolumeGetSize(RTDVMVOLUMEFMT hVolFmt)
    313317{
    314318    PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt;
     
    317321}
    318322
    319 DECLCALLBACK(int) dvmFmtMbrVolumeQueryName(RTDVMVOLUMEFMT hVolFmt, char **ppszVolName)
     323static DECLCALLBACK(int) rtDvmFmtMbrVolumeQueryName(RTDVMVOLUMEFMT hVolFmt, char **ppszVolName)
    320324{
    321325    NOREF(hVolFmt);
     
    323327}
    324328
    325 DECLCALLBACK(RTDVMVOLTYPE) dvmFmtMbrVolumeGetType(RTDVMVOLUMEFMT hVolFmt)
     329static DECLCALLBACK(RTDVMVOLTYPE) rtDvmFmtMbrVolumeGetType(RTDVMVOLUMEFMT hVolFmt)
    326330{
    327331    RTDVMVOLTYPE enmVolType = RTDVMVOLTYPE_UNKNOWN;
     
    338342}
    339343
    340 DECLCALLBACK(uint64_t) dvmFmtMbrVolumeGetFlags(RTDVMVOLUMEFMT hVolFmt)
     344static DECLCALLBACK(uint64_t) rtDvmFmtMbrVolumeGetFlags(RTDVMVOLUMEFMT hVolFmt)
    341345{
    342346    uint64_t fFlags = 0;
     
    349353}
    350354
    351 DECLCALLBACK(int) dvmFmtMbrVolumeRead(RTDVMVOLUMEFMT hVolFmt, uint64_t off, void *pvBuf, size_t cbRead)
     355static DECLCALLBACK(int) rtDvmFmtMbrVolumeRead(RTDVMVOLUMEFMT hVolFmt, uint64_t off, void *pvBuf, size_t cbRead)
    352356{
    353357    PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt;
    354358    AssertReturn(off + cbRead <= pVol->cbVolume, VERR_INVALID_PARAMETER);
    355359
    356     return dvmDiskRead(pVol->pVolMgr->pDisk, pVol->offStart + off, pvBuf, cbRead);
    357 }
    358 
    359 DECLCALLBACK(int) dvmFmtMbrVolumeWrite(RTDVMVOLUMEFMT hVolFmt, uint64_t off, const void *pvBuf, size_t cbWrite)
     360    return rtDvmDiskRead(pVol->pVolMgr->pDisk, pVol->offStart + off, pvBuf, cbRead);
     361}
     362
     363static DECLCALLBACK(int) rtDvmFmtMbrVolumeWrite(RTDVMVOLUMEFMT hVolFmt, uint64_t off, const void *pvBuf, size_t cbWrite)
    360364{
    361365    PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt;
    362366    AssertReturn(off + cbWrite <= pVol->cbVolume, VERR_INVALID_PARAMETER);
    363367
    364     return dvmDiskWrite(pVol->pVolMgr->pDisk, pVol->offStart + off, pvBuf, cbWrite);
    365 }
    366 
    367 RTDVMFMTOPS g_DvmFmtMbr =
     368    return rtDvmDiskWrite(pVol->pVolMgr->pDisk, pVol->offStart + off, pvBuf, cbWrite);
     369}
     370
     371RTDVMFMTOPS g_rtDvmFmtMbr =
    368372{
    369373    /* pcszFmt */
    370374    "MBR",
    371375    /* pfnProbe */
    372     dvmFmtMbrProbe,
     376    rtDvmFmtMbrProbe,
    373377    /* pfnOpen */
    374     dvmFmtMbrOpen,
     378    rtDvmFmtMbrOpen,
    375379    /* pfnInitialize */
    376     dvmFmtMbrInitialize,
     380    rtDvmFmtMbrInitialize,
    377381    /* pfnClose */
    378     dvmFmtMbrClose,
     382    rtDvmFmtMbrClose,
    379383    /* pfnGetValidVolumes */
    380     dvmFmtMbrGetValidVolumes,
     384    rtDvmFmtMbrGetValidVolumes,
    381385    /* pfnGetMaxVolumes */
    382     dvmFmtMbrGetMaxVolumes,
     386    rtDvmFmtMbrGetMaxVolumes,
    383387    /* pfnQueryFirstVolume */
    384     dvmFmtMbrQueryFirstVolume,
     388    rtDvmFmtMbrQueryFirstVolume,
    385389    /* pfnQueryNextVolume */
    386     dvmFmtMbrQueryNextVolume,
     390    rtDvmFmtMbrQueryNextVolume,
    387391    /* pfnVolumeClose */
    388     dvmFmtMbrVolumeClose,
     392    rtDvmFmtMbrVolumeClose,
    389393    /* pfnVolumeGetSize */
    390     dvmFmtMbrVolumeGetSize,
     394    rtDvmFmtMbrVolumeGetSize,
    391395    /* pfnVolumeQueryName */
    392     dvmFmtMbrVolumeQueryName,
     396    rtDvmFmtMbrVolumeQueryName,
    393397    /* pfnVolumeGetType */
    394     dvmFmtMbrVolumeGetType,
     398    rtDvmFmtMbrVolumeGetType,
    395399    /* pfnVolumeGetFlags */
    396     dvmFmtMbrVolumeGetFlags,
     400    rtDvmFmtMbrVolumeGetFlags,
    397401    /* pfnVolumeRead */
    398     dvmFmtMbrVolumeRead,
     402    rtDvmFmtMbrVolumeRead,
    399403    /* pfnVolumeWrite */
    400     dvmFmtMbrVolumeWrite
     404    rtDvmFmtMbrVolumeWrite
    401405};
    402406
  • trunk/src/VBox/Runtime/include/internal/dvm.h

    r36816 r37024  
    233233 * @param   pDisk   The disk descriptor.
    234234 */
    235 DECLINLINE(uint64_t) dvmDiskGetSectors(PCRTDVMDISK pDisk)
     235DECLINLINE(uint64_t) rtDvmDiskGetSectors(PCRTDVMDISK pDisk)
    236236{
    237237    return pDisk->cbDisk / pDisk->cbSector;
     
    247247 * @param   cbRead   How much to read.
    248248 */
    249 DECLINLINE(int) dvmDiskRead(PCRTDVMDISK pDisk, uint64_t off, void *pvBuf, size_t cbRead)
     249DECLINLINE(int) rtDvmDiskRead(PCRTDVMDISK pDisk, uint64_t off, void *pvBuf, size_t cbRead)
    250250{
    251251    AssertPtrReturn(pDisk, VERR_INVALID_POINTER);
     
    266266 * @param   cbWrite  How much to write.
    267267 */
    268 DECLINLINE(int) dvmDiskWrite(PCRTDVMDISK pDisk, uint64_t off, const void *pvBuf, size_t cbWrite)
     268DECLINLINE(int) rtDvmDiskWrite(PCRTDVMDISK pDisk, uint64_t off, const void *pvBuf, size_t cbWrite)
    269269{
    270270    AssertPtrReturn(pDisk, VERR_INVALID_POINTER);
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