// wdm.h
PIRP IoCsqRemoveIrp(
[in, out] PIO_CSQ Csq,
[in, out] PIO_CSQ_IRP_CONTEXT Context
);
View the official Windows Driver Kit DDI referenceNo description available.
The IoCsqRemoveIrp routine removes a particular IRP from the queue.
Csq [in, out]Pointer to the IO_CSQ structure for the driver's cancel-safe IRP queue. This structure must have been initialized by IoCsqInitialize or IoCsqInitializeEx.
Context [in, out]Pointer to the IO_CSQ_IRP_CONTEXT structure that identifies the IRP to remove. The IO_CSQ_IRP_CONTEXT structure is initialized by IoCsqInsertIrp or IoCsqInsertIrpEx when the IRP is first inserted in the queue.
This routine returns a pointer to the IRP that was removed from the queue, or NULL if that IRP has been canceled.
IoCsqRemoveIrp uses the queue's dispatch routines to remove the IRP. The IoCsqRemoveIrp routine:
Drivers can use the IoCsqRemoveNextIrp routine to remove an IRP that matches a specific criterion. For more information, see Cancel-Safe IRP Queues.
Note that IoCsq*Xxx* routines use the DriverContext[3] member of the IRP to hold IRP context information. Drivers that use these routines to queue IRPs must leave that member unused.
Callers of IoCsqRemoveIrp must be running at an IRQL <= DISPATCH_LEVEL. The driver's callback routines must work correctly at that IRQL.