VirtualBox

Changeset 66594 in vbox for trunk/include/iprt/formats


Ignore:
Timestamp:
Apr 17, 2017 3:29:05 PM (8 years ago)
Author:
vboxsync
Message:

iprt: Reworked and implemented VFS chains, adding stdfile, gzip and gunzip element provider/factories.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/formats/fat.h

    r66578 r66594  
    3131#include <iprt/assert.h>
    3232
    33 #pragma pack(1)
    3433
    3534/** @name FAT Media byte values
     
    4746 * This was the first DOS version with a BPB.
    4847 */
     48#pragma pack(1)
    4949typedef struct FATBPB20
    5050{
     
    6666    uint16_t        cSectorsPerFat;
    6767} FATBPB20;
     68#pragma pack()
    6869AssertCompileSize(FATBPB20, 0xd);
    6970/** Pointer to a DOS 2.0 BPB. */
     
    7677 * The DOS 3.0 BPB changes that survived.
    7778 */
     79#pragma pack(1)
    7880typedef struct FATBPB30CMN
    7981{
     
    8587    uint16_t        cTracksPerCylinder;
    8688} FATBPB30CMN;
     89#pragma pack()
    8790AssertCompileSize(FATBPB30CMN, 0x11);
    8891
     
    9093 * The DOS 3.0 BPB.
    9194 */
     95#pragma pack(1)
    9296typedef struct FATBPB30
    9397{
     
    98102    uint16_t        cHiddenSectors;
    99103} FATBPB30;
     104#pragma pack()
    100105AssertCompileSize(FATBPB30, 0x13);
    101106/** Pointer to a DOS 3.0 BPB. */
     
    107112 * The DOS 3.0 BPB, flattened structure.
    108113 */
     114#pragma pack(1)
    109115typedef struct FATBPB30FLAT
    110116{
     
    139145    /** @} */
    140146} FATBPB30FLAT;
     147#pragma pack()
    141148AssertCompileSize(FATBPB30FLAT, 0x13);
    142149/** Pointer to a flattened DOS 3.0 BPB. */
     
    149156 * The DOS 3.2 BPB.
    150157 */
     158#pragma pack(1)
    151159typedef struct FATBPB32
    152160{
     
    157165    uint16_t        cAnotherTotalSectors;
    158166} FATBPB32;
     167#pragma pack()
    159168AssertCompileSize(FATBPB32, 0x15);
    160169/** Pointer to a DOS 3.2 BPB. */
     
    166175 * The DOS 3.2 BPB, flattened structure.
    167176 */
     177#pragma pack(1)
    168178typedef struct FATBPB32FLAT
    169179{
     
    204214    /** @} */
    205215} FATBPB32FLAT;
     216#pragma pack()
    206217AssertCompileSize(FATBPB32FLAT, 0x15);
    207218/** Pointer to a flattened DOS 3.2 BPB. */
     
    214225 * The DOS 3.31 BPB.
    215226 */
     227#pragma pack(1)
    216228typedef struct FATBPB331
    217229{
     
    226238    uint32_t        cTotalSectors32;
    227239} FATBPB331;
     240#pragma pack()
    228241AssertCompileSize(FATBPB331, 0x19);
    229242/** Pointer to a DOS 3.31 BPB. */
     
    235248 * The DOS 3.31 BPB, flattened structure.
    236249 */
     250#pragma pack(1)
    237251typedef struct FATBPB331FLAT
    238252{
     
    274288    /** @} */
    275289} FATBPB331FLAT;
     290#pragma pack()
    276291AssertCompileSize(FATBPB331FLAT, 0x19);
    277292/** Pointer to a flattened DOS 3.31 BPB. */
     
    284299 * Extended BIOS parameter block (EBPB).
    285300 */
     301#pragma pack(1)
    286302typedef struct FATEBPB
    287303{
     
    306322    char            achType[8];
    307323} FATEBPB;
     324#pragma pack()
    308325AssertCompileSize(FATEBPB, 0x33);
    309326/** Pointer to an extended BIOS parameter block. */
     
    329346 * FAT32 Extended BIOS parameter block (EBPB).
    330347 */
     348#pragma pack(1)
    331349typedef struct FAT32EBPB
    332350{
     
    376394    union
    377395    {
     396        /** Type string variant.  */
    378397        char        achType[8];
     398        /** Total sector count if 4G or higher. */
    379399        uint64_t    cTotalSectors64;
    380400    } u;
    381401} FAT32EBPB;
     402#pragma pack()
    382403AssertCompileSize(FAT32EBPB, 0x4f);
    383404/** Pointer to a FAT32 extended BIOS parameter block. */
     
    393414 * FAT boot sector layout.
    394415 */
     416#pragma pack(1)
    395417typedef struct FATBOOTSECTOR
    396418{
     
    417439    uint16_t            uSignature;
    418440} FATBOOTSECTOR;
     441#pragma pack()
    419442AssertCompileSize(FATBOOTSECTOR, 0x200);
    420443/** Pointer to a FAT boot sector. */
     
    426449#define FATBOOTSECTOR_SIGNATURE     UINT16_C(0xaa55)
    427450
    428 #pragma pack()
     451
     452
     453/**
     454 * FAT32 info sector (follows the boot sector).
     455 */
     456typedef struct FAT32INFOSECTOR
     457{
     458    /** 0x000: Signature \#1 (FAT32INFOSECTOR_SIGNATURE_1). */
     459    uint32_t        uSignature1;
     460    /** Reserved, should be zero. */
     461    uint8_t         abReserved1[0x1E0];
     462    /** 0x1e4: Signature \#1 (FAT32INFOSECTOR_SIGNATURE_2). */
     463    uint32_t        uSignature2;
     464    /** 0x1e8: Last known number of free clusters (informational). */
     465    uint32_t        cFreeClusters;
     466    /** 0x1ec: Last allocated cluster number (informational).  This could be used as
     467     * an allocation hint when searching for a free cluster. */
     468    uint32_t        cLastAllocatedCluster;
     469    /** 0x1f0: Reserved, should be zero, preserve. */
     470    uint8_t         abReserved2[12];
     471    /** 0x1fc: Signature \#3 (FAT32INFOSECTOR_SIGNATURE_3). */
     472    uint32_t        uSignature3;
     473} FAT32INFOSECTOR;
     474AssertCompileSize(FAT32INFOSECTOR, 0x200);
     475/** Pointer to a FAT32 info sector. */
     476typedef FAT32INFOSECTOR *PFAT32INFOSECTOR;
     477/** Pointer to a const FAT32 info sector. */
     478typedef FAT32INFOSECTOR const *PCFAT32INFOSECTOR;
     479
     480#define FAT32INFOSECTOR_SIGNATURE_1     UINT32_C(0x41615252)
     481#define FAT32INFOSECTOR_SIGNATURE_2     UINT32_C(0x61417272)
     482#define FAT32INFOSECTOR_SIGNATURE_3     UINT32_C(0xaa550000)
    429483
    430484#endif
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