none
[usb]Is there any way to disable a port of a hub in an usb bus filter driver? RRS feed

  • Question

  • Hi,

    I wanna to disable a usb port of a hub in an usb bus filter driver, is there any way?

    What I want is when a forbidden usb device plugged in(e.g. USB wireless card, USB 3G modem, etc), a monitor daemon will command the usb bus filter driver to disable the related port of the hub.

    Thursday, January 9, 2014 4:12 PM

Answers

  • disable is not the right term. this has nothing to do with the physical usb port. you want the software device stack not to start. you can do this either by handling IRP_MN_START_DEVICE and failing it if necessary or allowing the start it to succeed and then failing the stack later with IoInvalidateDeviceState and reporting failed.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, January 10, 2014 12:42 AM

All replies

  • disable is not the right term. this has nothing to do with the physical usb port. you want the software device stack not to start. you can do this either by handling IRP_MN_START_DEVICE and failing it if necessary or allowing the start it to succeed and then failing the stack later with IoInvalidateDeviceState and reporting failed.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, January 10, 2014 12:42 AM
  • Does it work for an already plugged-in usb device?

    I wanna to read some information of a usb device, and then the monitor process can determine whether it is an offending device, and ask the driver to disable it appropriately.

    Friday, January 10, 2014 2:46 AM
  • IoInvalidate device state can fail the stack after it has started. your filter needs to be in the stack. Note that this design has a HUGE flaw...if you let the stack start, the user can do whatever malicious things you want to prevent in that window of time.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, January 10, 2014 3:33 AM