Modules | |
SMART Return Codes | |
Attribute IDs | |
Device attributes | |
Defines | |
#define | SERIAL_NUM_LEN 20 |
#define | FIRMWARE_REV_LEN 8 |
#define | MODEL_NUM_LEN 40 |
#define | VENDOR_UNIQUE_LEN 3 |
#define | WWN_LEN 8 |
#define | MAX_PARTITIONS_PER_DEVICE 8 |
#define | ATTR_TYPE_STR_DESC 0x20 |
A text description of the attribute. See below for a more detailed description of each attribute. | |
#define | ATTR_TYPE_INT_STATUS 0x40 |
Provided a status for the attribute. OK means the attribute value is well in the safe zone. FAIL means that a Threshold Exceeding Condition has been detected. | |
#define | ATTR_TYPE_INT_TYPE 0x80 |
The type of the SMART attribute. | |
#define | ATTR_TYPE_INT_VALUE 0x01 |
The current normalized attribute value. | |
#define | ATTR_TYPE_ULONGLONG_RAW 0x02 |
#define | ATTR_TYPE_INT_WORST 0x04 |
The worst (lowest) value recorded so far. This is an indicator of how close to failure the drive has ever been. | |
#define | ATTR_TYPE_INT_THRESHOLD 0x08 |
The attribute threshold. This value will not change and represents the lowest possible safe attribute value. | |
#define | SMART_SELFTEST_STATUS_NOERR 0x0 |
Indicates a previous self-test routine completed without error or no self-test status is available. | |
#define | SMART_SELFTEST_STATUS_ABORTED 0x1 |
The self-test routine was aborted by the host. | |
#define | SMART_SELFTEST_STATUS_INTERRUPTED 0x2 |
The self-test routine was interrupted by the host with a hardware or software reset. | |
#define | SMART_SELFTEST_STATUS_FATALERR 0x3 |
A fatal error or unknown test error occurred while the device was executing its self-test routine and the device was unable to complete the self-test routine. | |
#define | SMART_SELFTEST_STATUS_FAILED_UNKNOWN 0x4 |
The previous self-test completed having a test element that failed and the test element that failed is not known. | |
#define | SMART_SELFTEST_STATUS_FAILED_ELECTRICAL 0x5 |
The previous self-test completed having the electrical element of the test failed. | |
#define | SMART_SELFTEST_STATUS_FAILED_SERVOSEEK 0x6 |
The previous self-test completed having the servo and/or seek test element of the test failed. | |
#define | SMART_SELFTEST_STATUS_FAILED_READ 0x7 |
The previous self-test completed having the read element of the test failed. | |
#define | SMART_SELFTEST_STATUS_FAILED_HANDLING 0x8 |
The previous self-test completed having a test element that failed and the device is suspected of having handling damage. | |
#define | SMART_SELFTEST_STATUS_IN_PROGRESS 0xF |
Self-test routine in progress. | |
Enumerations | |
enum | SMART_TYPE { SMART_TYPE_ATA = 0, SMART_TYPE_NVME = 1 } |
enum | SMART_SELFTEST { SMART_SELFTEST_ABORT = 0, SMART_SELFTEST_SHORT = 1, SMART_SELFTEST_EXT = 2, SMART_SELFTEST_CONVEYANCE = 3, SMART_SELFTEST_SELECTIVE = 4, SMART_SELFTEST_MAX = 5 } |
Functions | |
SYSINFO_API int | SysInfoDll_Smart_Init (bool debug, wchar_t *iDebugFile=NULL, bool iRecordTEC=true) |
Call this function to initialize usage of the SMART set of APIs. | |
SYSINFO_API void | SysInfoDll_Smart_Cleanup (void) |
Call this function to clean up memory usage of the DLL after finishing all calls to SysInfo SMART APIs. It de-allocates all memory that was allocated and used by SmartDisk DLL. Calling subsequent SmartDll API calls after SmartDll_Cleanup is an error. | |
SYSINFO_API int | SysInfoDll_Smart_Refresh (bool iRecordTEC=false) |
Call this function to refresh (and re-probe) all SMART devices. If iRecordTEC is true, it records S.M.A.R.T. values for all the available S.M.A.R.T. devices discovered. | |
SYSINFO_API int | SysInfoDll_Smart_SetInitTimeout (DWORD iTimeoutMs) |
Call this function to set the timeout for retrieving SMART info from a drive. | |
SYSINFO_API int | SysInfoDll_Smart_GetNumSmartDevices (void) |
Call this function to return the total number of SMART devices detected. | |
SYSINFO_API int | SysInfoDll_Smart_GetNumDetectedDrives (void) |
Call this function to return the total number of physical drives detected. | |
SYSINFO_API int | SysInfoDll_Smart_GetPhysicalDeviceIDFirst (void) |
Returns the device ID of the first physical device detected. | |
SYSINFO_API int | SysInfoDll_Smart_GetPhysicalDeviceIDNext (void) |
Returns the device ID of the next physical device detected. | |
SYSINFO_API int | SysInfoDll_Smart_IsValidSmartDevice (int iDeviceID) |
Checks if a particular device ID is a SMART device. | |
SYSINFO_API int | SysInfoDll_Smart_GetDevicePartitionInfo (int *ioDriveNumSameDisk, int *ioNumPartition, int iDeviceID) |
Checks if a particular device ID belongs has multiple partitions. | |
SYSINFO_API int | SysInfoDll_Smart_GetDriveLetterFromDriveNum (wchar_t *ioDriveLetter, int iDriveNum) |
Get the drive letter from the drive number. | |
SYSINFO_API int | SysInfoDll_Smart_GetDeviceIDFromDriveNum (int iDriveNum) |
Get the device ID from the drive number. | |
SYSINFO_API int | SysInfoDll_Smart_GetDeviceSerialNumber (wchar_t *ioBuf, int *ioLen, int iDeviceID) |
Get the serial number of the device. | |
SYSINFO_API int | SysInfoDll_Smart_GetDeviceFirmWareRev (wchar_t *ioBuf, int *ioLen, int iDeviceID) |
Get the firmware revision number of the device. | |
SYSINFO_API int | SysInfoDll_Smart_GetDeviceModelNumber (wchar_t *ioBuf, int *ioLen, int iDeviceID) |
Get the device model number of the device. | |
SYSINFO_API int | SysInfoDll_Smart_GetDeviceCapacity (int *ioCapacity, int iDeviceID) |
Get the capacity of the device in MB . | |
SYSINFO_API int | SysInfoDll_Smart_GetDeviceInterface (wchar_t *ioBuf, int *ioLen, bool *isSSD, int iDeviceID) |
Get the interface type of the device and return if marked as SSD. | |
SYSINFO_API int | SysInfoDll_Smart_GetVolumeCapacity (int *ioCapacity, int iDriveNum) |
Get the capacity of a volume in MB . | |
SYSINFO_API int | SysInfoDll_Smart_GetSmartDeviceIDFirst (void) |
Returns the device ID of the first SMART device detected. | |
SYSINFO_API int | SysInfoDll_Smart_GetSmartDeviceIDNext (void) |
Returns the device ID of the next SMART device detected. | |
SYSINFO_API int | SysInfoDll_Smart_GetNumSmartAttr (int iDeviceID) |
Returns the number of SMART attributes for a SMART device. | |
SYSINFO_API int | SysInfoDll_Smart_GetSmartAttributeIDFirst (int iDeviceID) |
Returns the first discovered attribute ID of the SMART device. | |
SYSINFO_API int | SysInfoDll_Smart_GetSmartAttributeIDNext (int iDeviceID) |
Returns the next discovered attribute ID of the SMART device. | |
SYSINFO_API int | SysInfoDll_Smart_RefreshSmartAttributes (int iDeviceID) |
Refresh the SMART attributes for a SMART device. | |
SYSINFO_API int | SysInfoDll_Smart_ExecuteSelfTest (int iDeviceID, int iTestType) |
Execute a SMART self-test routine. | |
SYSINFO_API int | SysInfoDll_Smart_GetSelfTestStatus (int iDeviceID, int *ioStatus, int *ioPercentRem) |
Retrieve the status of a previously executed SMART self-test routine. | |
SYSINFO_API int | SysInfoDll_Smart_GetMaxLBA (int iDeviceID, unsigned long long *oMaxLBA) |
Retrieve maximum valid LBA for a device (HPA). | |
SYSINFO_API int | SysInfoDll_Smart_GetMax28bitLBA (int iDeviceID, unsigned int *oMaxLBA) |
Retrieve maximum valid 28-bit LBA for a device (HPA). | |
SYSINFO_API int | SysInfoDll_Smart_SetMaxLBA (int iDeviceID, unsigned long long iMaxLBA) |
Set the maximum allowable LBA for a device (HPA). | |
SYSINFO_API int | SysInfoDll_Smart_GetDCOMaxLBA (int iDeviceID, unsigned long long *oMaxLBA) |
Retrieve highest LBA accepted by a device (DCO). | |
SYSINFO_API int | SysInfoDll_Smart_SetDCOMaxLBA (int iDeviceID, unsigned long long iMaxLBA) |
Set the maximum valid LBA for a device (DCO). | |
SYSINFO_API int | SysInfoDll_Smart_RestoreDCO (int iDeviceID) |
Restore the DCO to default settings. | |
SYSINFO_API int | SysInfoDll_Smart_ReadSectors (int iDeviceID, unsigned long long iLBA, unsigned int iNumSectors, unsigned char *oBuffer) |
Read sectors from a device. | |
SYSINFO_API int | SysInfoDll_Smart_GetSmartAttributeByID (void *ioPtr, int *ioLen, int iAttrID, int inAttrType, int iDeviceID) |
Get the attribute value of a particular attribute ID for a SMART device. | |
SYSINFO_API int | SysInfoDll_Smart_GetAttrDescByID (wchar_t *oBuf, int *ioLen, int iAttrID, int iDeviceID) |
Get the attribute description of a particular attribute ID. | |
SYSINFO_API int | SysInfoDll_Smart_GetDeviceInfo (DEVICEINFO *oDeviceInfo, int iDeviceID) |
Get the device information (such as disk geometry, interface, supported/enabled features). | |
SYSINFO_API int | SysInfoDll_Smart_ExportReport (wchar_t *filename, int iDeviceID, wchar_t *iHeaderText, int iHeaderTextLen, int iExportFlags=3, int iHistoryAttr=0) |
Exports an ASCII text report containing the device information, SMART attribute values and history. | |
SYSINFO_API int | SysInfoDll_Smart_RecordTECData (int iDeviceID) |
Records the current set of normalized and raw attribute values to a binary file for use with TEC prediction. | |
SYSINFO_API int | SysInfoDll_Smart_GetTECDataSetCount (int *ioCount, int iDeviceID) |
Get number of TEC prediction data sets recorded for a particular SMART device. | |
SYSINFO_API int | SysInfoDll_Smart_ExportTECData (time_t *ioTimeArray, int *ioNormValArray, int *ioWorstValArray, unsigned long long *ioRawValArray, int *ioArraySize, int iAttrID, int iDeviceID) |
Extract the TEC prediction data for a particular attribute of a SMART device. | |
SYSINFO_API int | SysInfoDll_Smart_GetTECDataAtIndex (time_t *ioTime, int *ioNormVal, int *ioWorstVal, unsigned long long *ioRawVal, int inIndex, int iAttrID, int iDeviceID) |
Extract a particular TEC prediction data entry for a particular attribute of a SMART device. | |
SYSINFO_API int | SysInfoDll_Smart_EstimateTECByAttributeID (time_t *ioEarliest, time_t *ioLatest, int iAttrID, int iDeviceID) |
Predicts TEC based on previously recorded TEC prediction data for a particular attribute of a SMART device. | |
SYSINFO_API int | SysInfoDll_Smart_EstimateTEC (time_t *ioEarliest, time_t *ioLatest, int *oAttrID, int iDeviceID) |
Predicts TEC based on previously recorded TEC prediction data for all applicable attributes of a SMART device. |
#define SERIAL_NUM_LEN 20 |
#define FIRMWARE_REV_LEN 8 |
#define MODEL_NUM_LEN 40 |
#define VENDOR_UNIQUE_LEN 3 |
#define WWN_LEN 8 |
#define MAX_PARTITIONS_PER_DEVICE 8 |
#define ATTR_TYPE_STR_DESC 0x20 |
A text description of the attribute. See below for a more detailed description of each attribute.
#define ATTR_TYPE_INT_STATUS 0x40 |
Provided a status for the attribute. OK means the attribute value is well in the safe zone. FAIL means that a Threshold Exceeding Condition has been detected.
#define ATTR_TYPE_INT_TYPE 0x80 |
The type of the SMART attribute.
#define ATTR_TYPE_INT_VALUE 0x01 |
The current normalized attribute value.
#define ATTR_TYPE_ULONGLONG_RAW 0x02 |
#define ATTR_TYPE_INT_WORST 0x04 |
The worst (lowest) value recorded so far. This is an indicator of how close to failure the drive has ever been.
#define ATTR_TYPE_INT_THRESHOLD 0x08 |
The attribute threshold. This value will not change and represents the lowest possible safe attribute value.
#define SMART_SELFTEST_STATUS_NOERR 0x0 |
Indicates a previous self-test routine completed without error or no self-test status is available.
#define SMART_SELFTEST_STATUS_ABORTED 0x1 |
The self-test routine was aborted by the host.
#define SMART_SELFTEST_STATUS_INTERRUPTED 0x2 |
The self-test routine was interrupted by the host with a hardware or software reset.
#define SMART_SELFTEST_STATUS_FATALERR 0x3 |
A fatal error or unknown test error occurred while the device was executing its self-test routine and the device was unable to complete the self-test routine.
#define SMART_SELFTEST_STATUS_FAILED_UNKNOWN 0x4 |
The previous self-test completed having a test element that failed and the test element that failed is not known.
#define SMART_SELFTEST_STATUS_FAILED_ELECTRICAL 0x5 |
The previous self-test completed having the electrical element of the test failed.
#define SMART_SELFTEST_STATUS_FAILED_SERVOSEEK 0x6 |
The previous self-test completed having the servo and/or seek test element of the test failed.
#define SMART_SELFTEST_STATUS_FAILED_READ 0x7 |
The previous self-test completed having the read element of the test failed.
#define SMART_SELFTEST_STATUS_FAILED_HANDLING 0x8 |
The previous self-test completed having a test element that failed and the device is suspected of having handling damage.
#define SMART_SELFTEST_STATUS_IN_PROGRESS 0xF |
Self-test routine in progress.
enum SMART_TYPE |
enum SMART_SELFTEST |
SYSINFO_API int SysInfoDll_Smart_Init | ( | bool | debug, | |
wchar_t * | iDebugFile = NULL , |
|||
bool | iRecordTEC = true | |||
) |
Call this function to initialize usage of the SMART set of APIs.
This function should only be called once. The call enumerates through all detected drives, initializes the proper structures and retrieves SMART values. If SysInfoDll_Smart_Init is not called first, subsequent SysInfo SMART API calls will fail.
[in] | debug | A flag specifying if debug messages should be logged |
[in] | iDebugFile | The name of the debug file to write to. If NULL, "SmartDiskDebug.log" will be used. |
[in] | iRecordTEC | A flag specifying if we want to record and write all SMART attributes to a binary file for the purpose of TEC prediction. This value defaults to true. |
SYSINFO_API void SysInfoDll_Smart_Cleanup | ( | void | ) |
Call this function to clean up memory usage of the DLL after finishing all calls to SysInfo SMART APIs. It de-allocates all memory that was allocated and used by SmartDisk DLL. Calling subsequent SmartDll API calls after SmartDll_Cleanup is an error.
SYSINFO_API int SysInfoDll_Smart_Refresh | ( | bool | iRecordTEC = false |
) |
Call this function to refresh (and re-probe) all SMART devices. If iRecordTEC is true, it records S.M.A.R.T. values for all the available S.M.A.R.T. devices discovered.
[in] | iRecordTEC | A flag specifying if we want to record and write all SMART attributes to a binary file for the purpose of TEC prediction. This value defaults to false. |
SYSINFO_API int SysInfoDll_Smart_SetInitTimeout | ( | DWORD | iTimeoutMs | ) |
Call this function to set the timeout for retrieving SMART info from a drive.
[in] | iTimeoutMs | The timeout value in milliseconds |
SYSINFO_API int SysInfoDll_Smart_GetNumSmartDevices | ( | void | ) |
Call this function to return the total number of SMART devices detected.
SYSINFO_API int SysInfoDll_Smart_GetNumDetectedDrives | ( | void | ) |
Call this function to return the total number of physical drives detected.
SYSINFO_API int SysInfoDll_Smart_GetPhysicalDeviceIDFirst | ( | void | ) |
Returns the device ID of the first physical device detected.
SYSINFO_API int SysInfoDll_Smart_GetPhysicalDeviceIDNext | ( | void | ) |
Returns the device ID of the next physical device detected.
SYSINFO_API int SysInfoDll_Smart_IsValidSmartDevice | ( | int | iDeviceID | ) |
Checks if a particular device ID is a SMART device.
[in] | iDeviceID | Device ID to check |
SYSINFO_API int SysInfoDll_Smart_GetDevicePartitionInfo | ( | int * | ioDriveNumSameDisk, | |
int * | ioNumPartition, | |||
int | iDeviceID | |||
) |
Checks if a particular device ID belongs has multiple partitions.
A: (floppy) - drive number 0
C: (1st partition on physcial drive 0) - drive number 2
D: (2nd partition on physcial drive 0) - drive number 3
E: (cdrom) - drive number 4
If we call this function and pass in device ID 0, we will get:
ioDriveNumSameDisk = [2,3],
ioNumPartition = 2
Use SysInfoDll_Smart_GetDriveLetterFromDriveNum to convert the drive number to their corresponding letters.
[out] | ioDriveNumSameDisk | array of integers that will store the drive numbers of all the volumes that shares the same physical disk |
[in,out] | ioNumPartition | The size of the ioDriveNumSameDisk array. On return, contains the actual number of items in the array. If buffer is not big enough SMART_ERR_BUFFER_TOO_SMALL will be returned. |
[in] | iDeviceID | Device ID of the hard disk device |
SYSINFO_API int SysInfoDll_Smart_GetDriveLetterFromDriveNum | ( | wchar_t * | ioDriveLetter, | |
int | iDriveNum | |||
) |
Get the drive letter from the drive number.
[out] | ioDriveLetter | pointer to a character to store the drive letter |
[in] | iDriveNum | the drive number of the volume |
SYSINFO_API int SysInfoDll_Smart_GetDeviceIDFromDriveNum | ( | int | iDriveNum | ) |
Get the device ID from the drive number.
[in] | iDriveNum | the drive number of the volume |
SYSINFO_API int SysInfoDll_Smart_GetDeviceSerialNumber | ( | wchar_t * | ioBuf, | |
int * | ioLen, | |||
int | iDeviceID | |||
) |
Get the serial number of the device.
[out] | ioBuf | pre-allocated character buffer to hold serial number string |
[in,out] | ioLen | The size of ioBuf buffer. On return, contains the serial number string length. |
[in] | iDeviceID | Device ID of the hard disk device |
SYSINFO_API int SysInfoDll_Smart_GetDeviceFirmWareRev | ( | wchar_t * | ioBuf, | |
int * | ioLen, | |||
int | iDeviceID | |||
) |
Get the firmware revision number of the device.
[out] | ioBuf | pre-allocated character buffer to hold firmware revision string |
[in,out] | ioLen | The size of ioBuf buffer. On return, contains the firmware revision string length. |
[in] | iDeviceID | Device ID of the hard disk device |
SYSINFO_API int SysInfoDll_Smart_GetDeviceModelNumber | ( | wchar_t * | ioBuf, | |
int * | ioLen, | |||
int | iDeviceID | |||
) |
Get the device model number of the device.
[out] | ioBuf | pre-allocated character buffer to hold device model string. |
[in,out] | ioLen | The size of ioBuf buffer. On return, contains the device model string length. |
[in] | iDeviceID | Device ID of the hard disk device |
SYSINFO_API int SysInfoDll_Smart_GetDeviceCapacity | ( | int * | ioCapacity, | |
int | iDeviceID | |||
) |
Get the capacity of the device in MB .
[out] | ioCapacity | Pointer to an integer to hold capacity in MB. |
[in] | iDeviceID | Device ID of the hard disk device |
SYSINFO_API int SysInfoDll_Smart_GetDeviceInterface | ( | wchar_t * | ioBuf, | |
int * | ioLen, | |||
bool * | isSSD, | |||
int | iDeviceID | |||
) |
Get the interface type of the device and return if marked as SSD.
[out] | ioBuf | pre-allocated character buffer to hold device interface type string. |
[in,out] | ioLen | The size of ioBuf buffer. On return, contains the device interface type string length. |
[out] | isSSD | True if marked as SSD |
[in] | iDeviceID | Device ID of the hard disk device |
SYSINFO_API int SysInfoDll_Smart_GetVolumeCapacity | ( | int * | ioCapacity, | |
int | iDriveNum | |||
) |
Get the capacity of a volume in MB .
[out] | ioCapacity | Pointer to an integer to hold capacity in MB. |
[in] | iDriveNum | the drive number of the volume |
SYSINFO_API int SysInfoDll_Smart_GetSmartDeviceIDFirst | ( | void | ) |
Returns the device ID of the first SMART device detected.
SYSINFO_API int SysInfoDll_Smart_GetSmartDeviceIDNext | ( | void | ) |
Returns the device ID of the next SMART device detected.
SYSINFO_API int SysInfoDll_Smart_GetNumSmartAttr | ( | int | iDeviceID | ) |
Returns the number of SMART attributes for a SMART device.
[in] | iDeviceID | Device ID of the SMART device |
SYSINFO_API int SysInfoDll_Smart_GetSmartAttributeIDFirst | ( | int | iDeviceID | ) |
Returns the first discovered attribute ID of the SMART device.
[in] | iDeviceID | Device ID of the SMART device |
SYSINFO_API int SysInfoDll_Smart_GetSmartAttributeIDNext | ( | int | iDeviceID | ) |
Returns the next discovered attribute ID of the SMART device.
[in] | iDeviceID | Device ID of the SMART device |
SYSINFO_API int SysInfoDll_Smart_RefreshSmartAttributes | ( | int | iDeviceID | ) |
Refresh the SMART attributes for a SMART device.
[in] | iDeviceID | Device ID of the SMART device |
SYSINFO_API int SysInfoDll_Smart_ExecuteSelfTest | ( | int | iDeviceID, | |
int | iTestType | |||
) |
Execute a SMART self-test routine.
[in] | iDeviceID | Device ID of the SMART device |
[in] | iTestType | The self-test routine to execute. |
SYSINFO_API int SysInfoDll_Smart_GetSelfTestStatus | ( | int | iDeviceID, | |
int * | ioStatus, | |||
int * | ioPercentRem | |||
) |
Retrieve the status of a previously executed SMART self-test routine.
[in] | iDeviceID | Device ID of the SMART device |
[out] | ioStatus | On return, contains the status code of a previously executed SMART self-test routine. |
[out] | ioPercentRem | On return, contains an approximation of the percent of the self-test routine remaining until completion in ten percent increments. |
SYSINFO_API int SysInfoDll_Smart_GetMaxLBA | ( | int | iDeviceID, | |
unsigned long long * | oMaxLBA | |||
) |
Retrieve maximum valid LBA for a device (HPA).
[in] | iDeviceID | Device ID of the SMART device |
[out] | oMaxLBA | On return, contains the maximum valid LBA for the device |
SYSINFO_API int SysInfoDll_Smart_GetMax28bitLBA | ( | int | iDeviceID, | |
unsigned int * | oMaxLBA | |||
) |
Retrieve maximum valid 28-bit LBA for a device (HPA).
[in] | iDeviceID | Device ID of the SMART device |
[out] | oMaxLBA | On return, contains the maximum valid 28-bit LBA for the device |
SYSINFO_API int SysInfoDll_Smart_SetMaxLBA | ( | int | iDeviceID, | |
unsigned long long | iMaxLBA | |||
) |
Set the maximum allowable LBA for a device (HPA).
[in] | iDeviceID | Device ID of the SMART device |
[in] | iMaxLBA | The maximum allowable LBA for the device |
SYSINFO_API int SysInfoDll_Smart_GetDCOMaxLBA | ( | int | iDeviceID, | |
unsigned long long * | oMaxLBA | |||
) |
Retrieve highest LBA accepted by a device (DCO).
[in] | iDeviceID | Device ID of the SMART device |
[out] | oMaxLBA | On return, contains the highest LBA accepted by the device |
SYSINFO_API int SysInfoDll_Smart_SetDCOMaxLBA | ( | int | iDeviceID, | |
unsigned long long | iMaxLBA | |||
) |
Set the maximum valid LBA for a device (DCO).
[in] | iDeviceID | Device ID of the SMART device |
[in] | iMaxLBA | The maximum valid LBA allowable for the device |
SYSINFO_API int SysInfoDll_Smart_RestoreDCO | ( | int | iDeviceID | ) |
Restore the DCO to default settings.
[in] | iDeviceID | Device ID of the SMART device |
SYSINFO_API int SysInfoDll_Smart_ReadSectors | ( | int | iDeviceID, | |
unsigned long long | iLBA, | |||
unsigned int | iNumSectors, | |||
unsigned char * | oBuffer | |||
) |
Read sectors from a device.
[in] | iDeviceID | Device ID of the SMART device |
[in] | iLBA | The starting LBA to read |
[in] | iNumSectors | The number of sectors to read |
[out] | oBuffer | On return, contains the sectors read from the device |
SYSINFO_API int SysInfoDll_Smart_GetSmartAttributeByID | ( | void * | ioPtr, | |
int * | ioLen, | |||
int | iAttrID, | |||
int | inAttrType, | |||
int | iDeviceID | |||
) |
Get the attribute value of a particular attribute ID for a SMART device.
[out] | ioPtr | Pointer to store the requested attribute value. The type of pointer depends on inAttrType:
|
[in,out] | ioLen | (ATTR_TYPE_STR_DESC only) Size of the string buffer (in wchar). On return, contains the length of the description string. |
[in] | iAttrID | Attribute IDs you want to get |
[in] | inAttrType | Attribute type to retrieve(See ATTR_TYPE_* ) |
[in] | iDeviceID | Device ID of the SMART device |
SYSINFO_API int SysInfoDll_Smart_GetAttrDescByID | ( | wchar_t * | oBuf, | |
int * | ioLen, | |||
int | iAttrID, | |||
int | iDeviceID | |||
) |
Get the attribute description of a particular attribute ID.
[out] | oBuf | A pre-allocated buffer to hold the description string. |
[in,out] | ioLen | Size of the string buffer (in wchar). On return, contains the length of the desc string. |
[in] | iAttrID | Attribute IDs to retrieve the description for |
[in] | iDeviceID | Device ID of the SMART device |
SYSINFO_API int SysInfoDll_Smart_GetDeviceInfo | ( | DEVICEINFO * | oDeviceInfo, | |
int | iDeviceID | |||
) |
Get the device information (such as disk geometry, interface, supported/enabled features).
[out] | oDeviceInfo | Pointer to a DEVICEINFO struct to hold the info. |
[in] | iDeviceID | Device ID of hard disk device |
SYSINFO_API int SysInfoDll_Smart_ExportReport | ( | wchar_t * | filename, | |
int | iDeviceID, | |||
wchar_t * | iHeaderText, | |||
int | iHeaderTextLen, | |||
int | iExportFlags = 3 , |
|||
int | iHistoryAttr = 0 | |||
) |
Exports an ASCII text report containing the device information, SMART attribute values and history.
[in] | filename | string containing the file path to save the report to |
[in] | iDeviceID | the device ID to generate report for |
[in] | iHeaderText | string containing additional text to be written at the start of the report. |
[in] | iHeaderTextLen | length of the string in iHeaderText. If set to zero, iHeaderText shall be ignored. |
[in] | iExportFlags | flags to indicate which of the following to export:
|
[in] | iHistoryAttr | Attribute IDs to export the history for. Or set to 0 to export the history for all SMART attributes. (ignored if Bit 2 of iExportFlags is not set) |
SYSINFO_API int SysInfoDll_Smart_RecordTECData | ( | int | iDeviceID | ) |
Records the current set of normalized and raw attribute values to a binary file for use with TEC prediction.
[in] | iDeviceID | the device ID to record TEC prediction data for |
SYSINFO_API int SysInfoDll_Smart_GetTECDataSetCount | ( | int * | ioCount, | |
int | iDeviceID | |||
) |
Get number of TEC prediction data sets recorded for a particular SMART device.
[out] | ioCount | number of TEC prediction data sets recorded |
[in] | iDeviceID | the device ID of the SMART device |
SYSINFO_API int SysInfoDll_Smart_ExportTECData | ( | time_t * | ioTimeArray, | |
int * | ioNormValArray, | |||
int * | ioWorstValArray, | |||
unsigned long long * | ioRawValArray, | |||
int * | ioArraySize, | |||
int | iAttrID, | |||
int | iDeviceID | |||
) |
Extract the TEC prediction data for a particular attribute of a SMART device.
[out] | ioTimeArray | Array of time_t values to store the time of sampling |
[out] | ioNormValArray | Array of integer values to store the normalized values |
[out] | ioWorstValArray | Array of integer values to store the worst values |
[out] | ioRawValArray | Array of unsigned long long values to store the raw values |
[in,out] | ioArraySize | Pointer to the size of the arrays. On successful return, contains actual number of sets of TEC values exported. |
[in] | iAttrID | Attribute IDs to retrieve the history for |
[in] | iDeviceID | the device ID of the SMART device |
SYSINFO_API int SysInfoDll_Smart_GetTECDataAtIndex | ( | time_t * | ioTime, | |
int * | ioNormVal, | |||
int * | ioWorstVal, | |||
unsigned long long * | ioRawVal, | |||
int | inIndex, | |||
int | iAttrID, | |||
int | iDeviceID | |||
) |
Extract a particular TEC prediction data entry for a particular attribute of a SMART device.
[out] | ioTime | Pointer to a time_t to store the time of sampling |
[out] | ioNormVal | Pointer to an integer to store the normalized value |
[out] | ioWorstVal | Pointer to an integer to store the worst value |
[out] | ioRawVal | Pointer to an unsigned long long to store the raw value |
[in] | inIndex | Index of TEC prediction record to retrieve |
[in] | iAttrID | Attribute IDs to retrieve the history for |
[in] | iDeviceID | the device ID of the SMART device |
SYSINFO_API int SysInfoDll_Smart_EstimateTECByAttributeID | ( | time_t * | ioEarliest, | |
time_t * | ioLatest, | |||
int | iAttrID, | |||
int | iDeviceID | |||
) |
Predicts TEC based on previously recorded TEC prediction data for a particular attribute of a SMART device.
[out] | ioEarliest | Earliest predicted time for failure |
[out] | ioLatest | Latest predicted time for failure |
[in] | iAttrID | Attribute IDs to use to perform TEC prediction |
[in] | iDeviceID | the device ID of the SMART device |
However, note that the following is actually a warning rather than an error:
SYSINFO_API int SysInfoDll_Smart_EstimateTEC | ( | time_t * | ioEarliest, | |
time_t * | ioLatest, | |||
int * | oAttrID, | |||
int | iDeviceID | |||
) |
Predicts TEC based on previously recorded TEC prediction data for all applicable attributes of a SMART device.
[out] | ioEarliest | Earliest predicted time for failure |
[out] | ioLatest | Latest predicted time for failure |
[in] | oAttrID | Attribute IDs used to perform TEC prediction |
[in] | iDeviceID | the device ID of the SMART device |
However, note that the following are actually warnings rather than errors: