大网数据广告活动
域与目录服务

Revisiting COM Aggregation Rules with ADSI Extensions

· 52CE 我爱测

The following is a brief review of COM aggregation and ADSI extension rules.

The following is a brief review of COM aggregation and ADSI extension rules.

  • The CreateInstance method returns a pointer to an IUnknown interface, as follows, that does not delegate any function calls to the aggregator.

    The IUnknown::QueryInterface method returns pointers to the interfaces that it supports, and errors for interfaces it does not support.

    The IUnknown::AddRef method increments the reference count on the aggregated extension object itself.

    The IUnkown::Release method decrements the reference count on the aggregated extension object itself and destroys itself when the reference count is 0.

  • The extension object should store the IUnknown pointer of the aggregator, such as m_pOuterUnknown, during the implementation of the CreateInstance method.

  • All interfaces that the extension object supports, including IADsExtension, should inherit from IUnknown, which delegates all function calls back to the aggregator.

Extension writers can choose any internal implementation they prefer as long as they obey standard COM aggregation rules. Be aware that an extension object does not have to work as a standalone object. Extensions are designed to work as aggregates. However, an extension can be written to work as both a standalone object and as an aggregate.

In addition to standard COM aggregation support, an extension object may support IADsExtension for more advanced features. If late binding is supported, the extension should:

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)

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

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