Directory Services


The EnumClasses method enumerates class definitions for an object.

void EnumClasses( 
  LPWSTR* ppszClassNames,
  DWORD dwNumClasses,
  PADS_CLASS_DEF* ppClassDefinition,
  DWORD* pdwNumClasses


[in] Pointer to an array of class names.
[in] Number of specified classes.
[out] Pointer to a class definition structure.
[out] Number of returned class definitions.

Return Values

This method supports the standard HRESULT return code, including S_OK. For more information about other error codes, see ADSI Error Codes.


The specified number of classes (dwNumClasses) and the returned number of class definitions, pointed to by pdwNumClasses, are not required to be the same. For example, you can set dwNumClasses to -1 to initiate a search of all the class definitions. Otherwise, the search is performed on the specified classes only and the number of classes returned will be the same as the number specified.


Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension on Windows NT 4.0 SP6a and Windows 95/98/Me.
Header: Declared in Iads.h.