Hello everybody,
I am developing a TUN network interface using NDIS Miniport driver. It works, but for the past couple of days, I am trying to resolve the following issue:
The driver is installed using INF file manually.
When I call SetupDiCallClassInstaller(DIF_INSTALLDEVICE, ...)
, it creates the first virtual NIC. So far so good.
After I call SetupDiCallClassInstaller(DIF_INSTALLDEVICE, ...)
next time to create an additional virtual NIC, the previous one is stopped, driver restarted, then started again (along with the newly created one). This closes and invalidates all opened handles to the initial NIC causing the existing tunnel to terminate.