NetrEnumerateTrustedDomains (Opnum 19)

The NetrEnumerateTrustedDomains method SHOULD<220> return a set of NetBIOS names of trusted domains.

 NTSTATUS NetrEnumerateTrustedDomains(
   [in, unique, string] LOGONSRV_HANDLE ServerName,
   [out] PDOMAIN_NAME_BUFFER DomainNameBuffer

ServerName: The custom binding handle, as defined in section

DomainNameBuffer: A pointer to a DOMAIN_NAME_BUFFER structure, as specified in section, that contains a list of trusted domain names. The format of domain names contained in the buffer is specified in section

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.

The server initializes the DomainNames field of the DOMAIN_NAME buffer to the empty string. The server calls the NetrEnumerateTrustedDomainsEx method and for each PDS_DOMAIN_TRUSTSW element of the NETLOGON_TRUSTED_DOMAIN_ARRAY, appends the NetbiosDomainName field to the DomainNames field of the DOMAIN_NAME_BUFFER (section Then the server terminates the DomainNames field with two null bytes.

For details, see section, Receiving NetrEnumerateTrustedDomainsEx.