Export (0) Print
Expand All

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 used for the mini stream is specified from the Compound File Header (64 bytes).

c7cc99e4-90cf-4b98-8034-2bb605b372ea

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 (first mini FAT starting sector location).

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 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 4096 bytes, then mini FAT and mini stream are not required. In this case, the header's first mini FAT starting sector location can be set to ENDOFCHAIN, and the root directory entry's starting sector location can be set to ENDOFCHAIN.

The detailed mini FAT sector structure is specified below.


0

1

2

3

4

5

6

7

8

9
1
0

1

2

3

4

5

6

7

8

9
2
0

1

2

3

4

5

6

7

8

9
3
0

1

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, then there MUST be 128 fields specified to fill a 512-byte sector.

  • If Header Major Version is 4, then there MUST be 1024 fields specified to fill a 4096-byte sector.

Value Meaning

ENDOFCHAIN
0xFFFFFFFE

Chain terminators (ENDOFCHAIN = 0xFFFFFFFE).

 
Show:
© 2014 Microsoft