// ntddstor.h
typedef struct _DEVICE_MANAGE_DATA_SET_ATTRIBUTES {
ULONG Size;
DEVICE_DSM_ACTION Action;
ULONG Flags;
ULONG ParameterBlockOffset;
ULONG ParameterBlockLength;
ULONG DataSetRangesOffset;
ULONG DataSetRangesLength;
} DEVICE_MANAGE_DATA_SET_ATTRIBUTES, *PDEVICE_MANAGE_DATA_SET_ATTRIBUTES, DEVICE_DSM_INPUT, *PDEVICE_DSM_INPUT;
View the official Windows Driver Kit DDI reference// winioctl.h
typedef struct _DEVICE_MANAGE_DATA_SET_ATTRIBUTES {
DWORD Size;
DEVICE_DSM_ACTION Action;
DWORD Flags;
DWORD ParameterBlockOffset;
DWORD ParameterBlockLength;
DWORD DataSetRangesOffset;
DWORD DataSetRangesLength;
} DEVICE_MANAGE_DATA_SET_ATTRIBUTES, *PDEVICE_MANAGE_DATA_SET_ATTRIBUTES, DEVICE_DSM_INPUT, *PDEVICE_DSM_INPUT;
View the official Win32 API referenceNo description available.
The DEVICE_DSM_INPUT (or DEVICE_MANAGE_DATA_SET_ATTRIBUTES) structure specifies a management action for the data-set attributes for a device.
SizeSize of the DEVICE_DSM_INPUT structure, in bytes. The value of this member will change as members are added to the structure.
ActionA DEVICE_DSM_ACTION value that specifies the action to be performed. See DEVICE_DSM_ACTION Descriptions for a list of action values and descriptions.
If the DeviceDsmActionFlag_NonDestructive flag (most significant bit) is set in Action, the specified action is nondestructive. For nondestructive actions, the driver can safely forward the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES request to the next lower driver in the stack even if the driver does not handle the specified action. If the driver does handle the DSM, it should perform the normal processing of the data set ranges block that is specified by the DataSetRangesOffset and DataSetRangesLength members before forwarding the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES request to the next lower driver.
FlagsThese flags are global to all control actions. This member can be set to one of the following flags:
| Flag Value | Meaning |
|---|---|
| DEVICE_DSM_FLAG_ENTIRE_DATA_SET_RANGE | The control action is specified for the entire block of data set ranges. If this flag is set, the DataSetRangesOffset and DataSetRangesLength members must be set to zero. |
ParameterBlockOffsetSpecifies the start of the parameter block within the payload of the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES request. The format of the parameter block depends on the value of the Action member. For more information regarding parameter block format, see DEVICE_DSM_ACTION Descriptions. Note: The offset of the parameter block must be aligned on the address boundary of the corresponding parameter.
If ParameterBlockOffset is set to zero, then the parameter block does not exist.
ParameterBlockLengthSpecifies the length, in bytes, of the parameter block within the payload of the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES request.
If ParameterBlockLength is set to zero, then the parameter block does not exist.
DataSetRangesOffsetSpecifies the start of the block of data set ranges within the payload of the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES request. This block consists of one or more contiguous entries that are formatted as DEVICE_DSM_RANGE structures. Note: The offset of the data set range block must be aligned on the address boundary of the DEVICE_DSM_RANGE structure.
If set to zero, then the block of data set ranges does not exist.
DataSetRangesLengthSpecifies the length, in bytes, of the block of data set ranges within the payload of the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES request. If DataSetRangesLength is set to zero, the block of data set ranges does not exist.
For more information on the format of the payload for an IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES request, see Data Set Management Overview. The total size of the buffer should be at least sizeof(DEVICE_DSM_INPUT) + ParameterBlockLength + DataSetRangesLength.
The block of data set ranges is specified by the DataSetRangesOffset and DataSetRangesLength members. If this block exists, it contains contiguous DEVICE_DSM_RANGE structures.
DEVICE_DSM_ACTION Descriptions
IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES
Input structure for the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES control code.
SizeSize of this data structure. Must be set to
sizeof(DEVICE_MANAGE_DATA_SET_ATTRIBUTES).
ActionA valid value of type DEVICE_DATA_MANAGEMENT_SET_ACTION.
| Value | Meaning | |
|---|---|---|
| DeviceDsmAction_Trim 1 |
A trim action is performed. This value is not supported for user-mode applications. | |
| DeviceDsmAction_Notification 2 |
DeviceDsmActionFlag_NonDestructive (0x80000002) | A notification action is performed. The additional parameters are in a DEVICE_DSM_NOTIFICATION_PARAMETERS structure. The DeviceDsmActionFlag_NonDestructive (0x80000000) is a bit flag to indicate to the driver stack that this operation is non-destructive. |
| DeviceDsmAction_OffloadRead 3 |
DeviceDsmActionFlag_NonDestructive (0x80000003) | An offload read action is performed. The additional parameters are in a DEVICE_DSM_OFFLOAD_READ_PARAMETERS structure. The DeviceDsmActionFlag_NonDestructive (0x80000000) is a bit flag to indicate to the driver stack that this operation is non-destructive. Windows 7 and Windows Server 2008 R2: This value is not supported before Windows 8 and Windows Server 2012. |
| DeviceDsmAction_OffloadWrite 4 |
An offload write action is performed. The additional parameters are in a DEVICE_DSM_OFFLOAD_WRITE_PARAMETERS structure. Windows 7 and Windows Server 2008 R2: This value is not supported before Windows 8 and Windows Server 2012. |
|
| DeviceDsmAction_Allocation 5 |
DeviceDsmActionFlag_NonDestructive (0x80000005) | An allocation bitmap is retrieved for the first data set range specified. The DeviceDsmActionFlag_NonDestructive (0x80000000) is a bit flag to indicate to the driver stack that this operation is non-destructive. Windows 7 and Windows Server 2008 R2: This value is not supported before Windows 8 and Windows Server 2012. |
| DeviceDsmAction_Repair 6 |
DeviceDsmActionFlag_NonDestructive (0x80000006) | A repair action is performed. The additional parameters are in a DEVICE_DATA_SET_REPAIR_PARAMETERS structure. The DeviceDsmActionFlag_NonDestructive (0x80000000) is a bit flag to indicate to the driver stack that this operation is non-destructive. Windows 7 and Windows Server 2008 R2: This value is not supported before Windows 8 and Windows Server 2012. |
| DeviceDsmAction_Scrub 7 |
DeviceDsmActionFlag_NonDestructive (0x80000007) | A scrub action is performed. The DeviceDsmActionFlag_NonDestructive (0x80000000) is a bit flag to indicate to the driver stack that this operation is non-destructive. Windows 7 and Windows Server 2008 R2: This value is not supported before Windows 8 and Windows Server 2012. |
| DeviceDsmAction_Resiliency 8 |
DeviceDsmActionFlag_NonDestructive (0x80000008) | A resiliency action is performed. The DeviceDsmActionFlag_NonDestructive (0x80000000) is a bit flag to indicate to the driver stack that this operation is non-destructive. Windows 7 and Windows Server 2008 R2: This value is not supported before Windows 8 and Windows Server 2012. |
FlagsFlags for the actions.
| Value | Meaning |
|---|---|
| DEVICE_DSM_FLAG_TRIM_NOT_FS_ALLOCATED 0x80000000 |
If set then the described ranges are not allocated by a file system. This flag is specific to the DeviceDsmAction_Trim action. |
| DEVICE_DSM_FLAG_RESILIENCY_START_RESYNC 0x10000000 |
Starts a resync operation on the storage device. This flag is specific to the DeviceDsmAction_Resiliency action. |
| DEVICE_DSM_FLAG_RESILIENCY_START_LOAD_BALANCING 0x20000000 |
Starts a load balancing operation on the storage device. This flag is specific to the DeviceDsmAction_Resiliency action. |
ParameterBlockOffsetByte offset to the start of the parameter block stored in the buffer contiguous to this structure. Must be aligned to the corresponding structure alignment. A value of zero indicates there is no parameter block and the ParameterBlockLength member must also be zero.
ParameterBlockLengthLength of the parameter block, in bytes. A value of zero indicates there is no parameter block and the ParameterBlockOffset member must also be zero.
DataSetRangesOffsetByte offset to the start of the data set ranges block made up of an array of DEVICE_DATA_SET_RANGE structures stored in the buffer contiguous to this structure. Must be aligned to the DEVICE_DATA_SET_RANGE structure alignment. A value of zero indicates there is no data set ranges block and the DataSetRangesLength member must also be zero.
DataSetRangesLengthLength of the data set ranges block, in bytes. A value of zero indicates there is no data set ranges block and the DataSetRangesOffset member must also be zero.
The total length of the buffer that contains this structure must be at least
(sizeof(DEVICE_MANAGE_DATA_SET_ATTRIBUTES) + ParameterBlockLength + DataSetRangesLength).
IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES