IRQL rule set (WDM)
Use these rules to verify that your driver makes DDI calls at the required IRQL.
A driver that does not follow the IRQL rules can cause serious problems during operation that can lead to deadlock conditions or computer crashes.
In this section
Topic | Description |
---|---|
The ForwardedAtBadIrql rule specifies that the driver should call IoCallDriver and PoCallDriver at IRQL<DISPATCH_LEVEL unless the IRP major function code being forwarded is one of the following: |
|
The ForwardedAtBadIrqlAllocate rule specifies that the driver should call IoCallDriver and PoCallDriver at IRQL<DISPATCH_LEVEL, unless the IRP major function code being forwarded is one of the following: |
|
The ForwardedAtBadIrqlFsdAsync rule specifies that the driver call IoCallDriver and PoCallDriver at IRQL<DISPATCH_LEVEL, unless the IRP major function code being forwarded is one of the following: |
|
The ForwardedAtBadIrqlFsdSync rule specifies that the driver call IoCallDriver and PoCallDriver at IRQL<DISPATCH_LEVEL, unless the IRP major function code being forwarded is one of the following: |
|
The IrqlApcLte rule specifies that the driver calls ObGetObjectSecurity and ObReleaseObjectSecurity only when it is executing at IRQL <= APC_LEVEL. |
|
The IrqlDispatch rule specifies that the driver calls the following DDIs only when it is executing at IRQL = DISPATCH_LEVEL. |
|
The IrqlExAllocatePool rule specifies that the driver calls ExAllocatePoolWithTag and ExAllocatePoolWithTagPriority only when it is executing at IRQL<=DISPATCH_LEVEL. |
|
The IrqlExApcLte1 rule specifies that the driver calls ExAcquireFastMutex and ExTryToAcquireFastMutex only at IRQL <= APC_LEVEL. |
|
The IrqlExApcLte2 rule specifies that the driver calls the following routines only at IRQL <= APC_LEVEL. |
|
The IrqlExApcLte3 rule specifies that the driver calls the following executive support routines only at IRQL <= APC_LEVEL. |
|
The IrqlExApcLteInline rule specifies that DDIs are only called at proper IRQL levels |
|
The IrqlExFree1 rule specifies that ExFreePool and ExFreePoolWithTag are called at proper IRQL. |
|
The IrqlExFree2 rule specifies that ExFreePool and ExFreePoolWithTag are called at proper IRQL. |
|
The IrqlExFree3 rule specifies that ExFreePool and ExFreePoolWithTag are called at proper IRQL. |
|
The IrqlExPassive rule specifies that the driver calls the following executive support routines only at IRQL = PASSIVE_LEVEL: The IrqlExPassive rule also specifies that the driver calls ExRaiseStatus at IRQL <= APC_LEVEL |
|
The IrqlIoApcLte rule specifies that the driver calls the following I/O manager routines only when it is executing at IRQL <= APC_LEVEL: |
|
The IrqlIoDispatch rule specifies that the driver calls the following I/O Manager routines only when it is executing at IRQL <= DISPATCH_LEVEL: IoGetDeviceToVerify, IoSetDeviceToVerify. |
|
The IrqlIoPassive1 rule specifies that the driver calls the following routines only when it is executing at IRQL = PASSIVE_LEVEL: |
|
The IrqlIoPassive2 rule specifies that the driver calls the following I/O Manager routines only at IRQL = PASSIVE_LEVEL: |
|
The IrqlIoPassive3 rule specifies that the driver calls the following routines only when it is executing at IRQL = PASSIVE_LEVEL: |
|
The IrqlIoPassive4 rule specifies that the driver calls the following routines only when it is executing at IRQL = PASSIVE_LEVEL: |
|
The IrqlIoPassive5 rule specifies that the driver calls specific I/O Manager routines only when it is executing at IRQL = PASSIVE_LEVEL. |
|
The IrqlIoRtlZwPassive rule specifies that the driver calls specific I/O Manager routines only when it is executing at IRQL = PASSIVE_LEVEL. |
|
The IrqlKeApcLte1 rule specifies that the driver calls the following kernel routines only when it is executing at IRQL <= APC_LEVEL: |
|
The IrqlKeApcLte2 rule specifies that the driver calls the following kernel routines only when it is executing at IRQL <= APC_LEVEL: |
|
The IrqlKeDispatchLte rule specifies that the driver calls the following kernel routines only when it is executing at IRQL <= DISPATCH_LEVEL: |
|
The IrqlKeRaiseLower rule specifies that the driver does the following when raising and lowering the IRQL: When the driver calls KeRaiseIrql, it is executing at an IRQL that is lower than or equal to the value of the NewIrql parameter.The driver calls KeLowerIrql only after calling KeRaiseIrql or KeRaiseIrqlToDpcLevel. |
|
The IrqlKeRaiseLower2 rule specifies that drivers use KeLowerIrql to restore the original IRQL raised by a preceding call to KeRaiseIrql or KeRaiseIrqlToDpcLevel. |
|
The IrqlKeReleaseSpinLock rule specifies that the driver calls KeReleaseSpinLock only when it is executing at IRQL = DISPATCH_LEVEL. |
|
The IrqlKeSetEvent rule specifies that the KeSetEvent routine is only called at IRQL <= DISPATCH_LEVEL when Wait is set to FALSE, and at IRQL <= APC_LEVEL when Wait is set to TRUE. |
|
The IrqlKeWaitForMutexObject rule specifies the driver to call the KeWaitForMutexObject routine at the proper IRQL based on the value of the Timeout parameter: |
|
The IrqlKeWaitForMultipleObjects rule specifies that callers of the KeWaitForMultipleObjects routine must be running at proper IRQL based upon the Timeout parameter. |
|
The IrqlMmApcLte rule specifies that the driver calls the following memory manager routines only when it is executing at IRQL <= APC_LEVEL: |
|
The IrqlMmDispatch rule specifies that the driver calls MmFreeContiguousMemory only when it is executing at IRQL <= DISPATCH_LEVEL. |
|
The IIrqlNtifsApcPassive rule specifies that the driver calls the DDIs listed in the rule only when it is executing either at IRQL = PASSIVE_LEVEL or at IRQL <= APC_LEVEL. |
|
The IrqlObPassive rule specifies that the driver calls ObReferenceObjectByHandle only when it is executing at IRQL = PASSIVE_LEVEL. |
|
The IrqlPsPassive rule specifies that the driver calls the following Process Structure routines only when it is executing at IRQL = PASSIVE_LEVEL: |
|
The IrqlReturn rule specifies that the driver's dispatch routines return at the same IRQL at which they were called. |
|
The IrqlRtlPassive rule specifies that the driver calls RtlDeleteRegistryValue only when it is executing at IRQL = PASSIVE_LEVEL. |
|
The IrqlZwPassive rule specifies that the driver calls ZwClose only when it is executing at IRQL = PASSIVE_LEVEL. |
To select the Irql 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 Irql.
To select the default rule set from a Visual Studio developer command prompt window, specify Irql.sdv with the /check option. For example:
msbuild /t:sdv /p:Inputs="/check:Irql.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).