DsEnumerateDomainTrustsA function

The DsEnumerateDomainTrusts function obtains domain trust data for a specified domain.

Syntax

DSGETDCAPI DWORD DsEnumerateDomainTrustsA(
  LPSTR ServerName   OPTIONAL,
  ULONG              Flags,
  PDS_DOMAIN_TRUSTSA *Domains,
  PULONG             DomainCount
);

Parameters

OPTIONAL

Flags

Contains a set of flags that determines which domain trusts to enumerate. This can be zero or a combination of one or more of the following values.

DS_DOMAIN_DIRECT_INBOUND

Enumerate domains that directly trust the domain which has ServerName as a member.

DS_DOMAIN_DIRECT_OUTBOUND

Enumerate domains directly trusted by the domain which has ServerName as a member.

DS_DOMAIN_IN_FOREST

Enumerate domains that are a member of the same forest which has ServerName as a member.

DS_DOMAIN_NATIVE_MODE

Enumerate domains where the primary domain is running in Windows 2000 native mode.

DS_DOMAIN_PRIMARY

Enumerate domains that are the primary domain of the domain which has ServerName as a member.

DS_DOMAIN_TREE_ROOT

Enumerate domains that are at the root of the forest which has ServerName as a member.

Domains

Pointer to a PDS_DOMAIN_TRUSTS value that receives an array of DS_DOMAIN_TRUSTS structures. Each structure in this array contains trust data about a domain. The caller must free this memory when it is no longer required by calling NetApiBufferFree.

DomainCount

Pointer to a ULONG value that receives the number of elements returned in the Domains array.

Return Value

Returns ERROR_SUCCESS if successful or a Win32 error code otherwise. Possible error codes include those listed in the following list.

Requirements

   
Windows version Windows Vista Windows Server 2008
Target Platform Windows
Header dsgetdc.h
Library Netapi32.lib
DLL Netapi32.dll

See Also

DS_DOMAIN_TRUSTS

Directory Service Functions

NetApiBufferFree