en:docs:fapi:dosqfileinfo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:docs:fapi:dosqfileinfo [2018/08/28 10:21] – created prokusheven:docs:fapi:dosqfileinfo [2021/09/18 13:46] (current) prokushev
Line 1: Line 1:
 +{{page>en:templates:fapiint}}
 +
 +====== DosQFileInfo ======
 +
 This call returns information for a specific file. This call returns information for a specific file.
  
-==Syntax== +===== Syntax ===== 
- DosQFileInfo (FileHandle, FileInfoLevel, FileInfoBuf, FileInfoBufSize)+<code c> 
 +DosQFileInfo (FileHandle, FileInfoLevel, FileInfoBuf, FileInfoBufSize) 
 +</code> 
 + 
 +===== Parameters ===== 
 + 
 +  * FileHandle (HFILE) - input : File handle. 
 +  * FileInfoLevel (USHORT) - input : Level of file information required. A value of 1, 2, or 3 can be specified. Level 4 is reserved. The structures described in FileInfoBuf indicate the information returned for each of these levels. 
 +  * FileInfoBuf (PBYTE) - output : Address of the storage area where the system returns the requested level of file information. File information, where applicable, is at least as accurate as the most recent DosClose, DosBufReset, DosSetFileInfo, or DosSetPathInfo.
  
-==Parameters== +==== Level 1 Information ====
-;FileHandle (HFILE) - input : File handle. +
-;FileInfoLevel (USHORT) - input : Level of file information required. A value of 1, 2, or 3 can be specified. Level 4 is reserved. The structures described in FileInfoBuf indicate the information returned for each of these levels. +
-;FileInfoBuf (PBYTE) - output : Address of the storage area where the system returns the requested level of file information. File information, where applicable, is at least as accurate as the most recent DosClose, DosBufReset, DosSetFileInfo, or DosSetPathInfo.+
  
-'''Level 1 Information''' 
  
 FileInfoBuf contains the following structure, to which file information is returned: FileInfoBuf contains the following structure, to which file information is returned:
Line 40: Line 48:
 fileattrib (USHORT) : Attributes of the file, defined in DosSetFileMode.  fileattrib (USHORT) : Attributes of the file, defined in DosSetFileMode. 
  
-'''Level 2 Information'''+==== Level 2 Information ==== 
  
 FileInfoBuf contains a structure similar to the Level 1 structure, with the addition of the cbList field after the fileattrib field. FileInfoBuf contains a structure similar to the Level 1 structure, with the addition of the cbList field after the fileattrib field.
Line 47: Line 56:
 cbList (ULONG) : On output, this field contains the length of the entire EA set for the file object. This value can be used to calculate the size of the buffer required to hold EA information returned when FileInfoLevel = 3 is specified.  cbList (ULONG) : On output, this field contains the length of the entire EA set for the file object. This value can be used to calculate the size of the buffer required to hold EA information returned when FileInfoLevel = 3 is specified. 
  
-'''Level 3 Information'''+==== Level 3 Information ==== 
  
 FileInfoBuf contains an EAOP structure, which has the following format: FileInfoBuf contains an EAOP structure, which has the following format:
Line 94: Line 104:
  
                                                                          
-FileInfoBufSize (USHORT) - output : Length of FileInfoBuf.+  * FileInfoBufSize (USHORT) - output : Length of FileInfoBuf.
  
-==Return Code== +===== Return Code ===== 
- rc (USHORT) - return+ 
 +rc (USHORT) - return
  
 Return code descriptions are: Return code descriptions are:
  
-* 0         NO_ERROR  +  * 0         NO_ERROR  
-* 5         ERROR_ACCESS_DENIED  +  * 5         ERROR_ACCESS_DENIED  
-* 6         ERROR_INVALID_HANDLE  +  * 6         ERROR_INVALID_HANDLE  
-* 111        ERROR_BUFFER_OVERFLOW  +  * 111        ERROR_BUFFER_OVERFLOW  
-* 124        ERROR_INVALID_LEVEL  +  * 124        ERROR_INVALID_LEVEL  
-* 130        ERROR_DIRECT_ACCESS_HANDLE  +  * 130        ERROR_DIRECT_ACCESS_HANDLE  
-* 254        ERROR_INVALID_EA_NAME  +  * 254        ERROR_INVALID_EA_NAME  
-* 255        ERROR_EA_LIST_INCONSISTENT+  * 255        ERROR_EA_LIST_INCONSISTENT 
 + 
 +===== Remarks =====
  
-==Remarks== 
 The FAT file system supports modification of only date and time information contained in file information level 1. Zero is returned for the creation and access dates and times. The FAT file system supports modification of only date and time information contained in file information level 1. Zero is returned for the creation and access dates and times.
  
Line 117: Line 129:
 DosEnumAttribute returns the lengths of EAs. This information can be used to calculate the size of FileInfoBuf needed to hold full extended attribute (FEA) information returned by DosQFileInfo when Level 3 is specified. The size of the buffer is calculated as follows: DosEnumAttribute returns the lengths of EAs. This information can be used to calculate the size of FileInfoBuf needed to hold full extended attribute (FEA) information returned by DosQFileInfo when Level 3 is specified. The size of the buffer is calculated as follows:
  
-* One byte (for fea_usFlags) + +  * One byte (for fea_usFlags) + 
-* One byte (for fea_cbName) + +  * One byte (for fea_cbName) + 
-* Two bytes (for fea_cbValue) + +  * Two bytes (for fea_cbValue) + 
-* Value of cbName (for the name of the EA) + +  * Value of cbName (for the name of the EA) + 
-* One byte (for terminating NULL in fea_cbName) + +  * One byte (for terminating NULL in fea_cbName) + 
-* Value of cbValue (for the value of the EA)+  * Value of cbValue (for the value of the EA) 
 + 
 +===== Bindings ===== 
 + 
 +==== C Binding ====
  
-==Example Code== +<code c>
-=== C Binding=== +
-<PRE>+
 typedef struct _FDATE {   /* fdate */ typedef struct _FDATE {   /* fdate */
    
Line 206: Line 220:
 USHORT           rc;              /* return code */ USHORT           rc;              /* return code */
  
-</PRE>+</code> 
 + 
 +==== MASM Binding ====
  
-===MASM Binding=== +<code asm>
-<PRE>+
 FDATE   struc FDATE   struc
    
Line 283: Line 298:
  
 Returns WORD Returns WORD
-</PRE>+</code>
  
  
  
-====== Note ======+===== Note =====
  
 Text based on http://www.edm2.com/index.php/DosQFileInfo Text based on http://www.edm2.com/index.php/DosQFileInfo