Warning rule set (WDM)
Use these rules to verify that your driver can correctly processes IRPs in various contexts and follows Microsoft recommended best practices.
In this section
Topic | Description |
---|---|
The CheckDeviceObjectFlags rule specifies that a bus driver must check that the device object flags for DO_POWER_PAGABLE and DO_POWER_INRUSH are set consistently for the FDO and the child PDOs. This rule only applies to bus drivers. |
|
The CompletionEventChecking rule specifies that a driver does not call IoMarkIrpPending and KeSetEvent in a completion routine for the same IRP. |
|
The DeleteDevice rule specifies that drivers should not rely on the I/O Manager or PnP Manager to keep the DeviceObject alive after a call to IoDeleteDevice. |
|
The MultRemoveLock rule verifies that IoAcquireRemoveLock is called with only one unique Remove Lock. This is a warning rule. |
|
The PagedCode rule specifies that the driver calls the PAGED_CODE macro only when it is executing at IRQL <= APC_LEVEL. |
|
The PagedCodeAtPowerTrans rule specifies that a driver should not call PAGED_CODE while responding to a system IRP_MJ_POWER Irp (IRP_MN_SET_POWER) and to a device IRP_MJ_POWER Irp (IRP_MN_SET_POWER). |
|
The ReservedDDIs rule verifies that drivers do not call any reserved functions. |
To select the Warning rule set
Select your driver project (.vcxProj) in Microsoft Visual Studio. From the Driver menu, click Launch Static Driver Verifier….
Click the Rules tab. Under Rule Sets, select Warning.
To select the default rule set from a Visual Studio developer command prompt window, specify Warning.sdv with the /check option. For example:
msbuild /t:sdv /p:Inputs="/check:Warning.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).