STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// ntddstor.h

typedef struct _STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR {
  ULONG Version;
  ULONG Size;
  ULONG BytesPerCacheLine;
  ULONG BytesOffsetForCacheAlignment;
  ULONG BytesPerLogicalSector;
  ULONG BytesPerPhysicalSector;
  ULONG BytesOffsetForSectorAlignment;
} STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR, *PSTORAGE_ACCESS_ALIGNMENT_DESCRIPTOR;

View the official Windows Driver Kit DDI reference
// winioctl.h

typedef struct _STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR {
  DWORD Version;
  DWORD Size;
  DWORD BytesPerCacheLine;
  DWORD BytesOffsetForCacheAlignment;
  DWORD BytesPerLogicalSector;
  DWORD BytesPerPhysicalSector;
  DWORD BytesOffsetForSectorAlignment;
} STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR, *PSTORAGE_ACCESS_ALIGNMENT_DESCRIPTOR;

View the official Win32 API reference

NtDoc

No description available.

Windows Driver Kit DDI reference (ns-ntddstor-_storage_access_alignment_descriptor)

_STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR structure

Description

The STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR structure is used in conjunction with the IOCTL_STORAGE_QUERY_PROPERTY request to retrieve the storage access alignment descriptor data for a device.

Members

Version

Contains the size of the structure STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR. The value of this member will change as members are added to the structure.

Size

Specifies the total size of the descriptor, in bytes.

BytesPerCacheLine

The number of bytes in a cache line of the device.

BytesOffsetForCacheAlignment

The address offset necessary for proper cache access alignment, in bytes.

BytesPerLogicalSector

The number of bytes in a logical sector of the device.

BytesPerPhysicalSector

The number of bytes in a physical sector of the device.

BytesOffsetForSectorAlignment

The logical sector offset within the first physical sector where the first logical sector is placed, in bytes.

Example: Offset = 3 Logical sectors

+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|LBA      |X|X|X|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|Physical |               |                  |
|Sector   |      0        |        1         |         2
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

In this example, BytesOffsetForSectorAlignment = 3 * size_of_logical_sector.

Remarks

Storage class drivers issue a device-control request with the I/O control code IOCTL_STORAGE_QUERY_PROPERTY to retrieve this structure, which contains access alignment information for data transfer operations. The structure can be retrieved either from the device object for the bus or from an FDO, which forwards the request to the underlying bus.

See also

IOCTL_STORAGE_QUERY_PROPERTY


Win32 API reference (ns-winioctl-storage_access_alignment_descriptor)

STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR structure

Description

Used in conjunction with the IOCTL_STORAGE_QUERY_PROPERTY control code to retrieve the storage access alignment descriptor data for a device.

Members

Version

Contains the size of this structure, in bytes. The value of this member will change as members are added to the structure.

Size

Specifies the total size of the data returned, in bytes. This may include data that follows this structure.

BytesPerCacheLine

The number of bytes in a cache line of the device.

BytesOffsetForCacheAlignment

The address offset necessary for proper cache access alignment, in bytes.

BytesPerLogicalSector

The number of bytes in a logical sector of the device.

BytesPerPhysicalSector

The number of bytes in a physical sector of the device.

BytesOffsetForSectorAlignment

The logical sector offset within the first physical sector where the first logical sector is placed, in bytes.

Example: Offset = 3 Logical sectors

+---------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|LBA      |##|##|##|00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|
+---------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|Physical |                       |                       |                ...
|Sector   |           0           |           1           |           2
+---------+-----------------------+-----------------------+---------------

In this example, BytesOffsetForSectorAlignment = 3 * BytesPerLogicalSector.

See also

Disk Management Structures

IOCTL_STORAGE_QUERY_PROPERTY