WinFsp is a set of software components for Windows computers that allows the creation of user mode file systems. In this sense it is similar to FUSE (Filesystem in Userspace), which provides the same functionality on UNIX-like computers.
Interesting project. They also provide details on how it works:
WinFsp consists of a kernel mode FSD (File System Driver) and a user mode DLL (Dynamic Link Library). The FSD interfaces with NTOS (the Windows kernel) and handles all interactions necessary to present itself as a file system driver to NTOS. The DLL interfaces with the FSD and presents an easy to use API for creating user mode file systems.
It’s open source, using the AGPLv3 license.
It seems the Windows Subsystem for Linux is making great strides. I wonder if they could support FUSE with little effort?
Hello. I am the original author of WinFsp. WinFsp has a native API, but it also supports the FUSE 2.8 (high-level) API.
Bill Zissimopoulos
billziss,
Hello Bill! It’s nice to hear from the author. Way back in XP I also worked on NT file systems. I was kind of a rogue and used mingw instead of the MS DDK
I think this project has lots of potential, the previous contenders haven’t made it very far…
http://fuse.996288.n3.nabble.com/FUSE-for-Windows-td7788.html
But if this can deliver then having FUSE on windows fills in the missing gap for portable file systems and I can already think of many uses for it. I have a project in mind and I’m looking forward to giving this a shot,
Excellent. Let me know if I can help. If you decide to ahead and have questions I will be happy to try to answer them at this google group:
https://groups.google.com/forum/#!forum/winfsp
billziss,
Thank you. I’m developing a backup system but it’s just a standalone app and I’d like for it to be integrated as a native FS. I’ve tried using Microsoft’s native WebDAV support, which has the benefit of being fairly trivial and would have worked fine except I’ve found windows support for it to be infuriatingly inconsistent and buggy between windows versions. Authentication works differently on certain windows editions, some hardcode port 80, which may be used by another service, etc.
I’ve seen others emulating SMB, but what a headache
Fuse for windows would be perfect, really. So it’s exciting but I’m not sure when I’ll get to it, for me this falls into the unpaid work category, I guess it might for you too.
The FS driver I wrote back in the day could handle I/O requests but didn’t implement memory mapped IO blocks, which as I recall was required by notepad. It makes me curious how FUSE handles memory mapped IO. Is there some kind of block caching/syncing policy to make memory mapped IO work?
Edited 2016-07-24 20:49 UTC
To clarify WinFsp implements FUSE as a compatibility layer over its own API. I do not know the details of how FUSE implements memory mapped I/O on Linux or OSX, but here is a very simplified overview of how it is done by Windows FSD’s and WinFsp.
Broadly speaking there are two kinds of read/write requests in Windows: cached requests and non-cached requests. Let us assume that the FSD receives a cached read request. This will be routed to the NT cache manager (Cc), which will try to satisfy it by doing a straight memory copy from the Cc’s memory into the calling process address space. Now if that memory is not present it will page fault and the memory manager (MM) will eventually send a recursive read to the FSD and mark it as “PagingIo”. At this point the FSD is supposed to go to its real storage (the disk, the network, the user mode file system) and try to satisfy that request.
Memory mapped I/O in Windows is simply I/O that is marked as PagingIo. In principle the FSD does not differentiate between PagingIo that is originated through the Cc or a memory mapped file.
Bill
billziss,
Thanks for answering. There’s a lot I’ve forgotten, it’s hard to believe that it’s been a decade.
I see the webpage says only windows 8+ are tested. It happens I’m working with windows 7, and it’s not letting me install. It always fails at the “Status: Starting services” phase: “Service “WinFsp.Launcher’ (WinFsp.Launcher) failed to start. Verify that you have sufficient privileges to start system services.”
This was launched as administrator and I approved the UAC prompt to allow the Navimatics Corporation verified package to run.
Event viewer shows error 1920.
Anyways I’ll continue this on your google groups, I’ll have to create an account there first.
This looks very interesting. Is NFS suported?
WinFsp just provides the means to create a file system in user mode. You could use it to create an NFS client if you wanted. I have been toying with this idea although I don’t think I will have the time for it.
Here is an interesting project in case someone else thinks it would be cool to have an open source NFS client for Windows:
https://github.com/sahlberg/libnfs
“kernel mode FSD”… something which you would never be able to install on a Windows PC in production these days without being in development mode. They even mention this “bcdedit.exe -set testsigning” is the command used to enable it.
kernel mode FSDs require Microsoft to bless them… which costs a ton of money for a code review … and even then they’ll probably turn you down.
Edited 2016-07-21 13:27 UTC
That makes perfect sense to me. For those few people that would need/want this it isn’t a big burden to say “okay, I am going to trust a major component on my system to be unverified” by running 1 simple command as an admin. For everyone else there shouldn’t be a reason to ever be able to do that
That assumes Microsoft obeys my instructions forever. Given the way auto update settings mysteriously keep getting reset on Windows 8.1 systems in order to push 10, I’d not trust them not to revoke my trust, if you get my drift.
avgalen,
There are a couple serious issues with it. For starters you’ll be punished for using test mode:
https://www.reddit.com/r/survivetheculling/comments/498q3p/eac_drive…
Then there are the security implications. Just because I want to run my own driver doesn’t mean I want to allow all unsigned drivers, this is really pathetic on microsoft’s part. A far better solution would be to allow owners to set their own certificates in their own kernel.
Also, just because a driver has been signed under an MS approved CA chain doesn’t mean it’s safe. A hacker can buy an MS code signing key, some owners might want to further restrict the drivers allowed to run their computer, yet we’re not allowed to load a more restrictive & trustworthy CA.
Back when this all began and I was personally developing windows drivers, a tool was released and legitimately signed no less to allow owners to control their own chain of trust, yet every time the tool was released, windows update disabled the tool once again revoking owner control. It became clear that locking owners out was a goal rather than a side effect, and that’s why I abandoned windows kernel development.
I am pretty sure you can only buy such a key after going through a procedure that would make you give up your identity. Trying this approach to hack peoples pc would be extremely difficult, expensive and would make it easy to get you arrested.
Driver signing is making hobby development like this hard and expensive. And with every new Windows version they add more hoops to jump through (secure boot, EV-certificates). There is a reason you see much more development like this on Linux than on Windows. Not a happy reason as you have also experienced
avgalen,
http://arstechnica.com/security/2014/02/in-the-wild-phony-ssl-certi…
http://arstechnica.com/security/2012/06/flame-malware-was-signed-by…
http://www.securityweek.com/microsoft-blacklists-fake-windows-live-…
These are high profile forgeries, but impersonating small low tech companies is equally effective and far less likely to be caught.
Edit: You may not even have to generate a fraudulent certificate if you can find vulnerabilities in legitimate drivers that are already signed.
Edited 2016-07-22 11:19 UTC
Of course. That’s what proponents of greater corporate control do. It doesn’t affect them, so screw you! That’s their argument for more restrictions in a nutshell.
Yes, nothing says “screw you” like providing a helpful workaround.
I don’t like greater corporate control in general but in this case it seems the benefits for the masses outweigh the slight inconvenience of the few.
Edited 2016-07-22 20:28 UTC
avgalen,
I don’t think this touches on the root of the issue: Nobody’s arguing against the benefits, but there’s no reason that those benefits have to be disabled on FOSS developer machines. This doesn’t help anyone. You’ve made it very clear that the needs of the few don’t matter to you, and I guess if that’s the way you feel, then Q.E.D. But would you at least be able to admit that MS could handle it better if it wanted to?
Edited 2016-07-22 23:16 UTC
I actually did admit that MS could handle it better and asked you if you had talked with them about your ideas.
avgalen,
Not only didn’t microsoft do this, they banned tools that did. Since then they’ve become even less neutral with windows 8 by adding restrictions in userspace too. IMHO things are getting worse on that ship rather than better.
Edited 2016-07-25 21:26 UTC
Listen, your beef is with Microsoft, not with me. I am only trying to help. If you want to do kernel level development on a shared box you didn’t have to use a certificate but since Vista/7 on 64bit you have to. That is just the way it is. Now if you don’t like that: Take it up with Microsoft and discuss your alternative idea.
I understand that you would like to run your own code on your own computers and it sucks that there are disadvantages to that, but they CAN be sidestepped. Ever heard of DSEFix (still seems to work: http://www.unknowncheats.me/forum/dayz-sa/140652-dsefix-disable-dse…). Or just get a certificate?
But in general you shouldn’t let your mom run a Windows Insider build (I learned this the hard way), and you shouldn’t let your child be gaming on a machine with modified drivers. We know that Windows is not a great platform of this kind of tweaking while still expecting everything else to work normally.
I am the victim of a similar limitation by Microsoft. I started to use Native Boot (booting from a VHD-file without using virtualization) in the Windows 8 era when the “you cannot upgrade an OS that is installed in a VHD” limitation wasn’t documented yet. Upgrading to 8.1 required a hack (upgrading the VHD in HyperV) and upgrading to 10 required that hack again, but that was supposed to be the final version…and then 1511 and 1607 came and require an upgrade procedure for an update. This means my whole company, 50-100 laptops, rely on this hack to receive upgrades and now even some updates. So I know what it is like to be a minority….you just have to keep finding the right people inside Microsoft and try to convince them of a hack/workaround. It seems that after years I have finally been able to do that and 1607 should be my last painful upgrade.
These are the negatives of closed source, outside controlled software. The positives so greatly outweigh these negatives that I just accept and adapt to it.
avgalan,
IMHO that’s a very short sighted view, I want to encourage my kids to understand that that technology is not some kind of black magic. No, it’s people like me who program it and make it useful. Rather than being shamed and shielding them from internals, I think we should be exposing them to it. That’s how kids of my generation learned, and I was very fortunate that the internals were accessible in my time. These days mainstream platforms are all about taking away control, which I find to be a shame. And at least I know what my code does, which is more than anyone can say about the signed code shipping out of microsoft.
It doesn’t seem like there’s much possibility of agreement here, so let’s agree to disagree.
Edited 2016-07-26 15:15 UTC
Hi. Just to clarify that the installer available at http://www.secfs.net/winfsp/download/ contains a signed driver. You do not need to enable testsigning on Windows in order to run it.
Post likes these …. cannot upvote anymore…. Thumbs up anyway!
This sounds like it would go well with ReactOS.