Export (0) Print
Expand All
Expand Minimize

IoCsqInitializeEx routine

The IoCsqInitializeEx routine initializes the dispatch table for a cancel-safe IRP queue.

Syntax


NTSTATUS IoCsqInitializeEx(
  _Out_  PIO_CSQ Csq,
  _In_   PIO_CSQ_INSERT_IRP_EX CsqInsertIrp,
  _In_   PIO_CSQ_REMOVE_IRP CsqRemoveIrp,
  _In_   PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp,
  _In_   PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock,
  _In_   PIO_CSQ_RELEASE_LOCK CsqReleaseLock,
  _In_   PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp
);

Parameters

Csq [out]

Pointer to the IO_CSQ structure to be initialized by IoCsqInitializeEx.

CsqInsertIrp [in]

Pointer to the driver-defined CsqInsertIrpEx function for the driver's cancel-safe IRP queue.

CsqRemoveIrp [in]

Pointer to the driver-defined CsqRemoveIrp function for the driver's cancel-safe IRP queue.

CsqPeekNextIrp [in]

Pointer to the driver-defined CsqPeekNextIrp function for the driver's cancel-safe IRP queue.

CsqAcquireLock [in]

Pointer to the driver-defined CsqAcquireLock function for the driver's cancel-safe IRP queue.

CsqReleaseLock [in]

Pointer to the driver-defined CsqReleaseLock function for the driver's cancel-safe IRP queue.

CsqCompleteCanceledIrp [in]

Pointer to the driver-defined CsqCompleteCanceledIrp function for the driver's cancel-safe IRP queue.

Return value

IoCsqInitializeEx returns STATUS_SUCCESS on success, or the appropriate error code on failure.

Remarks

The IoCsqInitialize and IoCsqInitializeEx routines initialize an IO_CSQ structure that describes a driver's cancel-safe IRP queue. You can use IoCsqInitializeEx to specify an IRP queue with extended capabilities instead of one specified by IoCsqInitialize:

  • The driver implements a CsqInsertIrpEx routine rather than a CsqInsertIrp routine. CsqInsertIrpEx takes an additional parameter, InsertContext. When the driver calls IoCsqInsertIrpEx to insert the IRP, it specifies the value that is passed as InsertContext.

  • IoCsqInsertIrpEx returns the return value of CsqInsertIrpEx. Drivers can use the return value to indicate whether an insert operation succeeded or failed.

Otherwise, the effect of IoCsqInitializeEx is identical to that of IoCsqInitialize. 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.

Requirements

Version

Available in Windows Server 2003 and later versions of the Windows operating system. The routine is also available in the Csq.lib library that ships with the Windows Driver Kit (WDK) and the Driver Development Kit (DDK) for Windows Server 2003. Drivers that must also work on Windows XP, 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

Ntoskrnl.lib

IRQL

Any level

See also

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

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft