<div class="content"><p> </p><p>The <b>NetrUseGetInfo</b> method retrieves details from a
remote workstation about a connection to a shared resource on an SMB server.
The server SHOULD NOT allow this method to be invoked remotely<a id="Appendix_A_Target_47"></a><a aria-label="Product behavior note 47" href="def80006-2495-4571-8a93-1668e0f8af31#Appendix_A_47" data-linktype="relative-path">&lt;47&gt;</a> and SHOULD return
ERROR_CALL_NOT_IMPLEMENTED.</p><dl>
<dd>
<div><pre> unsigned long NetrUseGetInfo(
   [in, string, unique] WKSSVC_IMPERSONATE_HANDLE ServerName,
   [in, string] wchar_t* UseName,
   [in] unsigned long Level,
   [out, switch_is(Level)] LPUSE_INFO InfoStruct
 );
</pre></div>
</dd></dl><p><b>ServerName: </b>A <b>WKSSVC_IMPERSONATE_HANDLE</b>
structure (section <span><a href="2427e140-22b3-45f8-9e12-1b3593308e46" data-linktype="relative-path">2.2.2.2</a></span>) that
identifies the <span><a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server (2)</a></span>. The <span><a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a></span>
MUST map this structure to an <span><a href="3acf0e02-9bbd-4ce0-a7a0-586bc72d3ef4#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a></span> binding handle (<span><a href="https://go.microsoft.com/fwlink/?LinkId=89824" data-linktype="external">[C706]</a></span>
sections 4.3.5 and 5.1.5.2). The server MUST ignore this parameter.</p><p><b>UseName: </b>A pointer to a string that specifies
the local device name or shared resource name for which to return information.</p><p><b>Level: </b>A value that specifies the information
level of the data. This parameter MUST be one of the following values;
otherwise, the server MUST fail the call with an ERROR_INVALID_LEVEL code.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>0x00000000</p>
  </td>
  <td>
  <p>The buffer is a <b>USE_INFO_0</b> structure (section <span><a href="c6253242-d630-40ba-bded-f69695357ef3" data-linktype="relative-path">2.2.5.22</a></span>).</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000001</p>
  </td>
  <td>
  <p>The buffer is a <b>USE_INFO_1</b> structure (section <span><a href="969d330b-fffa-4c4f-8331-62b3989086ff" data-linktype="relative-path">2.2.5.23</a></span>).</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000002</p>
  </td>
  <td>
  <p>The buffer is a <b>USE_INFO_2</b> structure (section <span><a href="144e75a6-cda2-4418-96b9-e6867b50bfba" data-linktype="relative-path">2.2.5.24</a></span>).</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000003</p>
  </td>
  <td>
  <p>The buffer is a <b>USE_INFO_3</b> structure (section <span><a href="a6cb7714-e93e-4262-abd8-ca29c757a620" data-linktype="relative-path">2.2.5.25</a></span>).</p>
  </td>
 </tr></tbody></table>
</dd></dl><p><b>InfoStruct: </b>A pointer to the buffer that
specifies the data. The format of this data depends on the value of the <i>Level</i>
parameter.</p><p><b>Return Values: </b>When the message processing
result meets the description in the right-hand column of the following table,
this method MUST return one of the following values (<span><a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a></span>
section <span><a href="../ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d" data-linktype="relative-path">2.2</a></span>).
</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value/code</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>NERR_Success</p>
  <p>0x00000000</p>
  </td>
  <td>
  <p>The operation completed successfully.</p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_ACCESS_DENIED</p>
  <p>0x00000005</p>
  </td>
  <td>
  <p>Access is denied.</p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_INVALID_PARAMETER</p>
  <p>0x00000057</p>
  </td>
  <td>
  <p>One of the function parameters is not valid.</p>
  </td>
 </tr><tr>
  <td>
  <p>ERROR_INVALID_LEVEL</p>
  <p>0x0000007C</p>
  </td>
  <td>
  <p>The information level is invalid.</p>
  </td>
 </tr><tr>
  <td>
  <p>NERR_UseNotFound</p>
  <p>0x000008CA</p>
  </td>
  <td>
  <p>The network connection could not be found.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>The server SHOULD<a id="Appendix_A_Target_48"></a><a aria-label="Product behavior note 48" href="def80006-2495-4571-8a93-1668e0f8af31#Appendix_A_48" data-linktype="relative-path">&lt;48&gt;</a> enforce
security measures to verify that the caller has the required permissions to
execute this routine. If the server enforces security measures and the caller
does not have the required credentials, the server MUST fail the call with
ERROR_ACCESS_DENIED. Specifications for determining the identity of the caller
for the purpose of performing an access check are in <span><a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a></span>
section <span><a href="../ms-rpce/0e5b0e1c-0ba5-4342-bc36-30c66a9d07fd" data-linktype="relative-path">3.3.3.1.3</a></span>.</p><p>The <i>UseName</i> parameter specifies the local device name
or shared resource name for which to return information. The server MUST
canonicalize <i>UseName </i>(<span><a href="../ms-srvs/accf23b0-0f57-441c-9185-43041f1b0ee9" data-linktype="relative-path">[MS-SRVS]</a></span>
section <span><a href="../ms-srvs/e79aaff9-ba49-4548-8cc6-7041a7fcf907" data-linktype="relative-path">3.1.4.33</a></span>).
This MUST be a nonempty, null-terminated UTF-16 string; otherwise, the server
MUST fail the call with an ERROR_INVALID_PARAMETER error code.</p><p>The server MUST ensure that the remaining steps are executed
atomically with respect to other callers performing queries or updates to the <b>UseTable</b>
and <b>Connection</b> tables.</p><p>The server invokes the event to impersonate the client
([MS-RPCE] section <span><a href="../ms-rpce/a996aa17-8e04-4a25-806a-a3c724230e12" data-linktype="relative-path">3.3.3.4.3.1</a></span>)
passing in NULL as input parameter. If this event fails, the server MUST return
an error. If the event returns UserToken, the server MUST look in <b>UseTable</b>
for an entry where <b>UseEntry.UserToken</b> matches UserToken. If no match is
found, the server MUST fail the call with a NERR_UseNotFound error code.</p><p>If a match is found and <i>UseName</i> is a UNC path type,
the server MUST locate the connection where <i>UseName</i> matches <b>Connection.remote</b>.
If <i>UseName</i> is a local device name, the server MUST locate a <b>UseEntry.ConnectionTable</b>
where <i>UseName</i> matches <b>Connection.local</b>. If no match is found, the
server MUST fail the call with a NERR_UseNotFound error code. If a matching
connection is found, the server MUST return details about the connection on the
remote workstation.</p><p>The server MUST fill the return structures as follows:</p><ul><li><p><span><span> 
</span></span>If the <b>Level</b> member is 0, the server MUST return details
about the connection by filling the <b>USE_INFO_0_CONTAINER</b> structure
(section <span><a href="93aed681-2e57-41f7-84ca-4fb14ad5b7ba" data-linktype="relative-path">2.2.5.26</a></span>) in the <b>Buffer</b>
field of the <i>InfoStruct</i> parameter as follows. <b>USE_INFO_0_CONTAINER</b>
contains an array of <b>USE_INFO_0</b> structures.</p>
<ul><li><p><span><span>  </span></span><b>ui0_local</b>
set to <b>Connection.local</b></p>
</li><li><p><span><span>  </span></span><b>ui0_remote</b>
set to <b>Connection.Remote</b></p>
</li></ul></li><li><p><span><span> 
</span></span>If the <b>Level</b> member is 1, the server MUST return details
about the connection by filling the <b>USE_INFO_1_CONTAINER</b> structure (section
<span><a href="21a7e830-91b0-416e-a151-7760f3646d68" data-linktype="relative-path">2.2.5.27</a></span>)
in the <b>Buffer</b> field of the <i>InfoStruct</i> parameter as follows. <b>USE_INFO_1_CONTAINER</b>
contains an array of <b>USE_INFO_1</b> structures.</p>
<ul><li><p><span><span>  </span></span><b>ui1_local</b>
set to <b>Connection.local</b></p>
</li><li><p><span><span>  </span></span><b>ui1_remote</b>
set to <b>Connection.remote</b></p>
</li><li><p><span><span>  </span></span><b>ui1_password</b>
set to NULL</p>
</li><li><p><span><span>  </span></span><b>ui1_status</b>
set to <b>Connection.status</b></p>
</li><li><p><span><span>  </span></span><b>ui1_asg_type</b>
set to <b>Connection.asgtype</b></p>
</li><li><p><span><span>  </span></span><b>ui1_refcount</b>
set to <b>Connection.refcount</b></p>
</li><li><p><span><span>  </span></span><b>ui1_usecount</b>
set to <b>Connection.usecount</b></p>
</li></ul></li><li><p><span><span> 
</span></span>If the <b>Level</b> member is 2 or 3, the server MUST return details
about the connection by filling the <b>USE_INFO_2_CONTAINER</b> structure
(section <span><a href="f739de8a-b363-488e-a9c8-190ac6234189" data-linktype="relative-path">2.2.5.28</a></span>) in the <b>Buffer</b>
field of the <i>InfoStruct</i> parameter as follows. <b>USE_INFO_2_CONTAINER</b>
contains an array of <b>USE_INFO_2</b> structures.</p>
<ul><li><p><span><span>  </span></span><b>ui2_local</b>
set to <b>Connection.local</b></p>
</li><li><p><span><span>  </span></span><b>ui2_remote</b>
set to <b>Connection.remote</b></p>
</li><li><p><span><span>  </span></span><b>ui2_password</b>
set to NULL</p>
</li><li><p><span><span>  </span></span><b>ui2_status</b>
set to <b>Connection.status</b></p>
</li><li><p><span><span>  </span></span><b>ui2_asg_type</b>
set to <b>Connection.asgtype</b></p>
</li><li><p><span><span>  </span></span><b>ui2_refcount</b>
set to <b>Connection.refcount</b></p>
</li><li><p><span><span>  </span></span><b>ui2_usecount</b>
set to <b>Connection.usecount</b></p>
</li><li><p><span><span>  </span></span><b>ui2_username</b>
set to <b>Connection.username</b></p>
</li><li><p><span><span>  </span></span><b>ui2_domainname</b>
set to <b>Connection.domain</b></p>
</li></ul></li></ul><p>The server MUST invoke the event to end the client
impersonation ([MS-RPCE] section <span><a href="../ms-rpce/53d8f057-4e3a-4bc4-9355-a1cd781de901" data-linktype="relative-path">3.3.3.4.3.3</a></span>).</p></div>