Export (0) Print
Expand All

IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES control code

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 
WINAPI 
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

Parameters

hDevice [in]

Handle to the device. To obtain a device handle, call the CreateFile function.

dwIoControlCode [in]

Control code for the operation. Use IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES for this operation.

lpInBuffer

A pointer to a data block based on the DEVICE_MANAGE_DATA_SET_ATTRIBUTES structure. Note that the buffer may include parameter and data set range blocks. For more information, see DEVICE_MANAGE_DATA_SET_ATTRIBUTES.

nInBufferSize [in]

The size of the input buffer, in bytes.

lpOutBuffer [out]

A pointer to a data block based on the DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT structure. Note that the buffer may include additional blocks. For more information, see DEVICE_MANAGE_DATA_SET_ATTRIBUTES_OUTPUT.

Windows 7 and Windows Server 2008 R2:  Not used, set to NULL.

nOutBufferSize [in]

The size of the output buffer, in bytes.

Windows 7 and Windows Server 2008 R2:  Not used, set to 0.

lpBytesReturned [out]

Pointer to a variable that receives the size of the data stored in the output buffer, in bytes.

If the output buffer is too small, the call fails, GetLastError returns ERROR_INSUFFICIENT_BUFFER, and lpBytesReturned is zero.

If lpOverlapped is NULL, lpBytesReturned cannot be NULL. Even when an operation returns no output data and lpOutBuffer is NULL, DeviceIoControl makes use of lpBytesReturned. After such an operation, the value of lpBytesReturned is meaningless.

If lpOverlapped is not NULL, lpBytesReturned can be NULL. If this parameter is not NULL and the operation returns data, lpBytesReturned is meaningless until the overlapped operation has completed. To retrieve the number of bytes returned, call GetOverlappedResult. If hDevice is associated with an I/O completion port, you can retrieve the number of bytes returned by calling GetQueuedCompletionStatus.

lpOverlapped [in]

Pointer to an OVERLAPPED structure.

If hDevice was opened without specifying FILE_FLAG_OVERLAPPED, lpOverlapped is ignored.

If hDevice was opened with the FILE_FLAG_OVERLAPPED flag, the operation is performed as an overlapped (asynchronous) operation. In this case, lpOverlapped must point to a valid OVERLAPPED structure that contains a handle to an event object. Otherwise, the function fails in unpredictable ways.

For overlapped operations, DeviceIoControl returns immediately, and the event object is signaled when the operation has been completed. Otherwise, the function does not return until the operation has been completed or an error occurs.

Return value

If the operation completes successfully, DeviceIoControl returns a nonzero value.

If the operation fails or is pending, DeviceIoControl returns zero. To get extended error information, call GetLastError.

Remarks

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.

ValueParameters structureOutput block structure
DeviceDsmAction_TrimNoneNone
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_AllocationNone DEVICE_DATA_SET_LB_PROVISIONING_STATE
DeviceDsmAction_Repair DEVICE_DATA_SET_REPAIR_PARAMETERS None
DeviceDsmAction_ScrubNoneNone
DeviceDsmAction_ResiliencyNoneNone

 

Requirements

Minimum supported client

Windows 7

Minimum supported server

Windows Server 2008 R2

Header

WinIoCtl.h (include Windows.h)

See also

DEVICE_MANAGE_DATA_SET_ATTRIBUTES
DeviceIoControl

 

 

Community Additions

ADD
Show:
© 2014 Microsoft