IrpTracking rule set (WDM)
Use these rules to verify that your driver correctly tracks I/O request packets (IRP) so that the device is not removed while IRPs are outstanding.
In this section
Topic | Description |
---|---|
The IoReleaseRemoveLockAndWaitOutsideRemoveDevice rule specifies that IoReleaseRemoveLockAndWait should not be called outside IRP_MJ_PNP with IRP_MN_REMOVE_DEVICE for a PnP driver. |
|
The NsRemoveLockMnRemove rule verifies a driver does not return STATUS_NOT_SUPPORTED when processing IRP_MJ_PNP with MinorFunction IRP_MN_REMOVE_DEVICE. This rule only applies to FDO and FIDO drivers. |
|
The NsRemoveLockMnSurpriseRemove rule verifies that a driver does not return STATUS_NOT_SUPPORTED when processing an IRP_MJ_PNP request with minorFunction IRP_MN_SUPRISE_REMOVAL. This rule only applies to FDO and FIDO drivers. |
|
The NsRemoveLockQueryMnRemove rule verifies a driver does not return STATUS_NOT_SUPPORTED when processing IRP_MJ_PNP with MinorFunction IRP_MN_QUERY_REMOVE. This rule only applies to FDO and FIDO drivers. |
|
The RemoveLock rule specifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used correctly. Moreover, at the end of the IRP_MJ_PNP or IRP_MJ_POWER routine, the driver should not hold the RemoveLock. |
|
The RemoveLockCheck rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLockAndWait are used correctly when processing IRP_MJ_PNP with MinorFunction IRP_MN_REMOVE_DEVICE. |
|
The RemoveLockForward rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used correctly when forwarding an IRP to another device. |
|
The RemoveLockForward2 rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used correctly when forwarding the IRP to another device. |
|
The RemoveLockForwardDeviceControl rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used correctly when the driver uses IoCallDriver to forward an IRP to another device. |
|
The RemoveLockForwardDeviceControl2 rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used correctly when the driver uses IoCallDriver to forward an IRP to another device. |
|
The RemoveLockForwardDeviceControlInternal rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used in correctly when forwarding an IRP using IoCallDriver to another device. |
|
The RemoveLockForwardDeviceControlInternal2 rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used in correctly when forwarding an IRP using IoCallDriver to another device. |
|
The RemoveLockForwardRead rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used in correctly. |
|
The RemoveLockForwardRead2 rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used correctly when forwarding an IRP using IoCallDriver to another device. |
|
The RemoveLockForwardWrite rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used correctly when forwarding an IRP using IoCallDriver to another device. |
|
The RemoveLockForwardWrite2 rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used correctly when forwarding an IRP using IoCallDriver to another device. |
|
The RemoveLockMnRemove rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLockAndWait are used correctly when processing IRP_MJ_PNP with MinorFunction IRP_MN_REMOVE_DEVICE. |
|
The RemoveLockMnRemove2 rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLockAndWait are used correctly when processing IRP_MN_REMOVE_DEVICE request before the IRP is forwarded to lower drivers. |
|
The RemoveLockMnSurpriseRemove rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLockAndWait are used correctly when processing IRP_MJ_PNP with MinorFunction IRP_MN_SUPRISE_REMOVAL. The driver should acquire the remove lock before forwarding the IRP down the stack. |
|
The RemoveLockQueryMnRemove rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used correctly when processing IRP_MJ_PNP with MinorFunction IRP_MN_QUERY_REMOVE_DEVICE. The driver should acquire the remove lock before forwarding the IRP down the stack. |
|
The rule RemoveLockRelease2 verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used in strict alternation. Moreover, at the end of the dispatch routine the driver should not hold the remove lock. |
|
The RemoveLockReleaseCleanup rule specifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used in strict alternation. Each call to IoAcquireRemoveLock must have a matching call to IoReleaseRemoveLock. Moreover, at the end of the dispatch routine the driver should not hold the remove lock. |
|
The rule RemoveLockReleaseClose verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used in strict alternation. Moreover, at the end of the dispatch routine the driver should not hold the remove lock. |
|
The RemoveLockReleaseCreate rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used in strict alternation. Moreover, at the end of the dispatch routine the driver should not hold the remove lock. |
|
The RemoveLockReleaseDeviceControl rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used in strict alternation. Moreover, at the end of the dispatch routine the driver should not hold the remove lock. |
|
The RemoveLockReleaseInternalDeviceControl rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used in strict alternation. Moreover, at the end of the dispatch routine the driver should not hold the remove lock. |
|
The RemoveLockReleasePnp rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used in strict alternation. Moreover, at the end of the dispatch routine the driver should not hold the remove lock. |
|
The RemoveLockReleasePower rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used in strict alternation. Moreover, at the end of the dispatch routine the driver should not hold the remove lock. |
|
The RemoveLockReleaseRead rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used in strict alternation. Moreover, at the end of the dispatch routine the driver should not hold the remove lock. |
|
The RemoveLockReleaseShutdown rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used in strict alternation. Moreover, at the end of the dispatch routine the driver should not hold the remove lock. |
|
The RemoveLockReleaseSystemControl rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used in strict alternation. Moreover, at the end of the dispatch routine the driver should not hold the remove lock. |
|
The RemoveLockReleaseWrite rule verifies that calls to IoAcquireRemoveLock and IoReleaseRemoveLock are used in strict alternation. Moreover, at the end of the dispatch routine the driver should not hold the remove lock. |
To select the IrpTracking 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 IrpTracking.
To select the default rule set from a Visual Studio developer command prompt window, specify IrpTracking.sdv with the /check option. For example:
msbuild /t:sdv /p:Inputs="/check:IrpTracking.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).