VirtualBox

Changeset 69609 in vbox for trunk/src/VBox/Runtime/include


Ignore:
Timestamp:
Nov 7, 2017 6:59:38 PM (7 years ago)
Author:
vboxsync
Message:

iprt/dvm: Some API adjusting to VFS - work in progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/include/internal/dvm.h

    r69111 r69609  
    3131#include <iprt/err.h>
    3232#include <iprt/assert.h>
     33#include <iprt/vfs.h>
    3334#include "internal/magics.h"
    3435
     
    5556{
    5657    /** Size of the disk in bytes. */
    57     uint64_t       cbDisk;
     58    uint64_t        cbDisk;
    5859    /** Sector size. */
    59     uint64_t       cbSector;
    60     /** Read callback */
    61     PFNDVMREAD     pfnRead;
    62     /** Write callback. */
    63     PFNDVMWRITE    pfnWrite;
    64     /** Opaque user data. */
    65     void          *pvUser;
     60    uint64_t        cbSector;
     61    /** The VFS file handle if backed by such. */
     62    RTVFSFILE       hVfsFile;
    6663} RTDVMDISK;
    6764/** Pointer to a disk descriptor. */
     
    294291    AssertReturn(off + cbRead <= pDisk->cbDisk, VERR_INVALID_PARAMETER);
    295292
    296     return pDisk->pfnRead(pDisk->pvUser, off, pvBuf, cbRead);
     293    return RTVfsFileReadAt(pDisk->hVfsFile, off, pvBuf, cbRead, NULL /*pcbRead*/);
    297294}
    298295
     
    313310    AssertReturn(off + cbWrite <= pDisk->cbDisk, VERR_INVALID_PARAMETER);
    314311
    315     return pDisk->pfnWrite(pDisk->pvUser, off, pvBuf, cbWrite);
     312    return RTVfsFileWriteAt(pDisk->hVfsFile, off, pvBuf, cbWrite, NULL /*pcbWritten*/);
    316313}
    317314
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