Export (0) Print
Expand All
Expand Minimize

PdhCloseQuery function

Closes all counters contained in the specified query, closes all handles related to the query, and frees all memory associated with the query.

Syntax


PDH_STATUS PdhCloseQuery(
  _In_  PDH_HQUERY hQuery
);

Parameters

hQuery [in]

Handle to the query to close. This handle is returned by the PdhOpenQuery function.

Return value

If the function succeeds, it returns ERROR_SUCCESS. Otherwise, the function returns a system error code or a PDH error code.

The following is a possible value.

Return codeDescription
PDH_INVALID_HANDLE

The query handle is not valid.

 

Remarks

Do not use the counter handles associated with this query after calling this function.

The following shows the syntax if calling this function from Visual Basic.

PdhCloseQuery(
  ByVal QueryHandle as Long  
)
as Long

QueryHandle

[in] Identifies the query to close. The PdhVbOpenQuery function returns the identifier.

Examples

For an example, see Browsing Performance Counters or Reading Performance Data from a Log File.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Pdh.h

Library

Pdh.lib

DLL

Pdh.dll

See also

PdhOpenQuery

 

 

Community Additions

ADD
Show:
© 2014 Microsoft