Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Non English windows will report error in this function but the performance counter work will #94

Open
wawa0210 opened this issue Oct 14, 2019 · 1 comment

Comments

@wawa0210
Copy link

wawa0210 commented Oct 14, 2019

win/pdh.go

Line 432 in 24c5960

func PdhValidatePath(path string) uint32 {

I have encountered a very strange problem with the performance counter in the French operating system. When I use the PdhValidatePath method to check if the key is reasonable, the system reports an error, but the performance data returns normally.

I note the same key on English is
\Network Adapter(*)\Packets Sent/sec
and the same key on French windows is
\Interface réseau(*)\Paquets/s

Performance monitoring data can be obtained using both keys, but PdhValidatePath reports an error.
Errcode is that

0xC0000BC0 (PDH_CSTATUS_BAD_COUNTERNAME) | Unable to parse the counter path. Check the format and syntax of the specified path.

I checked the msdn documentation and found that they did not use PdhValidatePath in their official sample.

https://docs.microsoft.com/en-us/windows/win32/perfctrs/browsing-performance-counters

I hope that you can help me to give pointers on the best practices of pdh in non-English environments.

image

@cbwest3
Copy link

cbwest3 commented Feb 1, 2023

@wawa0210, will #126 help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants