EVT_WDF_DEVICE_D0_ENTRY EvtDeviceD0Entry
IsCalibrationMissing(calibrationBlob))
WriteCalibrationToDevice(calibrationBlob);
UpdateFirmwareSignature(storedSig);
// 5. Start HID report processing
WdfDeviceStopIdle(Device, FALSE);
Generic HIDI2C.sys does not support:
Manufacturers often provide user-mode calibration tools, but these suffer from race conditions during boot and lack the ability to inject corrected data before Windows Touch loads. kmdf hid minidriver for touch i2c device calibration
In your EvtDevicePrepareHardware, retrieve the I2C connection resources. The I2C target is represented by a WDFIOTARGET. Generic HIDI2C
NTSTATUS TouchCalibGetI2cTarget(WDFDEVICE Device, WDFIOTARGET *IoTarget) DECLARE_CONST_UNICODE_STRING(i2cResource, L"I2C1"); WDF_IO_TARGET_OPEN_PARAMS openParams; WDFIOTARGET target;// Get the I2C controller object from the system NTSTATUS status = WdfDeviceGetDeviceStackIoType(Device, ...); status = WdfIoTargetCreate(Device, WDF_NO_OBJECT_ATTRIBUTES, &target); WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_NAME(&openParams, &i2cResource, FILE_ANY_ACCESS); status = WdfIoTargetOpen(target, &openParams); *IoTarget = target; return status;