大网数据广告活动
网络与域名解析

Format Strings

· 52CE 我爱测

A format string is an interpreted token that the NDR engine understands. Format strings are often referred to as MOPs; this documentation uses the term format string throughout.

A format string is an interpreted token that the NDR engine understands. Format strings are often referred to as MOPs; this documentation uses the term format string throughout.

To be more precise, a format character is an individual (atomic) interpretable token. Each format character is one byte in size. A format string is a sequence of format characters or format characters and numerical data. The term descriptor is also used for naming common sequences; for example, a parameter format string or a parameter descriptor is a format string used to describe a parameter of a routine.

Format characters have suggestive symbolic names like FC_LONG or FC_STRUCT. All format string characters used by MIDL and the NDR engine are defined in the Ndrtypes.h file.

Format String Tables

Two primary format string tables are used by the engine: the procedure format string table, __MIDL_ProcFormatString, that keeps the procedure descriptors; and the type format string table, __MIDL_TypeFormatString, that keeps the data type descriptors. The compiler generates both into the main stub files (*_c.c, *_s.c, *_p.c). The procedure format string table is used mostly by various interpreters but it is also used for the buffer conversion regardless of the compiler mode. The type format string table is used when calling the core NDR engine to indicate specific data types to be worked on.

Format String Notation

The notation used in this document follows common programming description guidelines, with a bar ( | ) used to denote alternative constructs and square brackets ( [ ] ) used to indicate optional elements. Format strings are frequently stacked up for readability (accountability). Throughout this document, FC denotes a single format character. Format characters are presented in all CAPS, using their actual symbolic names. Other arbitrary fields are represented by a name and a size.

Angle brackets ( <> ) are used to denote sizes of the descriptors. The conventions shown in the following table are employed.

Notation Meaning
<n> The size of descriptor is n bytes.
<> The size of descriptor varies.
{<>}* The descriptor is repeated any number of times (0,1,2 …).

The following format characters have a special meaning.

Character Meaning
FC_END Indicates the end of some format strings.
FC_PAD Uninterpreted pad character.

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)

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

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