Platform:Windows/Minifilter drivers
File system minifilter drivers of Windows (Filter Manager, FLTMGR.SYS): how to recognise one, the FLT_REGISTRATION and FLT_OPERATION_REGISTRATION tables that list its callbacks, and the INF keys (altitude, load order group) that place it in the filter stack.
Recognising a minifilter
A minifilter is a kernel driver (Platform:Windows/Kernel drivers, Format:PE (Portable Executable)) that does not set MajorFunction itself but registers a table with the Filter Manager. In the Microsoft nullFilter sample, DriverEntry calls FltRegisterFilter(DriverObject, &FilterRegistration, &FilterHandle) and then FltStartFiltering(FilterHandle); on failure of the second call it calls FltUnregisterFilter. So imports of FltRegisterFilter and FltStartFiltering from FLTMGR.SYS identify one, and the first argument after the driver object is a pointer to a FLT_REGISTRATION in read-only data (the sample declares it CONST). Its INF declares Dependencies = "FltMgr" (Format:Windows driver INF).
Fact: Fact:Windows/identification/Minifilter by FltRegisterFilter.
FLT_REGISTRATION
First member Size is sizeof(FLT_REGISTRATION) and the second Version is the FLT_REGISTRATION_VERSION constant, so the first dword of the table identifies the header generation: Version 0x0200 (original), 0x0201, 0x0202 (Vista and later headers, the default when the header is built for Longhorn or later) and 0x0203 are defined. The table is followed by callback pointers; the two trailing members exist only in the Longhorn layout. See Fact:Windows/struct/FLT REGISTRATION x64 and Fact:Windows/enum/FLT REGISTRATION VERSION (offsets computed from the ReactOS re-implementation of fltkernel.h, not checked on a binary).
The pointer to OperationRegistration leads to an array of FLT_OPERATION_REGISTRATION terminated by an entry whose MajorFunction is IRP_MJ_OPERATION_END (0x80): Fact:Windows/struct/FLT OPERATION REGISTRATION x64. Each entry names an IRP_MJ_* code, flags (SKIP_PAGING_IO 1, SKIP_CACHED_IO 2, SKIP_NON_DASD_IO 4) and the pre- and post-operation callbacks: that array is the minifilter's equivalent of the MajorFunction table and the first thing to recover.
Altitude and load order in the INF
In the nullFilter INF the service has ServiceType = 2 (SERVICE_FILE_SYSTEM_DRIVER), LoadOrderGroup = "FSFilter Activity Monitor", and registry values under Instances: DefaultInstance, and per instance an Altitude string ("370020" in the sample) and Flags (0x1, suppress automatic attachments). The altitude decides the position among filters; it is the best static hint of what kind of filter a driver is (the load order group names the class: activity monitor, anti-virus, encryption and so on). Unverified: the full list of group names and altitude ranges; read Microsoft's allocated-altitude documentation.