Fix check_perfmon to support non-localized names

This fixes check_perfmon to support non-localized names on localized
Windows machines. The fix handles the given performance counter by
default as non-localized name, if none is found it falls back to the
localized name.

refs #5546
This commit is contained in:
Michael Insel 2018-11-26 17:13:58 +01:00
parent d17b403583
commit 5da4fbde3b
1 changed files with 5 additions and 1 deletions

View File

@ -297,7 +297,11 @@ bool QueryPerfData(printInfoStruct& pI)
if (FAILED(status))
goto die;
status = PdhAddCounter(hQuery, pI.wsFullPath.c_str(), NULL, &hCounter);
status = PdhAddEnglishCounter(hQuery, pI.wsFullPath.c_str(), NULL, &hCounter);
if (FAILED(status))
status = PdhAddCounter(hQuery, pI.wsFullPath.c_str(), NULL, &hCounter);
if (FAILED(status))
goto die;