|
it shows the cache memory buffer as 32kb instead of 16MB
also many values are 0
|
|
|
|
|
Can you send me the screen shot of your hdd information to saneesh8@hotmail.com
Saneesh
|
|
|
|
|
Also I have meet this issue, the problem is seems that the vista cann't support the function of SMART_RCV_DRIVE_DATA. when you call deviceiocontrol the return value is 50. Tks!
Mywork_007
|
|
|
|
|
Hi,
The problem in Vista is because of strict user permission (as far as i could understand). The command is should be supported by device driver for the hard drive. Once i figure out how to do it, i will update it on CP. Thanks
for looking at it.
Thanks,
Saneesh
Saneesh
|
|
|
|
|
Does this work on external storage arrays or SANs connected via FIBER, just curious because SANS simply present a LUN that is a virtual representation of disk space, and the operating system just sees the space as an additional drive, no matter how many disks the virtual space is stripped across at the san layer.
I will not be in the office for a few days, but when I get there I have a Hitachi Tagmastore SAN dedicated for testing I will try it out on and send the results to you if you are interested.
|
|
|
|
|
Hi,
Most of the time, this will work only on real hard drives present in the system. It wont even work on USB hard drives because the driver wont support it ??. Please try it and let me know the results.
Thanks,
Saneesh
|
|
|
|
|
hello sir ji
i double checked it
it is corupt
thanks
Girish Sharma
|
|
|
|
|
Which one is corrupted?? Both or only one? I just checked and found both are working.
Saneesh
|
|
|
|
|
Hi,
Why the threshold values always are zero? Anather application for HDD control has another values.
|
|
|
|
|
Is it 0 for all of them??? or of just one of the parameters?
Saneesh
|
|
|
|
|
The threshold values for some attributes may be 0. It is right. But it is 0 for all attributes! I can't understand why it is so
Help me, please!
|
|
|
|
|
When u compare the other values with the output from the other program u used, are they same? and only threshold is 0? May be there is some information / the index may be different for your particular model and my code is not checking for that. Can you debug the follwing code and see that you are getting? from function BOOL CSmartReader::ReadSMARTAttributes(HANDLE hDevice,UCHAR ucDriveIndex)
bRet=DeviceIoControl(hDevice,SMART_RCV_DRIVE_DATA,&stCIP,sizeof(stCIP),szAttributes,sizeof(ST_ATAOUTPARAM) + READ_ATTRIBUTE_BUFFER_SIZE - 1,&dwRet,NULL);
if(bRet)
{
pT1=(PBYTE)(((ST_ATAOUTPARAM*)szAttributes)->bBuffer);
for(ucT1=0;ucT1<30;++ucT1)
{
pT2=(PDWORD)&pT1[2+ucT1*12+5];
pT3=&pT1[2+ucT1*12];
pT3[INDEX_ATTRIB_RAW+2]=pT3[INDEX_ATTRIB_RAW+3]=pT3[INDEX_ATTRIB_RAW+4]=pT3[INDEX_ATTRIB_RAW+5]=pT3[INDEX_ATTRIB_RAW+6]=0;
if(pT3[0]!=0)
{
pSmartValues=GetSMARTValue(ucDriveIndex,pT3[0]);
if(pSmartValues)
pSmartValues->m_dwThreshold=pT2[0];
}
}
}
return bRet;
Saneesh
|
|
|
|
|
Hello, Saneesh! Sorry for my long silence.
I debug your specified code and look it's result.
After execution the following step
pSmartValues=GetSMARTValue(ucDriveIndex,pT3[0]);
the pSmartValues.m_dwThreshold is 4294967295. But the pT2[0] value is always 0, so after assignment statement pSmartValues->m_dwThreshold=pT2[0] the pSmartValues.m_dwThreshold value is 0 too.
So, can you help me to understand the pT2 variable meaning?
|
|
|
|
|
Looking at Section 2.6 of the SFF 8035i Revision 2 SMART Specification, titled "SMART Read Attribute Thresholds", the buffer beginning at OutParams.stCOP.bBuffer contains a 512 byte structure. This structure contains, among other things, a collection of smaller structures which include the threshold data. These structures are easily coded as something like this:
<br />
#define SMART_MAX_ATTRIBUTES 30<br />
#define SMART_MAX_THRESHOLDS 30<br />
<br />
#pragma pack( push, 1 )// Structures must be aligned on a single-byte boundary!<br />
typedef struct<br />
{<br />
BYTE ucId;<br />
BYTE ucValue;<br />
BYTE ucReserved[10];<br />
<br />
} SMART_THRESHOLD_INFO, *LPSMART_THRESHOLD_INFO;<br />
<br />
typedef struct<br />
{<br />
WORD wRevision;<br />
SMART_THRESHOLD_INFO arThresholds[ SMART_MAX_THRESHOLDS ];<br />
BYTE ucReserved[18];<br />
BYTE ucVendorSpecific[131];<br />
BYTE ucChecksum;<br />
<br />
} SMART_THRESHOLDS, *LPSMART_THRESHOLDS;<br />
#pragma pack( pop )<br />
With these structures in hand, we can modify the "Read Thresholds" code to be a bit easier to follow...
<br />
LPSMART_THRESHOLDS pThresholds = (LPSMART_THRESHOLDS)OutParams.stCOP.bBuffer;<br />
<br />
for( ucT1 = 0; ucT1 < SMART_MAX_THRESHOLDS; ucT1++ )<br />
{<br />
SMART_THRESHOLD_INFO& info = pThresholds->arThresholds[ ucT1 ];<br />
<br />
if( info.ucId != 0 )<br />
{<br />
pSmartValues = GetSMARTValue( ucDriveIndex, info.ucId );<br />
<br />
if( pSmartValues )<br />
pSmartValues->m_dwThreshold = info.ucValue;<br />
}<br />
}<br />
This same approach could, of course, be applied to the code which reads the attributes in as well. I'll leave that as an exercise for the reader...
Hope this helps!
- NL
*Real* programmers use "copy con:progname.exe"!
|
|
|
|
|
I tried your executable on a server with 2 HDD's using a RAID controller. And actually I was hoping to see 2 hdd's status accoording to SMART protocol, but I just get one. I understand that the OS sees only one hdd ( actually 2 parallel RAID1 ), so is there a way to achieve that, or is there some kind of an api needed delivered by the manufacturer?
Thank you!
**We are an example of helping each other**
|
|
|
|
|
Hi,
I never tried/see it like the way you have described. Well the way to open the drive is in "wsprintf(szT1,"\\\\.\\PHYSICALDRIVE%d",ucDriveIndex);
hDevice=CreateFile(szT1,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_SYSTEM,NULL);".
If the device driver can see it, i guess a different PHYSICALDRIVE should make it work. Does it shows up as two different HDD in control panel.
Which drive's data are you getting?
Saneesh
|
|
|
|
|
Saneesh,
Thank you for your reply.
I haven't tried it yest, but what I found out is that it sees a USB-memorystick also as a physical drive. so that physical drive thing is not just for the HDD only. You'll hear it soon from me about raid set.
Thank you.
**We are an example of helping each other**
|
|
|
|
|
I am trying to get the serial number from a SATA drive when running Vista Ultimate. I attempt to get a handle to the C: drive via:
HANDLE handle = CreateFile("\\\\.\\C:", GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
But unless I am Admin on Vista cannot get a handle, and promoting all our users to Admin isn't an option. So, basically my question is: has anyone been able to get a SATA serial number under Vista?
D_
|
|
|
|
|
Did you tried that with .Net? I guess that will be a lot easier.
- Is there a way like you can change the user to power user?
- Try to impersonate the program as an administrator and you should get the required privilege.
Saneesh
|
|
|
|
|
Hi Saneesh,
I have Windows XP Pro with VS 2005. When I compiled I get cannot open include file: 'devioctl.h'. I did add DDKInclude to my project path, but it still doesn't work. What am I missing? Thanks.
-hdpc
|
|
|
|
|
Can you try to forcefully include the path? I mean in smartreader.h
replace
#include <devioctl.h>
#include <ntdddisk.h>
with
#include "yourpath\\devioctl.h"
#include "yourpath\\ntdddisk.h"
Saneesh
|
|
|
|
|
Thanks Saneesh, that works. Not sure why the other way didn't work. Oh well as long as it works is good with me. Thanks again!
-hdpc
|
|
|
|
|
strange output and strange ratings
tugak@bigfoot.com
|
|
|
|
|
What happened with output? Ratings..dont know how it happened..
Saneesh
|
|
|
|
|
Temperature looks a bit strange on my HITACHI DK23EB-40.
Value: 58, Worst: 42, RAW: 61 , also "Seek Error Rate"
constantly increasing when system idle. No idea why.
|
|
|
|