How to stop and delete my Upperfilter Driver attached to WPDs without cutting off the device

I has a WDF filter driver. And I have put it in Upper Filters (or Lower Filters) Attribute of WPD device’s GUID item in Regedit to filter the I/O operation of WPDs.

BUT now the question is that I need to update my driver without cutting off the device and rebooting system. To achieve the aim, I wish i could stop and delete the driver in system. In fact, I can accept that the driver lose the control of WPDs connected until the WPD is manual unplugged and replugged. I really want to complete the update.

The WDF filter is installed as a PNP. I can freely delete or install the filter driver if I do not have any WPD devices(such as a USB DISK) connected with my PC, when I can see “STOPPED” as result of “sc query MYFILTER” in cmd. As comparation, I can’t do stop/delete operation if I have connected a USB DISK when I can see “RUNNING” and some information like “in use”.

Thanks for your read. I tried anything but fail. I really need some advice! IF you can be interested in my question, I can appendix.

The only way to add or remove a filter driver is to restart the device. You can do that by rebooting, or by restarting the device itself through Device Manager or devcon.

1 Like

@Tim_Roberts said:
The only way to add or remove a filter driver is to restart the device. You can do that by rebooting, or by restarting the device itself through Device Manager or devcon.

Thanks for answering. So there is no way to reinstall my driver if I dont disconnect the WPD though I accept the device is lost by my filter driver?

But why FS filter or NET(by WFP or others) filter and some others can be removed relatively freely? We do not have any methods to do so?

>

But why FS filter or NET(by WFP or others) filter and some others can be
removed relatively freely?

That’s a good question. Basically those ‘frameworks’ allow your
‘mini-driver’ to dynamically attach/detach to the framework without
interrupting the device stack itself. Note that the mini-drivers are not
pnp drivers but instead are legacy style drivers. They communicate with the
api exposed by the framework, and only indirectly with the stack they are
filtering. The framework itself is not unloadable without tearing down the
stack.

You could of course implement your own framework, but that seems like a lot
of work to handle what ought to be a infrequent event, Unless you are
trying to meet some uptime requirement, it hardly seems worth the bother.
Mark Roddy

1 Like

It’s not hard to restart a device. You just need some user-mode help. The user will hardly notice.

1 Like

Sorry for these days not replying. I think i might learn something more. Thanks a lot!!!