Device power mappings different between Win10 and Win11. Not sure why.

On win 10 s1-s3 map to d2 and the device is able to wake the system from sleep. On win11 they map to d3 and the device isn’t able to wake the system from sleep.

The docs for the Device_Capabilities structure says:
“If the bus driver is unable to determine the appropriate device power state for a root-enumerated device, it sets DeviceState[PowerSystemWorking] to PowerDeviceD0 and all other entries to PowerDeviceD3.” So I think that’s what’s happening but I don’t understand why or what needs to be done about it. My hunch is that I can’t just override what the bus says but I don’t know. Is the firmware not handling a request correctly? Does it have anything to do with modern standby?
Thanks,
-dan

What class of river? This mapping is COMPLETELY under the control of the driver. The IRP_MJ_POWER request with IRP_MN_QUERY_POWER allows the driver to supply its mapping. KMDF handles this through WdfDeviceSetPowerCapabilities.

Sorry, it’s a HID driver. Thanks I will look into that.

Calling WdfDeviceSetPowerCapabilities in my prepare hardware callback doesn’t make any difference. I think because someone higher in the stack (hidclass?) is overriding me. The doc says that drivers higher in the stack have priority on this.

The root of my confusion is that even with the in-box driver it works as expected on win10 but not win11 and I’m concerned that even if I can find a way to fix it in my driver that I’m just covering over some deeper issue that will bite us later. I suspect that the firmware isn’t doing something correctly for win11 but I’m not sure.

Are you are a filter driver? If so, then you have no say in the power management.