FDOPowerPolicyOwnerAPI rule (kmdf)
The FDOPowerPolicyOwnerAPI rule specifies that if an FDO driver relinquishes power policy ownership, the methods WdfDeviceInitSetPowerPolicyEventCallbacks, WdfDeviceAssignS0IdleSettings, and WdfDeviceAssignSxWakeSettings can only be called on the execution paths where the driver is a power policy owner. SDV issues a warning for this rule.
If an FDO driver calls the WdfDeviceInitSetPowerPolicyOwnership method with FALSE as the value of the second parameter, any subsequent calls to WdfDeviceInitSetPowerPolicyEventCallbacks, WdfDeviceAssignS0IdleSettings, and WdfDeviceAssignSxWakeSettings by that driver will cause a rule violation and a warning message.
How to test
|At compile time|
Run Static Driver Verifier and specify the FDOPowerPolicyOwnerAPI rule.Use the following steps to run an analysis of your code:
For more information, see Using Static Driver Verifier to Find Defects in Drivers.