<div class="content" name="DsrAddressToSiteNamesExW" uuid="95c43206-3a18-4af3-928d-02d2e0c3d6c1"><p>The <b>DsrAddressToSiteNamesExW</b> method SHOULD<a id="Appendix_A_Target_175"></a><a aria-label="Product behavior note 175" href="0c858a52-732a-43ec-85dd-e44b357c1898#Appendix_A_175" data-linktype="relative-path">&lt;175&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 and
subnet 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 DsrAddressToSiteNamesExW(
   [in, unique, string] LOGONSRV_HANDLE ComputerName,
   [in, range(0,4096)] DWORD EntryCount,
   [in, size_is(EntryCount)] PNL_SOCKET_ADDRESS SocketAddresses,
   [out] PNL_SITE_NAME_EX_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> (defined in 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. To avoid large memory allocations, this number was chosen as a
reasonable limit for the maximum number of socket addresses that this method
accepts.</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="2b40b2eb-480c-42e9-b864-3de716db892d" data-linktype="relative-path">NL_SITE_NAME_EX_ARRAY</a></span>
structure (section 2.2.1.2.3) that contains an array of site names and an array
of subnet names that correspond to socket addresses in <i>SocketAddresses</i>.
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 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>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 DsrAddressToSiteNamesExW is zero.</td>
 </tr></tbody></table><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_176"></a><a aria-label="Product behavior note 176" href="0c858a52-732a-43ec-85dd-e44b357c1898#Appendix_A_176" data-linktype="relative-path">&lt;176&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 and subnet names that
correspond to the <i>SocketAddresses</i> 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>