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

Pointer-Attribute Type Inheritance

· 52CE 我爱测

According to the DCE specification, each IDL file must define attributes for its pointers.

According to the DCE specification, each IDL file must define attributes for its pointers. If an explicit attribute is not assigned to a pointer, the pointer uses the value specified by the [ pointer_default] keyword. Some DCE implementations do not allow unattributed pointers. If a pointer does not have an explicit attribute, the IDL file must have a [pointer_default] specification so that the pointer attribute can be set.

In default (Microsoft-extensions) mode, you can specify a pointer's attribute in the IDL file that imports the defining IDL file. Pointers defined in one IDL file can inherit attributes that are specified in other IDL files. Also, in default mode, IDL files can include unattributed pointers. If neither the base nor the imported IDL files specify a pointer attribute or [pointer_default], unattributed pointers are interpreted as unique pointers.

The MIDL compiler assigns pointer attributes to pointers using the following priority rules (1 is highest).

Priority Description
1 Explicit pointer attributes are applied to the pointer at the definition or use site.
2 The default is the [pointer_default] attribute in the IDL file that defines the type.
3 The default is the [pointer_default] attribute in the IDL file that imports the type.
4 The default is [ ptr] in DCE-compatibility mode, or [ unique] in Microsoft-extensions mode.

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)

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

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