Directory Services |
The DsGetDcNext function retrieves the next domain controller in a domain controller enumeration operation.
DWORD WINAPI DsGetDcNext( HANDLE GetDcContextHandle, PULONG SockAddressCount, LPSOCKET_ADDRESS* SockAddresses, LPTSTR* DnsHostName );
All returned addresses will be of type AF_INET or AF_INET6. The sin_port member contains the port from the server record. A port of 0 indicates no port is available from DNS.
The caller must free this memory when it is no longer required by calling LocalFree.
This parameter is ignored if SockAddressCount is NULL.
Return Code | Description |
---|---|
ERROR_NO_MORE_ITEMS | The end of the enumeration has been reached. |
ERROR_FILEMARK_DETECTED | The DS_NOTIFY_AFTER_SITE_RECORDS flag was specified in the OptionFlags parameter in DsGetDcOpen and the last of the site-specific domain controllers has been enumerated. DsGetDcNext will then retrieve all of the domain controllers in the domain, including the site-specific domain controllers already enumerated. |
To reset the enumeration, close the current enumeration by calling DsGetDcClose and then reopen the enumeration by calling DsGetDcOpen again.
Client: Included in Windows XP.
Server: Included in Windows Server 2003.
Unicode: Implemented as Unicode and ANSI versions on Windows
XP.
Header: Declared in Dsgetdc.h.
Library: Use Netapi32.lib.
DsGetDcOpen, DsGetDcClose, SOCKET_ADDRESS, LocalFree, NetApiBufferFree, Enumerating Domain Controllers, Directory Service Functions