ChangeQueueState rule (kmdf)

The ChangeQueueState rule specifies that the WDF driver doesn't try to change the state of the Queue from concurrent threads or doesn’t call state changing DDIs one after another from within the same thread. Queue state changing callback functions are WdfIoQueueStop, WdfIoQueueStopSynchronously,WdfIoQueuePurge,WdfIoQueuePurgeSynchronously, WdfIoQueueDrain, WdfIoQueueDrainSynchronously, WdfIoQueueStopAndPurge and WdfIoQueueStopAndPurgeSynchronously. If these DDIs are called when a Queue state change is already in progress it will cause a computer to crash or to become unresponsive.

Driver model: KMDF

How to test

At compile time

Run Static Driver Verifier and specify the ChangeQueueState 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

WdfDeviceCreate WdfDriverCreate WdfIoQueueCreate WdfIoQueueDrain WdfIoQueueDrainSynchronously WdfIoQueuePurge WdfIoQueuePurgeSynchronously WdfIoQueueStop WdfIoQueueStopAndPurge WdfIoQueueStopAndPurgeSynchronously WdfIoQueueStopSynchronously