Re: How to NDIS halt when USB device unplugged by Alireza
Alireza
Wed Mar 03 13:28:11 CST 2004
> BTW, would it be a mistake to call IoAttachDeviceToDeviceStack() in the
NDIS driver after I have a pointer to the USB driver on the USBD stack?
That would allow PNP IRPs to flow from the USB driver to NDIS, but I thought
I saw a list of prohibited calls from NDIS that includes
IoAttachDeviceToDeviceStack().
Yes, that would be a mistake (assuming we are talking about -unified- driver
scheme and you want to do it on the PhysicalDeviceObject or NextDeviceObject
you got by calling NdisMGetDeviceProperty. NDIS has already attached its FDO
(the DeviceObject you get from the same call) to the stack and will send all
the PNP IRPs down as necessary. All you have to do is to use
NextDeviceObject to send your IRPs to.
It is also possible that I did not understand your question! then I
appreciate you tell me what PnP IRPs are you concern about not making it to
the USB device.
-ali
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Eric Hollas" <anonymous@discussions.microsoft.com> wrote in message
news:31370043-917C-47AB-AE96-28F7ACB4A1CA@microsoft.com...
> The reason for the Root enumerated NDIS driver was to leverage a well
tested USB driver which I was reluctant to modify extensively. The NDIS
driver I used was based on Eliyas' NDISWDM to NDISPROT code.
>
> Given the comments from Alireza and Bryan, I think the answer is to fold
the USB code into the NDIS MP driver and alter the INF file to tie it to my
hardware. This will not only eliminate IRP calls, but it will handle the
PNP unload problem I have now with two seperate drivers. Converting the
NDIS MP to an Intermediate Driver would allow me to maintain two seperate
drivers, but at the expense of a lot of code changes. For this version of
the software, I don't have time to fully test all of the changes a
conversion would require.
>
> BTW, would it be a mistake to call IoAttachDeviceToDeviceStack() in the
NDIS driver after I have a pointer to the USB driver on the USBD stack?
That would allow PNP IRPs to flow from the USB driver to NDIS, but I thought
I saw a list of prohibited calls from NDIS that includes
IoAttachDeviceToDeviceStack().
>
> Thanks,
> Eric