FltCbdqRemoveIo function (fltkernel.h)
FltCbdqRemoveIo removes a particular item from a minifilter driver's callback data queue.
Syntax
PFLT_CALLBACK_DATA FLTAPI FltCbdqRemoveIo(
[in, out] PFLT_CALLBACK_DATA_QUEUE Cbdq,
[in] PFLT_CALLBACK_DATA_QUEUE_IO_CONTEXT Context
);
Parameters
[in, out] Cbdq
Pointer to a cancel-safe callback data queue. This queue must have been initialized by calling FltCbdqInitialize.
[in] Context
Context pointer for the item to be removed. This context is initialized by FltCbdqInsertIo when the I/O request is first inserted in the queue. This parameter is required and must be non-NULL.
Return value
FltCbdqRemoveIo returns a pointer to the callback data structure for the I/O request that was removed from the queue. If no matching I/O request is found or if the queue is empty, FltCbdqRemoveIo returns NULL.
Remarks
FltCbdqRemoveIo removes the callback data (FLT_CALLBACK_DATA) structure for a particular I/O operation from a minifilter driver's callback data queue. FltCbdqRemoveIo can only be used to delete a callback data structure that has a Context structure associated with it. This association is created when the callback data structure is inserted into the callback data queue by FltCbdqInsertIo.
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 FltCbdqInitialize. FltCbdqRemoveIo uses the routines provided in the queue's dispatch table to lock the queue and remove the callback data structure from the queue. The remove operation itself is performed by the minifilter driver's CbdqRemoveIo callback routine.
If the queue is protected by a spin lock rather than a mutex object or resource variable, the caller of FltCbdqRemoveIo can be running at IRQL <= DISPATCH_LEVEL. If a mutex or resource is used, the caller must be running at IRQL <= APC_LEVEL.
There is a potential race between the filter manager removing a cancelled I/O request, and the filter driver removing it because it was completed. It is important to note that the request context remains valid after it is first removed, which will cause a second removal attempt to fail.
Requirements
Requirement | Value |
---|---|
Target Platform | Universal |
Header | fltkernel.h (include Fltkernel.h) |
IRQL | See Remarks section. |