I?m quite sure. As far as I know the documentation doesn?t clearly discuss the implementation on pending operations, but the approach you suggested (to wait for the minifilter to complete the operation on a different thread and then send it down (or complete it) on the original thread) has the disadvantage that it would prevent a filter from ever passing an operation down in a different context (the filter would be forced to allocate a new CallbackData in the new context, send that down, and on its completion it would have to complete back the original context). This is definitely more complicated than the current implementation, where the filter would just pend and then ?continue? the operation in the new context.
Also, from a design perspective, this would be a departure from the asynchronous model of NT.
FS Minifilter documentation should be read as complementary to the legacy file system filter documentation, and not as a replacement. It mostly tries to describe the FltMgr specific bits, so if it doesn?t mention anything specific to contexts for IRP_MJ_CLEANUP, I don?t think you should take that to mean that there are no other requirements, but instead I would read it to mean that there are no FltMgr specific constraints.
Thanks,
Alex.
On Jan 10, 2014, at 1:04 PM, xxxxx@arcabit.com wrote:
> Process contexts aren?t handled by FltMgr in the way you seem to expect here.
Are you sure, where is this documented? The doc says that we can return FILT_PREOP_PENDING and complete operation later in an arbitrary thread context? If synchronization would be required- it may be simply implemented by FiltMngr as synchronous user-mode request are handled: when receiving FILT_PREOP_PENDING, FiltMngr would block that tread waiting for completion by minifilter driver, and when this occurs- unblock that hread and call MJ_CLEANUP in it’s context. Minifilter drivers don’t call MJ_CLEANUP directly, this is always done by FiltMngr so it can handle proper contexts itself?
FS Minifilter dirvers doc doesn’t say about any required thread context when completing (strictly: asking FltMngr for completion) ANY pended operation…
NTFSD is sponsored by OSR
OSR is hiring!! Info at http://www.osr.com/careers
For our schedule of debugging and file system seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer