Open cbwest3 opened 1 year ago
@krpors: With your PDH experience, do you mind taking a look? tia
@cbwest Wow this has been 10 years ago already :) Anyway, I have no Windows installation anywhere to actually test the PDH stuff. I'm afraid I can't be of much help. Also, seeing my own PDH code still baffles me. I can't even remember how I got all this to work in the first place 😄
Thanks @krpors, I appreciate the timely response. Best of luck in your current endeavors!
Problem
Microsoft specifies the following method for expanding wildcards and using language-neutral counters (from https://learn.microsoft.com/en-us/windows/win32/api/pdh/nf-pdh-pdhaddenglishcounterw#remarks):
Solution
The PdhAddCounter and PdhAddEnglishCounter functions already exist. This PR adds the missing PdhGetCounterInfo and PdhExpandWildCardPath functions needed to localize counter names.
These functions allow me to expand
\physicaldisk(*)\avg. disk bytes/read
to:\\MYMACHINE\PhysicalDisk(0 C: F:)\Avg. Disk Bytes/Read
\\MYMACHINE\PhysicalDisk(1)\Avg. Disk Bytes/Read
\\MYMACHINE\PhysicalDisk(_Total)\Avg. Disk Bytes/Read