In some cases the Portmaster will fail to restart, because the Portmaster Kernel Extensions cannot be loaded and returns the error code
0x422. This stems from a known issue in Windows, where system services are not completely removed when something is monitoring the system services. When the Portmaster restarts, it is then unable to initialize the Kernel Extension, because the system thinks it is still unloading.
If you experience this issue, please follow this workaround:
Quoting from https://stackoverflow.com/a/20565337
There may be several causes which lead to the service being stuck in “marked for deletion”.
1. SysInternals’ Process Explorer is opened. Closing it should lead to automatic removal of the service.
3. Microsoft Management Console (MMC) is opened. To ensure all instances are closed, run
taskkill /F /IM mmc.exe.
4. Services console is opened. This is the same as the previous point, since Services console is hosted by MMC.
5. Event Viewer is opened. Again, this is the same as the third point.
7. Someone else is logged into the server and has one of the previously mentioned applications opened.
8. An instance of Visual Studio used to debug the service is open.