mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
PerfMon.dll: Additional change for r1267 (5f05e79b6a
).
This commit is contained in:
parent
6d79b7efa4
commit
4b227b413c
@ -40,7 +40,7 @@ struct MeasureData
|
|||||||
MeasureData() :
|
MeasureData() :
|
||||||
oldValue(),
|
oldValue(),
|
||||||
difference(false),
|
difference(false),
|
||||||
firstTime(false)
|
firstTime(true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -56,29 +56,41 @@ PLUGIN_EXPORT void Initialize(void** data, void* rm)
|
|||||||
PLUGIN_EXPORT void Reload(void* data, void* rm, double* maxValue)
|
PLUGIN_EXPORT void Reload(void* data, void* rm, double* maxValue)
|
||||||
{
|
{
|
||||||
MeasureData* measure = (MeasureData*)data;
|
MeasureData* measure = (MeasureData*)data;
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
LPCWSTR value = RmReadString(rm, L"PerfMonObject", L"");
|
LPCWSTR value = RmReadString(rm, L"PerfMonObject", L"");
|
||||||
if (_wcsicmp(value, measure->objectName.c_str()) != 0)
|
if (_wcsicmp(value, measure->objectName.c_str()) != 0)
|
||||||
{
|
{
|
||||||
measure->objectName = value;
|
measure->objectName = value;
|
||||||
measure->oldValue = 0;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
value = RmReadString(rm, L"PerfMonCounter", L"");
|
value = RmReadString(rm, L"PerfMonCounter", L"");
|
||||||
if (_wcsicmp(value, measure->counterName.c_str()) != 0)
|
if (_wcsicmp(value, measure->counterName.c_str()) != 0)
|
||||||
{
|
{
|
||||||
measure->objectName = value;
|
measure->counterName = value;
|
||||||
measure->oldValue = 0;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
value = RmReadString(rm, L"PerfMonInstance", L"");
|
value = RmReadString(rm, L"PerfMonInstance", L"");
|
||||||
if (_wcsicmp(value, measure->instanceName.c_str()) != 0)
|
if (_wcsicmp(value, measure->instanceName.c_str()) != 0)
|
||||||
{
|
{
|
||||||
measure->objectName = value;
|
measure->instanceName = value;
|
||||||
measure->oldValue = 0;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
measure->difference = RmReadInt(rm, L"PerfMonDifference", 1) == 1;
|
bool diff = RmReadInt(rm, L"PerfMonDifference", 1) == 1;
|
||||||
|
if (diff != measure->difference)
|
||||||
|
{
|
||||||
|
measure->difference = diff;
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed)
|
||||||
|
{
|
||||||
|
measure->oldValue = 0;
|
||||||
|
measure->firstTime = true;
|
||||||
|
}
|
||||||
|
|
||||||
*maxValue = 0.0;
|
*maxValue = 0.0;
|
||||||
}
|
}
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
#ifndef __Perfdata_h__
|
|
||||||
#define __Perfdata_h__
|
|
||||||
|
|
||||||
#include "titledb.h"
|
|
||||||
#include "perfsnap.h"
|
|
||||||
#include "objlist.h"
|
|
||||||
#include "perfobj.h"
|
|
||||||
#include "objinst.h"
|
|
||||||
#include "perfcntr.h"
|
|
||||||
|
|
||||||
/* The exported functions */
|
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
__declspec( dllexport ) UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id);
|
|
||||||
__declspec( dllexport ) void Finalize(HMODULE instance, UINT id);
|
|
||||||
__declspec( dllexport ) double Update2(UINT id);
|
|
||||||
__declspec( dllexport ) UINT GetPluginVersion();
|
|
||||||
__declspec( dllexport ) LPCTSTR GetPluginAuthor();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
@ -257,7 +257,6 @@
|
|||||||
<ClInclude Include="ObjInst.h" />
|
<ClInclude Include="ObjInst.h" />
|
||||||
<ClInclude Include="ObjList.h" />
|
<ClInclude Include="ObjList.h" />
|
||||||
<ClInclude Include="PerfCntr.h" />
|
<ClInclude Include="PerfCntr.h" />
|
||||||
<ClInclude Include="PerfData.h" />
|
|
||||||
<ClInclude Include="PerfObj.h" />
|
<ClInclude Include="PerfObj.h" />
|
||||||
<ClInclude Include="PerfSnap.h" />
|
<ClInclude Include="PerfSnap.h" />
|
||||||
<ClInclude Include="Titledb.h" />
|
<ClInclude Include="Titledb.h" />
|
||||||
|
Loading…
Reference in New Issue
Block a user