You can always put it back into the manual queue. If it is canceled while you have popped it out, it will be completed when you try to reinsert it
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Michael Jones
Sent: Wednesday, February 25, 2009 1:50 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] How to find a particular request in a manual queue
WdfIoQueueRetrieveFoundRequest says that it “delivers a specified
request to the driver, so that the driver can process the request”. I
took that to mean that it removes the request from the queue; I don’t
want to do that until I know if it’s the matching one or not. I suppose
I could re-queue it if it’s not the match, but what happens if that
request is canceled in the brief interval that it is not in the queue?
Being able to call WdfRequestRetrieveInputBuffer (and friends) on the
handle returned by WdfIoQueueFindRequest would be really handy…
–mkj
Doron Holan wrote:
WdfIoQueueRetrieveFoundRequest will convert the handle into a real WDFREQUEST you can touch,
http://msdn.microsoft.com/en-us/library/aa491586.aspx
d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Michael Jones
Sent: Wednesday, February 25, 2009 12:42 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to find a particular request in a manual queue
I seem to have painted myself into a corner. I am porting a legacy
driver to KMDF; the driver provides an IOCTL interface. One of the
IOCTLS is used by the app to create an object (which retains various
state information); the driver returns an ID which the app uses in
subsequent calls.
One of the functions the app can call is to wait for an event to occur;
the object’s state information identifies the event(s) on which to wait,
and the “wait” request gets completed when the hardware signals the
event (this happens via an interrupt, and the request is completed in a
DPC).
The app can also specify a timeout time; if the event does not occur
within before the timer expires, the request is completed with a code
meaning “timeout occurred”.
The state information for the object contains the WDFREQUEST of the
“wait” IOCTL when a wait is in progress. The request is also forwarded
to a manual queue, to handle cancellation. The problem I am having is
that I don’t see how to find that request in the manual queue so I can
remove it when time comes to complete it.
The WdfIoQueueFindRequest method returns a “handle”, but the doc implies
that it’s not the real handle for the request, since you’re only allowed
to do three things with it. Getting the context of the request is not
one of them. The Parameters returned by WdfIoQueueFindRequest do not
contain the IOCTL input buffer, so I can’t match the request I have with
input buffer (which contains the ID of the object).
Any suggestions? Hopefully I am just missing something obvious…
Cheers,
– mkj
//
// Michael K. Jones
// Stone Hill Consulting, LLC
// http://www.stonehill.com
//_______________________________________________
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
–
//
// Michael K. Jones
// Stone Hill Consulting, LLC
// http://www.stonehill.com
//_______________________________________________
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer