// ntddstor.h
// CTL_CODE(0x002d, 0x501, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES 0x002D9404
View the official Windows Driver Kit DDI reference// winioctl.h
// CTL_CODE(0x002d, 0x501, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES 0x002D9404
View the official Win32 API referenceNo description available.
This IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES request is used to send a data set management request to a storage device.
The buffer at Irp->AssociatedIrp.SystemBuffer contains a DEVICE_DSM_INPUT structure. Depending on the Action member of this structure, the input buffer might additionally include a parameter block and block of data set ranges. See DEVICE_DSM_ACTION Descriptions for descriptions of all possible actions.
Parameters.DeviceIoControl.InputBufferLength in the I/O stack location of the IRP indicates the size, in bytes, of the buffer, which must be at least sizeof(DEVICE_DSM_INPUT).
Depending on the value set in the Action member of DEVICE_DSM_INPUT, the request may return data in the buffer at Irp->AssociatedIrp.SystemBuffer. The system buffer will contain valid DEVICE_DSM_OUTPUT data if the DSM operation returns output and Parameters.DeviceIoControl.OutputBufferLength > 0. Depending on Action, the output buffer might additionally include an output block.
The length in bytes of the output buffer, if any. If output is returned, the output buffer must be at least sizeof(DEVICE_DSM_OUTPUT).
The Status field can be set to STATUS_SUCCESS, or possibly to STATUS_INVALID_DEVICE_REQUEST, STATUS_BUFFER_TOO_SMALL, STATUS_BUFFER_OVERFLOW, or some other error status.
Due to memory pool requirements by the storage driver stack, completion of the IRP containing this IOCTL must be at IRQL < DISPATCH_LEVEL.
See Data Set Management Overview for more information.
DEVICE_DSM_ACTION Descriptions
The IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES control code communicates attribute information to the volume manager and storage system device.
To perform this operation, call the DeviceIoControl function with the following parameters.
BOOL DeviceIoControl(
(HANDLE) hDevice, // handle to device
IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES, // dwIoControlCode
(LPVOID) lpInBuffer, // input buffer
(DWORD) nInBufferSize, // size of the input buffer
(LPVOID) lpOutBuffer, // output buffer
(DWORD) nOutBufferSize, // size of the input buffer
(LPDWORD) lpBytesReturned, // number of bytes returned
(LPOVERLAPPED) lpOverlapped // OVERLAPPED structure
);
Irp->IoStatus.Status is set to STATUS_SUCCESS if the request is successful.
Otherwise, Status to the appropriate error condition as a NTSTATUS code.
For more information, see NTSTATUS Values.
Use the IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES control code for sending storage system-specific information to the volume manager and storage system.
The input buffers passed through the lpInBuffer parameter start with a DEVICE_MANAGE_DATA_SET_ATTRIBUTES structure but may contain additional parameters before the list of data set ranges depending on the value of the Action member of the DEVICE_MANAGE_DATA_SET_ATTRIBUTES structure. The output buffers returned through the lpOutBuffer parameter start with a DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT structure but then can contain additional data depending on the value of the Action member of the DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT structure pointed to by the lpOutBuffer parameter. These values are one of the values for the DEVICE_DATA_MANAGEMENT_SET_ACTION data type.
| Value | Parameters structure | Output block structure |
|---|---|---|
| DeviceDsmAction_Trim | None | None |
| DeviceDsmAction_Notification | DEVICE_DSM_NOTIFICATION_PARAMETERS | None |
| DeviceDsmAction_OffloadRead | DEVICE_DSM_OFFLOAD_READ_PARAMETERS | STORAGE_OFFLOAD_READ_OUTPUT |
| DeviceDsmAction_OffloadWrite | DEVICE_DSM_OFFLOAD_WRITE_PARAMETERS | STORAGE_OFFLOAD_WRITE_OUTPUT |
| DeviceDsmAction_Allocation | None | DEVICE_DATA_SET_LB_PROVISIONING_STATE |
| DeviceDsmAction_Repair | DEVICE_DATA_SET_REPAIR_PARAMETERS | None |
| DeviceDsmAction_Scrub | None | None |
| DeviceDsmAction_Resiliency | None | None |