This topic has not yet been rated - Rate this topic

IoCsqRemoveIrp routine

The IoCsqRemoveIrp routine removes a particular IRP from the queue.

Syntax

PIRP IoCsqRemoveIrp(
  __inout  PIO_CSQ Csq,
  __inout  PIO_CSQ_IRP_CONTEXT Context
);

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 IoCsqXxx 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.

Requirements

Version

Available in Windows XP and later versions of Windows. Drivers that must also work in Windows 2000 and Windows 98/Me can instead link to Csq.lib to use the routine.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Contained in Ntoskrnl.lib.

IRQL

<= DISPATCH_LEVEL (see Remarks section)

See also

IO_CSQ
IO_CSQ_IRP_CONTEXT
IoCsqInitialize
IoCsqInitializeEx
IoCsqInsertIrp
IoCsqInsertIrpEx
IoCsqRemoveNextIrp
CsqAcquireLock
CsqCompleteCanceledIrp
CsqInsertIrp
CsqInsertIrpEx
CsqPeekNextIrp
CsqReleaseLock
CsqRemoveIrp

 

 

Send comments about this topic to Microsoft

Build date: 4/2/2012

Did you find this helpful?
(1500 characters remaining)