Core Temp is free, please help support it by donating

Home
Commercial
How does it work?
Add Ons
Support forum
FAQ
Change log
Developers
CPU list
Live chat
Contact us


Stay connected:


Affiliates:
Scythe
CPUID

Awards:
Softpedia editor's review
Core Temp Antivirus Report
Core Temp

Core Temp Plug-in SDK

Introduction:

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!

Download SDK

Implementation:

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_ex
{
	// Original structure (CoreTempSharedData)
	unsigned int	uiLoad[256];
	unsigned int	uiTjMax[128];
	unsigned int	uiCoreCnt;
	unsigned int	uiCPUCnt;
	float		fTemp[256];
	float		fVID;
	float		fCPUSpeed;
	float		fFSBSpeed;
	float		fMultiplier;	
	char		sCPUName[100];
	unsigned char	ucFahrenheit;
	unsigned char	ucDeltaToTjMax;
	// uiStructVersion = 2
	unsigned char	ucTdpSupported;
	unsigned char	ucPowerSupported;
	unsigned int	uiStructVersion;
	unsigned int	uiTdp[128];
	float		fPower[128];
	float		fMultipliers[256];
} CoreTempSharedDataEx, *LPCoreTempSharedDataEx, **PPCoreTempSharedDataEx;

unsigned int is a 32bit unsigned integer.
unsigned char is an 8bit (1 byte) value.
float is a 32bit floating point value.

Structure member alignment should be configured for a '4 Byte' alignment.

uiStructVersion represents the version of the CoreTempSharedDataEx structure incarnation.
Current version is 2. Future versions will only be extensions of this structure to maintain backward compatibility.
Plugins and shared memory clients should support the old interface as well, samples are available within the SDK.

ucFahrenheit, ucDeltaToTjMax, ucTdpSupported and ucPowerSupported 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.
If ucTdpSupported is true, processor TDP information in the uiTdp array is valud.
If ucPowerSupported is true, processor power consumption information in the fPower array is valid.

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.

  1. Start is invoked. This is where a plug-in should initialize itself and if it has a user interface, be displayed on screen.

  2. UpdateEx is invoked following the Start function invocation, UpdateEx receives initial data from Core Temp.

  3. UpdateEx is then invoked with every refresh Core Temp makes.

  4. Configure can only be called once Start has been called.

  5. Stop is invoked when the plug-in is stopped from the plug-in manager or Core Temp is shutting down.

  6. 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.

Download SDK

Shared memory interface:

Core Temp's shared area is named: "CoreTempMappingObjectEx".
Older versions of Core Temp created a shared area named "CoreTempMappingObject", the original structure layout can be seen at the top of the page.

C++ Dynamic Link Library for the shared memory interface:

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(CoreTempSharedDataEx *&pData);

You can declare it in your program in the following manner:

typedef bool (*fnGetCoreTempInfo)(CoreTempSharedDataEx *&pData);
fnGetCoreTempInfo GetCoreTempInfo;

For compatibility with some programming languages a function was added.
It uses Win32 API calling convention and is declared as follows:

bool WINAPI fnGetCoreTempInfoAlt(CoreTempSharedDataEx *pData);

typedef bool (*fnGetCoreTempInfoAlt)(CoreTempSharedDataEx *pData);
fnGetCoreTempInfoAlt GetCoreTempInfo;

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();

Usage:

  • Declare a pointer to CoreTempSharedDataEx 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 CoreTempSharedDataEx 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)
  • Check uiStructVersion to make sure what information is valid, if uiStructVersion < 2 then TDP, power and per-core multiplier information will not be valid.

Download SDK

.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".

Usage:

  • 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.
  • Check uiStructVersion to make sure what information is valid, if uiStructVersion < 2 then TDP, power and per-core multiplier information will not be valid.

Download SDK

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.