IoCsqRemoveIrp - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdm.h

PIRP IoCsqRemoveIrp(
  [in, out] PIO_CSQ             Csq,
  [in, out] PIO_CSQ_IRP_CONTEXT Context
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdm-iocsqremoveirp)

IoCsqRemoveIrp function

Description

The IoCsqRemoveIrp routine removes a particular IRP from the queue.

Parameters

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.

Return value

This routine returns a pointer to the IRP that was removed from the queue, or NULL if that IRP has been canceled.

Remarks

IoCsqRemoveIrp uses the queue's dispatch routines to remove the IRP. The IoCsqRemoveIrp routine:

  1. Calls the queue's CsqAcquireLock routine to lock the queue.
  2. Uses the IrpContext parameter to determine which IRP to remove, and calls the queue's CsqRemoveIrp routine to remove that IRP.
  3. Calls the queue's CsqReleaseLock routine to unlock the queue.

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.

See also

CsqAcquireLock

CsqCompleteCanceledIrp

CsqInsertIrp

CsqInsertIrpEx

CsqPeekNextIrp

CsqReleaseLock

CsqRemoveIrp

IO_CSQ

IO_CSQ_IRP_CONTEXT

IoCsqInitialize

IoCsqInitializeEx

IoCsqInsertIrp

IoCsqInsertIrpEx

IoCsqRemoveNextIrp