Re: IRP_MN_SURPRISE_REMOVE
From: Mark Roddy (markr_at_hollistech.com)
Date: 07/28/04
- Next message: vipin: "Re: Collate printing"
- Previous message: sean: "Re: ZwQueryValueKey"
- In reply to: Calvin Guan: "Re: IRP_MN_SURPRISE_REMOVE"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 27 Jul 2004 23:36:12 -0400
I agree with Calvin. Unless you can find a mechanism to convince the bus
driver to believe that the PDO is gone you will have what amounts to a dead
PDO. Virtualization works here: that is turning a function driver for a
hardware device into a bus driver for a virtual bus and enumerating virtual
PDOs on that virtual bus. See toaster for bus driver implementations.
Consider why you want to introduce this level of complexity into your
driver.
.
-- ===================== Mark Roddy Windows 2003/XP/2000 Consulting Hollis Technology Solutions 603-321-1032 www.hollistech.com markr@hollistech.com "Calvin Guan" <cguan@pleasenospam.ati.com> wrote in message news:%23SdV85BdEHA.1384@TK2MSFTNGP10.phx.gbl... > Maybe I didn't make it clear, see comments inline. > > "Alexander Grigoriev" <alegr@earthlink.net> wrote in message > news:O41aBVBdEHA.2408@tk2msftngp13.phx.gbl... > > It's not correct. > > > > When your bus driver doesn't return a PDO in QUERY_DEVICE_RELATIONS, it > > first receives SURPRISE_REMOVAL. Then all appications (and kernel clients) > > get notification for the device removal. They all are supposed to close > all > > handles and release all FILE_OBJECT references. The PDO stack is also > > supposed to cancel all I/O requests on SIRPRISE_REMOVAL (each request > holds > > a FILE_OBJECT reference and the upper DEVICE_OBJECT reference). > > Only when there are no open references to the stack left, it will receive > > IRP_MN_REMOVE_DEVICE. The bus driver is then supposed to delete the PDO. > > This is correct but I didn't see how it's related to my previous post. There > is not problem if the bus driver (assuming it's not written by you or me) > doesn't report the PDO. In such case, the behavior you mentioned above is > expected. > > The OP's question was "to remove device from a IRP_MN_QUERY_DEVICE_RELATIONS > response". I assumed he didn't mean in a BUS_DRIVER because it's absolutely > ok for a bus driver to do so. > > In case of any non-bus driver in the stack doing so, the stack still gets > surprise_remove and remove_dev. But the bus driver will NOT attempt to > delete the PDO at all after SURPRISE_REMOVE/REMOVE_DEV because he has > reported it in the most recent query but someone above just tossed it. > > Quoted from DDK doc: > "If the bus driver reported this device in its most recent response to an > IRP_MN_QUERY_DEVICE_RELATIONS request for BusRelations, the device is still > physically present on the machine. In this case, the bus driver: > a.. Retains the PDO for the device until the device has been physically > removed. " > > You should not keep the PDO after that. If your child device appears > again, > > you should create another PDO for it. > Again, if the bus driver does not report the PDO in the QUERY_RELATIONS. > > >but should not remove lower bus driver's PDOs > >from the list. > > I was trying to explain how bad it would be if someone does so. > > >There is no way to convince a real bus driver to delete and > > recreate the PDO. > This is what I was saying in my previous post. > > > It's not correct. > > What do you see wrong though? > > - > Calvin Guan Software Engineer > ATI Technologies Inc. www.ati.com > >
- Next message: vipin: "Re: Collate printing"
- Previous message: sean: "Re: ZwQueryValueKey"
- In reply to: Calvin Guan: "Re: IRP_MN_SURPRISE_REMOVE"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading