Add(MainForm,2953706,21,105)
{
Position=1
}
Add(Button,10504036,217,203)
{
Left=135
Top=5
Caption="Get temp"
link(onClick,11970995:doGetTemp,[])
}
Add(InlineCode,11970995,287,203)
{
WorkPoints=#9:doGetTemp|
EventPoints=#8:onResult|
DataPoints=#8:HDDIndex|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|4:uses|28: Windows, KOL, Share, Debug;|0:|4:type|29: THiAsmClass = class(TDebug)|11: private|0:|10: public|26: HDDIndex: THI_Event;|29: onResult: THI_Event; |57: procedure doGetTemp(var _Data: TData; Index: Word);|6: end;|0:|14:implementation|0:|3:var|30: Ip: array [0..$1F] of Byte =|55: ($00,$02,$00,$00,$D0,$01,$01,$4F,$C2,$A0,$B0,$00,$00,|55: $00,$00,$00,$8C,$FD,$14,$00,$00,$02,$00,$00,$03,$00,|28: $00,$00,$03,$00,$00,$00);|1: |48:function GetHDDTemperarure(Nhdd: Byte): Integer;|4:type|39: TSmartData = array [0..$20F] of Byte;|3:var|16: Op: TSmartData;|12: H: THandle;|11: br: DWORD;|5:begin|89: H := CreateFile(PChar('\\.\PhysicalDrive' + Int2Str(Nhdd)), $C0000000, 3, nil, 3, 0, 0);|15: if H <> 0 then|6: begin|63: DeviceIoControl(H, $0007C088, @Ip, $20, @Op, $210, br, nil);|18: CloseHandle(H);|37: Result := Op[$A8] * $FF + Op[$A7];|4: end|5: else|15: Result := 0;|4:end;|0:|0:|63:procedure THiAsmClass.doGetTemp(var _Data: TData; Index: Word);|3:var|13: I: Integer;|5:begin|39: I := ReadInteger(_Data, HDDIndex, 0);|58: _hi_CreateEvent(_Data, @onResult, GetHDDTemperarure(I));|4:end;|0:|0:|4:end.|
link(onResult,10659795:doText,[])
link(HDDIndex,15129361:Text,[])
}
Add(Edit,15129361,287,154)
{
Left=75
Top=5
Text="0"
}
Add(Label,10659795,357,203)
{
Left=200
Top=10
Width=11
Height=17
Caption="T"
}
Add(Label,11901701,21,154)
{
Left=20
Top=10
Width=54
Height=17
Caption="HDD num:"
}
Ответов: 4628
Рейтинг: 749
|
|||
Выдаёт что-то непонятное:
|
|||
карма: 26 |
|