Platform SDK: Active Directory, ADSI, and Directory Services

IADsExtension

The IADsExtension interface forms the basis of the ADSI application extension model. It gives independent software vendors (ISVs) the ability to add application-specific behaviors (methods or functions) into an existing ADSI object. Multiple vendors can independently extend the functionality of the same object to meet different needs.

The extension model is based on the aggregation model in COM. An aggregator, or outer object, can add to its repertoire of methods those of an aggregate object, or inner object. An ADSI extension object, which implements the IADsExtension interface, is simply an aggregate object, whereas an ADSI provider is an aggregator.

Note  When implementing an extension module, you should make sure to release an interface as soon as you are done with it. Otherwise, the aggregator cannot release the interface even when its use is no longer needed.

The IADsExtension interface can be used for two purposes:

  1. The extension component needs an initialization notification as defined by ADSI_EXT_dwCode in the Operate() method. In this case, an extension client needs only to call the Operate() method. The other two methods, namely, PrivateInvoke() and PrivateGetIDsOfNames(), usually returns E_NOTIMPL in the HRESULT value.
  2. The extension component supports any dual or dispatch interface. In this case, an extension client will need to call the PrivateGetIDsOfNames() or PrivateInvoke() methods. Operate() usually ignores the data and returns E_NOTIMPL in the HRESULT value.

Methods in Vtable Order

IUnknown methods Description
QueryInterface Returns pointers to supported interfaces.
AddRef Increments reference count.
Release Decrements reference count.

IADsExtension methods Description
Operate Performs the specified extended functionality.
PrivateGetIDsOfNames Maps the name(s) to a DISPID.
PrivateInvoke Invokes methods of the extended object.

Requirements

  Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with DSClient).
  Windows 95/98: Requires Windows 95 or later (with DSClient).
  Header: Declared in Iads.h.