Implementing reply semantics to communication ports the right way

I’m designing “reply” functionality to the kernel side of minifilter communication ports. This is a bit challenging because messages are received async. I’m sure there are plenty of ways that would get it working, but I’m trying to design it the correct way.

My current thinking is to queue up messages in a worker thread. If a message is sent that is expecting a reply, an event object is created, sent to the message callback, and waited on (with a reasonable timeout). When the message callback receives its next message, it copies the buffer and alerts the event.

Is this a solid design?

Ok… seems like I didn’t RTFM well enough; FltSendMessage already does this.