Bewerken

Delen via


MarkingQueuedIrps rule (wdm)

The MarkingQueuedIrps rule specifies that the driver calls IoMarkIrpPending for an IRP that requires further processing only while holding a spin lock. This rule applies only when the driver adds the IRP to a driver-managed queue.

Specifically, the driver violates this rule only when all of the following events occur.

Drivers should call IoMarkIrpPending for a queued IRP only while holding a spin lock. Otherwise, an IRP could be dequeued, completed by another driver routine, and freed by the system before the call to IoMarkIrpPending occurs, thereby causing a crash.

For more information, see Synchronizing IRP Cancellation.

Driver model: WDM

How to test

At compile time

Run Static Driver Verifier and specify the MarkingQueuedIrps rule.

Use the following steps to run an analysis of your code:
  1. Prepare your code (use role type declarations).
  2. Run Static Driver Verifier.
  3. View and analyze the results.

For more information, see Using Static Driver Verifier to Find Defects in Drivers.

Applies to

InsertHeadList IoCallDriver IoMarkIrpPending KeAcquireInStackQueuedSpinLock KeAcquireSpinLock KeInsertByKeyDeviceQueue KeInsertDeviceQueue KeInsertQueueDpc KeReleaseInStackQueuedSpinLock KeReleaseSpinLock PoCallDriver RemoveHeadList