embedinfo <> wrote:
>
>I am new to PC driver development. I would like to write USB packet
>monitoring tool. Based on my reading I have decided to write USB upper
>filter class driver.
Upper filter to which class?
>As a first step I added few DbgPrint messages all over the filter
>function and registered filter as Upper filter class to USB stack.
Do you mean USB class, {36FC9E60-...}? Remember, that class includes host
controllers, hubs, composite devices, and many other devices. Anything
that appears in Device Manager under "Universal Serial Bus controllers".
You're going to be intercepting ALL communications heading into ANY of
those devices.
>But after rebooting machine I just see following IOCTL being called:
>
>"IOCTL_INTERNAL_USB_GET_CONTROLLER_NAME" and some invalid IOCTL with
>hex code ("0x220408")
It's not invalid:
00220408 = IOCTL_USB_GET_NODE_INFORMATION
00220408 = IOCTL_USB_GET_ROOT_HUB_NAME
>I was expecting "IOCTL_INTERNAL_USB_SUBMIT_URB" call which is not
>called at all.
It sounds like you may have intercepted IRP_MJ_DEVICE_CONTROL instead of
IRP_MJ_INTERNAL_DEVICE_CONTROL. Is that possible?
>Can any one tell me if this is the right way to write USB packet
>monitoring tool?
It's one way to do it. Are you aware there are already quite a number of
tools that do this, including some that are free?
--
Tim Roberts,
Providenza & Boekelheide, Inc.