Miscellaneous rule set (KMDF)

Use these rules to verify that your driver correctly follows a general set of requirements for the proper handling of device objects, keys, and that the driver does not makes calls to DDIs that are not appropriate for a non-PnP driver or for a non-FDO driver that is not a power policy owner.

In this section

Topic Description

AccessHardwareKey

The AccessHardwareKey rule specifies that a bus driver should not try to access the hardware key of a child device from EvtChildListCreateDevice.

AddPdotoStaticChildlist

The AddPdotoStaticChildlist rule specifies that for a PDO device, the framework function WdfFdoAddStaticChild must be called after the driver calls WdfPdoInitAllocate and WdfDeviceCreate successfully.

ChildListConfiguration

The ChildListConfiguration rule specifies that drivers that support Dynamic Enumeration must call WdfFdoInitSetDefaultChildListConfig before calling the WdfDeviceCreate function.

Cleanup4CtlDeviceRegistered

The Cleanup4CtlDeviceRegistered rule specifies that if a Plug and Play (PnP) driver calls WdfDeviceCreate for the control device object, the driver must register one of the required event callback functions.

NonFDONotPowerPolicyOwnerAPI

The NonFDONotPowerPolicyOwnerAPI rule specifies that if a non-FDO driver is not a power policy owner, certain DDIs cannot be called.

NonPnPDrvPowerPolicyOwnerAPI

The NonPnPDrvPowerPolicyOwnerAPI rule specifies that non-PnP drivers cannot call certain DDIs related to power management.

UnSafeAllocatePool

The UnSafeAllocatePool rule is an important security rule that checks that a driver is not using deprecated DDIs to allocate memory.

To select the Miscellaneous rule set

  1. Select your driver project (.vcxProj) in Microsoft Visual Studio. From the Driver menu, click Launch Static Driver Verifier….

  2. Click the Rules tab. Under Rule Sets, select Miscellaneous.

    To select the default rule set from a Visual Studio developer command prompt window, specify Miscellaneous.sdv with the /check option. For example:

    msbuild /t:sdv /p:Inputs="/check:Miscellaneous.sdv" mydriver.VcxProj /p:Configuration="Win8 Release" /p:Platform=Win32
    

    For more information, see Using Static Driver Verifier to Find Defects in Drivers and Static Driver Verifier commands (MSBuild).