Platform SDK: Active Directory, ADSI, and Directory Services

IADsExtension Interface

The IADsExtension interface is defined as follows:

IADsExtension : public IUnknown
    {
    public:
        virtual HRESULT STDMETHODCALLTYPE Operate( 
            /* [in] */ DWORD dwCode,
            /* [in] */ VARIANT varData1,
            /* [in] */ VARIANT varData2,
            /* [in] */ VARIANT varData3) = 0;
 
        virtual HRESULT STDMETHODCALLTYPE PrivateGetIDsOfNames( 
            /* [in] */ REFIID riid,
            /* [in] */ OLECHAR __RPC_FAR *__RPC_FAR *rgszNames,
            /* [in] */ unsigned int cNames,
            /* [in] */ LCID lcid,
            /* [out] */ DISPID __RPC_FAR *rgDispid) = 0;
 
        virtual HRESULT STDMETHODCALLTYPE PrivateInvoke( 
            /* [in] */ DISPID dispidMember,
            /* [in] */ REFIID riid,
            /* [in] */ LCID lcid,
            /* [in] */ WORD wFlags,
            /* [in] */ DISPPARAMS __RPC_FAR *pdispparams,
            /* [out] */ VARIANT __RPC_FAR *pvarResult,
            /* [out] */ EXCEPINFO __RPC_FAR *pexcepinfo,
            /* [out] */ unsigned int __RPC_FAR *puArgErr) = 0;
    };

The aggregator (ADSI) calls the IADsExtension::Operate method. The extension should interpret the dwCode parameter and each varData parameter, according to the provider's documentation.

The aggregator (ADSI), calls the IADsExtension::PrivateGetIDsOfNames method. It is called after ADSI determines the extension to service the dispatch. The extension could use the type information for getting the DISPID, that is, using the DispGetIDsOfNames function.

ADSI normally calls the PrivateInvoke method after calling the PrivateGetIDsOfNames function. The extension should call the actual method that it implements. Alternatively, the extension can use type information and call the DispInvoke function.

All parameters have the same meaning as the parameters in the standard IDispatch::Invoke method.