Regarding the last user's comments - you don't need elevation, you need to set this flag to false and it should return selections:
bSingleCounterPerAdd = FALSE
The bug makes it so a programmer can't force it to only allow one selection. It may work elevated, but that makes no sense.
Also, the flag 'bWildCardInstances' must ALWAYS be set to TRUE,
otherwise it causes crashes in many cases, at least on Windows 7.
Other bugs on Vista+:
- You need to manually set the title, it no longer offers a default (NULL pointer).
- You can't set an initial performance counter to be highlighted. It is ignored.
- Sometimes the Instances won't show up on the bottom, depending on
where you click on the top portion of the dialog box. This causes an
invalid Counter path to be returned.
- Windows 7: PDH.DLL and 40 other DLL's are loaded, and STAY loaded once
PdhBrowseCounters returns. Manually unloading the DLL's often causes
crashes. This may or may not have something to do with .NET 4.0 being
present.