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.

Driver modelKMDF

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:
  1. Prepare your code (use role type declarations).
  2. Run Static Driver Verifier.
  3. View and analyze the results.

For more information, see Using Static Driver Verifier to Find Defects in Drivers.

Applies to

WdfDeviceAssignS0IdleSettings
WdfDeviceAssignSxWakeSettings
WdfDeviceInitSetPowerPolicyEventCallbacks
WdfDeviceInitSetPowerPolicyOwnership

 

 

Send comments about this topic to Microsoft

Build date: 2/13/2014

Show:
© 2014 Microsoft. All rights reserved.