Directory Services

IDsBrowseDomainTree::GetDomains

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
);

Parameters

ppDomainTree
[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.
dwFlags
[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 "myDom.Fabrikam.com".
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.
S_OK
The method was successful.
E_INVALIDARG
ppDomainTree is not valid.
E_FAIL
An unspecified error occurred.
E_OUTOFMEMORY
A memory allocation failure occurred.

Remarks

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

Requirements

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