SMART_RCV_DRIVE_DATA control code
Returns the ATA-2 identify data, the Self-Monitoring Analysis and Reporting Technology (SMART) thresholds, or the SMART attributes for the device. This IOCTL must be handled by drivers that support SMART.
The buffer at Irp->AssociatedIrp.SystemBuffer contains a SENDCMDINPARAMS structure that describes the request being sent to the device. The irDriveRegs.bCommandReg member specifies ID_CMD when identify data is requested and SMART_CMD when SMART data is requested. For a list of values that can be assigned to the features register (irDriveRegs.bFeaturesReg), see IDEREGS.
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 + 512).
The driver returns the SENDCMDOUTPARAMS structure and a 512-byte buffer of drive data to the buffer at Irp->AssociatedIrp.SystemBuffer.
If the caller specifies a SMART subcommand of SMART_READ_LOG in rDriveRegs.bFeaturesReg, the caller must also indicate the number of sectors to read in irDriveRegs.bSectorCountReg. The output buffer size must be >= the maximum of two values:
sizeof(SENDCMDINPARAMS)) -1 + (irDriveRegs.bSectorCountReg * SMART_LOG_SECTOR_SIZE).
The data read from the log will be placed in the buffer specified by the bBuffer member of SENDCMDOUTPARAMS.
I/O Status Block
The driver sets the Information field to (sizeof(SENDCMDOUTPARAMS) - 1 + 512) when it sets the Status field to STATUS_SUCCESS. Otherwise, the driver sets the Information field to zero and the Status field to possibly STATUS_INVALID_PARAMETER or STATUS_INSUFFICIENT_RESOURCES.
Supported in Microsoft Windows 2000 and later operating systems.
|Ntdddisk.h (include Ntdddisk.h)|