Steve
Wed Aug 29 02:06:02 CDT 2007
Thanks for your reply.
Your answers are very clear and very helpful.
"Doron Holan [MSFT]" wrote:
> who says i have limited patience ;) ? thanks for answering.
>
> d
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> "Walter Oney" <waltoney@oneysoft.com> wrote in message
> news:46D0AA05.EC990A89@oneysoft.com...
> > Steve wrote:
> >
> > I'm going to answer these questions so Doron doesn't have to expend any
> > more of his limited store of patience. Why do you want to do these
> > things? There isn't a DDI that's documented to let you do them, and the
> > fields in data structures that would let you do them are opaque. The
> > reason for both of those is that driver writers almost never need to do
> > them. Specifically:
> >
> >> (1).Is there any way to get all device object in the device object's
> >> stack?
> >
> > Yes, but why do YOU care about this? Diagnostic tools might need this
> > ability, but they can (mostly) rely on the registry to tell them.
> > (UpperFilters and LowerFilters). I didn't publish the source for the
> > DevView utility that shipped with my WDM book because it uses
> > undocumented and therefore fragile kernel calls to do what it does.
> > There is a field in a data structure that could be useful for this
> > purpose, but you can't use it safely from a driver because you can't get
> > access to the synchronization object that's needed to do it safely. I
> > think it's best not to say more about this, since you apparently don't
> > already know which field I'm talking about. The rule is that, if the
> > WDK/DDK doesn't document a particular field, you mustn't use it. And
> > PreFast will flag violations.
> >
> >> (2).I wonder Whether can I call IoCallDriver pass down IRP directly
> >> from
> >> upper filter to lower filter or not?
> >
> > Again, why do you want to do this? You'll bypass the function driver,
> > which may have a very good reason for not forwarding particular IRPs.
> > Not to mention that you can cause a crash at REMOVE_DEVICE time by
> > having an IRP outstanding that a driver in the middle of the stack
> > doesn't know about. Or jump into the middle of a series of operations
> > that the function driver needs to do in an atomic way without
> > interruption.
> >
> > There is a documented method for accomplishing a similar task anyway,
> > using IRP_MN_QUERY_INTERFACE. Your lower filter would handle this
> > request and return a direct-call interface up the stack. The function
> > driver should not be filtering these requests.
> >
> > In my book, I advised people writing USB function drivers to always pass
> > down INTERNAL_DEVICE_CONTROL requests. After writing this response, I
> > now think that's actually a bad idea.
> >
> > --
> > Walter Oney, Consulting and Training
> >
http://www.oneysoft.com
>
>