// sensorscx.h
typedef struct _SENSOR_CONTROLLER_CONFIG {
ULONG Size;
WDF_TRI_STATE DriverIsPowerPolicyOwner;
PFN_SENSOR_DRIVER_START_SENSOR EvtSensorStart;
PFN_SENSOR_DRIVER_STOP_SENSOR EvtSensorStop;
PFN_SENSOR_DRIVER_GET_SUPPORTED_DATA_FIELDS EvtSensorGetSupportedDataFields;
PFN_SENSOR_DRIVER_GET_DATA_FIELD_PROPERTIES EvtSensorGetDataFieldProperties;
PFN_SENSOR_DRIVER_GET_DATA_INTERVAL EvtSensorGetDataInterval;
PFN_SENSOR_DRIVER_SET_DATA_INTERVAL EvtSensorSetDataInterval;
PFN_SENSOR_DRIVER_GET_DATA_THRESHOLDS EvtSensorGetDataThresholds;
PFN_SENSOR_DRIVER_SET_DATA_THRESHOLDS EvtSensorSetDataThresholds;
PFN_SENSOR_DRIVER_GET_PROPERTIES EvtSensorGetProperties;
PFN_SENSOR_DRIVER_DEVICE_IO_CONTROL EvtSensorDeviceIoControl;
PFN_SENSOR_DRIVER_START_SENSOR_HISTORY EvtSensorStartHistory;
PFN_SENSOR_DRIVER_STOP_SENSOR_HISTORY EvtSensorStopHistory;
PFN_SENSOR_DRIVER_CLEAR_SENSOR_HISTORY EvtSensorClearHistory;
PFN_SENSOR_DRIVER_START_HISTORY_RETRIEVAL EvtSensorStartHistoryRetrieval;
PFN_SENSOR_DRIVER_CANCEL_HISTORY_RETRIEVAL EvtSensorCancelHistoryRetrieval;
PFN_SENSOR_DRIVER_SET_BATCH_LATENCY EvtSensorSetBatchLatency;
PFN_SENSOR_DRIVER_START_STATE_CHANGE_NOTIFICATION EvtSensorStartStateChangeNotification;
PFN_SENSOR_DRIVER_STOP_STATE_CHANGE_NOTIFICATION EvtSensorStopStateChangeNotification;
PFN_SENSOR_DRIVER_ENABLE_WAKE EvtSensorEnableWake;
PFN_SENSOR_DRIVER_DISABLE_WAKE EvtSensorDisableWake;
} SENSOR_CONTROLLER_CONFIG, *PSENSOR_CONTROLLER_CONFIG;
View the official Windows Driver Kit DDI referenceNo description available.
This structure contains pointers to callback functions that must be implemented by the driver, and passed on to the class extension to call.
SizeThe allocated size of this structure (in bytes).
DriverIsPowerPolicyOwnerIndicates whether or not driver owns the power policy. This value must be either WdfFalse, WdfUseDefault, or WdfTrue. For partners to take advantage of pep-based power management, they must set this flag to WdfFalse or WdfUseDefault and remove any _PSx method in their ACPI tables.
EvtSensorStartThis callback function starts the sensor based on the default properties specified by the driver, or properties set by the class extension.
EvtSensorStopThis callback function stops the sensor.
EvtSensorGetSupportedDataFieldsThis callback function returns a list of data fields supported by the specified sensor.
EvtSensorGetDataFieldPropertiesThis callback function returns the properties of a given data field associated with a sensor.
EvtSensorGetDataIntervalThis callback function returns the data interval for a specified sensor.
EvtSensorSetDataIntervalThis callback function sets the data interval for a specified sensor.
EvtSensorGetDataThresholdsThis callback function returns the thresholds that are associated with a sensor.
EvtSensorSetDataThresholdsThis callback function stops the sensor.
EvtSensorGetPropertiesThis callback function returns the properties for a given sensor.
EvtSensorDeviceIoControlThis callback function handles IOCTLs outside of the class extension.
Note If the driver needs to queue the IRP, it must copy the IRP to an IoQueue that the driver owns. This will prevent all IRPs for the driver to be stalled until completion.
EvtSensorStartHistoryEvtSensorStopHistoryEvtSensorClearHistoryEvtSensorStartHistoryRetrievalEvtSensorCancelHistoryRetrievalEvtSensorSetBatchLatencyThis callback function sets the batch latency for a specified sensor.
EvtSensorStartStateChangeNotificationEvtSensorStopStateChangeNotificationEvtSensorEnableWakeEvtSensorDisableWakeThis structure is given to the class extension using the SensorsCxDeviceInitialize function. If any of the following function pointers are not set, the driver will fail to load:
Each function returns STATUS_SUCCESS when completed successfully.
Note The class extension (CX) only uses the NT_SUCCESS macro to determine if the call to the driver’s Evt function was successful, but does not take any action if the function failed or does not return STATUS_SUCCESS.