[FORMATTING]

- TABS -> SPACES

svn path=/trunk/; revision=38984
This commit is contained in:
Aleksey Bragin 2009-01-20 19:15:08 +00:00
parent 25efba5b5b
commit 2e3d23a37d

View file

@ -65,31 +65,31 @@ typedef union _UCHAR4
// //
typedef struct _PACKED_BIOS_PARAMETER_BLOCK typedef struct _PACKED_BIOS_PARAMETER_BLOCK
{ {
UCHAR BytesPerSector[2]; UCHAR BytesPerSector[2];
UCHAR SectorsPerCluster[1]; UCHAR SectorsPerCluster[1];
UCHAR ReservedSectors[2]; UCHAR ReservedSectors[2];
UCHAR Fats[1]; UCHAR Fats[1];
UCHAR RootEntries[2]; UCHAR RootEntries[2];
UCHAR Sectors[2]; UCHAR Sectors[2];
UCHAR Media[1]; UCHAR Media[1];
UCHAR SectorsPerFat[2]; UCHAR SectorsPerFat[2];
UCHAR SectorsPerTrack[2]; UCHAR SectorsPerTrack[2];
UCHAR Heads[2]; UCHAR Heads[2];
UCHAR HiddenSectors[4]; UCHAR HiddenSectors[4];
UCHAR LargeSectors[4]; UCHAR LargeSectors[4];
} PACKED_BIOS_PARAMETER_BLOCK, *PPACKED_BIOS_PARAMETER_BLOCK; } PACKED_BIOS_PARAMETER_BLOCK, *PPACKED_BIOS_PARAMETER_BLOCK;
// sizeof = 0x019 // sizeof = 0x019
typedef struct _PACKED_BIOS_PARAMETER_BLOCK_EX typedef struct _PACKED_BIOS_PARAMETER_BLOCK_EX
{ {
PACKED_BIOS_PARAMETER_BLOCK Block; PACKED_BIOS_PARAMETER_BLOCK Block;
UCHAR LargeSectorsPerFat[4]; UCHAR LargeSectorsPerFat[4];
UCHAR ExtendedFlags[2]; UCHAR ExtendedFlags[2];
UCHAR FsVersion[2]; UCHAR FsVersion[2];
UCHAR RootDirFirstCluster[4]; UCHAR RootDirFirstCluster[4];
UCHAR FsInfoSector[2]; UCHAR FsInfoSector[2];
UCHAR BackupBootSector[2]; UCHAR BackupBootSector[2];
UCHAR Reserved[12]; UCHAR Reserved[12];
} PACKED_BIOS_PARAMETER_BLOCK_EX, *PPACKED_BIOS_PARAMETER_BLOCK_EX; } PACKED_BIOS_PARAMETER_BLOCK_EX, *PPACKED_BIOS_PARAMETER_BLOCK_EX;
// sizeof = 0x035 53 // sizeof = 0x035 53
@ -98,82 +98,82 @@ typedef struct _PACKED_BIOS_PARAMETER_BLOCK_EX
// //
typedef struct BIOS_PARAMETER_BLOCK typedef struct BIOS_PARAMETER_BLOCK
{ {
USHORT BytesPerSector; USHORT BytesPerSector;
UCHAR SectorsPerCluster; UCHAR SectorsPerCluster;
USHORT ReservedSectors; USHORT ReservedSectors;
UCHAR Fats; UCHAR Fats;
USHORT RootEntries; USHORT RootEntries;
USHORT Sectors; USHORT Sectors;
UCHAR Media; UCHAR Media;
USHORT SectorsPerFat; USHORT SectorsPerFat;
USHORT SectorsPerTrack; USHORT SectorsPerTrack;
USHORT Heads; USHORT Heads;
ULONG HiddenSectors; ULONG HiddenSectors;
ULONG LargeSectors; ULONG LargeSectors;
ULONG LargeSectorsPerFat; ULONG LargeSectorsPerFat;
union union
{ {
USHORT ExtendedFlags; USHORT ExtendedFlags;
struct struct
{ {
ULONG ActiveFat:4; ULONG ActiveFat:4;
ULONG Reserved0:3; ULONG Reserved0:3;
ULONG MirrorDisabled:1; ULONG MirrorDisabled:1;
ULONG Reserved1:8; ULONG Reserved1:8;
}; };
}; };
USHORT FsVersion; USHORT FsVersion;
ULONG RootDirFirstCluster; ULONG RootDirFirstCluster;
USHORT FsInfoSector; USHORT FsInfoSector;
USHORT BackupBootSector; USHORT BackupBootSector;
} BIOS_PARAMETER_BLOCK, *PBIOS_PARAMETER_BLOCK; } BIOS_PARAMETER_BLOCK, *PBIOS_PARAMETER_BLOCK;
#define FatValidBytesPerSector(xBytes) \ #define FatValidBytesPerSector(xBytes) \
(!((xBytes) & ((xBytes)-1)) && (xBytes)>=0x80 && (xBytes)<=0x1000) (!((xBytes) & ((xBytes)-1)) && (xBytes)>=0x80 && (xBytes)<=0x1000)
#define FatValidSectorsPerCluster(xSectors) \ #define FatValidSectorsPerCluster(xSectors) \
(!((xSectors) & ((xSectors)-1)) && (xSectors)>=0 && (xSectors)<=0x80) (!((xSectors) & ((xSectors)-1)) && (xSectors)>=0 && (xSectors)<=0x80)
typedef struct _PACKED_BOOT_SECTOR typedef struct _PACKED_BOOT_SECTOR
{ {
UCHAR Jump[3]; UCHAR Jump[3];
UCHAR Oem[8]; UCHAR Oem[8];
PACKED_BIOS_PARAMETER_BLOCK PackedBpb; PACKED_BIOS_PARAMETER_BLOCK PackedBpb;
UCHAR PhysicalDriveNumber; UCHAR PhysicalDriveNumber;
UCHAR CurrentHead; UCHAR CurrentHead;
UCHAR Signature; UCHAR Signature;
UCHAR Id[4]; UCHAR Id[4];
UCHAR VolumeLabel[11]; UCHAR VolumeLabel[11];
UCHAR SystemId[8]; UCHAR SystemId[8];
} PACKED_BOOT_SECTOR, *PPACKED_BOOT_SECTOR; } PACKED_BOOT_SECTOR, *PPACKED_BOOT_SECTOR;
// sizeof = 0x03E // sizeof = 0x03E
typedef struct _PACKED_BOOT_SECTOR_EX typedef struct _PACKED_BOOT_SECTOR_EX
{ {
UCHAR Jump[3]; UCHAR Jump[3];
UCHAR Oem[8]; UCHAR Oem[8];
PACKED_BIOS_PARAMETER_BLOCK_EX PackedBpb; PACKED_BIOS_PARAMETER_BLOCK_EX PackedBpb;
UCHAR PhysicalDriveNumber; UCHAR PhysicalDriveNumber;
UCHAR CurrentHead; UCHAR CurrentHead;
UCHAR Signature; UCHAR Signature;
UCHAR Id[4]; UCHAR Id[4];
UCHAR VolumeLabel[11]; UCHAR VolumeLabel[11];
UCHAR SystemId[8]; UCHAR SystemId[8];
} PACKED_BOOT_SECTOR_EX, *PPACKED_BOOT_SECTOR_EX; } PACKED_BOOT_SECTOR_EX, *PPACKED_BOOT_SECTOR_EX;
// sizeof = 0x060 // sizeof = 0x060
#define FatBootSectorJumpValid(xMagic) \ #define FatBootSectorJumpValid(xMagic) \
((xMagic)[0] == 0xe9 || (xMagic)[0] == 0xeb || (xMagic)[0] == 0x49) ((xMagic)[0] == 0xe9 || (xMagic)[0] == 0xeb || (xMagic)[0] == 0x49)
typedef struct _FSINFO_SECTOR typedef struct _FSINFO_SECTOR
{ {
ULONG SectorBeginSignature; ULONG SectorBeginSignature;
UCHAR Reserved[480]; UCHAR Reserved[480];
ULONG FsInfoSignature; ULONG FsInfoSignature;
ULONG FreeClusterCount; ULONG FreeClusterCount;
ULONG NextFreeCluster; ULONG NextFreeCluster;
UCHAR Reserved0[12]; UCHAR Reserved0[12];
ULONG SectorEndSignature; ULONG SectorEndSignature;
} FSINFO_SECTOR, *PFSINFO_SECTOR; } FSINFO_SECTOR, *PFSINFO_SECTOR;
// sizeof = 0x200 // sizeof = 0x200
#define FSINFO_SECTOR_BEGIN_SIGNATURE 0x41615252 #define FSINFO_SECTOR_BEGIN_SIGNATURE 0x41615252
@ -182,11 +182,10 @@ typedef struct _FSINFO_SECTOR
// //
// Cluster Markers: // Cluster Markers:
// //
// #define FAT_CLUSTER_AVAILABLE 0x00000000
#define FAT_CLUSTER_AVAILABLE 0x00000000 #define FAT_CLUSTER_RESERVED 0x0ffffff0
#define FAT_CLUSTER_RESERVED 0x0ffffff0 #define FAT_CLUSTER_BAD 0x0ffffff7
#define FAT_CLUSTER_BAD 0x0ffffff7 #define FAT_CLUSTER_LAST 0x0fffffff
#define FAT_CLUSTER_LAST 0x0fffffff
// //
// Directory Structure: // Directory Structure:
// //
@ -232,31 +231,31 @@ typedef struct _FAT_DATETIME {
// //
typedef struct _DIR_ENTRY typedef struct _DIR_ENTRY
{ {
UCHAR FileName[11]; UCHAR FileName[11];
UCHAR Attributes; UCHAR Attributes;
UCHAR Case; UCHAR Case;
UCHAR CreationTimeTenMs; UCHAR CreationTimeTenMs;
FAT_DATETIME CreationDateTime; FAT_DATETIME CreationDateTime;
FAT_DATE LastAccessDate; FAT_DATE LastAccessDate;
union { union {
USHORT ExtendedAttributes; USHORT ExtendedAttributes;
USHORT FirstClusterOfFileHi; USHORT FirstClusterOfFileHi;
}; };
FAT_DATETIME LastWriteDateTime; FAT_DATETIME LastWriteDateTime;
USHORT FirstCluster; USHORT FirstCluster;
ULONG FileSize; ULONG FileSize;
} DIR_ENTRY, *PDIR_ENTRY; } DIR_ENTRY, *PDIR_ENTRY;
// sizeof = 0x020 // sizeof = 0x020
typedef struct _LONG_FILE_NAME_ENTRY { typedef struct _LONG_FILE_NAME_ENTRY {
UCHAR Index; UCHAR Index;
UCHAR NameA[10]; UCHAR NameA[10];
UCHAR Attributes; UCHAR Attributes;
UCHAR Type; UCHAR Type;
UCHAR Checksum; UCHAR Checksum;
USHORT NameB[6]; USHORT NameB[6];
USHORT Reserved; USHORT Reserved;
USHORT NameC[2]; USHORT NameC[2];
} LONG_FILE_NAME_ENTRY, *PLONG_FILE_NAME_ENTRY; } LONG_FILE_NAME_ENTRY, *PLONG_FILE_NAME_ENTRY;
// sizeof = 0x020 // sizeof = 0x020
@ -285,14 +284,14 @@ typedef struct _LONG_FILE_NAME_ENTRY {
FAT_DIRENT_ATTR_VOLUME_ID) FAT_DIRENT_ATTR_VOLUME_ID)
typedef struct _PACKED_LFN_DIRENT { typedef struct _PACKED_LFN_DIRENT {
UCHAR Ordinal; // offset = 0 UCHAR Ordinal; // offset = 0
UCHAR Name1[10]; // offset = 1 (Really 5 chars, but not WCHAR aligned) UCHAR Name1[10]; // offset = 1 (Really 5 chars, but not WCHAR aligned)
UCHAR Attributes; // offset = 11 UCHAR Attributes; // offset = 11
UCHAR Type; // offset = 12 UCHAR Type; // offset = 12
UCHAR Checksum; // offset = 13 UCHAR Checksum; // offset = 13
WCHAR Name2[6]; // offset = 14 WCHAR Name2[6]; // offset = 14
USHORT MustBeZero; // offset = 26 USHORT MustBeZero; // offset = 26
WCHAR Name3[2]; // offset = 28 WCHAR Name3[2]; // offset = 28
} PACKED_LFN_DIRENT; // sizeof = 32 } PACKED_LFN_DIRENT; // sizeof = 32
#endif//__FAT_H__ #endif//__FAT_H__