Driver.NET
2.4.0
dotnet add package Driver.NET --version 2.4.0
NuGet\Install-Package Driver.NET -Version 2.4.0
<PackageReference Include="Driver.NET" Version="2.4.0" />
<PackageVersion Include="Driver.NET" Version="2.4.0" />
<PackageReference Include="Driver.NET" />
paket add Driver.NET --version 2.4.0
#r "nuget: Driver.NET, 2.4.0"
#:package Driver.NET@2.4.0
#addin nuget:?package=Driver.NET&version=2.4.0
#tool nuget:?package=Driver.NET&version=2.4.0
Driver.NET

Driver.NET is a powerful, simple and lightweight library used to create services and load/communicate with kernel drivers on Windows.
The solution is split in two libraries:
| Library | Purpose |
|---|---|
Driver.NET |
Create and configure a service in the registry, then load/unload it as a kernel driver (NtLoadDriver / NtUnloadDriver). |
Driver.NET.DeviceIoControl |
Open the symbolic link of a device and send I/O control requests (IOCTL) to the driver behind it. |
Supported frameworks
- .NET 10
- .NET Framework 4.8
Both libraries are Windows-only. Loading and unloading drivers requires an elevated process holding SeLoadDriverPrivilege.
Usage
Send an IOCTL to a device
using Driver.NET.DeviceIoControl;
using var Device = new DeviceIoControl("\\\\.\\MyDevice");
Device.Connect();
if (Device.IsValid)
{
var Request = new MY_REQUEST { Value = 42 };
if (Device.TryIoControl(IOCTL_MY_REQUEST, Request, out MY_RESPONSE Response))
{
// Use the response.
}
}
Create, load and unload a kernel driver service
using Driver.NET.Services;
var Service = WindowsService.FromServiceName("mydriver");
Service.CreateRegistryKey();
Service.WriteRegistryValue("ImagePath", "System32\\drivers\\mydriver.sys");
Service.WriteRegistryValue("Type", 1);
Service.WriteRegistryValue("ErrorControl", 1);
Service.WriteRegistryValue("Start", 1);
Service.WriteRegistryValue("Parameters\\MyCustomParameter", 69);
var KernelService = WindowsServiceKernel.FromService(Service);
var Status = KernelService.TryStartDriver(); // NTSTATUS, 0 on success.
KernelService.TryStopDriver();
Service.DeleteRegistryKey();
A complete example that retrieves the serial number of a disk by talking to the disk.sys driver through \\.\PhysicalDrive0 is available in the repository, in the Driver.NET.Example project.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- No dependencies.
-
net10.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 |
|---|---|---|
| 2.4.0 | 94 | 9/16/2026 |
| 2.3.4 | 366 | 9/7/2025 |
| 2.3.3 | 323 | 5/11/2025 |
| 2.3.2 | 535 | 3/27/2024 |
| 2.3.1 | 824 | 2/21/2023 |
| 2.3.0 | 911 | 2/15/2022 |
| 2.2.3 | 744 | 8/20/2021 |
| 2.2.2 | 862 | 8/11/2021 |
| 2.2.0 | 568 | 8/10/2021 |
| 2.1.0 | 707 | 4/11/2021 |
| 2.0.1 | 632 | 12/28/2020 |
| 2.0.0 | 610 | 12/28/2020 |
| 1.1.1 | 780 | 5/27/2020 |
| 1.1.0 | 694 | 5/25/2020 |
| 1.0.6.4 | 973 | 2/16/2019 |
| 1.0.6.3 | 930 | 2/3/2019 |
| 1.0.6.2 | 919 | 2/1/2019 |
| 1.0.6.1 | 905 | 1/29/2019 |
| 1.0.6 | 929 | 1/29/2019 |
| 1.0.4 | 954 | 12/22/2018 |
Targets .NET 10 and .NET Framework 4.8. The assembly is now marked as Windows-only. Fixes leaked token handles and unmanaged strings when loading/unloading drivers, and NTSTATUS values being read as 64-bit integers.