// ntddstor.h
typedef struct _DEVICE_LB_PROVISIONING_DESCRIPTOR {
ULONG Version;
ULONG Size;
UCHAR ThinProvisioningEnabled : 1;
UCHAR ThinProvisioningReadZeros : 1;
UCHAR AnchorSupported : 3;
UCHAR UnmapGranularityAlignmentValid : 1;
UCHAR GetFreeSpaceSupported : 1;
UCHAR MapSupported : 1;
UCHAR Reserved1[7];
ULONGLONG OptimalUnmapGranularity;
ULONGLONG UnmapGranularityAlignment;
ULONG MaxUnmapLbaCount;
ULONG MaxUnmapBlockDescriptorCount;
} DEVICE_LB_PROVISIONING_DESCRIPTOR, *PDEVICE_LB_PROVISIONING_DESCRIPTOR;
View the official Windows Driver Kit DDI reference// winioctl.h
typedef struct _DEVICE_LB_PROVISIONING_DESCRIPTOR {
DWORD Version;
DWORD Size;
BYTE ThinProvisioningEnabled : 1;
BYTE ThinProvisioningReadZeros : 1;
BYTE AnchorSupported : 3;
BYTE UnmapGranularityAlignmentValid : 1;
BYTE GetFreeSpaceSupported : 1;
BYTE MapSupported : 1;
BYTE Reserved1[7];
DWORDLONG OptimalUnmapGranularity;
DWORDLONG UnmapGranularityAlignment;
DWORD MaxUnmapLbaCount;
DWORD MaxUnmapBlockDescriptorCount;
} DEVICE_LB_PROVISIONING_DESCRIPTOR, *PDEVICE_LB_PROVISIONING_DESCRIPTOR;
View the official Win32 API referenceNo description available.
The DEVICE_LB_PROVISIONING_DESCRIPTOR structure is one of the query result structures returned from an IOCTL_STORAGE_QUERY_PROPERTY request. This structure contains the thin provisioning capabilities for a storage device.
VersionThe version of this structure.
SizeThe size of this structure. This is set to sizeof(DEVICE_LB_PROVISIONING_DESCRIPTOR).
ThinProvisioningEnabledThe thin provisioning–enabled status.
| Value | Meaning |
|---|---|
| 0 | Thin provisioning is disabled. |
| 1 | Thin provisioning is enabled. |
ThinProvisioningReadZerosReads to unmapped regions return zeros.
| Value | Meaning |
|---|---|
| 0 | Data read from unmapped regions is undefined. |
| 1 | Reads return zeros. |
AnchorSupportedSupport for the anchored LBA mapping state.
| Value | Meaning |
|---|---|
| 0 | The anchored LBA mapping state is not supported. |
| 1 | The anchored LBA mapping state is supported. |
UnmapGranularityAlignmentValidThe validity of unmap granularity alignment for the device.
| Value | Meaning |
|---|---|
| 0 | Unmap granularity alignment is not valid. |
| 1 | Unmap granularity alignment is valid. |
GetFreeSpaceSupportedIndicates support for DeviceDsmAction_GetFreeSpace.
| Value | Meaning |
|---|---|
| 0 | DeviceDsmAction_GetFreeSpace is not supported. |
| 1 | DeviceDsmAction_GetFreeSpace is supported. |
MapSupportedIndicates support for DeviceDsmAction_Map.
| Value | Meaning |
|---|---|
| 0 | DeviceDsmAction_Map is not supported. |
| 1 | DeviceDsmAction_Map is supported. |
Reserved1Reserved; do not use.
OptimalUnmapGranularityThe optimal number of blocks for unmap granularity for the device.
UnmapGranularityAlignmentThe current value, in blocks, set for unmap granularity alignment on the device. The value UnmapGranularityAlignmentValid indicates the validity of this member.
MaxUnmapLbaCountMaximum amount of LBAs that can be unmapped in a single UNMAP command, in units of logical blocks. Valid starting in Windows 10.
MaxUnmapBlockDescriptorCountMaximum number of descriptors allowed in a single UNMAP command. Valid starting in Windows 10.
This structure is returned in the system buffer from a IOCTL_STORAGE_QUERY_PROPERTY request when the PropertyId member of STORAGE_PROPERTY_QUERY is set to StorageDeviceLBProvisioningProperty.
The DEVICE_LB_PROVISIONING_DESCRIPTOR structure is written to the system buffer, Irp->AssociatedIrp.SystemBuffer, with a value of sizeof(DEVICE_LB_PROVISIONING_DESCRIPTOR) set in Parameters.DeviceIoControl.OutputBufferLength for the current IRP stack location.
If UnmapGranularityAlignmentValid is 0, then any code using UnmapGranularityAlignment should assume it has a value of 0.
If the underlying storage device is a SCSI device, unmapping capability can be queried. If the TrimEnabled member of the DEVICE_TRIM_DESCRIPTOR structure is TRUE, UNMAP is supported. The DEVICE_TRIM_DESCRIPTOR structure is returned in the system buffer from a IOCTL_STORAGE_QUERY_PROPERTY request when the PropertyId member of STORAGE_PROPERTY_QUERY is set to StorageDeviceTrimProperty.
The DEVICE_LB_PROVISIONING_DESCRIPTOR structure is one of the query result structures returned from an IOCTL_STORAGE_QUERY_PROPERTY request. This structure contains the thin provisioning capabilities for a storage device.
VersionContains the size of this structure, in bytes. The value of this member will change as members are added to the structure.
SizeSpecifies the total size of the data returned, in bytes. This may include data that follows this structure.
ThinProvisioningEnabledThe thin provisioning–enabled status.
| Value | Meaning |
|---|---|
| 0 | Thin provisioning is disabled. |
| 1 | Thin provisioning is enabled. |
ThinProvisioningReadZerosReads to unmapped regions return zeros.
| Value | Meaning |
|---|---|
| 0 | Data read from unmapped regions is undefined. |
| 1 | Reads return zeros. |
AnchorSupportedDeterministic read after trim support.
| Value | Meaning |
|---|---|
| 0 | Deterministic read after trim is not supported. |
| 1 | Deterministic read after trim is supported. |
UnmapGranularityAlignmentValidThe validity of unmap granularity alignment for the device.
| Value | Meaning |
|---|---|
| 0 | Unmap granularity alignment is not valid. |
| 1 | Unmap granularity alignment is valid. |
Reserved0Reserved.
Reserved1Reserved.
OptimalUnmapGranularityThe optimal number of logical sectors for unmap granularity for the device.
UnmapGranularityAlignmentThe current value, in logical sectors, set for unmap granularity alignment on the device.
MaxUnmapLbaCountStarting in Windows 10: The maximum number of LBAs that can be unmapped in a single unmap command, in logical blocks.
MaxUnmapBlockDescriptorCountStarting in Windows 10: The maximum number of descriptors allowed in a single unmap command.
This structure is returned from a IOCTL_STORAGE_QUERY_PROPERTY request when the PropertyId member of STORAGE_PROPERTY_QUERY is set to StorageDeviceLBProvisioningProperty.
If UnmapGranularityAlignmentValid = 0, then any code using UnmapGranularityAlignment should assume it has a value of 0.