Write an usb filter driver

Discussion in 'Windows Vista Drivers' started by Starring_Night, Sep 4, 2009.

  1. Hi! I want to write a filter driver to filter and modify the descriptors
    which returns from the usb device to windows OS.
    For example, USB will return Vender ID and Product ID when OS request. I
    want this filter driver get the Vender ID and Product ID, then change the
    values and return them to OS.
    I registered the major function [ IRP_MJ__INTERNAL_DEVICE_CONTROL] and
    checked a UrbHeader function in urb which is
    URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE.
    Then monitor the two descriptor types: USB_DEVICE_DESCRIPTOR_TYPE &
    USB_STRING_DESCRIPTOR_TYPE
    I can get the right descriptors. However, I can't change them.
    For example, I changed them, but the regedit shows the original descriptors.
    I can show the changed descriptors on debug window, but useless for regedit.
    How should I do to catch the right time, get value, then change and return
    to OS finally, whenever OS request for the descriptors?
     
    Starring_Night, Sep 4, 2009
    #1
    1. Advertisements

  2. Starring_Night

    Tim Roberts Guest

    Sorry, that is impossible. The enumeration is done by the USB host
    controller driver. The HCD talks directly to the hardware, and it's the
    HCD that creates the PDO with the device ID. There is no other driver
    below that or between those two steps, so there's no place to insert a
    filter.

    You can change the device descriptor and lie to whatever driver was
    defined, but you cannot change the VID/PID at a point where it affects the
    assignment of a driver.
    Can't be done.
     
    Tim Roberts, Sep 4, 2009
    #2
    1. Advertisements

  3. why do you want to do this?
     
    Doron Holan [MSFT], Sep 8, 2009
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.