IoCsqRemoveNextIrp - NtDoc

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

PIRP IoCsqRemoveNextIrp(
  [in, out]      PIO_CSQ Csq,
  [in, optional] PVOID   PeekContext
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

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

IoCsqRemoveNextIrp function

Description

The IoCsqRemoveNextIrp routine removes the next matching IRP in the queue.

Parameters

Csq [in, out]

Pointer to the driver's dispatch table for cancel-safe IRP queues. The dispatch table must be initialized by IoCsqInitialize.

PeekContext [in, optional]

A pointer to a driver-defined context value. IoCsqRemoveNextIrp passes this parameter to the driver's CsqPeekNextIrp routine. For more information, see the following Remarks section.

Return value

This routine returns a pointer to the next matching IRP in the queue, or NULL if no more IRPs are available. The routine only returns IRPs that have not yet been canceled.

Remarks

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

  1. Calls the queue's CsqAcquireLock routine to lock the queue.
  2. Calls the queue's CsqPeekNextIrp routine to find the next matching IRP in the queue. IoCsqRemoveNextIrp passes the value of the PeekContext parameter as the PeekContext parameter of CsqPeekNextIrp. CsqPeekNextIrp returns a pointer to the next matching IRP, or NULL if there is no matching IRP.
  3. If the return value of CsqPeekNextIrp is non-NULL, IoCsqRemoveNextIrp calls the queue's CsqRemoveIrp routine to remove the IRP.
  4. Calls the queue's CsqReleaseLock routine to unlock the queue.

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 IoCsqRemoveNextIrp 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

IoCsqInitialize

IoCsqInitializeEx

IoCsqInsertIrp

IoCsqInsertIrpEx

IoCsqRemoveIrp