EvtIoInCallerContext and WdfDeviceEnqueueRequest (For Open, Close request)

Hi Guys,
I have a KMDF driver which handles only specific type of IOCTLS and does not handle Read/Write/Open/Close. I create a Queue (parallel dispatch) which only accepts IOCTL request type (using WdfDeviceConfigureRequestDispatching).

I want to preprocess the WDF request so I register “InCallerContext”. Now my question is :-

  1. Will my “InCallerContext” callback be called for Open/Close/Read/Write calls as well?
  2. If yes, how should I handle these requests in “InCallerContext”?
  • Option 1: I can just complete the Open Close and _Fail _ Read Write.
  • Option 2: I can just call “WdfDeviceEnqueueRequest” on all the requests (assuming that the WDF will do everything for me) and preprocess the IOCTLs that I need to preprocess. I am concerned about this option in case the Framework tries to enqueue the Open/Close/Read/Write and it does not find that I have a queue for that, not sure what will "WdfDeviceEnqueueRequest " do in that case. Will it complete the Open/Close and fail the read/write (basically the default behavior of KMDF)

Not sure what is the right way to do but I would like to go with Option 2.
Please advice.


WdfDeviceEnqueueRequest will do the right thing. It feeds into whatever processing would have happened if you had not intercepted it.