Detachig filter module

Hello everybody. Hello dear Tim_Roberts.

I have writen ndis filter driver, that binded on two ethernet cards with two moduls. I want to detach one of them at run time. I can do it from within another module or from the same module, from inside DeviceIoControl function. How to do it ?. What ndis function let me to detach selected module from module list.

And second question:

How to bind driver to selected network card, if You have two ethernet cards. The INF file instruction lets to bind with all ethernets cards, but not only one.(HKR, Ndi\Interfaces,FilterMediaTipes,”ethernet”

Have you checked the Microsoft samples? I’m told this one is particular valuable: Windows-driver-samples/network/config/bindview at main · microsoft/Windows-driver-samples · GitHub

I meant unloading from the driver module itself or unloading from the second module.

Thanks a lot for the example.

A driver cannot unload itself. Is that what you’re asking?

Yes. Thank you, Mr. Tim Roberts. I'll just remove it from the FilterModuleList from the second module at runtime.