Click here to Skip to main content
11,644,982 members (57,174 online)
Click here to Skip to main content

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

, 25 May 2007 174.3K 9.4K 65
Rate this:
Please Sign up or sign in to vote.
Retrieving Hard drive information using S.M.A.R.T.

Sample Image - SMARTIMAGE.jpg

Introduction

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

License

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

Share

About the Author

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

You may also be interested in...

Comments and Discussions

 
Generalbuild project in VS above 2008 Pin
creepy21-Jun-15 16:41
membercreepy21-Jun-15 16:41 
QuestionRead SMART DATA Pin
Member 1060765510-Mar-14 3:55
memberMember 1060765510-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 
QuestionHow can read the S.M.A.R.T information with C# Pin
AlexXie23-Aug-09 3:37
memberAlexXie23-Aug-09 3:37 
AnswerRe: How can read the S.M.A.R.T information with C# Pin
Saneesh24-Aug-09 12:22
memberSaneesh24-Aug-09 12:22 
GeneralRe: How can read the S.M.A.R.T information with C# Pin
AlexXie25-Aug-09 3:48
memberAlexXie25-Aug-09 3:48 
GeneralSupport for SCSI HDD Pin
DP3216-Apr-09 6:23
memberDP3216-Apr-09 6:23 
GeneralRe: Support for SCSI HDD Pin
Saneesh7-Apr-09 6:15
memberSaneesh7-Apr-09 6:15 
GeneralRe: Support for SCSI HDD Pin
sukhas198-Apr-09 18:08
membersukhas198-Apr-09 18:08 
GeneralRe: Support for SCSI HDD Pin
sukhas1919-Apr-09 21:00
membersukhas1919-Apr-09 21:00 
GeneralRe: Support for SCSI HDD Pin
Saneesh21-Apr-09 4:12
memberSaneesh21-Apr-09 4:12 
GeneralRe: Support for SCSI HDD Pin
Saneesh21-Apr-09 4:13
memberSaneesh21-Apr-09 4:13 
GeneralThresholds Pin
Kenshin2k29-Dec-08 22:18
memberKenshin2k29-Dec-08 22:18 
GeneralRe: Thresholds Pin
Saneesh30-Dec-08 3:42
memberSaneesh30-Dec-08 3:42 
Questionsmall bug's? Pin
CodeFlatter5-Sep-08 4:28
memberCodeFlatter5-Sep-08 4:28 
AnswerRe: small bug's? Pin
Saneesh5-Sep-08 7:34
memberSaneesh5-Sep-08 7:34 
GeneralAwesome mate !! Pin
asold200723-Aug-08 16:45
memberasold200723-Aug-08 16:45 
GeneralRe: Awesome mate !! Pin
Saneesh23-Aug-08 16:54
memberSaneesh23-Aug-08 16:54 
Questionhow to get the partition or size of the disk?? [modified] Pin
warr~~en19-Jun-08 22:18
memberwarr~~en19-Jun-08 22:18 
AnswerRe: how to get the partition or size of the disk?? Pin
Saneesh20-Jun-08 3:59
memberSaneesh20-Jun-08 3:59 
GeneralRe: how to get the partition or size of the disk?? Pin
warr~~en20-Jun-08 4:39
memberwarr~~en20-Jun-08 4:39 
GeneralNo drives detected Pin
jaque-o12-Jun-08 22:55
memberjaque-o12-Jun-08 22:55 
GeneralRe: No drives detected Pin
Saneesh13-Jun-08 4:05
memberSaneesh13-Jun-08 4:05 
QuestionHow to use DeviceIoControl() api to write IDE HDD one or multiple sectors? Pin
itri9483422-Jun-08 1:34
memberitri9483422-Jun-08 1:34 
AnswerRe: How to use DeviceIoControl() api to write IDE HDD one or multiple sectors? Pin
Saneesh2-Jun-08 6:59
memberSaneesh2-Jun-08 6:59 
GeneralNeed help for console application to read HDD temp Pin
Shiftlord11-Mar-08 23:10
memberShiftlord11-Mar-08 23:10 
GeneralRe: Need help for console application to read HDD temp Pin
Saneesh12-Mar-08 4:39
memberSaneesh12-Mar-08 4:39 
GeneralRe: Need help for console application to read HDD temp Pin
Shiftlord12-Mar-08 5:24
memberShiftlord12-Mar-08 5:24 
GeneralRe: Need help for console application to read HDD temp Pin
Saneesh12-Mar-08 6:34
memberSaneesh12-Mar-08 6:34 
GeneralRe: Need help for console application to read HDD temp Pin
Shiftlord12-Mar-08 6:41
memberShiftlord12-Mar-08 6:41 
GeneralRe: Need help for console application to read HDD temp Pin
Shiftlord14-Mar-08 4:02
memberShiftlord14-Mar-08 4:02 
GeneralRe: Need help for console application to read HDD temp Pin
Saneesh14-Mar-08 6:41
memberSaneesh14-Mar-08 6:41 
GeneralCompiling Error Pin
koala_wk14-Oct-07 17:51
memberkoala_wk14-Oct-07 17:51 
GeneralRe: Compiling Error Pin
Saneesh15-Oct-07 5:15
memberSaneesh15-Oct-07 5:15 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150731.1 | Last Updated 25 May 2007
Article Copyright 2006 by Saneesh
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid