Staying an FS legacy filter driver #376
Replies: 8 comments 1 reply
-
@lundman, does this mean that the current implementation uses an older driver model called "FS legacy filter driver"? If I got this right, do you have any ideas or even plans about porting the driver to the current filter manager model? Quoting: Guidelines for Porting Legacy Filter DriversArticle · 15/12/2021 · 2 contributors Developers are encouraged to port legacy filter drivers to the filter manager model to obtain better functionality for their filter drivers and improve system reliability. Experienced developers should find it relatively easy to port a legacy filter driver to a minifilter driver. Filter driver developers at Microsoft recommend the following approach:
|
Beta Was this translation helpful? Give feedback.
-
I installed latest version of WinBTRFS. Then I tried to compare OpenZFS driver to it and to NTFS driver: $ driverquery | grep -i -e Date -e === -e zfs -e btrfs -e ntfs
Module Name Display Name Driver Type Link Date
============ ====================== ============= ======================
btrfs btrfs Kernel 16/03/2024 02:08:20
Ntfs Ntfs File System
OpenZFS OpenZFS Kernel 01/09/2023 07:49:05 Strangely enough both OpenZFS and WinBTRFS are listed as "Kernel drivers", while NTFS is listed as "File System" drivers. Why is the difference? Then I rechecked list of loaded FS filter drivers:
... and the WinBTRFS driver, Although it seems to be working: ... and WMI recognize the FS type, the
This raises another question – what does OpenZFS for Windows use filter driver for (if any)? |
Beta Was this translation helpful? Give feedback.
-
Ah very interesting - I went with whatever worked at the time, it was a steep learning curve. But if we can figure out how to modernise it, we should do so. |
Beta Was this translation helpful? Give feedback.
-
Having a btrfs tab in the dialog is sexy, we should have that! |
Beta Was this translation helpful? Give feedback.
-
@lundman writes:
Nice to hear. And no wonder – I assume IFS drivers to be among the most complex software parts of the OS. But let me summarize my two questions:
|
Beta Was this translation helpful? Give feedback.
-
I am not sure we should be a filter, since we are presumably at the bottom (top?) of the stack being a filesystem. I could be wrong, but are any other filesystems like fastfat, ntfs, btrfs etc listed with an "altitude" etc? We can in fact change to be "file system" instead of kernel drivers, there is an ENUM near the start of the registration of the driver code in hmm the .inf?. I suspect btrfs went with kernel over filesystem as both btrfs and zfs are more than a filesystem, since we do storage pools etc. |
Beta Was this translation helpful? Give feedback.
-
(as my reply became large, I'm moving it out as a separate comment) @lundman writes:
Thanks. OK, so I take it to be a rather unintentional outcome.
As you see in #376 (comment) above, none. Tried googling: https://nostarch.com/download/EvadingEDR_chapter6.pdf#page=4 ... and it seems that altitude applies only to minifilter drivers. The fully featured FS drivers are the final point in file I/O handling, thus no altitude here, IIUC. On my first sight ZFS formally could be falling into these categories:
But I believe these are FS-agnostic roles, not tied to a specific FS. Thus probably irrelevant to OpenZFS.
Oh, fair enough! I had forgot about the RAID layer and stuff. Thanks again. |
Beta Was this translation helpful? Give feedback.
-
Very interesting, thanks for sharing. It's hard to feel confident with Microsoft knowledge, there are a lot of information, and those in the know seem reluctant to share. |
Beta Was this translation helpful? Give feedback.
-
In one of my comment in #375 (reply in thread) I was surprised to see
<Legacy>
instead ofNum Instances
,Altitude
, andFrame
fields for OpenZFS driver.Then I found FLTMC - Windows CMD - SS64.com page which says:
Altitude
Minifilters are assigned a specific altitude by Microsoft. This will sit within a range that is specific to the function of the minifilter.
e.g. Anti-Virus minifilters are assigned an altitude between 320,000 and 329,999.
and encryption minifilters are assigned an altitude between 140,000 and 149,999.
For file Writes, Altitudes are processed in descending order.
For file Reads, Altitudes are processed in ascending order.
So when writing anti-virus is handled before encryption, but when reading decryption is handled before anti-virus.
Legacy filter drivers do not use the minifilter model, this means they don’t slot into place based on their altitude. For interoperability with legacy filter drivers, the filter manager can attach filter device objects to a file system I/O stack in more than one location [example]. However you should still consider replacing legacy filters with minifilters.
Beta Was this translation helpful? Give feedback.
All reactions