<div class="content" name="NetrFileGetInfo" uuid="7b41f566-5418-47c7-85d9-5be229127675"><p>The NetrFileGetInfo method MUST retrieve information about a
particular open <a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a>
resource or return an error code.</p><dl>
<dd>
<div><pre> NET_API_STATUS NetrFileGetInfo(
   [in, string, unique] SRVSVC_HANDLE ServerName,
   [in] DWORD FileId,
   [in] DWORD Level,
   [out, switch_is(Level)] LPFILE_INFO InfoStruct
 );
</pre></div>
</dd></dl><p><b>ServerName: </b>An <a href="5f8329ee-1965-4ea1-ad35-3b29fbb63232" data-linktype="relative-path">SRVSVC_HANDLE (section 2.2.1.1)</a>
pointer that identifies the server. The <a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a> MUST map this
structure to an RPC binding handle (see <a href="https://go.microsoft.com/fwlink/?LinkId=89824" data-linktype="external">[C706]</a> sections 4.3.5
and 5.1.5.2). The server MUST ignore this parameter.</p><p><b>FileId: </b>Specifies the file identifier of the
open resource to return information for. The value of this parameter MUST have
been returned in a previous <a href="c5433da3-e2a5-4cdb-850b-0f9ce0795b8b" data-linktype="relative-path">NetrFileEnum</a>
method call.</p><dl>
<dd>
<p><b>NOTE:</b> The <i>FileId</i> parameter returned in
a previous NetrFileEnum call is not guaranteed to be valid. Therefore, the
NetrFileGetInfo method is not guaranteed to succeed based on the validity of
the <i>FileId</i> parameter.</p>
</dd></dl><p><b>Level: </b>Specifies the information level of the
data. This parameter MUST have 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>2</td>
  <td>FILE_INFO_2</td>
 </tr><tr>
  <td>3</td>
  <td>FILE_INFO_3</td>
 </tr></tbody></table>
</dd></dl><p><b>InfoStruct: </b>This parameter is of type <a href="f11e7081-53df-4756-8a7a-8aaef97db9db" data-linktype="relative-path">LPFILE_INFO</a>, which is
defined in section 2.2.3.3. Its contents are determined by the value of the <b>Level</b>
member, as shown in the previous parameter 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 <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>
section <a href="../ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d" data-linktype="relative-path">2.2</a>.
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>0x00000000 NERR_Success</td>
  <td>The client request succeeded.</td>
 </tr><tr>
  <td>0x00000005 ERROR_ACCESS_DENIED</td>
  <td>Access is denied.</td>
 </tr><tr>
  <td>0x00000002 ERROR_FILE_NOT_FOUND</td>
  <td>The system cannot find the file specified.</td>
 </tr><tr>
  <td>0x0000007C ERROR_INVALID_LEVEL</td>
  <td>The system call level is not correct.</td>
 </tr><tr>
  <td>0x00000008 ERROR_NOT_ENOUGH_MEMORY</td>
  <td>Not enough storage is available to process this command.</td>
 </tr><tr>
  <td>0x0000084B NERR_BufTooSmall</td>
  <td>The supplied buffer is too small.</td>
 </tr></tbody></table>
</dd></dl><p>In response to a NetrFileGetInfo message, the server MUST
query open properties by invoking underlying server events as specified in <a href="../ms-cifs/d416ff7c-c536-406e-a951-4f04b2fd1d2b" data-linktype="relative-path">[MS-CIFS]</a>
section <a href="../ms-cifs/ad0c8f3f-6d3e-4db1-8ca8-c50976e87d2e" data-linktype="relative-path">3.3.4.16</a>
and <a href="../ms-smb2/5606ad47-5ee0-437a-817e-70c366052962" data-linktype="relative-path">[MS-SMB2]</a>
section <a href="../ms-smb2/154b1eef-6580-44aa-ac57-f1f41874d693" data-linktype="relative-path">3.3.4.20</a>,
providing <i>FileId</i> as the input parameter. When the server receives a
non-NULL FILE_INFO_3 structure from either a CIFS or SMB2 server, the server
MUST return information about a particular opening of a server resource (file,
device, or <a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca" data-linktype="relative-path">named pipe</a>).
Otherwise, the server MUST fail the call with an ERROR_FILE_NOT_FOUND error
code.</p><p>The <i>FileId</i> parameter specifies the file identifier of
the open resource in <b>FileList</b> to return information for. The value of
this parameter MUST have been returned in a previous NetrFileEnum message
response by the server.</p><p>The <i>Level</i> parameter can be either 2 or 3. If the
value of the <i>Level</i> parameter is anything else, the server MUST fail the
call with ERROR_INVALID_LEVEL. The value of the <i>Level</i> parameter
determines the format of the <i>InfoStruct</i> parameter.</p><p>The server MUST retrieve the <b>open</b> in FILE_INFO_3
structure from CIFS and SMB2 servers and fill the return structures as follows.</p><p>If the value of the <i>Level</i> parameter is 2, the server
MUST return information about the <b>open</b> whose file identifier is <i>FileId</i>
by filling the FILE_INFO_2 structure in the FileInfo2 field of the <i>InfoStruct</i>
parameter as follows:</p><ul><li><p><span><span> 
</span></span><b>fi2_id</b> MUST be set to <b>open.fi3_id</b>.</p>
</li></ul><p>If the value of the <i>Level</i> parameter is 3, the server
MUST return the <b>open</b> directly whose <b>fi3_id</b> is equal to <i>FileId</i>.</p><p>The server SHOULD<a id="Appendix_A_Target_48"></a><a aria-label="Product behavior note 48" href="ebb74ff2-abb1-4e1b-a76a-563a5cbbea9a#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 caller does not have the required credentials, the
server SHOULD<a id="Appendix_A_Target_49"></a><a aria-label="Product behavior note 49" href="ebb74ff2-abb1-4e1b-a76a-563a5cbbea9a#Appendix_A_49" data-linktype="relative-path">&lt;49&gt;</a> fail the call.</p></div>