From 4b227b413cc5acc3ba7c0fe8f5d6c82d13794244 Mon Sep 17 00:00:00 2001 From: spx Date: Mon, 26 Mar 2012 14:10:34 -0700 Subject: [PATCH] PerfMon.dll: Additional change for r1267 (5f05e79b6a). --- Plugins/PluginPerfMon/PerfData.cpp | 26 +++++++++++++++------ Plugins/PluginPerfMon/PerfData.h | 21 ----------------- Plugins/PluginPerfMon/PluginPerfMon.vcxproj | 1 - 3 files changed, 19 insertions(+), 29 deletions(-) delete mode 100644 Plugins/PluginPerfMon/PerfData.h 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 @@ -