VirtualBox

Changeset 67876 in vbox


Ignore:
Timestamp:
Jul 10, 2017 1:27:22 PM (8 years ago)
Author:
vboxsync
Message:

RTFsFatVolFormat144: 1 sector per cluster. Added hack for cluster rounding issues when using RTFsFatVolFormat to create a new raw image.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/fs/fatvfs.cpp

    r67621 r67876  
    50695069        uint64_t offCur = offFirstFat + cbFat * cFats + cbRootDir;
    50705070        uint64_t cbLeft = cTotalSectors * cbSector;
     5071        if (cbVol - cbLeft <= _256K) /* HACK ALERT! Format to end of volume if it's a cluster rounding thing.  */
     5072            cbLeft = cbVol;
    50715073        if (cbLeft > offCur)
    50725074        {
     
    51095111{
    51105112    return RTFsFatVolFormat(hVfsFile, 0 /*offVol*/, 1474560, fQuick ? RTFSFATVOL_FMT_F_QUICK : RTFSFATVOL_FMT_F_FULL,
    5111                             512 /*cbSector*/, 2 /*cSectorsPerCluster*/, RTFSFATTYPE_FAT12, 2 /*cHeads*/,  18 /*cSectors*/,
     5113                            512 /*cbSector*/, 1 /*cSectorsPerCluster*/, RTFSFATTYPE_FAT12, 2 /*cHeads*/,  18 /*cSectors*/,
    51125114                            0xf0 /*bMedia*/, 0 /*cHiddenSectors*/, 224 /*cRootDirEntries*/, NULL /*pErrInfo*/);
    51135115}
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