SysInfo.dll: Fixed regression from previous commit

This commit is contained in:
Birunthan Mohanathas 2012-03-17 15:42:22 +02:00
parent 9430c634d9
commit f51f2aac24

View File

@ -99,6 +99,8 @@ PLUGIN_EXPORT void Reload(void* data, void* rm, double* maxValue)
{ {
MeasureData* measure = (MeasureData*)data; MeasureData* measure = (MeasureData*)data;
int defaultData = -1;
LPCTSTR type = RmReadString(rm, L"SysInfoType", L""); LPCTSTR type = RmReadString(rm, L"SysInfoType", L"");
if (_wcsicmp(L"COMPUTER_NAME", type) == 0) if (_wcsicmp(L"COMPUTER_NAME", type) == 0)
{ {
@ -130,18 +132,22 @@ PLUGIN_EXPORT void Reload(void* data, void* rm, double* maxValue)
} }
else if (_wcsicmp(L"ADAPTER_DESCRIPTION", type) == 0) else if (_wcsicmp(L"ADAPTER_DESCRIPTION", type) == 0)
{ {
defaultData = 0;
measure->type = MEASURE_ADAPTER_DESCRIPTION; measure->type = MEASURE_ADAPTER_DESCRIPTION;
} }
else if (_wcsicmp(L"NET_MASK", type) == 0) else if (_wcsicmp(L"NET_MASK", type) == 0)
{ {
defaultData = 0;
measure->type = MEASURE_NET_MASK; measure->type = MEASURE_NET_MASK;
} }
else if (_wcsicmp(L"IP_ADDRESS", type) == 0) else if (_wcsicmp(L"IP_ADDRESS", type) == 0)
{ {
defaultData = 0;
measure->type = MEASURE_IP_ADDRESS; measure->type = MEASURE_IP_ADDRESS;
} }
else if (_wcsicmp(L"GATEWAY_ADDRESS", type) == 0) else if (_wcsicmp(L"GATEWAY_ADDRESS", type) == 0)
{ {
defaultData = 0;
measure->type = MEASURE_GATEWAY_ADDRESS; measure->type = MEASURE_GATEWAY_ADDRESS;
} }
else if (_wcsicmp(L"HOST_NAME", type) == 0) else if (_wcsicmp(L"HOST_NAME", type) == 0)
@ -207,7 +213,7 @@ PLUGIN_EXPORT void Reload(void* data, void* rm, double* maxValue)
RmLog(LOG_ERROR, buffer); RmLog(LOG_ERROR, buffer);
} }
measure->data = RmReadInt(rm, L"SysInfoData", -1); measure->data = RmReadInt(rm, L"SysInfoData", defaultData);
} }
PLUGIN_EXPORT LPCWSTR GetString(void* data) PLUGIN_EXPORT LPCWSTR GetString(void* data)