Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This key is used by the GetClassFilefunction to match patterns against various file bytes in a non-compound file. The named values are stored under the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FileType\< CLSID> \< n> = < offset , cb , mask , value >

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

The cbvalue represents the length in bytes from the beginning to the end of the file. It represents the byte range in the file. The cbvalue is a decimal unless preceded by "0x".

The maskvalue specifies abinary value used for masking. Masking is performed by using a logical AND operation, and the byte range specified by offsetand cb.If this value is omitted then the bytes will be set to all ones. This value is always hexadecimal.

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

Entries under the FileTypekey are used by the GetClassFilefunction to match patterns against various file bytes in a non-compound file. FileTypehas CLSIDsub keys, each of which has a series of sub keys \0, \1, \2.... These values contain a pattern that, if matched, yields the indicated CLSID. The following code examples show FileTypeentries.

\0 = 0, 4, FFFFFFFF, ABCD1234 where the first 4 bytes must be ABCD1234, in that order, or \1 = 0, 4, FFFFFFFF, 9876543 where they must match 9876543, or \2 = -4, 4, FEFEFEFE where the last four bytes in the file must be FEFEFEFE.

See Also