SpinLockSafe rule (wdm)

The SpinLockSafe rule specifies that IoStartNextPacket and IoCompleteRequest are not called while holding a spin lock.

This rule also specifies that the driver calls KeAcquireSpinLock or KeAcquireSpinLockAtDpcLevel before calling KeReleaseSpinLockFromDpcLevel or KeReleaseSpinLock, and that it calls IoAcquireCancelSpinLock before calling IoReleaseCancelSpinLock.

Static Driver Verifier can report false violations of this rule if the driver includes nested SpinLocks, even if those spin locks are acquired and released correctly.

Driver model: WDM

How to test

At compile time

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

IoAcquireCancelSpinLock IoCompleteRequest IoReleaseCancelSpinLock IoStartNextPacket KeAcquireSpinLock KeAcquireSpinLockRaiseToDpc KeReleaseSpinLock