2.4 Compound File Mini FAT Sectors
The mini FAT is used to allocate space in the mini stream. The mini stream is divided into smaller, equal-length sectors, and the sector size that is used for the mini stream is specified from the Compound File Header (64 bytes).
Figure 12: Sectors of a mini FAT array
The locations for mini FAT sectors are stored in a standard chain in the FAT, with the beginning of the chain stored in the header (location of the first mini FAT starting sector).
A mini FAT sector number can be converted into a byte offset into the mini stream by using the following formula: sector number x 64 bytes. This formula is different from the formula that is used to convert a sector number into a byte offset in the file, because no header is stored in the mini stream.
The mini stream is chained within the FAT in exactly the same fashion as any normal stream. The mini stream's starting sector is referenced in the first directory entry (root storage stream ID 0).
If all of the user streams in the file are greater than the cutoff of 4,096 bytes, the mini FAT and mini stream are not required. In this case, the location of the header's first mini FAT starting sector can be set to ENDOFCHAIN, and the location of the root directory entry's starting sector can be set to ENDOFCHAIN.
The detailed mini FAT sector structure is specified below.
|
|
|
|
|
|
|
|
|
|
1 |
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
3 |
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Next Sector in Chain (variable) |
|||||||||||||||||||||||||||||||
... |
Next Sector in Chain (variable): This field specifies the next sector number in a chain of sectors.
If header Major Version is 3, there MUST be 128 fields specified to fill a 512-byte sector.
If Header Major Version is 4, there MUST be 1,024 fields specified to fill a 4,096-byte sector.
Value
Meaning
ENDOFCHAIN
0xFFFFFFFE
Chain terminators (ENDOFCHAIN = 0xFFFFFFFE).