Hi all
I have a doubt about “CancelIo” request . What we need to do in the driver
level when we receive the request "CancelIo( Handle to the device ) ? can
anybody tell me How this logic works ?
Thanks in advance
srinivas
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
If you queue IRPs, marking the IRPs as pending and returning
STATUS_PENDING from the dispatch routine for those IRPs, then the
IoManager may attempt to perform cancel processing on those IRPs, as a
consequence of thread termination or explicit thread action (CancelIo.)
See the DDK for documentation about IoSetCancelRoutine and related
documentation regarding cancel processing in drivers. The idea is that
your driver is responsible for satisfying the notification that the
originating application no longer is interested in performing the
request(s), typically by dequeueing and completing the indicated IRP(s).
It has to be your driver in the case where you ‘pended’ the IRP, as only
your driver really knows where the IRP is queued, and how to unqueue it
and complete it.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
Srinivasa Rao Deevi
Sent: Saturday, September 08, 2001 9:37 PM
To: NT Developers Interest List
Subject: [ntdev] what we need to do When CancelIo request is
made in Application
Hi all
I have a doubt about “CancelIo” request . What we need to do
in the driver level when we receive the request "CancelIo(
Handle to the device ) ? can anybody tell me How this logic works ?
Thanks in advance
srinivas
You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> I have a doubt about “CancelIo” request . What we need to do in the driver
level when we receive the request "CancelIo( Handle to the device ) ? can
anybody tell me How this logic works ?
You must register a cancel routine in your IRP by IoSetCancelRoutine.
It will be called on thread death or on user-mode CancelIo call.
Read the Microsoft’s notes on IRP cancellation on how to do this correctly
with respect to races with the normal IRP processing - this is a known PITA
for driver developers for years.
The sample in Art Baker’s book contained a bug IIRC.
Max
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com