大网数据广告活动
Windows 系统接口

FileType Key

· 52CE 我爱测

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

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

Registry Entry

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FileType
   {CLSID}
      n = offset, cb, mask, value

offset

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".

cb

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".

mask

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.

value

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.

Remarks

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

<file_extension>

GetClassFile

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。