Platform SDK: Performance Monitoring |
The CounterPathCallback function is an application-defined callback function that processes the counter path strings read from the szReturnPathBuffer member of the PDH_BROWSE_DLG_CONFIG structure.
PDH_STATUS __stdcall CounterPathCallBack( DWORD_PTR dwArg );
The following members of the PDH_BROWSE_DLG_CONFIG structure are used to communicate with the callback function:
If the buffer is too small to load the current selection, the browser will set this value to PDH_MORE_DATA. If the browser sets this member to ERROR_SUCCESS, then the szReturnPathBuffer member contains a valid counter path or counter path list.
If the callback function reallocates a new buffer, it should set this member to PDH_RETRY so that the browser will try to load the buffer with the selected paths and call the callback function again.
If some other error occurred, then the callback function should return the appropriate PDH error status value.
If the function succeeds (processes the buffer and does not need to be called again), it returns ERROR_SUCCESS.
If the function fails (an error occurs and the function needs to be called again to retry the processing), it returns PDH_RETRY. This is usually the result of insufficient memory.
Windows NT/2000: Requires Windows NT 4.0 or later.
Header: Declared in Pdh.h.