Re: How to NDIS halt when USB device unplugged

From: Alireza Dabagh [MS] (alid_at_online.microsoft.com)
Date: 03/03/04


Date: Wed, 3 Mar 2004 11:28:11 -0800


> 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


Relevant Pages

  • Re: Question about FILE_OBJECT
    ... NDIS IM is a driver that fully conforms to the model, ... I.E. every time they allocated a new context object they ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Running NDISTest on Vista with an NDIS IM Driver
    ... I had a quick look at the ndistest stuff in the WLK1.0c, ... actually some ndis driver in the ... I tried using the version that comes with WLK/DTM on PassThru (NDIS IM ...
    (microsoft.public.development.device.drivers)
  • Re: NDIS functionality details
    ... In my driver I need to decompress compressed video data and provide ... >> NDIS subsystem exports a lot of functions with Ndis* prefix. ... >> DDK says, that there is two ways, one is to copy each packet to driver ...
    (microsoft.public.development.device.drivers)
  • Re: NDIS Intermediate (passthru) communicates with second driver
    ... already occupied by NDIS. ... Now PASSTHRU is an NDIS intermediate driver, ... implements both an NDIS miniport and an NDIS protocol. ... device object via IoCreateDevicein the standard way in your IM. ...
    (microsoft.public.development.device.drivers)
  • Re: Where is Bill Pauls NDIS miniport driver wrapper?
    ... This is a special compatibility module for allowing Windows NDIS ... use of the ndis compat API and can be compiled with a specially ... Contains an .inf file parser graciously provided by Matt Dodd (and ... been tested with exactly three drivers: ...
    (freebsd-questions)