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.
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:
For more information, see Using Static Driver Verifier to Find Defects in Drivers.