SensorsCxSensorCreate function (sensorscx.h)

This function creates an instance of a sensor in the class extension.

Syntax

NTSTATUS SensorsCxSensorCreate(
  [in]  WDFDEVICE              FxDevice,
  [in]  PWDF_OBJECT_ATTRIBUTES pSensorAttributes,
  [out] PSENSOROBJECT          pSensor
);

Parameters

[in] FxDevice

A WDFDEVICE handle to the framework device object that represents the sensor.

[in] pSensorAttributes

A reference to WDF_OBJECT_ATTRIBUTES.

[out] pSensor

A reference to a sensor object that is used within the class extension.

Return value

This function returns NTSTATUS with different values. Some values that may be returned are the following:

  • STATUS_SUCCESS is returned when the function completes successfully.
  • STATUS_INVALID_PARAMETER is returned if any of the _In_ parameters are NULL.
  • STATUS_INSUFFICIENT_RESOURCES is returned if there were insufficient resources to allocate memory for this function.

Remarks

SensorsCxSensorCreate is implemented by the class extension and must be called by the driver.

Note  If pSensorAttributes->ParentObject is not set to NULL or FxDevice, then SensorsCxSensorCreate will fail. If pSensorAttributes->ParentObject is NULL, then the class extension (CX) will set it to FxDevice.
 

The sensors class extension writes a set of properties for each sensor when SensorsCxSensorCreate. For information about these properties, see Enumeration properties.

Requirements

Requirement Value
Target Platform Desktop
Header sensorscx.h

See also

Enumeration properties

WDF_OBJECT_ATTRIBUTES