// 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 reference
No 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.
Version
The version of this structure.
Size
The size of this structure. This is set to sizeof(DEVICE_LB_PROVISIONING_DESCRIPTOR)
.
ThinProvisioningEnabled
The thin provisioning–enabled status.
Value | Meaning |
---|---|
0 | Thin provisioning is disabled. |
1 | Thin provisioning is enabled. |
ThinProvisioningReadZeros
Reads to unmapped regions return zeros.
Value | Meaning |
---|---|
0 | Data read from unmapped regions is undefined. |
1 | Reads return zeros. |
AnchorSupported
Support 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. |
UnmapGranularityAlignmentValid
The validity of unmap granularity alignment for the device.
Value | Meaning |
---|---|
0 | Unmap granularity alignment is not valid. |
1 | Unmap granularity alignment is valid. |
GetFreeSpaceSupported
Indicates support for DeviceDsmAction_GetFreeSpace.
Value | Meaning |
---|---|
0 | DeviceDsmAction_GetFreeSpace is not supported. |
1 | DeviceDsmAction_GetFreeSpace is supported. |
MapSupported
Indicates support for DeviceDsmAction_Map.
Value | Meaning |
---|---|
0 | DeviceDsmAction_Map is not supported. |
1 | DeviceDsmAction_Map is supported. |
Reserved1
Reserved; do not use.
OptimalUnmapGranularity
The optimal number of blocks for unmap granularity for the device.
UnmapGranularityAlignment
The current value, in blocks, set for unmap granularity alignment on the device. The value UnmapGranularityAlignmentValid indicates the validity of this member.
MaxUnmapLbaCount
Maximum amount of LBAs that can be unmapped in a single UNMAP command, in units of logical blocks. Valid starting in Windows 10.
MaxUnmapBlockDescriptorCount
Maximum 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.
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.
ThinProvisioningEnabled
The thin provisioning–enabled status.
Value | Meaning |
---|---|
0 | Thin provisioning is disabled. |
1 | Thin provisioning is enabled. |
ThinProvisioningReadZeros
Reads to unmapped regions return zeros.
Value | Meaning |
---|---|
0 | Data read from unmapped regions is undefined. |
1 | Reads return zeros. |
AnchorSupported
Deterministic read after trim support.
Value | Meaning |
---|---|
0 | Deterministic read after trim is not supported. |
1 | Deterministic read after trim is supported. |
UnmapGranularityAlignmentValid
The validity of unmap granularity alignment for the device.
Value | Meaning |
---|---|
0 | Unmap granularity alignment is not valid. |
1 | Unmap granularity alignment is valid. |
Reserved0
Reserved.
Reserved1
Reserved.
OptimalUnmapGranularity
The optimal number of logical sectors for unmap granularity for the device.
UnmapGranularityAlignment
The current value, in logical sectors, set for unmap granularity alignment on the device.
MaxUnmapLbaCount
Starting in Windows 10: The maximum number of LBAs that can be unmapped in a single unmap command, in logical blocks.
MaxUnmapBlockDescriptorCount
Starting 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.