Obtaining Counter Path Elements from a Counter Path

To retrieve the elements of a path, call the PdhParseCounterPath function. The function parses the elements of a counter path and returns them in a PDH_COUNTER_PATH_ELEMENTS structure.

If you have a complex instance name (one that contains a parent instance and instance index), you can call the PdhParseInstanceName function to extract the instance name, instance index, and parent name.