filter driver?

I would need to incorporate a proprietary usb protocol to a usb massive storage device, and we would like to write a usb filter driver. This driver would need to

  1. get pid, vid, and serialnumber during the enumeration process.
  2. it should also change the standard enumeration string, for example, when windows usb driver sends 0x800600020000…, we change it a little bit in such a way that 0x800600021200…

I would like to ask whether a usb or a bus filter driver can do this. If so, is there a sample code in WDK that we can follow. Thanks in advance.

xxxxx@hotmail.com wrote:

I would need to incorporate a proprietary usb protocol to a usb massive storage device, and we would like to write a usb filter driver. This driver would need to

  1. get pid, vid, and serialnumber during the enumeration process.

That’s easy. You can fetch the descriptors yourself when your filter is
loaded.

  1. it should also change the standard enumeration string, for example, when windows usb driver sends 0x800600020000…, we change it a little bit in such a way that 0x800600021200…

What do you mean by “standard enumeration string”? Is that a mass
storage class concept? You can certainly intercept all of the URBs
going down to the device, and modify the buffers as they get returned.

I would like to ask whether a usb or a bus filter driver can do this. If so, is there a sample code in WDK that we can follow.

Yes, a device lower filter driver could do this. There are samples of
filter drivers in the WDK; src\general\toaster\kmdf\filter has a good
start. It isn’t a USB device, so you’ll have to add the URB handling.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Tim,

Thanks for the pointer. I would like to have the filter driver attached to a usb device or a usb massive storage device. Is there a sample available? thanks again

What are you trying to do that has led you to the conclusion that you
need to “have the filter driver attached to a usb device or a usb
massive storage device” ?

There are no specific examples in the WDK of usbstor or generic usb
device filters. There are several examples of filter drivers -
toaster, disk, etc. You could implement a disk class lower filter
driver that determined that it was sitting on top of usbstor.

Mark Roddy

On Wed, Dec 1, 2010 at 10:47 PM, wrote:
> Tim,
>
> Thanks for the pointer. I would like to have the filter driver attached to a usb device or a usb massive storage device. Is there a sample available? thanks again
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>