Platform SDK: Active Directory, ADSI, and Directory Services

ADsFreeEnumerator

The ADsFreeEnumerator function frees an enumerator object that has been created through ADsBuildEnumerator.

HRESULT ADsFreeEnumerator(
  IEnumVARIANT *pEnumVariant 
);

Parameters

pEnumVariant
[out] Pointer to the IEnumVARIANT interface on the enumerator object to be freed.

Return Values

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

S_OK
The enumerator object has been freed successfully.
E_ADS_BAD_PARAMETER
The specified enumerator is not valid.
For other return values, see ADSI Error Codes.

Remarks

The general procedure for enumerating objects in a container involves the following:

  1. Calling ADsBuildEnumerator to create an enumerator object.
  2. Performing enumeration by calling ADsEnumerateNext on the newly created enumerator.
  3. Freeing the enumerator by using ADsFreeEnumerator.

For more information and a code example, see the ADsBuildEnumerator topic.

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 Adshlp.h.
  Library: Included as a resource in ActiveDs.dll.

See Also

ADSI Error Codes, ADSI Functions, ADsBuildEnumerator, ADsEnumerateNext, IEnumVARIANT