OpenVPN / tap-windows6

Windows TAP driver (NDIS 6)
Other
794 stars 237 forks source link

Fix incomplete old driver removal #135

Closed lstipakov closed 4 years ago

lstipakov commented 4 years ago

This should fix https://github.com/OpenVPN/tap-windows6/issues/129.

becm commented 4 years ago

It seems due to no adapters being in use, UpdateDriverForPlugAndPlayDevices() does not request a reboot. Adapters should have already switched over to the new driver when InstallDrivers() returns.

This should allow calling RemoveDrivers() after InstallDrivers() to also remove the now no longer locked previous driver version. Without a block/check for the newly installed driver this approach can only be used when an adapter holds a lock on the correct (new) driver: