Platform SDK: Active Directory, ADSI, and Directory Services

DsGetDomainControllerInfo

The DsGetDomainControllerInfo function retrieves information about a domain controller (DC).

DWORD DsGetDomainControllerInfo(
  HANDLE hDs,
  LPTSTR DomainName,
  DWORD InfoLevel,
  DWORD *pcOut,
  VOID **ppInfo
);

Parameters

hDs
[in] Bind handle to the directory service.
DomainName
[in] Pointer to a null-terminated Unicode string specifying the name of the domain.
InfoLevel
[in] Indicates the version of the DS_DOMAIN_CONTROLLER_INFO structure which should be returned. Currently, only version 1 (DS_DOMAIN_CONTROLLER_INFO_1) is supported.
pcOut
[out] Pointer to a variable that receives the count of the number of items returned in ppInfo.
ppInfo
[out] Pointer to a variable that receives a pointer to an array of DS_DOMAIN_CONTROLLER_INFO structures. This array must be freed using DsFreeDomainControllerInfo.

Return Values

If the function returns domain controller information, the return value is ERROR_SUCCESS.

If the function fails, the return value can be one of the following error codes.

ERROR_INVALID_PARAMETER
A parameter is incorrect.
ERROR_NOT_SUPPORTED
The requested version of the directory service server extensions is not supported.
ERROR_DS_INTERNAL_FAILURE
The version of the DS_DOMAIN_CONTROLLER_INFO function returned by the DC did not match the version requested in InfoLevel.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Ntdsapi.h.
  Library: Included as a resource in Ntdsapi.dll.
  Unicode: Implemented as Unicode and ANSI versions on Windows 2000.

See Also

DC and Replication Management Functions, DS_DOMAIN_CONTROLLER_INFO_1, DsFreeDomainControllerInfo