Introduction to File System Filter Drivers
Download EaseFilter Filter Driver SDK Setup File
Download EaseFilter Filter Driver SDK Zip File
Understand EaseFilter Filter Driver SDK Programming
What Is a File System Filter Driver?
A file system filter driver is an optional driver that adds value to or modifies the behavior of a file system. A file system filter driver is a kernel-mode component that runs as part of the Windows executive.
A file system filter driver can filter I/O operations for one or more file systems or file system volumes. Depending on the nature of the driver, filter can mean log, observe, modify, or even prevent. Typical applications for file system filter drivers include antivirus utilities, encryption programs, and hierarchical storage management systems.
File System Filter Drivers Are Not Device Drivers
A device driver is a software component that controls a particular hardware I/O device. For example, a DVD storage driver controls a DVD drive.
In contrast, a file system filter driver works in conjunction with one or more file systems to manage file I/O operations. These operations include creating, opening, closing, and enumerating files and directories; getting and setting file, directory, and volume information; and reading and writing file data. In addition, file system filter drivers must support file system-specific features such as caching, locking, sparse files, disk quotas, compression, security, recoverability, reparse points, and volume mount points.
For more details on the similarities and differences between file system filter drivers and device drivers, see the following:
How File System Filter Drivers Are Similar to Device Drivers
The following subsections describe some of the similarities between file system filter drivers and device drivers in the Microsoft Windows operating system.
Like device drivers, file system filter drivers have DriverEntry, dispatch, and I/O completion routines. They call many of the same kernel-mode routines that device drivers call, and they filter I/O requests for devices (that is, file system volumes) with which they are associated.
Because file system filter drivers and device drivers are part of the I/O system, they both receive I/O request packets(IRPs) and act on them.
Like device drivers, file system filter drivers can also create their own IRPs and send them to lower-level drivers.
Both kinds of drivers can register for notification (by using callback functions) of various system events.
Like device drivers, file system filter drivers can receive Introduction to I/O Control Codes (IOCTLs). However, file system filter drivers can also receive--and define--file system control codes (FSCTLs).
Like device drivers, file system filter drivers can be configured to be loaded at system startup time or to be loaded later, after the system startup process is complete.
How File System Filter Drivers Are Different from Device Drivers
The following subsections describe some of the differences between file system filter drivers and device drivers.
No Power Management
Because file system filter drivers are not device drivers and thus do not control hardware devices directly, they do not receive IRP_MJ_POWER requests. Instead, power IRPs are sent directly to the storage device stack. In rare circumstances, however, file system filter drivers might interfere with power management. For this reason, file system filter drivers should not register dispatch routines for IRP_MJ_POWER in the DriverEntry routine, and they should not call PoXxx routines.
File system filter drivers cannot be Windows Driver Model (WDM) drivers. The Microsoft Windows Driver Model is only for device drivers. For more information about file system driver development in Windows Me, Windows 98, and Windows 95, see the Windows Me Driver Development Kit (DDK).
No AddDevice or StartIo
Because file system filter drivers are not device drivers and thus do not control hardware devices directly, they should not have AddDevice or StartIo routines.
Different Device Objects Created
Although file system filter drivers and device drivers both create device objects, they differ in the number and kinds of device objects that they create.
Device drivers create physical and functional device objects to represent devices. The Plug and Play (PnP) Manager builds and maintains a global device tree that contains all device objects that are created by device drivers. The device objects that file system filter drivers create are not contained in this device tree.
File system filter drivers do not create physical or functional device objects. Instead, they create control device objects and filter device objects. The control device object represents the filter driver to the system and to user-mode applications. The filter device object performs the actual work of filtering a specific file system or volume. A file system filter driver normally creates one control device object and one or more filter device objects.
Because file system filter drivers are not device drivers, they do not perform direct memory access (DMA).
Unlike device filter drivers, which can attach above or below a target device's function driver, file system filter drivers can attach only above a target file system driver. Thus, in device-driver terms, a file system filter driver can be only an upper filter, never a lower filter.
Installing a File System Filter Driver
For Microsoft Windows XP and later operating systems, you should install your file system filter drivers by using an INF file and an installation application. (On Windows 2000 and earlier operating systems, filter drivers were commonly installed by the Service Control Manager.)
In the future, INF-based installation is expected to become a requirement for file system filter drivers for the Windows Hardware Logo Program. Note that "INF-based installation" means only that you will need to use an INF file to copy files and to store information in the registry. You will not be required to install your entire product by using only an INF file, and you will not be required to provide a "right-click install" option for your driver.
This section includes:
Creating an INF File for a File System Filter Driver
Load Order Groups for File System Filter Drivers
File System Filter Driver Classes and Class GUIDs
Using an INF File to Install a File System Filter Driver
Using an INF File to Uninstall a File System Filter Driver