List,
I have a few questions about pended I/O operations from minifilter callbacks.
- After returning FLT_PREOP_PENDING from a pre-callback, or FLT_POSTOP_MORE_PROCESSING_REQUIRED from a post-callback, are there any requirements around where FltCompletePendedPreOperation or FltCompletePendedPostOperation are called? I had assumed any context would be permissible (such as from system thread started with PsCreateSystemThread), but an old OSR-related discussion [1] seems to eerily suggest otherwise, and there were other indications that calling FltComplete* from a separate thread could be problematic [2]. However, how else would one be expected to make use of FltComplete* functions if not from another thread?
1a) Are there guarantees (or only incorrect assumptions from developers) related to your thread context in a minifilter driver depending on the IRP and pre/post callbacks, and if so (how) does the Filter Manager handle resuming IRP processing for subsequent minifilters in the chain following a FltComplete* call from a system thread? Or is this left up to the caller of the FltComplete* functions?
1b) Are the context requirements listed here [3] applicable to minifilters calling FltComplete* as well? Are these requirements for all possible CallbackStatus values from FltCompletePendedPreOperation or only a subset of them?
- When pending a pre- or post- operation in a minifilter, it seems like you are required to create your own copy (and where appropriate reference counts for some members) of the FLT_RELATED_OBJECTS parameter, as this is a stack-based parameter of the parent function that will not be valid after return your pending status code from your callback. Are you also required to create a copy of the FLT_CALLBACK_DATA data (versus tucking a pointer away into your work queue item)?
Cheers,
Jason V. Miller
Technical Leader, FireAMP
xxxxx@cisco.com
Cisco Systems Canada Co, 181 Bay St.
Suite 3400, Toronto, ON, Canada, M5J 2T3
Phone: 416-306-7000, Fax: 416-306-7099
Preferences?-?Unsubscribe?-?Privacy
[1] http://www.osronline.com/showthread.cfm?link=252309 (specifically discussion around [A])
[2] http://www.osronline.com/showthread.cfm?link=166259
[3] http://msdn.microsoft.com/en-us/library/windows/hardware/ff540124(v=vs.85).aspx
[A]
“”"
However, you might want to worry about the fact that IRP_MJ_CLEANUP must be
called in the context of the process that close that last handle so you must
queue in such a way that the thread that dequeues it either completes the
request or, if it sends it down, it must do so in the same process context.
“”"