WinFsp.Native
0.1.1
See the version list below for details.
dotnet add package WinFsp.Native --version 0.1.1
NuGet\Install-Package WinFsp.Native -Version 0.1.1
<PackageReference Include="WinFsp.Native" Version="0.1.1" />
<PackageVersion Include="WinFsp.Native" Version="0.1.1" />
<PackageReference Include="WinFsp.Native" />
paket add WinFsp.Native --version 0.1.1
#r "nuget: WinFsp.Native, 0.1.1"
#:package WinFsp.Native@0.1.1
#addin nuget:?package=WinFsp.Native&version=0.1.1
#tool nuget:?package=WinFsp.Native&version=0.1.1
WinFsp.Native
Zero-alloc, AOT-ready WinFsp binding for modern .NET — build user-mode file systems on Windows with native performance.
Why WinFsp.Native?
| WinFsp.Native | Official WinFsp.Net | |
|---|---|---|
| Native AOT | Full support (IsAotCompatible) |
Not compatible (reflection-based) |
| Target | .NET 8+ | .NET Standard 2.0 / .NET Framework 3.5 |
| Hot-path alloc | Zero managed heap allocation | Allocates per callback |
| P/Invoke | [LibraryImport] source generator |
[DllImport] with marshaling |
| Async I/O | ValueTask<T> + STATUS_PENDING |
Synchronous only |
| API style | IFileSystem interface + FileSystemHost |
Inheritance-based FileSystemBase |
| Dependencies | Zero NuGet dependencies | Microsoft.Win32.Registry + System.IO.FileSystem.AccessControl |
Quick Start
dotnet add package WinFsp.Native
using WinFsp.Native;
class MyFs : IFileSystem
{
public bool SynchronousIo => true;
public int GetVolumeInfo(out ulong totalSize, out ulong freeSize, out string volumeLabel)
{
totalSize = 1024 * 1024;
freeSize = 512 * 1024;
volumeLabel = "MyDrive";
return NtStatus.Success;
}
// Implement other IFileSystem methods...
}
// Mount
var host = new FileSystemHost(new MyFs());
host.Mount("Z:");
Two API Levels
High-Level: IFileSystem + FileSystemHost
Implement the IFileSystem interface with familiar .NET types (string, Memory<byte>, ValueTask<T>). The FileSystemHost handles all WinFsp plumbing — mounting, callback dispatch, async STATUS_PENDING, buffer management, and cancellation.
using WinFsp.Native;
// One using gets you everything: IFileSystem, FileSystemHost, NtStatus,
// FspFileInfo, CleanupFlags, CreateOptions, result types, etc.
Low-Level: WinFspFileSystem
Direct function pointer access to all 64 WinFsp callback slots. Full control, zero abstraction overhead.
using WinFsp.Native;
using WinFsp.Native.Interop; // FspVolumeParams, FspFileSystemInterface, etc.
var fs = new WinFspFileSystem();
fs.VolumeParams.SectorSize = 4096;
fs.Interface.Read = &OnRead;
fs.Mount("Z:");
Prerequisites
- Windows 10/11
- WinFsp 2.x installed (with Developer files for building)
- .NET 8.0+ SDK
Project Structure
src/WinFsp.Native/ # The binding library
tests/WinFsp.Native.Tests/ # Integration tests (mounts real WinFsp FS)
examples/HelloFs/ # Minimal read-only file system example
Building
dotnet build
dotnet test
dotnet pack
License
MIT — see LICENSE.
Runtime dependency: WinFsp (GPLv3 with FLOSS exception). WinFsp must be installed on the target machine. This binding library does not redistribute WinFsp binaries.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.2-pre.3 | 63 | 5/3/2026 |
| 0.1.1 | 140 | 4/6/2026 |
| 0.1.0 | 98 | 4/6/2026 |