MSDN Home >  MSDN Library >  Storage Devices >  Reference >  I/O Requests for Mass Storage Drivers >  Disk I/O Control Codes
 
Storage Devices: Windows DDK

SMART_SEND_DRIVE_COMMAND

Operation

Sends one of the following Self-Monitoring Analysis and Reporting Technology (SMART) commands to the device:

  • Enable or disable reporting on the device
  • Enable or disable autosaving of attributes
  • Save current attributes now
  • Execute offline diagnostics
  • Get current SMART status

This IOCTL must be handled by drivers that support SMART.

Input

The buffer at Irp->AssociatedIrp.SystemBuffer contains a SENDCMDINPARAMS structure that describes the command being sent to the device. The irDriveRegs.bCommandReg member must specify SMART_CMD. The irDriveRegs.bFeaturesReg member must specify ENABLE_SMART, DISABLE_SMART, ENABLE_DISABLE_AUTOSAVE, SAVE_ATTRIBUTE_VALUES, EXECUTE_OFFLINE_DIAG, or RETURN_SMART_STATUS.

Parameters.DeviceIoControl.InputBufferLength specifies the size in, bytes, of the input buffer, which must be >= (sizeof(SENDCMDINPARAMS) 1).

Parameters.DeviceIoControl.OutputBufferLength specifies the size, in bytes, of the output buffer, which must be >= (sizeof(SENDCMDOUTPARAMS) 1). If SMART status is being requested, the output buffer must be >= (sizeof(SENDCMDOUTPARAMS) 1 + sizeof(IDEREGS)).

Output

The driver returns the SENDCMDOUTPARAMS structure to the buffer at Irp->AssociatedIrp.SystemBuffer. If SMART status was requested and successfully received from the device, the driver includes the IDEREGS structure in the output buffer.

I/O Status Block

When the driver sets the Status field to STATUS_SUCCESS, it sets the Information field is set to ((sizeof(SENDCMDOUTPARAMS) 1) + sizeof(IDEREGS)) for returning SMART status and to (sizeof(SENDCMDOUTPARAMS)  1) for all other commands. The driver should set the Status field to STATUS_INVALID_PARAMETER if an input parameter is incorrect or to STATUS_IO_DEVICE_ERROR if the device aborts a command it does not support. If Status is not STATUS_SUCCESS, the driver sets the Information field to zero.

Headers

Defined in ntdddisk.h. Include ntdddisk.h.

See Also

SENDCMDINPARAMS, SENDCMDOUTPARAMS

 Contact Us   |  E-Mail this Page   |  MSDN Flash Newsletter
 © 2003 Microsoft Corporation. All rights reserved.   Terms of Use  Privacy Statement   Accessibility