diff --git a/Plugins/PluginPerfMon/PerfData.cpp b/Plugins/PluginPerfMon/PerfData.cpp
index 339d2f2f..5204def8 100644
--- a/Plugins/PluginPerfMon/PerfData.cpp
+++ b/Plugins/PluginPerfMon/PerfData.cpp
@@ -40,7 +40,7 @@ struct MeasureData
MeasureData() :
oldValue(),
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)
{
MeasureData* measure = (MeasureData*)data;
+ bool changed = false;
LPCWSTR value = RmReadString(rm, L"PerfMonObject", L"");
if (_wcsicmp(value, measure->objectName.c_str()) != 0)
{
measure->objectName = value;
- measure->oldValue = 0;
+ changed = true;
}
value = RmReadString(rm, L"PerfMonCounter", L"");
if (_wcsicmp(value, measure->counterName.c_str()) != 0)
{
- measure->objectName = value;
- measure->oldValue = 0;
+ measure->counterName = value;
+ changed = true;
}
value = RmReadString(rm, L"PerfMonInstance", L"");
if (_wcsicmp(value, measure->instanceName.c_str()) != 0)
{
- measure->objectName = value;
- measure->oldValue = 0;
+ measure->instanceName = value;
+ 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;
}
diff --git a/Plugins/PluginPerfMon/PerfData.h b/Plugins/PluginPerfMon/PerfData.h
deleted file mode 100644
index 03c2f57c..00000000
--- a/Plugins/PluginPerfMon/PerfData.h
+++ /dev/null
@@ -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
\ No newline at end of file
diff --git a/Plugins/PluginPerfMon/PluginPerfMon.vcxproj b/Plugins/PluginPerfMon/PluginPerfMon.vcxproj
index 4068bc6a..febf1677 100644
--- a/Plugins/PluginPerfMon/PluginPerfMon.vcxproj
+++ b/Plugins/PluginPerfMon/PluginPerfMon.vcxproj
@@ -257,7 +257,6 @@
-