Hi, All:
I need to write a HID mini-driver for a HID device. I reference to the windows sample: vhidmini2. I have implemented the basic functions and it works well. Now I want to implement S0 idle for my device, but because the mini-driver is not the power policy owner (default the hid class driver is), so WdfDeviceAssignS0IdleSettings fails with 0xC0000010.
I notices that there are two IOCTLs named IOCTL_HID_ACTIVATE_DEVICE and IOCTL_HID_DEACTIVATE_DEVICE, and I think that maybe I can sleep and wake my device when I receive the two IOCTLs. But no matter how long I wait (not use my device, no interrupts and other IOCTLs), I can not receive IOCTL_HID_ACTIVATE_DEVICE and IOCTL_HID_DEACTIVATE_DEVICE.
My question is: How to implement S0 idle for my HID mini-driver and device?
Should I call WdfDeviceInitSetPowerPolicyOwnership to set the mini-driver as the power policy owner or something else?