<div class="content"><p> </p><p>The NetrShareGetInfo method retrieves information about a
particular shared resource on the <span><a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a></span> from the <b>ShareList</b>.</p><dl>
<dd>
<div><pre> NET_API_STATUS NetrShareGetInfo(
   [in, string, unique] SRVSVC_HANDLE ServerName,
   [in, string] WCHAR* NetName,
   [in] DWORD Level,
   [out, switch_is(Level)] LPSHARE_INFO InfoStruct
 );
</pre></div>
</dd></dl><p><b>ServerName: </b>An <span><a href="5f8329ee-1965-4ea1-ad35-3b29fbb63232" data-linktype="relative-path">SRVSVC_HANDLE (section 2.2.1.1)</a></span>
pointer that identifies the server. The <span><a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a></span> MUST map this
structure to an RPC 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). If this parameter is NULL, the local computer is used.</p><p><b>NetName: </b>A pointer to a null-terminated UTF-16
string that specifies the name of the share to return information for.</p><p><b>Level: </b>Specifies the information level of the
data. This parameter MUST be one of the following values.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>0</p>
  </td>
  <td>
  <p><span><a href="73a25288-8086-4975-91a3-5cbee5b590cc" data-linktype="relative-path">LPSHARE_INFO_0</a></span></p>
  </td>
 </tr><tr>
  <td>
  <p>1</p>
  </td>
  <td>
  <p><span><a href="fc69f110-998d-4c16-9667-514e22fdd80b" data-linktype="relative-path">LPSHARE_INFO_1</a></span></p>
  </td>
 </tr><tr>
  <td>
  <p>2</p>
  </td>
  <td>
  <p><span><a href="baead467-920e-4278-853b-bbd303aadfd6" data-linktype="relative-path">LPSHARE_INFO_2</a></span></p>
  </td>
 </tr><tr>
  <td>
  <p>501</p>
  </td>
  <td>
  <p><span><a href="bd6fb43c-a7fc-4430-8567-bf558552dea3" data-linktype="relative-path">LPSHARE_INFO_501</a></span></p>
  </td>
 </tr><tr>
  <td>
  <p>502</p>
  </td>
  <td>
  <p><span><a href="8605fd54-6ede-4316-b30d-ecfafa133c1d" data-linktype="relative-path">LPSHARE_INFO_502_I</a></span></p>
  </td>
 </tr><tr>
  <td>
  <p>503</p>
  </td>
  <td>
  <p><span><a href="0448e06c-91b2-4ca6-bd9c-02ed396a3fbc" data-linktype="relative-path">LPSHARE_INFO_503_I</a></span></p>
  </td>
 </tr><tr>
  <td>
  <p>1005</p>
  </td>
  <td>
  <p><span><a href="8a481783-9c6e-4f17-99d1-aea6578e21fb" data-linktype="relative-path">LPSHARE_INFO_1005</a></span></p>
  </td>
 </tr></tbody></table>
</dd></dl><p><b>InfoStruct: </b>This parameter is of type <span><a href="419f538b-9342-455e-9b8c-fa430e77bc54" data-linktype="relative-path">LPSHARE_INFO</a></span>
union, as specified in section 2.2.3.6. Its contents are determined by the
value of the <i>Level</i> parameter, as shown in the preceding table.</p><p><b>Return Values: </b>The method returns 0x00000000
(NERR_Success) to indicate success; otherwise, it returns a nonzero error code.
The method can take any specific error code value, as specified in <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>.
The most common error codes are listed in the following table.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>0x00000000</p>
  <p>NERR_Success</p>
  </td>
  <td>
  <p>The client request succeeded.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000005</p>
  <p>ERROR_ACCESS_DENIED</p>
  </td>
  <td>
  <p>Access is denied.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x0000007C</p>
  <p>ERROR_INVALID_LEVEL</p>
  </td>
  <td>
  <p>The system call level is not correct.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000057</p>
  <p>ERROR_INVALID_PARAMETER</p>
  </td>
  <td>
  <p>The client request failed because the specified
  parameter is invalid.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000008</p>
  <p>ERROR_NOT_ENOUGH_MEMORY</p>
  </td>
  <td>
  <p>Not enough storage is available to process this
  command.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x0000084B</p>
  <p>NERR_BufTooSmall</p>
  </td>
  <td>
  <p>The supplied buffer is too small.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000906</p>
  <p>NERR_NetNameNotFound</p>
  </td>
  <td>
  <p>The share name does not exist.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>If <i>ServerName</i> does not match any <b>Transport.ServerName</b>
in <b>TransportList</b> with the SVTI2_SCOPED_NAME bit set in <b>Transport.Flags</b>,
the server MUST reset <i>ServerName</i> as &#34;*&#34;.</p><p>The server MUST remove any preceding &#34;\\&#34; from the
parameter <i>ServerName</i> and normalize the <i>ServerName</i> parameter as
specified in section <span><a href="281119a2-9545-4d8d-b186-6e85b412f4ff" data-linktype="relative-path">3.1.6.8</a></span>, passing in
the updated <i>ServerName</i> parameter as the ServerName, and an empty string
as the ShareName.</p><p>The <i>NetName</i> parameter specifies the name of the share
for which to return information. 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 value of the <i>Level</i> parameter can be 0, 1, 2, 501,
502, 503, or 1005. If the value of the <i>Level</i> parameter is anything else,
the server MUST fail the call with an ERROR_INVALID_LEVEL error code. The value
of the <i>Level</i> parameter determines the format of the <i>InfoStruct</i>
parameter. </p><p>The server MUST locate a <b>Share</b> from <b>ShareList</b>,
where <i>NetName</i> matches <b>Share.ShareName</b> and the normalized <i>ServerName</i>
matches <b>Share.ServerName</b>. If no share is found, the server MUST fail the
call with NERR_NetNameNotFound error code. If a matching <b>Share</b> is found,
the server MUST query share properties by invoking the underlying server events
as specified in <span><a href="../ms-cifs/d416ff7c-c536-406e-a951-4f04b2fd1d2b" data-linktype="relative-path">[MS-CIFS]</a></span>
section <span><a href="../ms-cifs/c5193839-4cd5-4f95-8ada-df13584251ce" data-linktype="relative-path">3.3.4.12</a></span>
or <span><a href="../ms-smb/f210069c-7086-4dc2-885e-861d837df688" data-linktype="relative-path">[MS-SMB]</a></span>
section <span><a href="../ms-smb/8708a390-e791-48d7-aa2a-bdaceaefecbd" data-linktype="relative-path">3.3.4.7</a></span>,
and <span><a href="../ms-smb2/5606ad47-5ee0-437a-817e-70c366052962" data-linktype="relative-path">[MS-SMB2]</a></span>
section <span><a href="../ms-smb2/13acd5bf-3518-4dfd-8e06-a2e5cc45bf04" data-linktype="relative-path">3.3.4.16</a></span>,
providing the tuple &lt;<i>normalized server name</i>, <i>NetName</i>&gt; as
the input parameter. When the server receives STATUS_SUCCESS for a share, it
MUST consider the received SHARE_INFO_503_I and SHARE_INFO_1005 structures as
valid. The server MUST return information about the shared resource on the
server. </p><p>The server MUST use the <b>share</b> in valid
SHARE_INFO_503_I and SHARE_INFO_1005 structures from either CIFS or SMB2
servers and fill the return structures as follows. The server MUST discard the
structures received from other file server except the value of <b>share.shi503_current_uses</b>.</p><p>If the value of the <i>Level</i> parameter is 0, the server
MUST return information about the <b>share</b> by filling the SHARE_INFO_0
structure in the <b>ShareInfo0</b> member of the <i>InfoStruct</i> parameter.</p><ul><li><p><span><span> 
</span></span><b>shi0_netname</b> MUST be set to <b>share.shi503_netname</b>.</p>
</li></ul><p>If the value of the <i>Level</i> parameter is 1, the server
MUST return information about the <b>share</b> by filling the SHARE_INFO_1
structure in the <b>ShareInfo1</b> member of the <i>InfoStruct</i> parameter.</p><ul><li><p><span><span> 
</span></span><b>shi1_netname</b> MUST be set to <b>share.shi503_netname</b>.</p>
</li><li><p><span><span> 
</span></span><b>shi1_type</b> MUST be set to <b>share.shi503_type</b>.</p>
</li><li><p><span><span> 
</span></span><b>shi1_remark</b> MUST be set to <b>share.shi503_remark</b>.</p>
</li></ul><p>If the value of the <i>Level</i> parameter is 2, the server
MUST return information about the <b>share</b> by filling the SHARE_INFO_2
structure in the <b>ShareInfo2</b> member of the <i>InfoStruct</i> parameter.</p><ul><li><p><span><span> 
</span></span><b>shi2_netname</b> MUST be set to <b>share.shi503_netname</b>.</p>
</li><li><p><span><span> 
</span></span><b>shi2_type</b> MUST be set to <b>share.shi503_type</b>.</p>
</li><li><p><span><span> 
</span></span><b>shi2_remark</b> MUST be set to <b>share.shi503_remark</b>.</p>
</li><li><p><span><span> 
</span></span><b>shi2_permissions</b> MUST be set to <b>share.shi503_permissions</b>.</p>
</li><li><p><span><span> 
</span></span><b>shi2_max_uses</b> MUST be set to <b>share.shi503_max_uses</b>.</p>
</li><li><p><span><span> 
</span></span><b>shi2_current_uses</b> MUST be set to the sum of <b>share.shi503_current_uses</b>
values retrieved from both CIFS and SMB2 servers.</p>
</li><li><p><span><span> 
</span></span><b>shi2_path</b> MUST be set to <b>share.shi503_path</b>.</p>
</li><li><p><span><span> 
</span></span><b>shi2_passwd</b> MUST be set to <b>share.shi503_passwd</b>.</p>
</li></ul><p>If the value of the <i>Level</i> parameter is 501, the
server MUST return information about the <b>share</b> by filling the
SHARE_INFO_501 structure in the <b>ShareInfo501</b> member of the <i>InfoStruct</i>
parameter.</p><ul><li><p><span><span> 
</span></span><b>shi501_netname</b> MUST be set to <b>share.shi503_netname</b>.</p>
</li><li><p><span><span> 
</span></span><b>shi501_type</b> MUST be set to <b>share.shi503_type</b>.</p>
</li><li><p><span><span> 
</span></span><b>shi501_remark</b> MUST be set to <b>share.shi503_remark</b>.</p>
</li><li><p><span><span> 
</span></span><b>shi501_flags</b> MUST be set to <b>share.ShareFlags</b>.</p>
</li></ul><p>If the value of the <i>Level</i> parameter is 502, the
server MUST return information about the <b>share</b> by filling the
SHARE_INFO_502_I structure in the <b>ShareInfo502</b> member of the <i>InfoStruct</i>
parameter.</p><ul><li><p><span><span> 
</span></span><b>shi502_netname</b> MUST be set to <b>share.shi503_netname</b>.</p>
</li><li><p><span><span> 
</span></span><b>shi502_type</b> MUST be set to <b>share.shi503_type</b>.</p>
</li><li><p><span><span> 
</span></span><b>shi502_remark</b> MUST be set to <b>share.shi503_remark</b>.</p>
</li><li><p><span><span> 
</span></span><b>shi502_permissions</b> MUST be set to <b>share.shi503_permissions</b>.</p>
</li><li><p><span><span> 
</span></span><b>shi502_max_uses</b> MUST be set to <b>share.shi503_max_uses</b>.</p>
</li><li><p><span><span> 
</span></span><b>shi502_current_uses</b> MUST be set to the sum of <b>share.shi503_current_uses</b>
values retrieved from both CIFS and SMB2 servers.</p>
</li><li><p><span><span> 
</span></span><b>shi502_path</b> MUST be set to <b>share.shi503_path</b>.</p>
</li><li><p><span><span> 
</span></span><b>shi502_passwd</b> MUST be set to <b>share.shi503_passwd</b>.</p>
</li><li><p><span><span> 
</span></span><b>shi502_security_descriptor</b> MUST be set to <b>share.shi503_security_descriptor</b>.</p>
</li></ul><p>If the value of the <i>Level</i> parameter is 503, the
server MUST return information about the <b>share</b> in the SHARE_INFO_503_I
structure by filling the SHARE_INFO_503_I structure in the <b>ShareInfo503</b>
member of the <i>InfoStruct</i> parameter, except that <b>shi503_current_uses</b>
MUST be set to the sum of <b>share.shi503_current_uses</b> values retrieved
from both CIFS and SMB2 servers.</p><p>The server MUST set the STYPE_CLUSTER_FS,
STYPE_CLUSTER_SOFS, and STYPE_CLUSTER_DFS bits of the shi*_type field to zero;
the client MUST ignore them on receipt.</p><p>If the value of the <i>Level</i> parameter is 1005, the
server MUST return information about the <b>share</b> in the SHARE_INFO_1005
structure directly by filling the SHARE_INFO_1005 structure in the <b>ShareInfo1005</b>
member of the <i>InfoStruct</i> parameter.</p><p>If both the SMB server and the SMB2 server return an error,
the server MUST fail the call with NERR_NetNameNotFound error code.</p><p>The server SHOULD<a id="Appendix_A_Target_60"></a><a aria-label="Product behavior note 60" href="ebb74ff2-abb1-4e1b-a76a-563a5cbbea9a#Appendix_A_60" data-linktype="relative-path">&lt;60&gt;</a> enforce
security measures to verify that the caller has the required permissions to
execute this routine. If the caller does not have the required credentials, the
server SHOULD<a id="Appendix_A_Target_61"></a><a aria-label="Product behavior note 61" href="ebb74ff2-abb1-4e1b-a76a-563a5cbbea9a#Appendix_A_61" data-linktype="relative-path">&lt;61&gt;</a> fail the call.</p></div>