That’s a relief, I thought it might be Orful Programmer… - Mike
----- Original Message -----
From: Dan Kyler
To: Windows System Software Devs Interest List
Sent: Friday, September 29, 2006 2:41 PM
Subject: RE: [ntdev] STATUS_TIMEOUT returns no error to app
(PS what’s an OP?)
That would be you: the Original Poster.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mike Kemp
Sent: Friday, September 29, 2006 2:26 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] STATUS_TIMEOUT returns no error to app
Yes, I create an IRP and pass it to the lower level (1394) driver. I wait
for the completion event. Some calls also have a completion routines that
trigger the completion event, some don’t. For unknown reasons sometimes the
lower level driver seems to hang forever. So to be kind to my app I am
timing out and returning an error to the app (all my calls from the app are
synchronous). I’m trying not to get too bogged down at this point with
excessively complex cancellation as I suspect that under most conditions the
lower level driver does not hang, probably only when an earlier action
(probably mine) has upset it. However I am concerned at the asynchronous
MJ_CLEANUP or surprise removal happening during any of these actions, so it
looks like I will have to implement a safer cancellation strategy anyway.
Thanks for the useful comments, Mike (PS what’s an OP?)
----- Original Message -----
From: Dan Kyler
To: Windows System Software Devs Interest List
Sent: Thursday, September 28, 2006 10:33 PM
Subject: RE: [ntdev] STATUS_TIMEOUT returns no error to app
That’s not how I interpreted the original question. Perhaps I read more
into it than was there, but I assumed he was holding the IRP from above and
had created his own IRP(s) to pass down to service that request.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mark Roddy
Sent: Thursday, September 28, 2006 2:54 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] STATUS_TIMEOUT returns no error to app
Actually I just reread the OP’s post and it seems that he wants to cancel an
IRP that he does not own and does not have a safe reference to. Specifically
I think he has called IoCallDriver on an IRP he received from above, is
waiting (probably synchronously in his dispatch routine, which is another
problem) and has timed out waiting for completion and would like to call
IoCancelIrp on the IRP he doesn’t own as he has called IoCallDriver on it
and he did not create it.
This is the ‘can I call IoCancelIrp on an IRP I did not create’ problem. I
think that the answer is ‘not safely unless he can guarantee that the IRP in
question has not been completed’.
I hate this sort of design. The originator of the IO request ought to be the
agent responsible for deciding what ‘too long to wait is’. The OP can solve
this problem by having a completion handler for the IRP and a
synchronization mechanism between his completion handler and his dispatch
routine that allows him to safely call IoCancelIrp.
=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dan Kyler
Sent: Thursday, September 28, 2006 2:43 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] STATUS_TIMEOUT returns no error to app
Ah. Gotcha. I was thinking in terms of the design of my driver which
may cancel IRPs sent to a lower level driver, which doesn’t really
have this issue. I guess I was thinking there was no race condition,
when in fact I am handling the race condition.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bob Kjelgaard
Sent: Thursday, September 28, 2006 12:13 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] STATUS_TIMEOUT returns no error to app
Huh? As I understand the OP’s situation, it is not his driver that
owns the IRP to be cancelled. What race condition exists in his
driver?
How about the one between his calling IoCancelIrp in arbitrary thread
context, and his completion routine for that same IRP in another
arbitrary context?
If he’s just timed out a wait at passive level, he could be swapped,
the IRP completed on another thread, and a now-invalid PIRP gets
passed to IoCancelIrp (just one example).
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
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