Based on your request, it seems you are encountering a persistent WinDivert error where the driver installation fails, and the system demands a restart (often caused by a "System Restart Pending" state in Windows).
return SystemState.Clean;
The “WinDivert driver cannot be installed” error is annoying, but it’s Windows trying to protect you from unsigned or stale drivers. In 90% of cases, solves it instantly. Based on your request, it seems you are
if (key != null) return SystemState.RestartRequired; Based on your request
For most people, will solve it. If it keeps happening, follow steps 2–5. For most people
. This is common with VPNs (like X-VPN), specialized firewalls, network monitoring tools, and certain gaming software. Stack Overflow
Only do this if the problem persists and you trust the source of WinDivert.