Login | Register

Shared memory API reporting incorrect values?

User feature requests
Planned features for Core Temp
  • Author

Shared memory API reporting incorrect values?

Postby The_Assimilator » Tue Apr 29, 2014 8:46 pm

I've created a .NET application to read Core Temp's shared memory. Because the .NET DLL supplied in the Plug-in SDK is out of date and does not support version 2 fields of the CoreTempSharedDataEx struct, I reimplemented the shared memory reading with an up-to-date version of this struct, which I've declared as so:

Code: Select all
  [StructLayout(LayoutKind.Sequential, Pack = 1)]
  internal struct CoreTempSharedDataEx
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
    public uint[] uiLoad;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
    public uint[] uiTjMax;
    public uint uiCoreCnt;
    public uint uiCPUCnt;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
    public float[] fTemp;
    public float fVID;
    public float fCPUSpeed;
    public float fFSBSpeed;
    public float fMultiplier;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 100)]
    public string sCPUName;
    public byte ucFahrenheit;
    public byte ucDeltaToTjMax;
    // v2 fields
    public byte ucTdpSupported;
    public byte ucPowerSupported;
    public uint uiStructVersion;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
    public uint[] uiTdp;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
    public float[] fPower;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
    public float[] fMultipliers;

The problem is that the version 2 fields in the struct are reporting odd values for my i5 3570K, using Core Temp 1.0 RC6:

Code: Select all
ucTdpSupported = 1
ucPowerSupported = 1
uiStructVersion = 0
uiTdp = (all values in the array are 0)
fPower = (all values in the array are 0.0)
fMultipliers = (all values in the array are 0.0)

I am unsure whether the uiTdp/fPower/fMultiplier arrays should be zero'd, but I am pretty sure that uiStructVersion should not be reporting 0. Please can you advise what the problem may be?

Then a general question - while the shared memory API reports what (I assume) is the number of physical CPUs in the system via the uiCPUCnt field, the CoreTempSharedDataEx struct is defined in such a way that it's not possible to get information for more than 1 physical CPU at a time. Is this intended, or an oversight?
Registered User
Registered User
Posts: 11
Joined: Sat Feb 13, 2010 8:28 am
Location: South Africa

Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest