Skip to content

Commit dcad93d

Browse files
authored
init
1 parent 9c3389a commit dcad93d

9 files changed

+1506
-0
lines changed

GetCoreTempInfoDelphi.pas

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// Core Temp shared memory reader for Delphi
2+
// Author: Michal Kokorceny
3+
// Web: http://74.cz
4+
// E-mail: michal@74.cz
5+
//
6+
// Core Temp project home page:
7+
// http://www.alcpu.com/CoreTemp
8+
9+
unit GetCoreTempInfoDelphi;
10+
11+
interface
12+
13+
{$IFDEF MSWINDOWS}
14+
15+
type
16+
CORE_TEMP_SHARED_DATA = packed record
17+
uiLoad: packed array [0 .. 255] of Cardinal;
18+
uiTjMax: packed array [0 .. 127] of Cardinal;
19+
uiCoreCnt: Cardinal;
20+
uiCPUCnt: Cardinal;
21+
fTemp: packed array [0 .. 255] of Single;
22+
fVID: Single;
23+
fCPUSpeed: Single;
24+
fFSBSpeed: Single;
25+
fMultipier: Single;
26+
sCPUName: packed array [0 .. 99] of AnsiChar;
27+
ucFahrenheit: ByteBool;
28+
ucDeltaToTjMax: ByteBool;
29+
end;
30+
31+
function fnGetCoreTempInfo(out Data: CORE_TEMP_SHARED_DATA): Boolean;
32+
33+
{$ENDIF}
34+
35+
implementation
36+
37+
{$IFDEF MSWINDOWS}
38+
39+
uses
40+
Windows;
41+
42+
const
43+
CoreTempSharedArea = 'CoreTempMappingObject';
44+
45+
function fnGetCoreTempInfo(out Data: CORE_TEMP_SHARED_DATA): Boolean;
46+
var
47+
HCoreTempSharedArea: Cardinal;
48+
PCoreTempSharedArea: Pointer;
49+
begin
50+
Result := False;
51+
HCoreTempSharedArea := OpenFileMapping(FILE_MAP_READ, True,
52+
CoreTempSharedArea);
53+
if HCoreTempSharedArea <> 0 then
54+
try
55+
PCoreTempSharedArea := MapViewOfFile(HCoreTempSharedArea, FILE_MAP_READ,
56+
0, 0, SizeOf(Data));
57+
if Assigned(PCoreTempSharedArea) then
58+
try
59+
FillChar(Data, SizeOf(Data), 0);
60+
Move(PCoreTempSharedArea^, Data, SizeOf(Data));
61+
Result := True;
62+
finally
63+
UnmapViewOfFile(PCoreTempSharedArea);
64+
end;
65+
finally
66+
CloseHandle(HCoreTempSharedArea);
67+
end;
68+
end;
69+
70+
{$ENDIF}
71+
72+
end.

Y530FunControlService.dpr

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
program Y530FunControlService;
2+
3+
uses
4+
Vcl.SvcMgr,
5+
main in 'main.pas' {FanControlService: TService};
6+
7+
{$R *.RES}
8+
9+
begin
10+
// Windows 2003 Server requires StartServiceCtrlDispatcher to be
11+
// called before CoRegisterClassObject, which can be called indirectly
12+
// by Application.Initialize. TServiceApplication.DelayInitialize allows
13+
// Application.Initialize to be called from TService.Main (after
14+
// StartServiceCtrlDispatcher has been called).
15+
//
16+
// Delayed initialization of the Application object may affect
17+
// events which then occur prior to initialization, such as
18+
// TService.OnCreate. It is only recommended if the ServiceApplication
19+
// registers a class object with OLE and is intended for use with
20+
// Windows 2003 Server.
21+
//
22+
// Application.DelayInitialize := True;
23+
//
24+
if not Application.DelayInitialize or Application.Installing then
25+
Application.Initialize;
26+
Application.CreateForm(TFanControlService, FanControlService);
27+
Application.Run;
28+
29+
end.

Y530FunControlService.dproj

Lines changed: 1042 additions & 0 deletions
Large diffs are not rendered by default.

Y530FunControlService.dproj.local

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<BorlandProject>
3+
<Transactions>
4+
<Transaction>1899.12.30 00:00:00.000.906,D:\Crossgroup\CrossStart\FastMM\FastMM4.pas=</Transaction>
5+
<Transaction>1899.12.30 00:00:00.000.877,D:\Crossgroup\CrossStart\CrossStartService\CrossStartService.dproj=D:\Crossgroup\Новая папка\Y530FunControlService.dproj</Transaction>
6+
<Transaction>1899.12.30 00:00:00.000.760,D:\Crossgroup\CrossStart\CrossStartService\main.pas=D:\Crossgroup\Новая папка\main.pas</Transaction>
7+
<Transaction>1899.12.30 00:00:00.000.760,D:\Crossgroup\CrossStart\CrossStartService\main.dfm=D:\Crossgroup\Новая папка\main.dfm</Transaction>
8+
</Transactions>
9+
</BorlandProject>

Y530FunControlService.identcache

678 Bytes
Binary file not shown.

Y530FunControlService.res

58.2 KB
Binary file not shown.

Y530FunControlService.stat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Stats]
2+
EditorSecs=6246
3+
DesignerSecs=14
4+
InspectorSecs=46
5+
CompileSecs=60035
6+
OtherSecs=15
7+
StartTime=19.12.2019 23:48:58
8+
RealKeys=0
9+
EffectiveKeys=0
10+
DebugSecs=106

main.dfm

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
object FanControlService: TFanControlService
2+
OldCreateOrder = False
3+
DisplayName = 'Fan fix control Lenovo Y530'
4+
OnContinue = ServiceContinue
5+
OnPause = ServicePause
6+
OnShutdown = ServiceShutdown
7+
OnStart = ServiceStart
8+
OnStop = ServiceStop
9+
Height = 112
10+
Width = 235
11+
object Timer1: TTimer
12+
Enabled = False
13+
Interval = 700
14+
OnTimer = Timer1Timer
15+
Left = 120
16+
Top = 24
17+
end
18+
end

0 commit comments

Comments
 (0)