Platform SDK: Active Directory, ADSI, and Directory Services

IADsExtension::Operate

The IADsExtension::Operate method is invoked by the aggregator to perform the extended functionality. The method interprets the control code and input parameters according to the specifications of the provider. Consult the provider's documentation for the proper usage.

HRESULT IADsExtension::Operate(
  DWORD dwCode,
  VARIANT varData1,
  VARIANT varData2,
  VARIANT varData3
);

Parameters

dwCode
[in] A value of the ADSI extension control code. ADSI defines the following code value.
dwCode Description
ADS_EXT_INITCREDENTIALS Verifies user credentials in the extension object.

varData1
[in] Provider-supplied data the extension object will operate on. The value depends upon the control code value and is presently undefined.
varData2
[in] Provider-supplied data the extension object will operate on. The value depends upon the control code value and is presently undefined.
varData3
[in] Provider-supplied data the extension object will operate on. The value depends upon the control code value and is presently undefined.

Return Values

This method supports the standard return values, as well as the following:

S_OK
The operation is successful.
E_FAIL
The operation is not successful.
E_NOTIMPL
The method is not implemented.

For other return values, see ADSI Error Codes.

Remarks

The aggregator will ignore the E_FAIL and E_NOTIMPL return values.

Example Code [C++]

The following C/C++ code snippet shows a generic implementation.

STDMETHOD(Operate)(ULONG dwCode, VARIANT varData1, VARIANT varData2, VARIANT varData3)
{
   HRESULT hr = S_OK;
   switch (dwCode) 
   {
      case ADS_EXT_INITCREDENTIALS:
      // You can prompt for a credential.
      // MessageBox(NULL, "INITCRED", "ADsExt", MB_OK);
      break;
      default:
          hr = E_FAIL;
      break;
    }        
    return hr;
}

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.

See Also

IADsExtension, ADSI Error Codes