Export (0) Print
Expand All
Expand Minimize

CounterPathCallBack callback function

Applications implement the CounterPathCallBack function to process the counter path strings returned by the Browse dialog box.

Syntax


PDH_STATUS __stdcall CounterPathCallBack(
  _In_  DWORD_PTR dwArg
);

Parameters

dwArg [in]

User-defined value passed to the callback function by the Browse dialog box. You set this value in the dwCallBackArg member of the PDH_BROWSE_DLG_CONFIG structure.

Return value

Return ERROR_SUCCESS if the function succeeds.

If the function fails due to a transient error, you can return PDH_RETRY and PDH will call your callback immediately.

Otherwise, return an appropriate error code. The error code is passed back to the caller of PdhBrowseCounters.

Remarks

The following members of the PDH_BROWSE_DLG_CONFIG structure are used to communicate with the callback function:

szReturnPathBuffer

Contains the counter path strings that the user selected.

cchReturnPathLength

Contains the maximum size of the szReturnPathBuffer member. If the callback function reallocates a new buffer, it must also update this value.

CallBackStatus

On entry to the callback function, this member contains the status of the path buffer. On exit, the callback function sets the status value resulting from processing.

If the browser sets this member to ERROR_SUCCESS, then the szReturnPathBuffer member contains a valid counter path or counter path list.

If the buffer is too small to load the current selection, the browser will set this value to PDH_MORE_DATA. Allocate a larger szReturnPathBuffer buffer and return PDH_RETRY.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Pdh.h

See also

PdhBrowseCounters
PDH_BROWSE_DLG_CONFIG

 

 

Community Additions

ADD
Show:
© 2014 Microsoft