The PdhConnectMachine function connects to the specified machine, and creates and initializes a machine entry in the PDH DLL.
PDH_STATUS PdhConnectMachine(
IN LPCTSTR szMachineName // machine to browse
);
If the function succeeds, it returns ERROR_SUCCESS.
If the function fails, the return value is a PDH error status defined in pdhmsg.h. The following are possible error values:
An application can call PdhConnectMachine to establish a connection to a remote machine at a more convenient time than when the application opens a query and adds counters.
Performance Data Helper Overview, Performance Data Functions, , PdhEnumMachines