Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Could I uninstall a function device from filter driver

Yansheng_YuYansheng_Yu Member Posts: 7
As I could uninstall a device from Device Manager via right click the device item on device list. then it will remove and uninstall the device instance.

I am wondering if I could do the same thing in the device filter driver


I write a filter driver for usb class, the driver could then filter a usb function device, I return a failure status when IRP_MN_start_device . After a while, PNP Manager issue a IRP_MN_REMOVE_DEVICE.

However, the function device is only disabled(start failed with a exclamation mark), my question is that possible to make it disappeared from Device Manager via the filter driver code? (maybe remove the device node? send IRP?)

Comments

  • Mark_RoddyMark_Roddy Member - All Emails Posts: 4,552

    You have to filter the bus driver to control the presentation of physical device objects on a 'bus'. For USB that means filtering the USB controllers.

  • Doron_HolanDoron_Holan Member - All Emails Posts: 10,714
    There are two kinds of disappear. As mark describes you can filter the bus and prevent the device from ever being enumerated (no small task). The second is you can mark the device as hidden/don’t show in UI and it is only shown in device manager when the user selects show hidden devices. For don’t show in UI the device must be successfully started though, which your filter is preventing.
    d
  • Yansheng_YuYansheng_Yu Member Posts: 7
    :) Thanks for comments!it is helpful.
    To make my understanding correctly.:
    it is not a good/graceful way to remove a physical device from function filter driver.
    it is better to remove it from bus/bus filter driver.

    the fuction filter driver may failed the device start.so, mark it as hidden device may not taking effect.

    I will look into the both cases.

    thanks again
  • Doron_HolanDoron_Holan Member - All Emails Posts: 10,714

    What bigger problem are you trying to solve?

    The device !'ed out in device manager is not a problem. It is a power tool that few users use. It is the simplest solution. Writing a bus filter is no small task and KMDF will provide little help.

    d
  • Yansheng_YuYansheng_Yu Member Posts: 7
    not a big task :D ,I had wrote the bus driver at this moment,and Adding a little more code to filter my devices will finish my target
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Writing WDF Drivers 12 September 2022 Live, Online
Internals & Software Drivers 23 October 2022 Live, Online
Kernel Debugging 14 November 2022 Live, Online
Developing Minifilters 5 December 2022 Live, Online