NetrEnumerateTrustedDomainsEx (Opnum 36)

The NetrEnumerateTrustedDomainsEx method SHOULD<214> 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, rather than the array of strings in DOMAIN_NAME_BUFFER structure, as specified in section The array is returned as part of the NETLOGON_TRUSTED_DOMAIN_ARRAY structure, as specified in section

 NET_API_STATUS NetrEnumerateTrustedDomainsEx(
   [in, unique, string] LOGONSRV_HANDLE ServerName,

ServerName: The custom binding handle, as defined in section

Domains: A pointer to a NETLOGON_TRUSTED_DOMAIN_ARRAY structure, as specified in section, that contains an array of DS_DOMAIN_TRUSTSW structures, as specified in section, 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




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



The workstation does not have a trust secret.



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