FileType Key

Used by GetClassFile to match patterns against various file bytes in a non-compound file.

Registry Entry

      n = offset, cb, mask, value


Determines how far from the beginning or end of the file to begin the comparison. If the offset is a negative value, the comparison begins from the end of the file minus the offset value. The offset value is a decimal type unless preceded by "0x".


Represents the length in bytes from the beginning to the end of the file. Represents the byte range in the file. The cb value is a decimal unless preceded by "0x".


A binary value used for masking, which is performed by using a logical AND operation, and the byte range specified by offset and cb. If this value is omitted, the bytes are set to all ones. This value is always hexadecimal.


Represents the pattern that must match for a file to be of this file type. The pattern is used to properly identify a known file format from its contents, not by its extension.


Entries are used by the GetClassFile function to match patterns against various file bytes in a non-compound file. FileType has CLSID subkeys, each of which has a series of subkeys 0, 1, 2, 3. These values contain patterns that, if one matches, yield the indicated CLSID. For example, a value of "0, 4, FFFFFFFF, ABCD1234" indicates that the first 4 bytes must be ABCD1234, in that order. A value of "-4, 4, FEFEFEFE " indicates that the last four bytes in the file must be FEFEFEFE. If either pattern matches, the CLSID is returned.

The HKEY_LOCAL_MACHINE\SOFTWARE\Classes key corresponds to the HKEY_CLASSES_ROOT key, which was retained for compatibility with earlier versions of COM.

Related topics