PdhOpenQueryH function

Creates a new query that is used to manage the collection of performance data.

This function is identical to the PdhOpenQuery function, except that it supports the use of handles to data sources.

Syntax


PDH_STATUS PdhOpenQueryH(
  _In_  PDH_HLOG   hDataSource,
  _In_  DWORD_PTR  dwUserData,
  _Out_ PDH_HQUERY *phQuery
);

Parameters

hDataSource [in]

Handle to a data source returned by the PdhBindInputDataSource function.

dwUserData [in]

User-defined value to associate with this query. To retrieve the user data later, call the PdhGetCounterInfo function and access the dwQueryUserData member of PDH_COUNTER_INFO.

phQuery [out]

Handle to the query. You use this handle in subsequent calls.

Return value

If the function succeeds, it returns ERROR_SUCCESS.

If the function fails, the return value is a system error code or a PDH error code.

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

PdhBindInputDataSource

 

 

Show: