Skip to content

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

Description

@wawa0210

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions