Completing operations from minifilter MessageNotifyCallback

My minifilter handles reparse points. When the filter sees one of it’s reparse point tags in an IRP_MJ_CREATE PostCreate, it sends a message to a user process to resolve the request. And, it inserts the PFLT_CALLBACK_DATA (Cbd) into a Cancel Safe Queue (CSQ). When the user process has resolved the request, it calls FilterSendMessage to tell the filter that the the create can now complete. In order to obtain the Cbd, I want to call FltCbdqRemoveIo with a key for the PeekContext from my MessageNotifyCallback. But, I need the PFLT_CALLBACK_DATA_QUEUE object which is associated with my PFLT_INSTANCE object.

What are some possible strategies to get to my CSQ? I don’t see a clean way from existing API’s and data structures. I suppose I could create my own list of instances, associate a key such as a counter to each entry in the list, and pass the counter value to the user process, then it to look the instance in the MessageNotifyCallback.

BTW, I’m a newbie to this list and to minifilters. This list has been a huge help as I’ve been working through design issues!

One-to-one relation of communication port with CSQ?

wrote in message news:xxxxx@ntfsd…
> My minifilter handles reparse points. When the filter sees one of it’s reparse point tags in an IRP_MJ_CREATE PostCreate, it sends a message to a user process to resolve the request. And, it inserts the PFLT_CALLBACK_DATA (Cbd) into a Cancel Safe Queue (CSQ). When the user process has resolved the request, it calls FilterSendMessage to tell the filter that the the create can now complete. In order to obtain the Cbd, I want to call FltCbdqRemoveIo with a key for the PeekContext from my MessageNotifyCallback. But, I need the PFLT_CALLBACK_DATA_QUEUE object which is associated with my PFLT_INSTANCE object.
>
> What are some possible strategies to get to my CSQ? I don’t see a clean way from existing API’s and data structures. I suppose I could create my own list of instances, associate a key such as a counter to each entry in the list, and pass the counter value to the user process, then it to look the instance in the MessageNotifyCallback.
>
> BTW, I’m a newbie to this list and to minifilters. This list has been a huge help as I’ve been working through design issues!
>
>

I send a message from filter to user mode. The user mode program returns the reply immediately to the filter. When the user mode program completes the request it sends a new message to the filter.

Ah, I see. Create a new port for each operation. Thanks!

Though wouldn’t my user mode program need to poll for a port to open? As opposed to waiting for an event. Or I could use one port as the master event port to indicate to a new request is ready…

> Ah, I see. Create a new port for each operation. Thanks!

No, for each volume you’re filtering.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com