CancelIrp

Hi there

  1. Is it possibel for a creator driver of an Irp to cancel it
    (IoCancelIrp) ,while it is submitted to a lower level driver ?

  2. Does TdiBuildxxx sets the InvokeOnCancel on the cancel routine passed
    as parameter

  1. Yes.
  2. See the macros for the TdiBuildXXX routines - your completion handler is
    set as invoke on completion with STATUS_CANCELLED. This is NOT a cancel
    routine, it is a completion routine. You are not involved in the actual
    cancel processing of the request, you will just be notified if and when your
    request is completed, for any reason.

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Zvi Dubitzky
Sent: Wednesday, August 11, 2004 5:27 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] CancelIrp

Hi there

  1. Is it possibel for a creator driver of an Irp to cancel it
    (IoCancelIrp) ,while it is submitted to a lower level driver ?

  2. Does TdiBuildxxx sets the InvokeOnCancel on the cancel routine
    passed as parameter — Questions? First check the Kernel Driver FAQ at
    http://www.osronline.com/article.cfm?id=256 You are currently subscribed to
    ntdev as: xxxxx@hollistech.com To unsubscribe send a blank email to
    xxxxx@lists.osr.com

>1. Is it possibel for a creator driver of an Irp to cancel it (IoCancelIrp)
,while it is submitted to a

lower level driver ?

Surely, but there are no guarantees that the IRP will be really cancelled. The
IRP can be already in the uncancellable state (delivered to hardware).

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

You also need to make sure that in between the time you locate the irp
you want to cancel and the time you call IoCancelIrp that the irp has
not completed on you and the irp you are about to use for IoCancelIrp is
now freed. Walter Oney’s book has a great example on how to safe guard
against this using InterlockedXxx logic.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Wednesday, August 11, 2004 3:55 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] CancelIrp

  1. Is it possibel for a creator driver of an Irp to cancel it
    (IoCancelIrp)
    ,while it is submitted to a
    lower level driver ?

Surely, but there are no guarantees that the IRP will be really
cancelled. The
IRP can be already in the uncancellable state (delivered to hardware).

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com