Thema: Delphi S.M.A.R.T. figured out

Einzelnen Beitrag anzeigen

Razor
(Gast)

n/a Beiträge
 
#6

Re: S.M.A.R.T. figured out

  Alt 24. Aug 2007, 01:01
I am really sorry for little push i really am but >>>>


This program that ive made show on my brothers computer wich has 3 disks (samsung,baracuda,western digital)
Shows all temperatures the same.
http://img210.imageshack.us/img210/1...4001414ni6.jpg


Another dude i asked him,shows nothing at all.
Then i asked one last guy and it showed this under vista + he has 1 drive.So what you see is wrong.
http://img440.imageshack.us/img440/9969/hdtempsn3.png



And the funny thing is i get correct temperature for scsi drive wich is same as speedfan's but its bad becouse its not working for others,Can you test and post,so i can indetify the bug/problem....

Delphi-Quellcode:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls,smart_drv;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Timer1: TTimer;
    procedure Timer1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    function GetDriveTemp(drive:longint):byte;
      procedure disktemp;
       function GetHDDCount: integer;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}


 procedure tform1.disktemp;
 var
 i:integer;
 b:longint;
begin
 ReadSMART;
for i:=0 to 3 do
begin
if hSMARTIOCTL[i] = INVALID_HANDLE_VALUE then continue;
b:=GetDriveTemp(i);
end;
end;
 function tform1.GetHDDCount: integer;
var f, i: integer;
begin
  i := 0;
  repeat
    f := FileOpen('\\.\PHYSICALDRIVE' + IntToStr(i), fmOpenRead or fmShareDenyNone);
    if f = -1 then break;
    inc (i);
  until false;
  result := i;
end;
function tform1.GetDriveTemp(drive:longint):byte;
var i:longint;
begin
result:=0;
for i:=0 to 255 do
begin
if SCOP[ 0 ].attr[ i ].bAttrID=194 then
begin
result:=SCOP[ 0].attr[ i ].Raw[0];
break;
end;
end;
 end;







procedure TForm1.Timer1Timer(Sender: TObject);
var
SmartResult: TSmartResult ;
begin
if GetHDDCount=1 then begin
Label1.caption:='Disk 1 '+inttostr(GetDriveTemp(0))+' °C';
  end;
if GetHDDCount=3 then begin
Label1.caption:='Disk 1 '+inttostr(GetDriveTemp(0))+' °C';


Label2.caption:='Disk 2 '+inttostr(GetDriveTemp(1))+' °C';


Label3.caption:='Disk 3 '+inttostr(GetDriveTemp(2))+' °C';
             form1.caption:=inttostr(SmartResult.Temperature);
 end;

end;

procedure TForm1.FormCreate(Sender: TObject);
begin
disktemp;
end;

end.
Angehängte Dateien
Dateityp: rar temperature_hdd_325.rar (8,8 KB, 89x aufgerufen)
  Mit Zitat antworten Zitat