VirtualBox

Changeset 48854 in vbox for trunk/src/VBox/Storage/DMG.cpp


Ignore:
Timestamp:
Oct 3, 2013 9:48:48 PM (11 years ago)
Author:
vboxsync
Message:

DMG: Fixes for making vbox-img convert work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/DMG.cpp

    r48852 r48854  
    457457    {
    458458        /*
    459          * The I/O context stuff seems to complicated and undocument that I'm
    460          * not going to bother trying implement this efficiently right now.
     459         * Alloate a temporary buffer on the stack or heap and use
     460         * vdIfIoIntIoCtxCopyTo to work the context.
     461         *
     462         * The I/O context stuff seems too complicated and undocument that I'm
     463         * not going to bother trying to implement this efficiently right now.
    461464         */
    462465        void *pvFree = NULL;
     
    466469        else
    467470            pvFree = pvBuf = RTMemTmpAlloc(cbToRead);
    468         if (!pvBuf)
     471        if (pvBuf)
    469472        {
    470473            rc = RTVfsFileReadAt(pThis->hDmgFileInXar, off, pvBuf, cbToRead, NULL);
     
    14411444 * @returns VBox status code.
    14421445 * @param   fOpen           Flags for defining the open type.
    1443  * @param   pVDIfsIo        The storage I/O interface to use.
     1446 * @param   pVDIfs          List of VD I/O interfaces that we can use.
    14441447 * @param   pvStorage       The storage pointer that goes with @a pVDIfsIo.
    14451448 * @param   pszFilename     The input filename, optional.
     
    14521455 *          is being in serveral places.
    14531456 */
    1454 static int dmgOpenImageWithinXar(uint32_t fOpen, PVDINTERFACEIO pVDIfsIo, void *pvStorage, const char *pszFilename,
     1457static int dmgOpenImageWithinXar(uint32_t fOpen, PVDINTERFACE pVDIfs, void *pvStorage, const char *pszFilename,
    14551458                                 PRTVFSFSSTREAM phXarFss, PRTVFSFILE phDmgFileInXar)
    14561459{
     
    14581461     * Open the XAR file stream.
    14591462     */
    1460     if (!pVDIfsIo)
    1461         return VERR_INVALID_PARAMETER;
    1462 
    14631463    RTVFSFILE hVfsFile;
    1464     int rc = VDIfCreateVfsFile(pVDIfsIo, pvStorage, fOpen, &hVfsFile);
     1464    int rc = VDIfCreateVfsFile(pVDIfs, pvStorage, fOpen, &hVfsFile);
    14651465    if (RT_FAILURE(rc))
    14661466        return rc;
     
    15661566    {
    15671567        rc = dmgOpenImageWithinXar(VDOpenFlagsToFileOpenFlags(uOpenFlags, false /* fCreate */),
    1568                                    VDIfIoGet(pThis->pVDIfsImage),
     1568                                   pThis->pVDIfsImage,
    15691569                                   pThis->pStorage,
    15701570                                   pThis->pszFilename,
     
    17101710    {
    17111711        rc = dmgOpenImageWithinXar(RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE,
    1712                                    VDIfIoGet(pVDIfsImage), pStorage, NULL /* pszFilename */,
     1712                                   pVDIfsImage, pStorage, NULL /* pszFilename */,
    17131713                                   &hXarFss, &hDmgFileInXar);
    17141714        if (RT_FAILURE(rc))
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