Core Temp Plug-in SDK
In version 0.99 Core Temp
introduced the Shared memory interface, allowing 3rd party applications access
to a shared memory block, which is created by Core Temp, and this way tap into
the information Core Temp provided.
Version 1.0 goes one step
further and provides a complete plug-in platform. Core Temp is capable of
supporting plug-ins written in just about any programming language. It even
supports .Net Framework based plug-ins with a very simple and efficient
implementation. You can create a functioning plug-in literally in seconds!
Currently the data structure
used by both the shared memory interface and the plug-in platform is the same.
It is implemented as follows (C/C++):
typedef struct core_temp_shared_data
unsigned int uiLoad;
unsigned int uiTjMax;
unsigned int uiCoreCnt;
unsigned int uiCPUCnt;
unsigned char ucFahrenheit;
unsigned char ucDeltaToTjMax;
unsigned int is a 32bit unsigned integer.
unsigned char is an 8bit (1 byte) value.
float is a 32bit floating point value.
ucFahrenheit and ucDeltaToTjMax represent boolean values. 0 = false, 1 = true.
If ucFahrenheit is true, the temperature is reported in Fahrenheit.
If ucDeltaToTjMax is true, the temperature reported represents the distance from TjMax.
The life-cycle of a plugin:
The plugin has a coherent and logical life-cycle.
Functions are called in a specific order which allows the plug-in to start,
stop, receive updates, etc. For details on how to develop and implement a
plug-in, please see the documentation in the SDK.
Start is invoked. This is where a plug-in should initialize itself and if it has
a user interface, be displayed on screen.
Update is invoked following the Start function invocation, Update receives
initial data from Core Temp.
Update is then invoked with every refresh Core Temp makes.
Configure can only be called once Start has been called.
Stop is invoked when the plug-in is stopped from the plug-in manager or Core
Temp is shutting down.
Remove will be invoked if the user chooses to remove the plug-in, and only
following a Stop invocation to allow the plug-in to release resources. This
function should handle cleanup before the plugin is removed.
Shared memory interface:
Core Temp's shared area is named: "CoreTempMappingObject".
C++ Dynamic Link Library for the shared memory
This DLL was written in C++, and it can be easily used with most programming languages.
Version 1.2 adds support for static linking of the DLL in Borland environments (32 bit only).
There is only a single function, here is the internal function declaration:
bool __declspec(dllimport) fnGetCoreTempInfo(CORE_TEMP_SHARED_DATA *&pData);
You can declare it in your program in the following manner:
typedef bool (*fnGetCoreTempInfo)(CORE_TEMP_SHARED_DATA *&pData);
For compatibility with some programming languages a function was added.
It uses Win32 API calling convention and is declared as follows:
bool WINAPI fnGetCoreTempInfoAlt(CORE_TEMP_SHARED_DATA *pData);
typedef bool (*fnGetCoreTempInfoAlt)(CORE_TEMP_SHARED_DATA *pData);
Version 1.2 of the DLL adds the option for better object oriented approach,
although you can take advantage of it only in case you statically link the DLL
to your project and include the header file provided in the archive.
CoreTempProxy *proxy = new CoreTempProxy();
Declare a pointer to CORE_TEMP_SHARED_DATA structure and allocate it.
It is also recommended
to fill the allocated memory with NULL to avoid possible problems.
Call the function using the pointer to CORE_TEMP_SHARED_DATA structure as an argument.
The function will fill the structure if the shared memory was successfully read.
The function returns 'true' if succeeded and 'false' if it failed. You can use GetLastError() in case
the function fails.
In case the function fails due to an exception GetLastError() returns UNKNOWN_EXCEPTION (0x20000000)
.NET Framework 2.0 Dynamic Link Library for the
shared memory interface:
This DLL was written in C# with the project set to .NET Framework 2.0.
The namespace is "GetCoreTempInfoNET".
Class name is "CoreTempInfo".
Create an instance of "CoreTempInfo" class.
It is a good idea to sign up for the ReportError event, fired whenever an error occurs, containing an error code and
the error message.
The function returns 'true' if succeeded and 'false' if it failed. You can use GetLastError property in case
the function fails. The return value is of enum type "ErrorCodes".
In case the function fails due to an exception GetLastError returns Data_Retrieve_Failed (0x0).
You can use the GetErrorMessage() function to retrieve a string containing a textual error message.
Delphi shared memory interface library:
Developed and contributed by Michal Kokorceny from http://74.cz/.
Use this library to gain access to Core Temp's shared memory easily.
Download Delphi PAS file only
Download Delphi demo project
An application with a Shared Memory block allows all running processes on the system to have access to a part of it's memory.
It is often used to enable third party software to use information that is not easily obtained via code.
There is usually no dependency between the two processes and each one is completely independent.
One process simply
harnesses the shared information of the other for its own uses, like visual display, monitoring and logging.