共用方式為


2.4.45 FileStandardInformation

This information class is used to query file information.

A FILE_STANDARD_INFORMATION data element, defined as follows, is returned by the server.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

AllocationSize

...

EndOfFile

...

NumberOfLinks

DeletePending

Directory

Reserved

AllocationSize (8 bytes): A 64-bit signed integer that contains the file allocation size, in bytes. The value of this field MUST be an integer multiple of the cluster size.

EndOfFile (8 bytes):  A 64-bit signed integer that contains the absolute end-of-file position as a byte offset from the start of the file. EndOfFile specifies the offset to the byte immediately following the last valid byte in the file. Because this value is zero-based, it actually refers to the first free byte in the file. That is, it is the offset from the beginning of the file at which new bytes appended to the file will be written. The value of this field MUST be greater than or equal to 0.

NumberOfLinks (4 bytes):  A 32-bit unsigned integer that contains the number of non-deleted links to this file.

DeletePending (1 byte): A Boolean (section 2.1.8) value. Set to TRUE to indicate that a file deletion has been requested; set to FALSE otherwise.

Directory (1 byte): A Boolean (section 2.1.8) value. Set to TRUE to indicate that the file is a directory; set to FALSE otherwise.

Reserved (2 bytes):  A 16-bit field. This field is reserved. This field can be set to any value, and MUST be ignored.

This operation returns a status code as specified in section 2.2. Upon success, the status code returned by the function that processes this file information class is STATUS_SUCCESS. The most common error codes are listed in the following table.

Error code

Meaning

STATUS_INFO_LENGTH_MISMATCH

0xC0000004

The specified information record length does not match the length that is required for the specified information class.