VirtualBox

Changeset 67878 in vbox


Ignore:
Timestamp:
Jul 10, 2017 2:22:42 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
116842
Message:

fatvfs.cpp: Fixed another formatting problem causing trouble with XP: Either set cTotalSectors16 or cTotalSectors32, never both. XP would ignore our WINNT.SIF file otherwise, while having no trouble accessing the floppy and files from the (rescue) command line. Also fixed a file date issue where we dated everything back to 1980.

File:
1 edited

Legend:

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

    r67877 r67878  
    14161416
    14171417    if (puDate)
    1418         *puDate = ((RT_MIN(Time.i32Year, 1980) - 1980) << 9)
     1418        *puDate = ((uint16_t)(RT_MAX(Time.i32Year, 1980) - 1980) << 9)
    14191419                | (Time.u8Month << 5)
    14201420                | Time.u8MonthDay;
    14211421    if (puTime)
    1422         *puTime = (Time.u8Hour   << 11)
     1422        *puTime = ((uint16_t)Time.u8Hour   << 11)
    14231423                | (Time.u8Minute << 5)
    14241424                | (Time.u8Second >> 1);
     
    49294929    pBootSector->Bpb.Bpb331.cTracksPerCylinder  = cHeads;
    49304930    pBootSector->Bpb.Bpb331.cHiddenSectors      = cHiddenSectors;
    4931     pBootSector->Bpb.Bpb331.cTotalSectors32     = cTotalSectors <= UINT32_MAX     ? (uint32_t)cTotalSectors : 0;
     4931    /* XP barfs if both cTotalSectors32 and cTotalSectors16 are set */
     4932    pBootSector->Bpb.Bpb331.cTotalSectors32     = cTotalSectors <= UINT32_MAX && pBootSector->Bpb.Bpb331.cTotalSectors16 == 0
     4933                                                ? (uint32_t)cTotalSectors : 0;
    49324934    if (enmFatType != RTFSFATTYPE_FAT32)
    49334935    {
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