Manual dispatch vs WDF sequential dispatch in the serial port driver example - why the complication?

Dear all,

I have a legacy serial driver whose design was based on the Microsoft’s serial driver example, with some modification. But the main structure on how I/O requests via different queues is the same. I checked the discussion on this forum:

https://community.osr.com/discussion/257955/using-manual-dispatching-of-i-o-requests-in-wdf-serial-driver-sample

but it didn’t provide answers I was looking for. The key question is: why were manual dispatch queues necessary? If a design has the following properties:

  1. each serial port has a separate device instance, with separate IO queues.
  2. read, write and ioctl operations on a single serial port are configured to go to different queues, with sequential dispatch.

then the result would be the same as having parallel dispatch on different queues and then enforce serialization in the manual queues. The main difference I see is that WDF handles IO request synchronization for me, simplifying my design. I feel like I’m missing something, but don’t know what, as I don’t believe MS engineers would miss something this obvious.

As a general rule, WDF I/O queues are lightweight and very useful. If adding one (or even a bunch) makes the design even a bit simpler or more reliable, then it’s well worth it.