About ISensorClassExtension

A sensor driver uses ISensorClassExtension to initialize and unitialize the sensor class extension, raise events, process WPD input/output control codes (IOCTLs), and correctly close UMDF file handles.

Methods to Manage Object Lifetime

To initialize the class extension, a PnP-based hardware sensor driver calls ISensorClassExtension::Initialize when it is called by UMDF in IPnpCallbackHardware::OnPrepareHardware. This step provides the class extension object with pointers to the driver's main class and to the class that implements the callback interface to handle events that are raised by the class extension object. When the driver is called by UMDF in IPnpCallbackHardware::OnReleaseHardware, it should call ISensorClassExtension::Uninitialize and then release the class extension object. Note that some types of sensors may need to initialize and uninitialize the class extension at different times.

Methods to Raise Events

The driver can raise various kinds of sensor events (usually that contain sensor data) by calling ISensorClassExtension::PostEvent and state-information events by calling ISensorClassExtension::PostStateChange. For more information about how events work in sensor drivers, see About Sensor Driver Events.

Methods to Manage IOCTLs and Handles

Sensor drivers forward two kinds of UMDF calls to the class extension: