StartIoCancel rule (wdm)
Setting the NonCancelable parameter to FALSE before registering the Cancel routine can result in a cancellation race condition.
Because a driver's Cancel routine must include a call to IoReleaseCancelSpinLock (to release the spin lock that the I/O Manager acquires before calling the Cancel routine), consider verifying your driver with both the StartIoCancel rule and the CancelSpinLock rule.
How to test
|At compile time|
Run Static Driver Verifier and specify the StartIoCancel 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.