Okay, I think I’ve finally got this through my thick skull.
Given a manual queue populated with WdfRequestForwardToIoQueue, if there is
an EvtIoCanceledOnQueue callback, it is called, the driver owns the request,
and the driver must complete the request. If there is no callback the
request is cancelled and completed by the framework (verified
experimentally).
My problem was that I had a callback which did not complete the request. It
was not clear to me from the documentation that EvtIoCanceledOnQueue is not
just notification–its presence changes the cancellation behavior of the
framework.
I also note that in the Wdf doc section on cancellation, the term “delivered
to the driver” has 2 meanings: ever delivered in the past, and delivered but
not given back. Cancellation has 3 meanings: requested to be cancelled,
marked cancelled by the framework, and marked cancelled and completed by the
framework.
Of course my confusion would have been much less with framework source.
Thanks for clearing things up,
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
Sent: Wednesday, July 18, 2007 8:44 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] How to keep list of active requests in KMDF
We are discussing a manual queue which has been populated with
WdfRequestForwardToIoQueue. The requests have always been previously
presented to the driver.
So, in this scenario, if there is an EvtIoCanceledOnQueue, it is called, the
driver owns the request, and the driver must complete the request.
That is consistent with what I have seen (I had a callback, for the purpose
of debug logging).
What is the behavior in this case if there is no EvtIoCanceledOnQueue
callback? Since the request has been presented, will it be completed, or
will it sit on the manual queue waiting for someone to do something?
Thanks,
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bob Kjelgaard
Sent: Wednesday, July 18, 2007 8:20 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] How to keep list of active requests in KMDF
>
It is my observation that the framework does not complete requests that have
been forwarded to a manual queue when they are cancelled. This differs from
the behavior for queues with requests that have never been delivered to the
driver. Am I wrong? <<
EvtIoCanceledOnQueue is called if it exists and the request has been
presented to the driver.
In all other cases (no callback, never presented) the request is completed
with STATUS_CANCELLED.
>
Assuming that is correct, and if not, I’ve apparently found a horrible bug
in Kmdf, <<
I would most certainly like to know the details of this.
>
Saying that a manual queue gives you cancellation for free (and I believe
I’ve used those very words on this list) implies that you don’t have to do
anything if the request is cancelled while on the queue. <<
You don’t have to do anything to complete the request when it is cancelled
while on the queue unless you want to. You do have to consider in your
rationale for using the queue that the request can be cancelled while on the
queue and thus “disappear” on you. Some people don’t consider that “free”.
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