<div class="content"><p> </p><p>The NetrFileGetInfo method MUST retrieve information about a
particular open <span><a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a></span> 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 <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 (see <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>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 <span><a href="c5433da3-e2a5-4cdb-850b-0f9ce0795b8b" data-linktype="relative-path">NetrFileEnum</a></span> 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>
  <p>2</p>
  </td>
  <td>
  <p><span><a href="b64cd630-e38a-49b8-9f35-bfd81d674892" data-linktype="relative-path">FILE_INFO_2</a></span></p>
  </td>
 </tr><tr>
  <td>
  <p>3</p>
  </td>
  <td>
  <p><span><a href="1ce89330-a817-408d-975b-eb2852481238" data-linktype="relative-path">FILE_INFO_3</a></span></p>
  </td>
 </tr></tbody></table>
</dd></dl><p><b>InfoStruct: </b>This parameter is of type <span><a href="f11e7081-53df-4756-8a7a-8aaef97db9db" data-linktype="relative-path">LPFILE_INFO</a></span>,
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 <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>0x00000002</p>
  <p>ERROR_FILE_NOT_FOUND</p>
  </td>
  <td>
  <p>The system cannot find the file specified.</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>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></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 <span><a href="../ms-cifs/d416ff7c-c536-406e-a951-4f04b2fd1d2b" data-linktype="relative-path">[MS-CIFS]</a></span>
section <span><a href="../ms-cifs/ad0c8f3f-6d3e-4db1-8ca8-c50976e87d2e" data-linktype="relative-path">3.3.4.16</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/154b1eef-6580-44aa-ac57-f1f41874d693" data-linktype="relative-path">3.3.4.20</a></span>,
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 <span><a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_34f1dfa8-b1df-4d77-aa6e-d777422f9dca" data-linktype="relative-path">named pipe</a></span>).
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_47"></a><a aria-label="Product behavior note 47" href="ebb74ff2-abb1-4e1b-a76a-563a5cbbea9a#Appendix_A_47" data-linktype="relative-path">&lt;47&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_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> fail the call.</p></div>