3.5.4.7.2 NetrEnumerateTrustedDomainsEx (Opnum 36)

The NetrEnumerateTrustedDomainsEx method SHOULD<228> return a list of trusted domains from a specified server. This method extends NetrEnumerateTrustedDomains by returning an array of domains in a more flexible DS_DOMAIN_TRUSTSW structure, as specified in section 2.2.1.6.2, rather than the array of strings in DOMAIN_NAME_BUFFER structure, as specified in section 2.2.1.6.1. The array is returned as part of the NETLOGON_TRUSTED_DOMAIN_ARRAY structure, as specified in section 2.2.1.6.3.

 NET_API_STATUS NetrEnumerateTrustedDomainsEx(
   [in, unique, string] LOGONSRV_HANDLE ServerName,
   [out] PNETLOGON_TRUSTED_DOMAIN_ARRAY Domains
 );

ServerName: The custom binding handle, as defined in section 3.5.4.1.

Domains: A pointer to a NETLOGON_TRUSTED_DOMAIN_ARRAY structure, as specified in section 2.2.1.6.3, that contains an array of DS_DOMAIN_TRUSTSW structures, as specified in section 2.2.1.6.2, one for each trusted domain.

Return Values: The method returns 0x00000000 on success; otherwise, it SHOULD return one of the following error codes.

Return Value/Code

Description

0x0000051F

ERROR_NO_LOGON_SERVERS

There are currently no logon servers available to service the logon request.

0x000006FA

ERROR_NO_TRUST_LSA_SECRET

The workstation does not have a trust secret.

0x000006FB

ERROR_NO_TRUST_SAM_ACCOUNT

The security database on the server does not have a computer account for this workstation trust relationship.

This method is a wrapper for DsrEnumerateDomainTrusts, which strips off the F flag from the returned data for backward compatibility. For details, see section 3.5.4.7.1.