Question about cancel a irp.

Hello everyone,

I am a newbie in this field.
I am developing a nt4 driver for my PCI card. The card uses DMA to
transfer the data that it received to the host’s memory.
Everytime, my application issued ReadFile command to read in the file.
My question is: Can I cancel the Read Irp after it is issued? At
first, I just want to issue another DeviceIoControl to my driver to
ask it to cancel the read, but it only reaches the driver after the
read irp is completed.
Thanks for any help.

Best regards,
Jingcao mailto:xxxxx@chinaren.com

Sounds like the IRPs are being queued at a higher level, so you see
them serialized.

If your driver supports cancellation of IRPs, you might be able to use
CancelIo() instead of a custom IOCTL. But it doesn’t allow you to target
a particular IRP for cancellation.


Dave Cox
Hewlett-Packard Co.
HPSO/SSMO (Santa Barbara)
https://ecardfile.com/id/Dave+Cox

-----Original Message-----
From: Jingcao Hu [mailto:xxxxx@chinaren.com]
Sent: Sunday, May 14, 2000 8:21 PM
To: NT Developers Interest List
Subject: [ntdev] Question about cancel a irp.

Hello everyone,

I am a newbie in this field.
I am developing a nt4 driver for my PCI card. The card uses DMA to
transfer the data that it received to the host’s memory.
Everytime, my application issued ReadFile command to read in the file.
My question is: Can I cancel the Read Irp after it is issued? At
first, I just want to issue another DeviceIoControl to my driver to
ask it to cancel the read, but it only reaches the driver after the
read irp is completed.
Thanks for any help.

Best regards,
Jingcao mailto:xxxxx@chinaren.com


You are currently subscribed to ntdev as: david_cox2@hp.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

Hello COX,
Thanks a lot for your help. that’s what I am looking for.
Thanks again.

Tuesday, May 16, 2000, 6:27:03 AM, you wrote:

CDHRe> Sounds like the IRPs are being queued at a higher level, so you see
CDHRe> them serialized.

CDHRe> If your driver supports cancellation of IRPs, you might be able to use
CDHRe> CancelIo() instead of a custom IOCTL. But it doesn’t allow you to target
CDHRe> a particular IRP for cancellation.

CDHRe> -----------------------------------------------------------------------
CDHRe> Dave Cox
CDHRe> Hewlett-Packard Co.
CDHRe> HPSO/SSMO (Santa Barbara)
CDHRe> https://ecardfile.com/id/Dave+Cox

CDHRe> -----Original Message-----
CDHRe> From: Jingcao Hu [mailto:xxxxx@chinaren.com]
CDHRe> Sent: Sunday, May 14, 2000 8:21 PM
CDHRe> To: NT Developers Interest List
CDHRe> Subject: [ntdev] Question about cancel a irp.

CDHRe> Hello everyone,

CDHRe> I am a newbie in this field.
CDHRe> I am developing a nt4 driver for my PCI card. The card uses DMA to
CDHRe> transfer the data that it received to the host’s memory.
CDHRe> Everytime, my application issued ReadFile command to read in the file.
CDHRe> My question is: Can I cancel the Read Irp after it is issued? At
CDHRe> first, I just want to issue another DeviceIoControl to my driver to
CDHRe> ask it to cancel the read, but it only reaches the driver after the
CDHRe> read irp is completed.
CDHRe> Thanks for any help.

CDHRe> Best regards,
CDHRe> Jingcao mailto:xxxxx@chinaren.com

CDHRe> —
CDHRe> You are currently subscribed to ntdev as: david_cox2@hp.com
CDHRe> To unsubscribe send a blank email to $subst(‘Email.Unsub’)

CDHRe> —
CDHRe> You are currently subscribed to ntdev as: xxxxx@chinaren.com
CDHRe> To unsubscribe send a blank email to $subst(‘Email.Unsub’)

CDHRe> ________________________
CDHRe> Are you ChinaRen?
CDHRe> ¸ÐÊÜÖйúÈ˵ĵç×ÓÉú»î
CDHRe> http://www.chinaren.com

Best regards,
Jingcao mailto:xxxxx@chinaren.com

> My question is: Can I cancel the Read Irp after it is issued? At

The IRP can be cancelled only if it did not reach the actual device yet and
is
hanging in some queue (StartIo for instance) waiting for device to be free
for
it.
IRPs are cancelled at thread death - all outstanding IRPs issued by the
thread. Cancel an IRP explicitly seems to be not so good idea, though
possible.

Max