#ifndef _NTIOAPI_H
typedef struct _FILE_FS_SECTOR_SIZE_INFORMATION
{
ULONG LogicalBytesPerSector;
ULONG PhysicalBytesPerSectorForAtomicity;
ULONG PhysicalBytesPerSectorForPerformance;
ULONG FileSystemEffectivePhysicalBytesPerSectorForAtomicity;
ULONG Flags; // SSINFO_FLAGS_*
ULONG ByteOffsetForSectorAlignment;
ULONG ByteOffsetForPartitionAlignment;
} FILE_FS_SECTOR_SIZE_INFORMATION, *PFILE_FS_SECTOR_SIZE_INFORMATION;
View code on GitHub
// ntddk.h
typedef struct _FILE_FS_SECTOR_SIZE_INFORMATION {
ULONG LogicalBytesPerSector;
ULONG PhysicalBytesPerSectorForAtomicity;
ULONG PhysicalBytesPerSectorForPerformance;
ULONG FileSystemEffectivePhysicalBytesPerSectorForAtomicity;
ULONG Flags;
ULONG ByteOffsetForSectorAlignment;
ULONG ByteOffsetForPartitionAlignment;
} FILE_FS_SECTOR_SIZE_INFORMATION, *PFILE_FS_SECTOR_SIZE_INFORMATION;
View the official Windows Driver Kit DDI reference
This structure is documented in Windows Driver Kit.
The FILE_FS_SECTOR_SIZE_INFORMATION structure is used to query physical and logical sector size information for a file system volume.
LogicalBytesPerSector
Logical bytes per sector reported by physical storage. This is the same value as the block size for used for Logical Block Addressing (LBA).
PhysicalBytesPerSectorForAtomicity
Actual bytes per sector reported by physical storage used for an atomic write.
PhysicalBytesPerSectorForPerformance
Bytes per sector reported by physical storage for best performance.
FileSystemEffectivePhysicalBytesPerSectorForAtomicity
The portion of PhysicalBytesPerSectorForAtomicity considered as the physical sector size by the file system.
Flags
Flags for sector alignment and performance capabilities. This value is a bitwise OR combination of the following:
Value | Meaning |
---|---|
SSINFO_FLAGS_ALIGNED_DEVICE | Logical sectors of the storage device are aligned to physical sector boundaries. |
SSINFO_FLAGS_PARTITION_ALIGNED_ON_DEVICE | The partition is aligned to physical sector boundaries on the storage device. |
SSINFO_FLAGS_NO_SEEK_PENALTY | The storage device has no seek penalty. |
SSINFO_FLAGS_PARTITION_ALIGNED_ON_DEVICE | The storage device supports the TRIM operation. |
ByteOffsetForSectorAlignment
The offset, in bytes, of the beginning of the first logical sector within the first physical sector. This member is set to SSINFO_OFFSET_UNKNOWN if proper device information is not available to calculate the value.
ByteOffsetForPartitionAlignment
The offset value, in bytes, used to align the partition to a physical sector boundary. This member is set to SSINFO_OFFSET_UNKNOWN if proper device information is not available to calculate the value.
This information can be queried in either of the following ways:
No specific access rights are required to query this information. Thus this information is available as long as the volume is accessed through an open handle to the volume itself, or to a file or directory on the volume.
The size of the buffer passed in the FileInformation parameter to FltQueryVolumeInformation or ZwQueryVolumeInformationFile must be at least sizeof (FILE_FS_SECTOR_SIZE_INFORMATION).
The file system uses the value of LogicalBytesPerSector to determine the size of an allocation unit. The LogicalBytesPerSector member of this structure is equivalent to the BytesPerSector member of the FILE_FS_SIZE_INFORMATION and FILE_FS_FULL_SIZE_INFORMATION structures.
If the system is unable to determine values for PhysicalBytesPerSectorForAtomicity and PhysicalBytesPerSectorForPerformance from the storage device, then they are set to the value of LogicalBytesPerSector.
IRP_MJ_QUERY_VOLUME_INFORMATION