Performance counter names in Windows are localized, so for instance the counter \Processor(_Total)\% Processor Time
is called something else in other language versions of Windows. This means that in order to find the correct name one must first find the index of the counter and then use the PdhLookupPerfNameByIndex function to get the localized name (using PdhAddEnglishCounter is out if Windows XP should be supported).
This is all good for the performance object (Processor
) and counter (% Processor Time
) parts of the counter path above, but what about the instance name (_Total
)? I cannot find this string in the registry, so I suppose that it is provided by whatever system component that provides the information.
Is the instance name for system provided performance counters guaranteed to be the same across different language versions of Windows?
If not, how can I determine which instance corresponds to the _Total
instance?