About minifilter contexts
A context is a structure that is defined by the minifilter driver and that can be associated with a filter manager object. The filter manager provides support that allows minifilter drivers to associate contexts with objects to preserve state across I/O operations.
Types of contexts
Minifilters can create and set contexts for the following objects:
- Files (Windows Vista and later)
- Stream handles (file objects)
- Transactions (Windows Vista and later)
Volume contexts must be allocated from nonpaged pool. All other context types can be allocated from paged or nonpaged pool.
Filter driver context sample code
See the CTX sample for an example of a minifilter driver that uses contexts.
How to manage contexts
The following sections describe how to manage filter contexts:
- Registering Context Types
- Creating Contexts
- Setting Contexts
- Getting Contexts
- Referencing Contexts
- Releasing Contexts
- Deleting Contexts
- Freeing Contexts
- File System Support for Contexts
- Best Practices
For information regarding the support provided by the filter manager, see Supporting minifilter contexts.