 |
|
 |
I cannot seem to build this in VS 2010, I left all the settings intact. Is there some project configuration that must be done to silence the intelli-sense errors?
|
|
|
|
 |
|
 |
Hi, I succeed to run the SMART.exe, but when I try rebuild SMART.dsw in VC6.0, I get some Compile error message(DDKInclude path already setting), Any idea how can i solve it? thank!
e:\smart\ddkinclude\winreg.h(107) : error C2146: syntax error : missing ';' before identifier 've_valueptr'
e:\smart\ddkinclude\winreg.h(107) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
e:\smart\ddkinclude\winreg.h(107) : error C2501: 've_valueptr' : missing storage-class or type specifiers
e:\smart\ddkinclude\winreg.h(113) : error C2146: syntax error : missing ';' before identifier 've_valueptr'
e:\smart\ddkinclude\winreg.h(113) : error C2501: 'DWORD_PTR' : missing storage-class or type specifiers
e:\smart\ddkinclude\winreg.h(113) : error C2501: 've_valueptr' : missing storage-class or type specifiers
e:\smart\ddkinclude\winreg.h(145) : error C2065: 'HKEY' : undeclared identifier
e:\smart\ddkinclude\winreg.h(146) : error C2146: syntax error : missing ')' before identifier 'hKey'
e:\smart\ddkinclude\winreg.h(146) : warning C4229: anachronism used : modifiers on data are ignored
e:\smart\ddkinclude\winreg.h(146) : error C2491: 'RegCloseKey' : definition of dllimport data not allowed
e:\smart\ddkinclude\winreg.h(146) : error C2059: syntax error : ')'
e:\smart\ddkinclude\winreg.h(152) : error C2146: syntax error : missing ')' before identifier 'hKey'
e:\smart\ddkinclude\winreg.h(152) : warning C4229: anachronism used : modifiers on data are ignored
e:\smart\ddkinclude\winreg.h(152) : error C2491: 'RegOverridePredefKey' : definition of dllimport data not allowed
e:\smart\ddkinclude\winreg.h(154) : error C2059: syntax error : ')'
e:\smart\ddkinclude\winreg.h(163) : error C2061: syntax error : identifier 'PHKEY'
e:\smart\ddkinclude\winreg.h(171) : error C2061: syntax error : identifier 'PHKEY'
...
modified on Tuesday, August 24, 2010 11:12 PM
|
|
|
|
 |
|
 |
Looks like you are missing some basic header files. I made this in VS 2003.
Can you try to add the necessary header files and see how it is going?
Saneesh
|
|
|
|
 |
|
 |
Hi, I can't get anything when i run the program, no error at all, just blank. I try to 2 computers, one on xp and another on window 7. Any idea how can i solve it. Hope to hear from you soon
|
|
|
|
 |
|
 |
Windows 7, i dont know. I never tried. I send you a different email early with more details.
Saneesh
|
|
|
|
 |
|
 |
Run the program as administrator in windows 7 it will solve the issue
|
|
|
|
 |
|
 |
Hi, can you help me pls, how can i use this code in a win32 console aplication, what to include in the *.cpp file where my main() is, and how do you include DDKInclude in the workspace?
|
|
|
|
 |
|
 |
Just set the path properly in your console application and that should take care of the path problem. Keeping the .cpp is better because it is easy to manage.
Saneesh
|
|
|
|
 |
|
 |
And which DLL I have to take? Can you post a smart sample code for me?
|
|
|
|
 |
|
 |
You can do it. Try. Just export those fns like DeviceIOControl and try..
Saneesh
|
|
|
|
 |
|
 |
I would like to try. But how can I export the functions? I'm sorry, but i've never done that.
|
|
|
|
 |
|
 |
How can read the S.R.A.R.T information with C# language?
Anybody can provide some methods for me.thanks!
|
|
|
|
 |
|
 |
You can export the deviceiocontrol and other relevant functions as below.
[DllImport("xxxx.dll")]
public static extern fnType fnName ( Params );
With this, you can call and execute the code from C#
Saneesh
|
|
|
|
 |
|
 |
Thanks Saneesh!
You mean i can use the dll that was build by C++, is that right?
But i just want to known how can i only use the C# language to build a dll and use it.
Can you give me some advice about this?
|
|
|
|
 |
|
 |
Did anyone had any luck with using this program to monitor SMART params for HDDs that are connected through SCSI? It is giving device I/O errors. Any help is appreciated.
|
|
|
|
 |
|
 |
I never tried on a SCSI hard drive. What error code is it getting for DeviceIoControl?
Saneesh
|
|
|
|
 |
|
 |
Hi Saneesh,
DeviceIoControl control returns the error code 1117 which is error code for I/O device error.
Regards,
Sukhas
|
|
|
|
 |
|
 |
Hi Saneesh, Could you please throw some light on the error code for the SCSI hard disks?
sukhas
|
|
|
|
 |
|
 |
I never tried on the SCSI. Did you tried any other deviceiocontrol codes with scsi?
Saneesh
|
|
|
|
 |
|
 |
May be the driver does not like it. Can you check with a sample scsi disk driver code?
Saneesh
|
|
|
|
 |
|
 |
Hello,
i have some probs on my laptop and desktop pc...both xp machines..
all the threshhold values are 0....smartmontools and hddlife is getting other and i think correct threshold values ?
any idea how to get the right ones
|
|
|
|
 |
|
 |
Did you tried to debug and see if the buffer is getting values properly? Also the .ini file, is that in the executable / debug path? Without that the code wont work.
Saneesh
|
|
|
|
 |
|
 |
Thx 4 this fine code!
but, a small bug is fixed.
first:
My threshold is always 0, but HD-Tune has some values!
I fix this:
stCIP.irDriveRegs.bFeaturesReg=READ_THRESHOLDS;
stCIP.cBufferSize=READ_THRESHOLD_BUFFER_SIZE; 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+<big>5</big>];
to
stCIP.irDriveRegs.bFeaturesReg=READ_THRESHOLDS;
stCIP.cBufferSize=READ_THRESHOLD_BUFFER_SIZE; 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+<big>1</big>];
+5 is 4 bytes after usable threshold data.
second:
Some RAW data is truncated, see HD-Tune or smartmontools at many hd drives.
i fix all of this (at 2 positions):
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;
to
pT3[INDEX_ATTRIB_RAW+4]=pT3[INDEX_ATTRIB_RAW+5]=pT3[INDEX_ATTRIB_RAW+6]=0;
pT3[INDEX_ATTRIB_RAW+2]=pT3[INDEX_ATTRIB_RAW+3]=0 kills high word from data.
Now works fine for me, all data like hd-tune and smartmontools!
|
|
|
|
 |
|
 |
Thanks for pointing it out.
Saneesh
Saneesh
|
|
|
|
 |
|
 |
I searched a long time for that.. especially to read the temperature of the hdd !
thank you
|
|
|
|
 |