<div class="content" name="DsrAddressToSiteNamesW" uuid="0731ce2e-fde2-405c-b7d7-c9012df9d718"><p>The <b>DsrAddressToSiteNamesW</b> method SHOULD<a id="Appendix_A_Target_173"></a><a aria-label="Product behavior note 173" href="0c858a52-732a-43ec-85dd-e44b357c1898#Appendix_A_173" data-linktype="relative-path">&lt;173&gt;</a> translate a list of socket
addresses into their corresponding <span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_8abdc986-5679-42d9-ad76-b11eb5a0daba" data-linktype="relative-path">site</a></span> names. For
details about the mapping from socket address to subnet/site name, see <span><a href="../ms-adts/d2435927-0999-4c62-8c6d-13ba31a52e1a" data-linktype="relative-path">[MS-ADTS]</a></span>
sections <span><a href="../ms-adts/cdacdd51-f324-41e9-b83f-71263902dabe" data-linktype="relative-path">6.1.1.2.2.1</a></span>
and <span><a href="../ms-adts/448970b1-1778-4569-9bb3-3bbaa86ad7df" data-linktype="relative-path">6.1.1.2.2.2</a></span>.
</p><dl>
<dd>
<div><pre> NET_API_STATUS DsrAddressToSiteNamesW(
   [in, unique, string] LOGONSRV_HANDLE ComputerName,
   [in, range(0,4096)] DWORD EntryCount,
   [in, size_is(EntryCount)] PNL_SOCKET_ADDRESS SocketAddresses,
   [out] PNL_SITE_NAME_ARRAY* SiteNames
 );
</pre></div>
</dd></dl><p><b>ComputerName: </b>The custom <span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_44deb72d-c62b-4335-90e4-b9fd4dd782ed" data-linktype="relative-path">binding
handle</a></span> (section <span><a href="3b224201-b531-43e2-8c79-b61f6dea8640" data-linktype="relative-path">3.5.4.1</a></span>) that
represents the connection to a <span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_76a05049-3531-4abd-aec8-30e19954b4bd" data-linktype="relative-path">domain controller</a></span>.</p><p><b>EntryCount: </b>The number of socket addresses
specified in <i>SocketAddresses</i>. The maximum value for <i>EntryCount</i> is
32000. The limit was chosen to prevent clients from being able to force large
memory allocations on servers.</p><p><b>SocketAddresses: </b>An array of <span><a href="235d0c09-b9db-44c5-9d4d-806919be657b" data-linktype="relative-path">NL_SOCKET_ADDRESS</a></span>
structures (section 2.2.1.2.4) that contains socket addresses to translate. The
number of addresses specified MUST be equal to <i>EntryCount</i>.</p><p><b>SiteNames: </b>A pointer to an <span><a href="4c5fb44a-6d68-420d-970e-68ad5436bbd3" data-linktype="relative-path">NL_SITE_NAME_ARRAY</a></span>
structure (section 2.2.1.2.2) that contains a corresponding array of site
names. The number of entries returned is equal to <i>EntryCount</i>. The fields
of an entry are set to zero if the corresponding socket address does not map to
any site, or if the address family of the socket address is not IPV4 or IPV6.
The mapping of IP addresses to sites is specified in [MS-ADTS] section
6.1.1.2.2.1.</p><p><b>Return Values: </b>The method returns 0x00000000
on success; otherwise, it returns a nonzero error code.</p><table><thead>
  <tr>
   <th>
   <p>Return Value/Code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000008 ERROR_NOT_ENOUGH_MEMORY</td>
  <td>Not enough storage is available to process this command.</td>
 </tr><tr>
  <td>0x00000057 ERROR_INVALID_PARAMETER</td>
  <td>One of the parameters is invalid. This error value is returned if the value of EntryCount passed to DsrAddressToSiteNamesW is zero.</td>
 </tr></tbody></table><dl>
<dd>
<p> </p>
</dd></dl><p>This method returns errors based on Common Error Processing
Rule A, specified in section <span><a href="2d776bfc-e81f-4c8f-9da8-4c2920f65413" data-linktype="relative-path">3</a></span>.</p><p>Verify that the client has sufficient privileges. The server
determines if the client has sufficient privileges (as specified in section <span><a href="1ec94886-2b64-45af-b68e-3d9faa36617c" data-linktype="relative-path">3.5.4.2</a></span>).
If the server is not a domain controller the Access Request mask is set to
NETLOGON_WKSTA_RPC_ACCESS. If the server is a domain controller the Access
Request mask is set to NETLOGON_DCLOC_RPC_ACCESS.<a id="Appendix_A_Target_174"></a><a aria-label="Product behavior note 174" href="0c858a52-732a-43ec-85dd-e44b357c1898#Appendix_A_174" data-linktype="relative-path">&lt;174&gt;</a> If the
client does not have sufficient privileges the server MUST return
ERROR_ACCESS_DENIED.</p><p>The server MUST return the site names that correspond to the
<i>SocketAddresses</i> parameter by using the method specified for IP address
and site/subnet mapping ([MS-ADTS] section <span><a href="../ms-adts/255d4630-f033-4289-8db6-c36060b47e17" data-linktype="relative-path">6.1.1.2.2.2.1</a></span>).</p></div>