PerfMon.dll: Additional change for r1267 (5f05e79b6a).

This commit is contained in:
spx 2012-03-26 14:10:34 -07:00
parent 6d79b7efa4
commit 4b227b413c
3 changed files with 19 additions and 29 deletions

View File

@ -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;
} }

View File

@ -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

View File

@ -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" />