Click here to Skip to main content
15,442,199 members
Articles / Programming Languages / C++
Posted 6 Dec 2006


69 bookmarked

Hard drive information using S.M.A.R.T.

Rate me:
Please Sign up or sign in to vote.
4.33/5 (31 votes)
25 May 2007
Retrieving Hard drive information using S.M.A.R.T.

Sample Image - SMARTIMAGE.jpg


This is very simple program which communicates with the Hard drive to get the information using S.M.A.R.T. available within the hard drive.

The core part is to prepare the command structure and pass it to the device driver which communicates with the hard drive. It uses the DeviceIoControl function. For eg: bRet=DeviceIoControl(hDevice,SMART_SEND_DRIVE_COMMAND,&stCIP,sizeof(stCIP),&stCOP,sizeof(stCOP),&dwRet,NULL);

Don't forget to include the "DDKInclude" folder in the workspace to your VC's include folder before compiling. This sample is only intended for beginners. Most of the information for S.M.A.R.T. is available in the net.

Also the information for each id is stored in an .ini file. You can see that in the Debug / Release folder.

Double click on any of the item in the list box to get more information about it. For e.g., xx sector count

Please contact me for any doubts and i will be happy to answer to your questions


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Written By
Software Developer (Senior)
United States United States
I am from the beautiful sea side town called Kochi ( cochin), Kerala, South India.

Comments and Discussions

QuestionCan you do this cove to delphi Pin
Member 1435927415-Oct-19 10:52
MemberMember 1435927415-Oct-19 10:52 
Questionis posible do it in delphi Pin
Member 1435927414-Oct-19 12:48
MemberMember 1435927414-Oct-19 12:48 
QuestionAbout temperature calculation Pin
Member 1383132616-May-18 22:15
MemberMember 1383132616-May-18 22:15 
QuestionNo data read while running exe file Pin
Member 1307035822-May-17 0:26
MemberMember 1307035822-May-17 0:26 
AnswerRe: No data read while running exe file Pin
Bokov Sergey27-Jun-17 3:59
MemberBokov Sergey27-Jun-17 3:59 
QuestionGood Pin
el_tel22-Nov-16 4:45
Memberel_tel22-Nov-16 4:45 
Generalbuild project in VS above 2008 Pin
creepy21-Jun-15 16:41
Membercreepy21-Jun-15 16:41 
QuestionRead SMART DATA Pin
nareshlove10-Mar-14 3:55
Membernareshlove10-Mar-14 3:55 
QuestionIs this code can damage Samsung F4 drives like smartmontools ? Pin
Shurwint26-Oct-13 4:32
MemberShurwint26-Oct-13 4:32 
SuggestionPlease update the code and compile a new dll Pin
CitizenDC26-Jun-12 9:11
MemberCitizenDC26-Jun-12 9:11 
GeneralRe: Please update the code and compile a new dll Pin
Saneesh26-Jul-12 3:54
MemberSaneesh26-Jul-12 3:54 
BugRegarding RAW and Threshold Value Pin
Nidheesh V N16-May-12 18:49
MemberNidheesh V N16-May-12 18:49 
GeneralRe: Regarding RAW and Threshold Value Pin
Saneesh17-May-12 4:34
MemberSaneesh17-May-12 4:34 
QuestionProject settings Pin
jlkdaslkfjd31-Oct-11 0:24
Memberjlkdaslkfjd31-Oct-11 0:24 
AnswerRe: Project settings Pin
Saneesh17-May-12 4:34
MemberSaneesh17-May-12 4:34 
QuestionCan not compile in VC6.0 [modified] Pin
weishoumeng24-Aug-10 17:06
Memberweishoumeng24-Aug-10 17:06 
AnswerRe: Can not compile in VC6.0 Pin
Saneesh30-Aug-10 17:21
MemberSaneesh30-Aug-10 17:21 
GeneralBlank screen when click on 'Read SMART Values' Button Pin
Nicholas Amh20-Apr-10 20:32
MemberNicholas Amh20-Apr-10 20:32 
GeneralRe: Blank screen when click on 'Read SMART Values' Button Pin
Saneesh21-Apr-10 5:20
MemberSaneesh21-Apr-10 5:20 
GeneralRe: Blank screen when click on 'Read SMART Values' Button Pin
arun00219-Feb-11 3:22
Memberarun00219-Feb-11 3:22 
GeneralC++ win32 console aplication Pin
madmat8714-Nov-09 13:57
Membermadmat8714-Nov-09 13:57 
GeneralRe: C++ win32 console aplication Pin
Saneesh18-Nov-09 15:56
MemberSaneesh18-Nov-09 15:56 
QuestionUse this Code for C# Pin
MasterChef23-Oct-09 9:31
MemberMasterChef23-Oct-09 9:31 
AnswerRe: Use this Code for C# Pin
Saneesh24-Oct-09 6:35
MemberSaneesh24-Oct-09 6:35 
QuestionRe: Use this Code for C# Pin
MasterChef25-Oct-09 6:10
MemberMasterChef25-Oct-09 6:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.