CheckCounter
TOC
Collapse the table of content
Expand the table of content

CheckCounter routine

The CheckCounter function retrieves information that describes a counter.

Syntax


PFND3D10DDI_CHECKCOUNTER CheckCounter;

VOID APIENTRY CheckCounter(
  _In_    D3D10DDI_HDEVICE      hDevice,
  _In_    D3D10DDI_QUERY        Query,
  _Out_   D3D10DDI_COUNTER_TYPE *pCounterType,
  _Out_   UINT                  *pActiveCounters,
  _Out_   LPSTR                 pName,
  _Inout_ UINT                  *pNameLength,
  _Out_   LPSTR                 pUnits,
  _Inout_ UINT                  *pUnitsLength,
  _Out_   LPSTR                 pDescription,
  _Inout_ UINT                  *pDescriptionLength
)
{ ... }

Parameters

hDevice [in]

A handle to the display device (graphics context).

Query [in]

A D3D10DDI_QUERY-typed value that identifies the counter identifier that information is retrieved for.

pCounterType [out]

A pointer to a variable that receives one of the following values from the D3D10DDI_COUNTER_TYPE enumeration that identifies the data type that the counter outputs.

ValueMeaning

D3D10DDI_COUNTER_TYPE_FLOAT32

Single-precision float

D3D10DDI_COUNTER_TYPE_UINT16

16-bit value

D3D10DDI_COUNTER_TYPE_UINT32

32-bit value

D3D10DDI_COUNTER_TYPE_UINT64

64-bit value

 

pActiveCounters [out]

A pointer to a variable that receives the number of simultaneously active counters that are allocated for the creation of the counter identifier that Query identifies.

pName [out]

A pointer that the driver returns a NULL-terminated string to that contains the name of the counter identifier.

pNameLength [in, out]

A pointer to a variable that receives the size, in bytes, of the NULL-terminated string that the pName parameter specifies.

pUnits [out]

A pointer that the driver returns a NULL-terminated string to that contains the name of the units that the counter identifier measures.

pUnitsLength [in, out]

A pointer to a variable that receives the size, in bytes, of the NULL-terminated string that the pUnits parameter specifies.

pDescription [out]

A pointer that the driver returns a NULL-terminated string to that contains the description of what the counter identifier measures.

pDescriptionLength [in, out]

A pointer to a variable that receives the size, in bytes, of the NULL-terminated string that the pDescription parameter specifies.

Return value

None

The driver can use the pfnSetErrorCb callback function to set an error code. For more information about setting error codes, see the following Remarks section.

Remarks

The driver's CheckCounter function can call the pfnSetErrorCb callback function to set the ERR_UNSUPPORTED error code if the Query parameter of CheckCounterspecifies a well-known counter that the device does not support.

The driver must validate a device-dependent counter identifier to ensure the identifier is within range. The driver must also ensure that enough space exists to copy each counter string into each buffer that the Microsoft Direct3D runtime provides. The driver can call the pfnSetErrorCb callback function to set the E_INVALIDARG error code if there is not enough space for any of the provided buffers.

The driver's CheckCounter function cannot call the pfnSetErrorCb callback function to set the D3DDDIERR_DEVICEREMOVED error code because CheckCounter is a capability-check type of function. The driver must ensure that it has enough information after device creation to respond to a call to CheckCounter, even in the presence of D3DDDIERR_DEVICEREMOVED.

Requirements

Target platform

Version

Available in Windows Vista and later versions of the Windows operating systems.

Header

D3d10umddi.h (include D3d10umddi.h)

See also

D3D10DDI_DEVICEFUNCS
D3D10DDI_QUERY
pfnSetErrorCb

 

 

Send comments about this topic to Microsoft

Show:
© 2016 Microsoft