// wdm.h
NTSTATUS IoCsqInsertIrpEx(
[in, out] PIO_CSQ Csq,
[in, out] PIRP Irp,
[out, optional] PIO_CSQ_IRP_CONTEXT Context,
[in, optional] PVOID InsertContext
);
View the official Windows Driver Kit DDI referenceNo description available.
The IoCsqInsertIrpEx routine inserts an IRP into the driver's cancel-safe IRP 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.
Irp [in, out]Pointer to the IRP to be queued.
Context [out, optional]Pointer to an IO_CSQ_IRP_CONTEXT structure. IoCsqInsertIrpEx 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.
InsertContext [in, optional]Pointer to a driver-defined context value. This parameter is passed to the driver's CsqInsertIrpEx routine, if it has one. Otherwise, this parameter is ignored.
If the Csq parameter was initialized with IoCsqInitialize, IoCsqInsertIrpEx always returns STATUS_SUCCESS. If Csq was initialized with IoCsqInitializeEx, IoCsqInsertIrpEx returns the value that was returned by the driver's CsqInsertIrpEx routine.
IoCsqInsertIrpEx uses the queue's dispatch routines to insert the IRP. The IoCsqInsertIrpEx routine:
If the IRP to be inserted has already been canceled, IoCsqInsertIrpEx does not attempt to insert the IRP into 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 IoCsqInsertIrpEx must be running at an IRQL <= DISPATCH_LEVEL. The driver's callback routines must work correctly at this IRQL.