<div class="content" name="NetrEnumerateTrustedDomains" uuid="1d106b28-c30f-4fd1-b7b0-240b6250d7f6"><p>The <b>NetrEnumerateTrustedDomains</b> method SHOULD<a id="Appendix_A_Target_237"></a><a aria-label="Product behavior note 237" href="0c858a52-732a-43ec-85dd-e44b357c1898#Appendix_A_237" data-linktype="relative-path">&lt;237&gt;</a> return a set of <span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf" data-linktype="relative-path">NetBIOS
names</a></span> of <span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_5ee032d0-d944-4acb-bbb5-b1cfc7df6db6" data-linktype="relative-path">trusted</a></span> <span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca" data-linktype="relative-path">domains</a></span>.
</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 <span><a href="3b224201-b531-43e2-8c79-b61f6dea8640" data-linktype="relative-path">3.5.4.1</a></span>.</p><p><b>DomainNameBuffer: </b>A pointer to a <span><a href="11743dc4-7a2d-4464-b351-50aeb8801b8b" data-linktype="relative-path">DOMAIN_NAME_BUFFER</a></span>
structure, as specified in section 2.2.1.6.1, that contains a list of trusted <span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_45a1c9f1-0263-49a8-97c7-7aca1a99308c" data-linktype="relative-path">domain
names</a></span>. 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>0x0000051F ERROR_NO_LOGON_SERVERS</td>
  <td>There are currently no logon servers available to service the logon request.</td>
 </tr><tr>
  <td>0x000006FA ERROR_NO_TRUST_LSA_SECRET</td>
  <td>The workstation does not have a trust secret.</td>
 </tr><tr>
  <td>0x000006FB ERROR_NO_TRUST_SAM_ACCOUNT</td>
  <td>The security database on the server does not have a computer account for this workstation trust relationship.</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 <span><a href="c3e9870a-0943-4d45-be94-edb9419a1c11" data-linktype="relative-path">NetrEnumerateTrustedDomainsEx</a></span>
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>