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:
Requests to process I/O control codes that are received through IQueueCallbackDeviceIoControl::OnDeviceIoControl. To forward an I/O request to the class extension for processing, the driver must call ISensorClassExtension::ProcessIoControl.
Notifications about clients closing file handles that are received through IFileCallbackCleanup::OnCleanupFile. To forward an I/O request cancellation, the driver must call ISensorClassExtension::CleanupFile.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for