ReqSendWhileSpinlock rule (kmdf)

The ReqSendWhileSpinlock rule specifies that no requests are sent while the driver holds a spinlock.

If the driver sends any requests while it holds a spinlock, it could cause a deadlock or clash with the lower driver that receives the requests, if the lower driver also attempts to acquire a lock or access shared resources.

Driver model KMDF

How to test

At compile time

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

WdfRequestSend WdfSpinLockAcquire WdfSpinLockRelease KeAcquireSpinLock KeReleaseSpinLock

See also

Completing I/O Requests Synchronizing Cancel and Completion Code