IoSetCompletionRoutineExCheck rule (wdm)
The IoSetCompletionRoutineExCheck rule specifies that the IoSetCompletionRoutineEx routine returns an NTSTATUS value. The driver must check this value to determine if the IoCompletion routine was successfully registered before calling IoCallDriver or PoCallDriver.
If the IoCompletion routine is successfully registered, IoSetCompletionRoutineEx allocates memory that remains allocated until the IoCompletion routine executes. Drivers must ensure that their IoCompletion routine executes by calling IoCallDriver or PoCallDriver otherwise, the kernel will leak memory.
How to test
|At compile time|
Run Static Driver Verifier and specify the IoSetCompletionRoutineExCheck 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.