Export (0) Print
Expand All
Expand Minimize

FltCbdqInsertIo callback function

FltCbdqInsertIo inserts the callback data structure for an I/O operation into a minifilter driver's callback data queue.

Syntax


NTSTATUS FltCbdqInsertIo(
  _Inout_   PFLT_CALLBACK_DATA_QUEUE Cbdq,
  _In_      PFLT_CALLBACK_DATA Cbd,
  _In_opt_  PFLT_CALLBACK_DATA_QUEUE_IO_CONTEXT Context,
  _In_opt_  PVOID InsertContext
);

Parameters

Cbdq [in, out]

Pointer to the caller's cancel-safe callback data queue. This queue must have been initialized by calling FltCbdqInitialize.

Cbd [in]

Pointer to the callback data (FLT_CALLBACK_DATA) structure for the I/O operation to be queued. The operation must be an IRP-based I/O operation.

Context [in, optional]

Caller-supplied variable that receives an opaque context pointer for the I/O request. Minifilter drivers can use this pointer to identify a specific item in the queue so that it can be removed by calling FltCbdqRemoveIo. If the minifilter driver is not required to remove particular I/O requests from the queue, this parameter can be NULL.

InsertContext [in, optional]

Context pointer to be passed to the minifilter driver's CbdqInsertIo callback routine.

Return value

FltCbdqInsertIo returns STATUS_SUCCESS or an appropriate NTSTATUS value such as one of the following:

Return codeDescription
STATUS_PENDING

The callback data structure was inserted into the callback data queue.

STATUS_FLT_CBDQ_DISABLED

The callback data structure was not inserted into the callback data queue because the queue is currently disabled. To reenable the queue, call FltCbdqEnable. This is an error code.

 

Remarks

FltCbdqInsertIo inserts the specified callback data (FLT_CALLBACK_DATA) structure into a minifilter driver's callback data queue.

Minifilter drivers can use the FltCbdqXxx routines to implement a callback data queue for IRP-based I/O operations. By using these routines, minifilter drivers can make their queues cancel-safe; the system transparently handles I/O cancellation for the minifilter drivers.

The FltCbdqXxx routines can only be used for IRP-based I/O operations. To determine whether a given callback data structure represents an IRP-based I/O operation, use the FLT_IS_IRP_OPERATION macro.

A callback data queue is initialized by calling FltCbdqInitialize. FltCbdqInsertIo uses the functions provided in the queue's dispatch table to lock the queue and insert the callback data structure into the queue. The insert operation itself is performed by the queue's CbdqInsertIo routine.

See FltCbdqInitialize for details on how to create a callback data queue. Use FltCbdqRemoveIo to remove a particular I/O request from the queue, or FltCbdqRemoveNextIo to remove the next available I/O request.

If the queue is protected by a spin lock rather than a mutex object or resource variable, the caller of FltCbdqInsertIo can be running at IRQL <= DISPATCH_LEVEL. If a mutex or resource is used, the caller must be running at IRQL <= APC_LEVEL.

Requirements

Header

Fltkernel.h (include Fltkernel.h)

IRQL

See Remarks section.

See also

FLT_CALLBACK_DATA
FLT_CALLBACK_DATA_QUEUE
FLT_IS_IRP_OPERATION
FltCbdqDisable
FltCbdqEnable
FltCbdqInitialize
FltCbdqRemoveIo
FltCbdqRemoveNextIo

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft