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

Late Binding vs. Vtable Access in the ADSI Extension Model

· 52CE 我爱测

A dual interface enables direct vtable access to all its functions while a dispatch interface does not.

A dual interface enables direct vtable access to all its functions while a dispatch interface does not. A C/C++ client can query for a dual interface pointer and use direct vtable access to invoke its functions. This provides faster access than invoking the function using the IDispatch::GetIDsOfNames and IDispatch::Invoke functions. This is especially true in the extension model, because all dual interfaces in an extension object must delegate their GetIDsOfNames and Invoke functions back to the aggregator (ADSI) first. The aggregator then must perform extra internal steps to identify which extension object, possibly including the aggregator itself, provides support for the function called and redirect the call to the appropriate object.

Visual Basic also invokes a dual-interface function using direct access to a vtable, if it has a pointer to the interface and access to type data from the type library. ADSI clients written in Visual Basic can specify a pointer to a dual interface, for example, IADs, explicitly, and thus enable vtable access to functions in the interface.

Dim inf as IADs
 
Set inf = GetObject("LDAP://CN=jeffsmith,DC=fabrikam,DC=com") ' An object that supports IADsDualInf.
inf.Get("name") 'IADs.Get() will be invoked through direct vtable access.

Because an IDispatch interface does not support vtable access, this example does not apply. That is, a dispatch function is always invoked through the IDispatch::GetIDsOfNames and IDispatch::Invoke functions only.

Current releases of VBScript and JScript also do not support vtable access. Therefore, a dual interface in a VBScript or JScript environment performs like a dispatch interface.

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)

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

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