Performance Counters Functi ...


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

C++
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 clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderPdh.h
LibraryPdh.lib
DLLPdh.dll

See Also

PdhOpenQuery

Send comments about this topic to Microsoft

Build date: 11/12/2009

Tags :


Page view tracker