Platform SDK: Performance Monitoring |
The 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.
[C++] PDH_STATUS PdhCloseQuery( HQUERY hQuery ); [Visual Basic] PdhCloseQuery( ByVal QueryHandle as Long ) as Long
If the function succeeds, it returns ERROR_SUCCESS and closes and deletes the query. Otherwise, the function returns a PDH error value.
The following is the possible PDH error value.
Error value | Description |
---|---|
PDH_INVALID_HANDLE | The query handle is not valid. |
[C++] PDH error values are defined in PDHMsg.h.
[Visual Basic] PDH error values are defined in PDHDef.txt.
The handles added to this query should be deleted or zeroed and not used after the query they belong to is deleted.
Windows NT/2000: Requires Windows NT 4.0 or later.
Header: Declared in Pdh.h (C/C++).
Library: Use Pdh.lib.