Skip to content

Commit

Permalink
Fix check_perfmon to support non-localized names
Browse files Browse the repository at this point in the history
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

(cherry picked from commit 5da4fbd)
  • Loading branch information
mcktr authored and Michael Friedrich committed Mar 19, 2019
1 parent 2fdc1cc commit 60bc79f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/check_perfmon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 60bc79f

Please sign in to comment.