// ntddstor.h
typedef struct _DEVICE_DATA_SET_LB_PROVISIONING_STATE {
ULONG Size;
ULONG Version;
ULONGLONG SlabSizeInBytes;
ULONG SlabOffsetDeltaInBytes;
ULONG SlabAllocationBitMapBitCount;
ULONG SlabAllocationBitMapLength;
ULONG SlabAllocationBitMap[ANYSIZE_ARRAY];
} DEVICE_DATA_SET_LB_PROVISIONING_STATE, *PDEVICE_DATA_SET_LB_PROVISIONING_STATE, DEVICE_DSM_ALLOCATION_OUTPUT, *PDEVICE_DSM_ALLOCATION_OUTPUT;
View the official Windows Driver Kit DDI reference// winioctl.h
typedef struct _DEVICE_DATA_SET_LB_PROVISIONING_STATE {
DWORD Size;
DWORD Version;
DWORDLONG SlabSizeInBytes;
DWORD SlabOffsetDeltaInBytes;
DWORD SlabAllocationBitMapBitCount;
DWORD SlabAllocationBitMapLength;
DWORD SlabAllocationBitMap[ANYSIZE_ARRAY];
} DEVICE_DATA_SET_LB_PROVISIONING_STATE, *PDEVICE_DATA_SET_LB_PROVISIONING_STATE, DEVICE_DSM_ALLOCATION_OUTPUT, *PDEVICE_DSM_ALLOCATION_OUTPUT;
View the official Win32 API referenceNo description available.
The DEVICE_DATA_SET_LB_PROVISIONING_STATE structure is returned by an IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES request when requesting logical block provisioning information for a data set range.
SizeThe size of this structure, including the slab allocation bitmap, in bytes.
VersionThe version of this structure.
SlabSizeInBytesThe size, in bytes, of a slab.
SlabOffsetDeltaInBytesThe difference, in bytes, from the offset specified in the data set range to the starting slab position.
SlabAllocationBitMapBitCountThe number of bits in the allocation bitmap mapping slabs for the data set range.
SlabAllocationBitMapLengthThe number of ULONG array values containing the slab allocation bitmap.
SlabAllocationBitMapA bitmap of slab allocations.
Provisioning state information is returned when the Action member of DEVICE_DSM_INPUT is set to DeviceDsmAction_Allocation. The caller should include only one data set range in the system buffer at DataSetRangesOffset.
On return, the system buffer contains a DEVICE_DSM_OUTPUT structure followed by the DEVICE_DATA_SET_LB_PROVISIONING_STATE structure. The DEVICE_DATA_SET_LB_PROVISIONING_STATE structure begins at an offset from the beginning of the system buffer specified by OutputBlockOffset in DEVICE_DSM_OUTPUT.
Each bit in the allocation bitmap represents a slab mapping within the data set range requested. The bits correspond directly to the slabs in the data set range. This means that bit 0 in the bitmap marks the first slab in the range. A slab is mapped if the bit value = 1 and unmapped if the bit value = 0.
Space for SlabAllocationBitMap should be allocated based on the number of possible slabs in the requested data set range. The SlabAllocationBitMapLength of the bitmap returned is (number of slabs / 32) + ((number of slabs MOD 32) > 0 ? 1 : 0).
Slab size is determined by the OptimalUnmapGranularity member of DEVICE_LB_PROVISIONING_DESCRIPTOR returned from an IOCTL_STORAGE_QUERY_PROPERTY request. The length of the data set range provided should be a multiple of OptimalUnmapGranularity. When the range length is not a multiple of OptimalUnmapGranularity, it is reduced to be a multiple.
If the starting offset in the data set range is not aligned on a slab boundary, a multiple of OptimalUnmapGranularity, the offset will be adjusted to the next boundary. The difference between the requested offset and the adjusted offset is returned in SlabOffsetDeltaInBytes.
If the slab allocation total returned in SlabAllocationBitMapBitCount is not as expected because of data set range alignment or length adjustments, an additional request may be submitted with a data set range modified according to the values in both SlabAllocationBitMapBitCount and SlabOffsetDeltaInBytes. The new range will properly select the slabs left out of the bitmap returned by the previous request.
DEVICE_DSM_ACTION Descriptions
IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES
Output structure for the DeviceDsmAction_Allocation action of the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES control code.
SizeThe size of this structure, including the bitmap, in bytes.
VersionThe version of this structure.
SlabSizeInBytesThe size of a slab, in bytes.
SlabOffsetDeltaInBytesIf the range specified is not aligned to the OptimalUnmapGranularity as returned in DEVICE_LB_PROVISIONING_DESCRIPTOR structure then the data represented in the SlabAllocationBitMap is offset from the specified range by this amount.
SlabAllocationBitMapBitCountThe number of relevant bits in the bitmap.
SlabAllocationBitMapLengthThe number of DWORDs in the bitmap array.
SlabAllocationBitMapThe allocation bitmap containing one bit for each slab. If a bit is set then the corresponding slab is allocated. Otherwise, if a bit is clear, the corresponding slab is unallocated.
Provisioning state information is returned when the Action member of the DEVICE_MANAGE_DATA_SET_ATTRIBUTES structure is set to DeviceDsmAction_Allocation. The caller should include only one data set range in the system buffer at DataSetRangesOffset.
On return, the system buffer contains a DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT structure followed by the DEVICE_DATA_SET_LB_PROVISIONING_STATE structure. The DEVICE_DATA_SET_LB_PROVISIONING_STATE structure begins at an offset from the beginning of the system buffer specified by OutputBlockOffset in DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT.
Each bit in the allocation bitmap represents a slab mapping within the data set range requested. The bits correspond directly to the slabs in the data set range. This means that bit 0 in the bitmap marks the first slab in the range. A slab is mapped if the bit value = 1 and unmapped if the bit value = 0.
Space for SlabAllocationBitMap should be allocated based on the number of possible
slabs in the requested data set range. The SlabAllocationBitMapLength of the bitmap
returned is
(number_of_slabs / 32) + ((number_of_slabs MOD 32) > 0 ? 1 : 0).
Slab size is determined by the OptimalUnmapGranularity member of the DEVICE_LB_PROVISIONING_DESCRIPTOR structure returned from an IOCTL_STORAGE_QUERY_PROPERTY control code. The length of the data set range provided should be a multiple of OptimalUnmapGranularity. When the range length is not a multiple of OptimalUnmapGranularity, it is reduced to be a multiple.
If the starting offset in the data set range is not aligned on a slab boundary, a multiple of OptimalUnmapGranularity, the offset will be adjusted to the next boundary. The difference between the requested offset and the adjusted offset is returned in SlabOffsetDeltaInBytes.
If the slab allocation total returned in SlabAllocationBitMapBitCount is not as expected because of data set range alignment or length adjustments, an additional request may be submitted with a data set range modified according to the values in both SlabAllocationBitMapBitCount and SlabOffsetDeltaInBytes. The new range will properly select the slabs left out of the bitmap returned by the previous request.
If the requested slab size is too large (for example if it is larger than the maximum transfer length of the HBA) then the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES can fail with ERROR_INVALID_PARAMETER.
DEVICE_LB_PROVISIONING_DESCRIPTOR
IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES