Is it possible to use WdfInterruptAcquireLock() instead of WdfInterruptTryToAcquireLock() in a KMDF driver if you are not using passive interrupt handling (WDF_INTERRUPT_CONFIG::PassiveHandling == FALSE)? The docs are pretty clear on passive interrupt handling, but pretty fuzzy without passive interrupt handling. I've tried WdfInterruptTryToAcquireLock() in a EVT_WDF_IO_QUEUE_IO_DEVICE_CONTROL callback and it consistently fails and I have to resort to a work item which seems pretty excessive for just setting 1 little variable shared between multiple callbacks.
I need all this to synchronize data between an EVT_WDF_INTERRUPT_ISR, an EVT_WDF_INTERRUPT_DPC and EVT_WDF_IO_QUEUE_IO_DEVICE_CONTROL. For context, the EVT_WDF_IO_QUEUE_IO_DEVICE_CONTROL basically blocks the calling user space thread until a hardware event is triggered, the EVT_WDF_INTERRUPT_ISR is triggered by the hardware which sets a flag on a shared variable and queues up the EVT_WDF_INTERRUPT_DPC via WdfInterruptQueueDpcForIsr() that completes the original blocking EVT_WDF_IO_QUEUE_IO_DEVICE_CONTROL request using WdfRequestComplete().
It looks like you're new here. If you want to get involved, click one of these buttons!
|Upcoming OSR Seminars|
|Developing Minifilters||29 July 2019||OSR Seminar Space|
|Writing WDF Drivers||23 Sept 2019||OSR Seminar Space|
|Kernel Debugging||21 Oct 2019||OSR Seminar Space|
|Internals & Software Drivers||18 Nov 2019||Dulles, VA|