Before doing complex troubleshooting, restart your PC. This clears the system memory and releases any active locks on old driver files.
Create an exclusion for your application's folder in your antivirus settings Memory Integrity Windows Security
catch (WinDivertException ex) when (ex.ErrorCode == 5) // ERROR_ACCESS_DENIED
If you are using an older tool or a custom-compiled version of WinDivert, Windows 10 and Windows 11 will block it by default.
Now that we understand the potential causes, let's work through the solutions, from the simplest and least intrusive to the most effective.
The system often triggers this alert when an older version of the driver is still locked in the system's memory or has a conflicting registry path. 🛠️ How to Fix the WinDivert Driver Error
However, users frequently encounter the error:
Press , type regedit , and press Enter to open the Registry Editor.
A previous session of your program closed improperly, leaving the driver locked in Windows memory.
If you've tried all the above methods and the error persists, consider these more advanced possibilities:
If you are using a niche, customized, or older version of WinDivert that lacks an official digital signature, Windows will block it at the kernel level. You can temporarily disable this enforcement to test if it solves the issue.
Open regedit and navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinDivert . Right-click and the WinDivert folder.
: Some users have reported this error in relation to WMI (Windows Management Instrumentation) corruption. Tools like the Microsoft Activation Script (MAS)
// Log error, assume clean if check fails to prevent blocking user
This is the number one cause of the error. Starting with Windows Vista 64-bit and strictly enforced in Windows 10 and 11, Microsoft requires all kernel-mode drivers to have a . This signature is a digital "stamp of approval" that verifies the publisher's identity and that the driver hasn't been tampered with.
Graceful Driver State Manager Target Scenario: Handling the "System Restart Pending" error (ERROR_ACCESS_DENIED / 0x5) during WinDivert installation.
Open the Windows Registry Editor by pressing Win + R , typing regedit , and hitting Enter .