The Generic DirectoryEntry template provides the base definition for directory entries (see Table 14). All directory entry structures derive from this template and only Microsoft-defined directory entry structures are valid (exFAT does not have provisions for manufacturer-defined directory entry structures except as defined in Section 7.8 and Section 7.9). The ability to interpret the Generic DirectoryEntry template is mandatory.

Table 14 Generic DirectoryEntry Template

Field NameOffset(byte)Size(byte)Comments
EntryType01This field is mandatory and Section 6.2.1 defines its contents.
CustomDefined119This field is mandatory and structures which derive from this template may define its contents.
FirstCluster204This field is mandatory and Section 6.2.2 defines its contents.
DataLength248This field is mandatory and Section 6.2.3 defines its contents.

6.2.1 EntryType Field

The EntryType field has three modes of usage which the value of the field defines (see list below).

  • 00h, which is an end-of-directory marker and the following conditions apply:
    • All other fields in the given DirectoryEntry are actually reserved
    • All subsequent directory entries in the given directory also are end-of-directory markers
    • End-of-directory markers are only valid outside directory entry sets
    • Implementations may overwrite end-of-directory markers as necessary
  • Between 01h and 7Fh inclusively, which is an unused-directory-entry marker and the following conditions apply:
    • All other fields in the given DirectoryEntry are actually undefined
    • Unused directory entries are only valid outside of directory entry sets
    • Implementations may overwrite unused directory entries as necessary
    • This range of values corresponds to the InUse field (see Section 6.2.1.4) containing the value 0
  • Between 81h and FFh inclusively, which is a regular directory entry and the following conditions apply:
    • The contents of the EntryType field (see Table 15) determine the layout of the remainder of the DirectoryEntry structure
    • This range of values, and only this range of values, are valid inside a directory entry set
    • This range of values directly corresponds to the InUse field (see Section 6.2.1.4) containing the value 1

To prevent modifications to the InUse field (see Section 6.2.1.4) erroneously resulting in an end-of-directory marker, the value 80h is invalid.

Table 15 Generic EntryType Field Structure

Field NameOffset(bit)Size(bits)Comments
TypeCode05This field is mandatory and Section 6.2.1.1 defines its contents.
TypeImportance51This field is mandatory and Section Section 6.2.1.2 defines its contents.
TypeCategory61This field is mandatory and Section 6.2.1.3 defines its contents.
InUse71This field is mandatory and Section 6.2.1.4 defines its contents.
6.2.1.1 TypeCode Field

The TypeCode field partially describes the specific type of the given directory entry. This field, plus the TypeImportance and TypeCategory fields (see Section 6.2.1.2 and Section 6.2.1.3, respectively) uniquely identify the type of the given directory entry.

All possible values of this field are valid, unless the TypeImportance and TypeCategory fields both contain the value 0; in that case, the value 0 is invalid for this field.

6.2.1.2 TypeImportance Field

The TypeImportance field shall describe the importance of the given directory entry.

The valid values for this field shall be:

  • 0, which means the given directory entry is critical (see Section 6.3.1.2.1 and Section 6.4.1.2.1 for critical primary and critical secondary directory entries, respectively)
  • 1, which means the given directory entry is benign (see Section 6.3.1.2.2 and Section 6.4.1.2.2 for benign primary and benign secondary directory entries, respectively)
6.2.1.3 TypeCategory Field

The TypeCategory field shall describe the category of the given directory entry.

The valid values for this field shall be:

  • 0, which means the given directory entry is primary (see Section 6.3)
  • 1, which means the given directory entry is secondary (see Section 6.4)
6.2.1.4 InUse Field

The InUse field shall describe whether the given directory entry in use or not.

The valid values for this field shall be:

  • 0, which means the given directory entry is not in use; this means the given structure actually is an unused directory entry
  • 1, which means the given directory entry is in use; this means the given structure is a regular directory entry

6.2.2 FirstCluster Field

The FirstCluster field shall contain the index of the first cluster of an allocation in the Cluster Heap associated with the given directory entry.

The valid range of values for this field shall be:

  • Exactly 0, which means no cluster allocation exists
  • Between 2 and ClusterCount + 1, which is the range of valid cluster indices

Structures which derive from this template may redefine both the FirstCluster and DataLength fields, if a cluster allocation is not compatible with the derivative structure.

6.2.3 DataLength Field

The DataLength field describes the size, in bytes, of the data the associated cluster allocation contains.

The valid range of value for this field is:

  • At least 0; if the FirstCluster field contains the value 0, then this field’s only valid value is 0
  • At most ClusterCount * 2SectorsPerClusterShift* 2BytesPerSectorShift

Structures which derive from this template may redefine both the FirstCluster and DataLength fields, if a cluster allocation is not possible for the derivative structure.