Düzenle

Aracılığıyla paylaş


IrpProcessing rule set (KMDF)

Use these rules to verify that your driver correctly processes I/O request packets (IRP).

In this section

Topic Description

FwdIrpToIoQueueValid

The rule FwdIrpToIoQueueValid specifies that the driver sends an IRP to an I/O queue, using WdfDeviceWdmDispatchIrpToIoQueue method from either the EvtDeviceWdmIrpDispatch callback or the EvtDeviceWdmIrpPreprocess callback.

SetCompletionRoutineFromDispatch

The SetCompletionRoutineFromDispatch rule verifies that the driver does not specify a completion routine on an IRP from their EvtDeviceWdmIrpDispatch callback function.

MiniportOnlyWdmDevice

The MiniportOnlyWdmDevice rule specifies that WDF drivers should not use IoCreateDevice and IoCreateDeviceSecure functions to create bare WDM device objects. This will cause the computer to crash if someone tries to send an IRP to the WDM device. This is because IRP dispatch entries of the device are set to WDF-specific entries, but the framework hasn’t created a WDF device. However, miniport drivers can use the DDIs because driver dispatch entry points aren’t set for them.

To select the IrpProcessing 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 IrpProcessing.

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

    msbuild /t:sdv /p:Inputs="/check:IrpProcessing.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).