FILE_ALLOCATION_INFORMATION - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTIOAPI_H

/**
 * The FILE_ALLOCATION_INFORMATION structure is used to set the allocation size for a file.
 * \sa https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/ns-ntifs-_file_allocation_information
 */
typedef struct _FILE_ALLOCATION_INFORMATION
{
    LARGE_INTEGER AllocationSize;
} FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;

#endif

View code on GitHub
// ntifs.h

typedef struct _FILE_ALLOCATION_INFORMATION {
  LARGE_INTEGER AllocationSize;
} FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
View the official Windows Driver Kit DDI reference

NtDoc

This structure is documented in Windows Driver Kit.

Windows Driver Kit DDI reference (ns-ntifs-_file_allocation_information)

FILE_ALLOCATION_INFORMATION structure

Description

The FILE_ALLOCATION_INFORMATION structure is used to set the allocation size for a file.

Members

AllocationSize

File allocation size, in bytes. Usually this value is a multiple of the sector or cluster size of the underlying physical device.

Remarks

This operation can be performed in either of the following ways:

This operation is valid only for files. It is undefined for directories.

File system minifilters must use FltSetInformationFile, not ZwSetInformationFile, to set the allocation size for a file.

FILE_WRITE_DATA access is required to set this information.

A file's allocation size and end-of-file position are independent of each other, with the following exception: The end-of-file position must always be less than or equal to the allocation size. If the allocation size is set to a value that is less than the end-of-file position, the end-of-file position is automatically adjusted to match the allocation size.

The size of the FileInformation buffer passed to FltSetInformationFile or ZwSetInformationFile must be >= sizeof(FILE_ALLOCATION_INFORMATION).

This structure must be aligned on a LONGLONG (8-byte) boundary.

See also

FILE_END_OF_FILE_INFORMATION

FltSetInformationFile

IRP_MJ_SET_INFORMATION

ZwSetInformationFile