VirtualBox

Changeset 40843 in vbox for trunk/src/VBox/Storage/VMDK.cpp


Ignore:
Timestamp:
Apr 10, 2012 8:53:19 AM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
77362
Message:

Storage: Miscellaneous bug fixes to make the library work on big endian machines

File:
1 edited

Legend:

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

    r40739 r40843  
    25252525        goto out;
    25262526
    2527     if (    RT_LE2H_U32(Header.flags & RT_BIT(17))
     2527    if (    (RT_LE2H_U32(Header.flags) & RT_BIT(17))
    25282528        &&  RT_LE2H_U64(Header.gdOffset) == VMDK_GD_AT_END)
    25292529        pExtent->fFooter = true;
     
    42334233    PVMDKMARKER pMarker = (PVMDKMARKER)&aMarker[0];
    42344234    memset(pMarker, '\0', sizeof(aMarker));
    4235     pMarker->uSector = RT_H2LE_U64(VMDK_BYTE2SECTOR(pExtent->cGTEntries * sizeof(uint32_t)));
     4235    pMarker->uSector = RT_H2LE_U64(VMDK_BYTE2SECTOR((uint64_t)pExtent->cGTEntries * sizeof(uint32_t)));
    42364236    pMarker->uType = RT_H2LE_U32(VMDK_MARKER_GT);
    42374237    rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pExtent->pFile->pStorage, uFileOffset,
     
    43414341                PVMDKMARKER pMarker = (PVMDKMARKER)&aMarker[0];
    43424342                memset(pMarker, '\0', sizeof(aMarker));
    4343                 pMarker->uSector = VMDK_BYTE2SECTOR(RT_ALIGN_64(RT_H2LE_U64(pExtent->cGDEntries * sizeof(uint32_t)), 512));
     4343                pMarker->uSector = VMDK_BYTE2SECTOR(RT_ALIGN_64(RT_H2LE_U64((uint64_t)pExtent->cGDEntries * sizeof(uint32_t)), 512));
    43444344                pMarker->uType = RT_H2LE_U32(VMDK_MARKER_GD);
    43454345                rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pExtent->pFile->pStorage, uFileOffset,
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette