I had to update a WDM driver recently and in doing so decided to review all the code.
(Yes it should be ported to WDF, but that's a task for another day...)
In reviewing the code, I found that the cancellation logic and cancel routine were improperly implemented.
The following document from Microsoft was very useful to me.
The section "Cancel Logic with a Driver-Supplied Lock" was most helpful.
It helped me better understand the possible race conditions that can happen and the proper way to deal with them.
I expect most people are probably using WDF and may not have to deal with this, but I thought I would share it with the community just in case.
It looks like you're new here. If you want to get involved, click one of these buttons!
|Upcoming OSR Seminars|
|Writing WDF Drivers||21 Oct 2019||OSR Seminar Space & ONLINE|
|Internals & Software Drivers||18 Nov 2019||Dulles, VA|
|Kernel Debugging||30 Mar 2020||OSR Seminar Space|
|Developing Minifilters||27 Apr 2020||OSR Seminar Space & ONLINE|