<div class="content"><p align="right"><a href="https://msdn.microsoft.com/en-us/library/1d106b28-c30f-4fd1-b7b0-240b6250d7f6" data-linktype="external">msdn link</a></p><p>The <b>NetrEnumerateTrustedDomains</b> method SHOULD<a id="Appendix_A_Target_227"></a><a aria-label="Product behavior note 227" href="0c858a52-732a-43ec-85dd-e44b357c1898#Appendix_A_227" data-linktype="relative-path">&lt;227&gt;</a> return a set of <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf" data-linktype="relative-path">NetBIOS names</a> of <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_5ee032d0-d944-4acb-bbb5-b1cfc7df6db6" data-linktype="relative-path">trusted</a> <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca" data-linktype="relative-path">domains</a>. </p><dl>
<dd>
<div><pre> NTSTATUS NetrEnumerateTrustedDomains(
   [in, unique, string] LOGONSRV_HANDLE ServerName,
   [out] PDOMAIN_NAME_BUFFER DomainNameBuffer
 );
</pre></div>
</dd></dl><p><b>ServerName: </b>The custom binding handle, as
defined in section <a href="3b224201-b531-43e2-8c79-b61f6dea8640" data-linktype="relative-path">3.5.4.1</a>.</p><p><b>DomainNameBuffer: </b>A pointer to a <a href="11743dc4-7a2d-4464-b351-50aeb8801b8b" data-linktype="relative-path">DOMAIN_NAME_BUFFER</a>
structure, as specified in section 2.2.1.6.1, that contains a list of trusted <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_45a1c9f1-0263-49a8-97c7-7aca1a99308c" data-linktype="relative-path">domain names</a>. The format of
domain names contained in the buffer is specified in section 2.2.1.6.1.</p><p><b>Return Values: </b>The method returns 0x00000000
on success; otherwise, it SHOULD return one of the following error codes.</p><table><thead>
  <tr>
   <th>
   <p>Return Value/Code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>0x0000051F</p>
  <p>ERROR_NO_LOGON_SERVERS</p>
  </td>
  <td>
  <p>There are currently no logon servers available to
  service the logon request.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x000006FA</p>
  <p>ERROR_NO_TRUST_LSA_SECRET</p>
  </td>
  <td>
  <p>The workstation does not have a trust secret.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x000006FB</p>
  <p>ERROR_NO_TRUST_SAM_ACCOUNT</p>
  </td>
  <td>
  <p>The security database on the server does not have a
  computer account for this workstation trust relationship.</p>
  </td>
 </tr></tbody></table><dl>
<dd>
<p> </p>
</dd></dl><p>The server initializes the <i>DomainNames</i> field
of the DOMAIN_NAME_BUFFER to the empty string. The server calls the <a href="c3e9870a-0943-4d45-be94-edb9419a1c11" data-linktype="relative-path">NetrEnumerateTrustedDomainsEx</a>
method and for each <b>PDS_DOMAIN_TRUSTSW</b> element of the <b>NETLOGON_TRUSTED_DOMAIN_ARRAY</b>,
appends the <i>NetbiosDomainName</i> field to the <i>DomainNames</i> field of
the <b>DOMAIN_NAME_BUFFER</b> (section 2.2.1.6.1). Then the server terminates
the <i>DomainNames</i> field with two null bytes.</p><p>For details, see section 3.5.4.7.2, Receiving
NetrEnumerateTrustedDomainsEx.</p></div>