That would be a bad idea. KMDF uses DriverContext in the irp for some
book keeping, I am pretty sure the WDFQUEUE uses the same fields as the
CSQ. It could only come into play for cancellation logic in which case
you are OK b/c you are not setting a KMDF cancel routine, but if all you
are doing is putting it on a csq, why not have a parallel WDFQUEUE and
be done with it?
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@seagate.com
Sent: Tuesday, May 02, 2006 10:34 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Is there an easier way to remove a WDFREQUEST from
a WDFQUEUE?
We had originally extracted the IRP from WDFREQUEST, and then stuffed
the
IRP on a CSQ. This is sounding like we should have remained with CSQs.
Gary G. Little
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Philip D Barila
Sent: Tuesday, May 02, 2006 12:20 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Is there an easier way to remove a WDFREQUEST from
a
WDFQUEUE?
Doron,
What’s the KMDF definition of a “non sequential queue”? I can only find
Sequential, Parallel, and Manual dispatching types. Are you suggesting
that I use WdfIoQueueDispatchParallel with no EvtIoYYY routines?
Remember that I have two queues, a Ready Q, of stuff that’s fully
prepped
for hanging on the hardware, and an In Progress Q, of stuff that’s
already
on the hardware. Both of them were Manual, and that worked reasonably
well for the Ready Q, but has been a pain for the In Progress Q.
Although I haven’t finished the coding, I’m converting the Ready Q to
WdfIoQueueDispatchParallel and have assigned an EvtIoDefault routine for
that Queue, so every time I stick something in there, the Default
routine
will get called ASAP, which will hang it on the hardware, or requeue it
if
there isn’t room on the hardware. No problem there. I’m using that
WDFQUEUE in a manner that it’s intended, and unless I’m misreading the
docs, that should work well for us.
It’s the Q of stuff that’s already on the hardware that is causing
trouble.
I don’t want any automatic dispatching, I really don’t want or need a
callback when something’s been inserted. I do want a Cancellation
callback, and that part already works.
I need to be able to remove an arbitrarily positioned WDFREQUEST from it
more conveniently than FindFirst/FindNext/FindClose, and perhaps your
“non
sequential queue” is good for that. I am not trying to *get* a
WDFREQUEST, I’m trying to remove a specific one. This occurs as a
result
of either an interrupt (command completion) or a timer firing (command
timeout).
Given the above, I’d really appreciate some more detail on “non
sequential
queue”, “shove the request into the queue”, and why I would want to set
a
cancel routine on the request if I’m using the WDFQUEUE (and its
EvtCanceledOnIoQueue callback) to manage cancellation for me?
If the WDFQUEUE can be used the way I described above, it’s apparent
that
there is at least one WDFQUEUE usage model that I don’t grok, which
isn’t
too surprising. I anticipate being educated.
Thanks,
Phil
Philip D. Barila
Seagate Technology LLC
(720) 684-1842
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Monday, May 01, 2006 6:06 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Is there an easier way to remove a WDFREQUEST from
a
WDFQUEUE?
Why do you need a manual queue at all? Just park all of your requeusts
in a non sequential queue. Since you are already tracking the
wdfrequest separately, you just shove the request into the queue,
(optionally) set the cancel routine and then complete the request when
it is done (removing the optional cancel routine first if needed). If
you just need a container of requests that handles cancellation for you,
this is the way to go.
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@seagate.com
Sent: Monday, May 01, 2006 3:45 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Is there an easier way to remove a WDFREQUEST from
a WDFQUEUE?
Peter,
I tried WdfIoQueueFindRequest with the WDFREQUEST I was looking for.
The
req wasn’t found, and I know it hadn’t been cancelled or completed yet.
And it makes sense. The WDFREQUEST parameter to WdfIoQueueFindRequest
is
labeled Previous for a reason, and that is that it’s documented as the
starting point for a search. Although I don’t have a clue how it’s
implemented, it appears from external evidence that
WdfIoQueueFindRequest
assumes that its only usage model is the FindFirst/FindNext/FindClose
model. It doesn’t appear to be capable of returning the Request you
already have.
If I already have a WDFREQUEST, and I know which WDFQUEUE it’s in, the
logical thing to do would be to simply do a
WdfIoQueueRemoveRequest(WDFQUEUE Queue, WDFREQUEST Request), don’t you
think?
Too bad there isn’t one of those. The closest thing to that is
WdfIoQueueRetrieveFoundRequest().
Although calling WdfIoQueueRetrieveFoundRequest() with the WDFREQUEST I
already have appears to work safely in this generation of WDF, the docs
clearly say that you need to do WdfIoQueueFindRequest first, and don’t
forget to dereference the find handle when you are done. Hence my
reluctance to use it, since it adds a lot of code overhead to a very
simple operation.
Peter, I appreciate that “all WDF, all the time” is desirable, but let’s
face an inescapable fact: WDFQUEUEs weren’t designed to be used as
vectors, they were designed primarily as single-ended queues, and using
them that way works very well. Trying to use them as a vector, which is
really what we were doing, is stretching the utility of the WDFQUEUE
beyond where it is equipped to go without serious usability compromises.
So I don’t offer much of a criticism of the WDFQUEUE, it would be nice
if
it were more conveniently used as a vector, but it’s not, and I assume
that wasn’t part of the design requirement.
Allow me to append the caveat that I might be horribly misunderstanding
the WDFQUEUE model badly, but since both you and Doron both have said
“Use
WdfIoQueueFindRequest()”, I doubt that I’m completely out in the weeds,
so
I think my analysis is reasonably sound. Please correct me where
appropriate.
Thanks,
BTW, I implemented the Mark/UnmarkCancelable and EvtRequestCancel
callback
in about 10 lines of real code, plus liberal comments. In our
environment, that was clearly the way to go. If the WDFQUEUE didn’t
have
the ugly overhead involved, it would have been a wash, and I would have
left it the way it was.
Phil
Philip D. Barila
Seagate Technology LLC
(720) 684-1842
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Peter Wieland
Sent: Monday, May 01, 2006 2:59 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Is there an easier way to remove a WDFREQUEST from
a
WDFQUEUE?
WdfIoQueueFindRequest will look for a specific request if you hand it
the reqeust handle. Think of it as referencing the request for your iff
it hasn’t yet been cancelled or completed.
So you don’t need to iterate through the queue. You can make a single
call.
-p
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer