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 code | Description |
- 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 2000 Professional |
| Minimum supported server | Windows 2000 Server |
| Header | Pdh.h |
| Library | Pdh.lib |
| DLL | Pdh.dll |
See Also
- PdhOpenQuery
Send comments about this topic to Microsoft
Build date: 11/12/2009