IoCsqInsertIrp function (wdm.h)
The IoCsqInsertIrp routine inserts an IRP in the driver's cancel-safe IRP queue.
Syntax
void IoCsqInsertIrp(
[in, out] PIO_CSQ Csq,
[in, out] PIRP Irp,
[out, optional] PIO_CSQ_IRP_CONTEXT Context
);
Parameters
[in, out] Csq
Pointer to the IO_CSQ structure for the driver's cancel-safe IRP queue. This structure must have been initialized by IoCsqInitialize or IoCsqInitializeEx.
[in, out] Irp
Pointer to the IRP to be queued.
[out, optional] Context
Pointer to an IO_CSQ_IRP_CONTEXT structure. IoCsqInsertIrp initializes this structure with context information for the inserted IRP. The driver passes this value to IoCsqRemoveIrp to delete the IRP from the queue. Context can be NULL if the driver will not use IoCsqRemoveIrp to remove this IRP from the queue.
Return value
None
Remarks
IoCsqInsertIrp uses the queue's dispatch routines to insert the IRP. The IoCsqInsertIrp routine:
- Calls the queue's CsqAcquireLock routine to lock the queue.
- Calls the queue's CsqInsertIrp routine to insert the IRP.
- Marks the IRP as pending.
- Calls the queue's CsqReleaseLock routine to unlock the queue.
Drivers can also use IoCsqInsertIrpEx to insert an IRP into the queue. For a queue that is specified by IoCsqInitializeEx, IoCsqInsertIrpEx provides additional capabilities. For more information, see Cancel-Safe IRP Queues.
Note that the 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 IoCsqInsertIrp must be running at an IRQL <= DISPATCH_LEVEL. The driver's callback routines must work correctly at that IRQL.