I have a usbhub.sys lower filter driver where I would like to filter URBs and
make changes to them.when I recieve a URB,I want to send my own request down
and on it's return change the URB and send it back.any hints on how I go
about doing this would be welcome

Re: usbhub.sys lower filter driver by Doron

Doron
Fri Sep 17 00:39:03 CDT 2004

allocate your own urb and store the old urb in a context that you will
restore when the request completes. note that the usbhub FDO does not send
the URBs down to its own PDO. It can short circuit the remaining usb
topology and send requests directly the PDO for the root hub. If you want
to modify the URB traffic for your device, create a lower filter for the
class driver sending the URB itself, not the hub that enumerated it.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"shadab" <shadab@discussions.microsoft.com> wrote in message
news:3874EC15-9015-4F7A-AA91-7F85E94D642D@microsoft.com...
> To be more precise,I am trying to intercept all of the
> URB_FUNCTION_SELECT_INTERFACE and the
> URB_FUNCTION_SELECT_CONFIGURATION URBs sent by upper layer drivers to my
> device so that I can change eg. the interface numbers to be sent to my
> device.
> How do I go about it ? Since the size of urbs coming in may be different
> from the what I need to send down etc...
> TIA
> Shadab
>
> "shadab" wrote:
>
>> I have a usbhub.sys lower filter driver where I would like to filter URBs
>> and
>> make changes to them.when I recieve a URB,I want to send my own request
>> down
>> and on it's return change the URB and send it back.any hints on how I go
>> about doing this would be welcome



Re: usbhub.sys lower filter driver by shadab

shadab
Fri Sep 17 03:59:05 CDT 2004

Thanks Doron for ur answer.
My device is a composite device and so usbhub.sys is loaded as a parent
driver for it
in W2K.So let me get this straight :
I receive IOCTL_INTERNAL_USB_SUBMIT_URB
I create a new URB,give it's address in the IRP and in the completion
routine ,copy relevant data from my URB to the original urb ,restore original
urb address in the IRP .
Is this ok ?

"Doron Holan [MS]" wrote:

> allocate your own urb and store the old urb in a context that you will
> restore when the request completes. note that the usbhub FDO does not send
> the URBs down to its own PDO. It can short circuit the remaining usb
> topology and send requests directly the PDO for the root hub. If you want
> to modify the URB traffic for your device, create a lower filter for the
> class driver sending the URB itself, not the hub that enumerated it.
>
> d
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> "shadab" <shadab@discussions.microsoft.com> wrote in message
> news:3874EC15-9015-4F7A-AA91-7F85E94D642D@microsoft.com...
> > To be more precise,I am trying to intercept all of the
> > URB_FUNCTION_SELECT_INTERFACE and the
> > URB_FUNCTION_SELECT_CONFIGURATION URBs sent by upper layer drivers to my
> > device so that I can change eg. the interface numbers to be sent to my
> > device.
> > How do I go about it ? Since the size of urbs coming in may be different
> > from the what I need to send down etc...
> > TIA
> > Shadab
> >
> > "shadab" wrote:
> >
> >> I have a usbhub.sys lower filter driver where I would like to filter URBs
> >> and
> >> make changes to them.when I recieve a URB,I want to send my own request
> >> down
> >> and on it's return change the URB and send it back.any hints on how I go
> >> about doing this would be welcome
>
>
>

Re: usbhub.sys lower filter driver by Doron

Doron
Fri Sep 17 10:05:42 CDT 2004

you don't need to resotre the urb address in the irp because when you
allocate your own urb, you put it into your own stack location. when your
completion routine runs, you need to copy the relevant data out of your URB
and fill in the caller's URB properly.

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"shadab" <shadab@discussions.microsoft.com> wrote in message
news:EACA227D-FA64-4DB3-AFE6-A1B18F82881C@microsoft.com...
> Thanks Doron for ur answer.
> My device is a composite device and so usbhub.sys is loaded as a parent
> driver for it
> in W2K.So let me get this straight :
> I receive IOCTL_INTERNAL_USB_SUBMIT_URB
> I create a new URB,give it's address in the IRP and in the completion
> routine ,copy relevant data from my URB to the original urb ,restore
> original
> urb address in the IRP .
> Is this ok ?
>
> "Doron Holan [MS]" wrote:
>
>> allocate your own urb and store the old urb in a context that you will
>> restore when the request completes. note that the usbhub FDO does not
>> send
>> the URBs down to its own PDO. It can short circuit the remaining usb
>> topology and send requests directly the PDO for the root hub. If you
>> want
>> to modify the URB traffic for your device, create a lower filter for the
>> class driver sending the URB itself, not the hub that enumerated it.
>>
>> d
>>
>> --
>> Please do not send e-mail directly to this alias. this alias is for
>> newsgroup purposes only.
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>>
>> "shadab" <shadab@discussions.microsoft.com> wrote in message
>> news:3874EC15-9015-4F7A-AA91-7F85E94D642D@microsoft.com...
>> > To be more precise,I am trying to intercept all of the
>> > URB_FUNCTION_SELECT_INTERFACE and the
>> > URB_FUNCTION_SELECT_CONFIGURATION URBs sent by upper layer drivers to
>> > my
>> > device so that I can change eg. the interface numbers to be sent to my
>> > device.
>> > How do I go about it ? Since the size of urbs coming in may be
>> > different
>> > from the what I need to send down etc...
>> > TIA
>> > Shadab
>> >
>> > "shadab" wrote:
>> >
>> >> I have a usbhub.sys lower filter driver where I would like to filter
>> >> URBs
>> >> and
>> >> make changes to them.when I recieve a URB,I want to send my own
>> >> request
>> >> down
>> >> and on it's return change the URB and send it back.any hints on how I
>> >> go
>> >> about doing this would be welcome
>>
>>
>>



RE: usbhub.sys lower filter driver by shadab

shadab
Thu Sep 16 08:37:10 CDT 2004

To be more precise,I am trying to intercept all of the
URB_FUNCTION_SELECT_INTERFACE and the
URB_FUNCTION_SELECT_CONFIGURATION URBs sent by upper layer drivers to my
device so that I can change eg. the interface numbers to be sent to my device.
How do I go about it ? Since the size of urbs coming in may be different
from the what I need to send down etc...
TIA
Shadab

"shadab" wrote:

> I have a usbhub.sys lower filter driver where I would like to filter URBs and
> make changes to them.when I recieve a URB,I want to send my own request down
> and on it's return change the URB and send it back.any hints on how I go
> about doing this would be welcome