2.4.48 FileValidDataLengthInformation

This information class is used to set the valid data length information for a file. A file's valid data length is the length, in bytes, of the data that has been written to the file. This valid data extends from the beginning of the file to the last byte in the file that has not been zeroed or left uninitialized.<146>

A FILE_VALID_DATA_LENGTH_INFORMATION data element, defined as follows, is provided by the client.


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

ValidDataLength

...

ValidDataLength (8 bytes): A 64-bit signed integer that contains the new valid data length for the file. This parameter MUST be a positive value that is greater than the current valid data length, but less than or equal to the current file size.

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_MEDIA_WRITE_PROTECTED

0xC00000A2

The target cannot be written to because it is write-protected.

STATUS_INVALID_PARAMETER

0xC000000D

The ValidDataLength specified is not a valid parameter or the given handle is to a sparse or compressed file.

STATUS_PRIVILEGE_NOT_HELD

0xC0000061

The manage volume privilege is not held.

STATUS_INFO_LENGTH_MISMATCH

0xC0000004

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