Directory Services


The IDsBrowseDomainTree::GetDomains method retrieves the trust domains of the current computer. The current computer is set using the IDsBrowseDomainTree::SetComputer method.

HRESULT GetDomains( 
  PDOMAINTREE* ppDomainTree,
  DWORD dwFlags


[in] Pointer to a DOMAINTREE structure pointer that receives the trust domain data. The caller must free this memory when no longer required by calling IDsBrowseDomainTree::FreeDomains.
[in] Contains a set of flags that modify the domain contents. This can be zero or a combination of one or more of the following values.
Value Meaning
DBDTF_RETURNFQDN The pszNCName members of the DOMAINDESC structures will receive the fully-qualified domain names. The fully-qualified domain name takes the form "DC=myDom, DC=Fabrikam, DC=com" as opposed to "".
DBDTF_RETURNMIXEDDOMAINS The method will return downlevel trust domains.
DBDTF_RETURNEXTERNAL The method will return external trust domains.
DBDTF_RETURNINBOUND If this flag is set, the method returns trusting domains. If this flag is not set, the method returns trusted domains.
DBDTF_RETURNINOUTBOUND The method will return both trusted and trusting domains.

Return Values

Returns a standard HRESULT value including the following.
The method was successful.
ppDomainTree is not valid.
An unspecified error occurred.
A memory allocation failure occurred.


For more information about how to access and use the data provided by this method, see Domain Browser.


Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Header: Declared in Dsclient.h.

See Also

DOMAINTREE, DOMAINDESC, IDsBrowseDomainTree::FreeDomains, Domain Browser, IDsBrowseDomainTree