Correct, the usb stack does a lot of internal optimizations once an IRP
is sent to a hub PDO. You are better off filtering the one device you
want to filter, rather then the entire bus.
d
-----Original Message-----
From: Mark Roddy [mailto:xxxxx@hollistech.com]
Sent: Thursday, July 25, 2002 4:09 AM
To: NT Developers Interest List
Subject: [ntdev] RE: IRP_MJ_INTERNAL_DEVICE_CONTROL not getting called
in Windows XP !
You are a USB controller upper filter. This means you are filtering the
FDO of a USB controller device. This is not sufficient to filter the IO
requests targetted at the PDOs of the USB controller. To filter all of
those PDOs generically you need to write a bus filter driver. The method
for writing a bus filter driver is not documented by Microsoft. The
method is not complicated. However, for USB, the USB stack is rather
complicated, and filtering the PDOs correctly is a bit of a mess.
=====================
Mark Roddy
Windows XP/2000/NT Consultant, Microsoft MVP
Hollis Technology Solutions 603-321-1032
www.hollistech.com
xxxxx@hollistech.com
For Windows Device Driver Training: see www.azius.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Abhijit Mirajkar
Sent: Thursday, July 25, 2002 3:17 AM
To: NT Developers Interest List
Subject: [ntdev] RE: IRP_MJ_INTERNAL_DEVICE_CONTROL not
getting called in Windows XP !
Hi,
Thanks for the reply. I am not exactly sure where my driver
resides, but here is the sequence I used to install my driver
from my application:
SetupOpenInfFile
SetupInstallServicesFromInfSection
SetupDiOpenClassRegKey
SetupInstallFromInfSection
I can see that the name of my filter driver is been added to
“HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\Class{36FC9E
60-C465-11CF-8
056-444553540000}” , with the key “UpperFilters”.
My driver gets called at its ‘AddDevice’ entry point for each
USB device present in the system. Here’s a part of trace of
the Debug output at boot time :
BusUpperFilter: Entered the Driver Entry : BusUpperFilter:
BusUpperFilter: Inside Add filter
BusUpperFilter: AddDevice PDO (0x80f4fc50) FDO (0x80e7af08)
BusUpperFilter: AddDevice: 80e7af08 to 80e3c028->80f4fc50
BusUpperFilter: FilterPnp unknown_pnp_irp IRP:0x80e7ac78
BusUpperFilter: FilterPass
BusUpperFilter: FilterPnp IRP_MN_FILTER_RESOURCE_REQUIREMENTS
IRP:0x80e65e70
BusUpperFilter: FilterPass
BusUpperFilter: FilterPnp IRP_MN_START_DEVICE IRP:0x80e65e70
BusUpperFilter: FilterPnp IRP_MN_QUERY_INTERFACE IRP:0x80e681f8
BusUpperFilter: FilterPass
BusUpperFilter: FilterPnp IRP_MN_QUERY_INTERFACE IRP:0x80e681f8
BusUpperFilter: FilterPass
BusUpperFilter: FilterPnp IRP_MN_QUERY_CAPABILITIES IRP:0x80e65e70
BusUpperFilter: FilterPass
BusUpperFilter: FilterPnp IRP_MN_QUERY_PNP_DEVICE_STATE IRP:0x80e65e70
BusUpperFilter: FilterPass
BusUpperFilter: FilterPnp IRP_MN_QUERY_DEVICE_RELATIONS IRP:0x80e65e70
BusUpperFilter: FilterPass
BusUpperFilter: Inside Add filter
BusUpperFilter: AddDevice PDO (0x80e0f030) FDO (0x80e18d70)
BusUpperFilter: AddDevice: 80e18d70 to 80e85348->80e0f030
BusUpperFilter: FilterPnp unknown_pnp_irp IRP:0x80e65e70
BusUpperFilter: FilterPass
BusUpperFilter: FilterPnp IRP_MN_QUERY_RESOURCE_REQUIREMENTS
IRP:0x80e65e70
BusUpperFilter: FilterPass
BusUpperFilter: FilterPnp IRP_MN_FILTER_RESOURCE_REQUIREMENTS
IRP:0x80e65e70
BusUpperFilter: FilterPass
BusUpperFilter: FilterPnp IRP_MN_START_DEVICE IRP:0x80e65e70
BusUpperFilter: FilterPnp IRP_MN_QUERY_CAPABILITIES IRP:0x80e65e70
BusUpperFilter: FilterPass
BusUpperFilter: FilterPnp IRP_MN_QUERY_PNP_DEVICE_STATE IRP:0x80e65e70
BusUpperFilter: FilterPass
BusUpperFilter: FilterPnp IRP_MN_QUERY_DEVICE_RELATIONS IRP:0x80e65e70
BusUpperFilter: FilterPass
BusUpperFilter: FilterPnp IRP_MN_QUERY_DEVICE_RELATIONS IRP:0x80e62428
BusUpperFilter: FilterPass
BusUpperFilter: FilterPower IRP_MN_START_DEVICE IRP:0x80e77460
BusUpperFilter: FilterPower IRP_MN_REMOVE_DEVICE IRP:0x80e76b88
BusUpperFilter: FilterPass
BusUpperFilter: FilterPass
BusUpperFilter: FilterPass
BusUpperFilter: FilterPass
BusUpperFilter: FilterPass
BusUpperFilter: FilterPass
Please let me know if what I am doing is right, or should I
implement the things in any different way. Thanks,
Regards,
Abhijit
> -----Original Message-----
> From: Doron Holan [mailto:xxxxx@windows.microsoft.com]
> Sent: Wednesday, July 24, 2002 12:13 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: IRP_MJ_INTERNAL_DEVICE_CONTROL not
getting called
> in Windows XP !
>
> Where in the usb bus did you put your filter? On top of the
root hub
> FDO? Or on each PDO that usbhub/usbgccp creates?
>
> D
>
>
> -----Original Message-----
> From: xxxxx@controlnet.co.in [mailto:xxxxx@controlnet.co.in]
> Sent: Wednesday, July 24, 2002 9:00 AM
> To: NT Developers Interest List
> Subject: [ntdev] IRP_MJ_INTERNAL_DEVICE_CONTROL not getting
called in
> Windows XP !
>
> Hi,
>
> I have written one (upper) filter driver for USB Bus in
Windows XP. I
> wish to have a look at URBs getting passed to the bus
driver. However
> my handler for IRP_MJ_INTERNAL_DEVICE_CONTROL doesn’t get called !
>
> In the DriverEntry, I have registered all my handlers as :
>
> UINT iCount;
> for (iCount = 0; iCount < IRP_MJ_MAXIMUM_FUNCTION; ++iCount)
> DriverObject->MajorFunction[iCount] = FilterPass;
>
> DriverObject->MajorFunction[IRP_MJ_POWER] = FilterPower;
> DriverObject->MajorFunction[IRP_MJ_PNP] = FilterPnp;
> DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = FilterWmi;
> DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] =
> FilterInternalIOCTL;
>
> Though ‘FilterPnp’ is getting called, ‘FilterInternalIOCTL’
never gets
> called ! I also watched all IRP_MJ_xxx codes in ‘FilterPass’ (the
> default passthrough routine), but the code
> ‘IRP_MJ_INTERNAL_DEVICE_CONTROL’ doesn’t appear.
>
> Can anybody please help ?
> Thanks,
>
> Regards,
> Abhijit Mirajkar
You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
%%email.unsub%%
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%