S.M.A.R.T.
S.M.A.R.T.
SMART = Self-Monitoring Analysis and Reporting Technology
This Lib / Example can monitor your Hard Disk Smart function.
The source code is from Rings and Max (viewtopic.php?t=6599)
I just add a GUI and made it easier to use ( for library purpose).
You can download a first sample here.
This Lib / Example can monitor your Hard Disk Smart function.
The source code is from Rings and Max (viewtopic.php?t=6599)
I just add a GUI and made it easier to use ( for library purpose).
You can download a first sample here.
Last edited by Droopy on Wed Nov 30, 2005 10:52 pm, edited 1 time in total.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
It don't work with Win9x/Me, because of
Maybe it would work with
Like :
Code: Select all
hdh = CreateFile_("\\.\PhysicalDrive" + Str(Drive),#GENERIC_READ | #GENERIC_WRITE, #FILE_SHARE_READ | #FILE_SHARE_WRITE,0, #OPEN_EXISTING, 0, 0)
Code: Select all
hdh = CreateFile_("\\.\SMARTVSD", #GENERIC_READ, #FILE_SHARE_READ, 0, #OPEN_EXISTING, 0, 0)
Code: Select all
VersionInfo\dwOSVersionInfoSize = SizeOf(OSVERSIONINFO)
Platform = GetVersionEx_(VersionInfo)
If Platform
If VersionInfo\dwPlatformId = #VER_PLATFORM_WIN32_WINDOWS ; Win9x/Me
hdh = CreateFile_("\\.\SMARTVSD", #GENERIC_READ, #FILE_SHARE_READ, 0, #OPEN_EXISTING, 0, 0)
Else ; NT kernel
hdh = CreateFile_("\\.\PhysicalDrive" + Str(Drive), #GENERIC_READ | #GENERIC_WRITE, #FILE_SHARE_READ | #FILE_SHARE_WRITE, 0, #OPEN_EXISTING, 0, 0)
EndIf
EndIf
If hdh <> #INVALID_HANDLE_VALUE
etc ...
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Very cool Lib?GeoTrail wrote:39 degrees on my first drive. VERY cool lib
Give the credits to Rings mostly, as he did the really hard work about accessing the Physical Drive.
I did the entire retrieval of the S.M.A.R.T. attributes in extension to Rings code.
Droopy wrapped around it and added some constants. You guys should really learn to give the kudos, where it belongs to. What you do is close to stealing intellectual property. As coder you should understand that this is the worst in this business.
Recycling top, innovation flop!
And stop calling everything a Lib. Just because I take some other people's code and add a gui doesn't make it a lib, ffs.
Athlon64 3800+ · 1 GB RAM · Radeon X800 XL · Win XP Prof/SP1+IE6.0/Firefox · PB 3.94/4.0
Intel Centrino 1.4 MHz · 1.5 GB RAM · Radeon 9000 Mobility · Win XP Prof/SP2+IE6.0/Firefox · PB 3.94/4.0
Intel Centrino 1.4 MHz · 1.5 GB RAM · Radeon 9000 Mobility · Win XP Prof/SP2+IE6.0/Firefox · PB 3.94/4.0
Well, I can't disagree with Max.
Hmm is this supossed to work with SATA drives anyway?
In any case... any real programmer would know how to handle errors, at line 185 you should add this (on the next, blank, line, of, course)..
So if there arent any items, break. In my case with the SATA drives I dont get any output from the list, so thats why you should have this kind of error checking. You shouldnt avoid error checking, ever. (Even less if you're going to release something to public).
Hmm is this supossed to work with SATA drives anyway?
In any case... any real programmer would know how to handle errors, at line 185 you should add this (on the next, blank, line, of, course)..
Code: Select all
If CountList(SmartLList()) < 1 ;use = 0 if it makes you horny though.
ProcedureReturn 0
EndIf
Woot?, it will crash (the program itself) since it has no error checking, but crashing the OS? which OS are you using? 9x ?
Not that I care though (about this 'lib' crashing people's systems)..
Not that I care though (about this 'lib' crashing people's systems)..
Last edited by dagcrack on Wed Nov 30, 2005 4:32 am, edited 1 time in total.
In the source code the credit is done to Rings and you, sorry to omit this in the post.Give the credits to Rings mostly, as he did the really hard work about accessing the Physical Drive.
This code is for including in the Droopy Lib, i'll compile it with tailbite / add documentation in chm format for each functions / add credit to for each author.And stop calling everything a Lib. Just because I take some other people's code and add a gui doesn't make it a lib, ffs.
I add Status State : (Test done by destroying some hard disk, i need to check smart status, it's a major value for me )Recycling top, innovation flop!
Code: Select all
If Smart\Value < Smart\Threshold
Status= "BAD"
Else
Status="OK"
EndIf
I have a dead disk, wich Smart status is OK, but Smart Error Log report many errors. (With SmartMonTools http://smartmontools.sourceforge.net/
I want to retrieve SMART Error Log, someone know how to do this ?
Then why are you quoting me? It isn't my responsibility to check who the original author is before I say something is coolMax. wrote:Very cool Lib?
Give the credits to Rings mostly, as he did the really hard work about accessing the Physical Drive.
I did the entire retrieval of the S.M.A.R.T. attributes in extension to Rings code.
Droopy wrapped around it and added some constants. You guys should really learn to give the kudos, where it belongs to. What you do is close to stealing intellectual property. As coder you should understand that this is the worst in this business.
Recycling top, innovation flop!
And stop calling everything a Lib. Just because I take some other people's code and add a gui doesn't make it a lib, ffs.

I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
My beef with what you did (and also do with other people's stuff) is:
1. This is a Tips & Tricks section. I understand this as sharing new source codes/snippets for people to learn & use and not to announce libraries or applications, even more if there was nothing really new.
2. If you like to enhance stuff of others, add it to their threads, so people learn to know where it comes from and also maybe get hints from the development history.
3. If you recycle, use proper credits. This is more than mentioning a bunch of names in the source code only without a clear indicator who did what.
4. If you intend to Tailbite stuff of others in order to distribute it, I'd consider it good style if you asked for the original coders consent.
5. If you quote, like you did in the source code, do it in an appropriate way.
6. Don't omit the origin in the posting. This is what people see.
http://forums.purebasic.com/german/view ... highlight=
Some might see things like that not as serious as I do, but for me, several incidents like this were reason enough not to share any more code since more than 1 year and this one confirms me. So...

1. This is a Tips & Tricks section. I understand this as sharing new source codes/snippets for people to learn & use and not to announce libraries or applications, even more if there was nothing really new.
2. If you like to enhance stuff of others, add it to their threads, so people learn to know where it comes from and also maybe get hints from the development history.
3. If you recycle, use proper credits. This is more than mentioning a bunch of names in the source code only without a clear indicator who did what.
4. If you intend to Tailbite stuff of others in order to distribute it, I'd consider it good style if you asked for the original coders consent.
5. If you quote, like you did in the source code, do it in an appropriate way.
Without knowing better or rereading the entire thread, I'd think that it is you who said: "I extended Rings' snippet a bit so it reads also the S.M.A.R.T. data of an harddisk...";{- ORIGINAL POST : viewtopic.php?t=6599&postdays=0&postorder=asc&start=15
; I extended Rings' snippet a bit so it reads also the S.M.A.R.T. data of an harddisk
; (If The HDD is capable of).
; The values are held in two structures.
; bAttrValue is The current value of an Attribute. Attribute means certain monitoring
; parameter, like temperature, Read errors And such.
; bWorstValue is speaking For itself.
; bRawValue is The value translated; for example, for Attribute 194 my system reports
; "104" as current value, "7" as worst (O_o), "0" as threshold And "39" as raw value.
; The "39" is "39 °C", as we are talking about temperatures.
; bWarrantyThreshold is The value defined by The vendor And The actual value should
; never be below.
;}
6. Don't omit the origin in the posting. This is what people see.
and as with the good old tin-can phones, this is what results of itSMART = Self-Monitoring Analysis and Reporting Technology
This Lib / Example can monitor your Hard Disk Smart function.
http://www.penguinbyte.com/apps/pbwebst ... /SMART.zip
http://forums.purebasic.com/german/view ... highlight=
----------------Subject: S.M.A.R.T. von Droopy
Droopy hat folgendes geschrieben:
SMART = Self-Monitoring Analysis and Reporting Technology
This Lib / Example can monitor your Hard Disk Smart function.
viewtopic.php?t=17974
Grüße ... Kiffi
Some might see things like that not as serious as I do, but for me, several incidents like this were reason enough not to share any more code since more than 1 year and this one confirms me. So...
...I want to retrieve SMART Error Log, someone know how to do this ?

Athlon64 3800+ · 1 GB RAM · Radeon X800 XL · Win XP Prof/SP1+IE6.0/Firefox · PB 3.94/4.0
Intel Centrino 1.4 MHz · 1.5 GB RAM · Radeon 9000 Mobility · Win XP Prof/SP2+IE6.0/Firefox · PB 3.94/4.0
Intel Centrino 1.4 MHz · 1.5 GB RAM · Radeon 9000 Mobility · Win XP Prof/SP2+IE6.0/Firefox · PB 3.94/4.0