Rafael to obtain the S.M.A.R.T data you can use the WMI or the Windows API.
using the WMI
the WMI classes to obtain S.M.A.R.T
data are
- MSStorageDriver_ATAPISmartData
- MSStorageDriver_FailurePredictData
- MSStorageDriver_FailurePredictStatus
- MSStorageDriver_FailurePredictThresholds
- MSStorageDriver_ScsiInfoExceptions
All are located in the root\WMI
namespace. unfortunately these classes are not very well documented.
using the WINAPI
To access the S.M.A.R.T data from the Windows API requires a little more of work, you must use the DeviceIoControl
and CreateFile
functions passing the respective structures to holding the data. you can find many sample of this on the net.
To calculate the speed of a Hard Disk
there is not a Windows api which expose directly this information. so you must calculate this your self. for an example you can check this application DISKSPEED
which include the source code in C++. they uses the CreateFile
function setting the FILE_FLAG_NO_BUFFERING ($20000000)
flag, to make which any writes and read made to the file handle be done directly without being buffered.