Expand Minimize

KsRemoveIrpFromCancelableQueue function

The KsRemoveIrpFromCancelableQueue function pops the next noncanceled IRP from the specified queue that can be canceled and removes its cancel status. The function searches the list until an IRP is found that has a cancel routine or until the end of the list is reached. The function minimizes the use of the cancel spin lock by using the provided spin lock to synchronize access in most cases. The function may be called at IRQ level DISPATCH_LEVEL or lower.

Syntax


PIRP KsRemoveIrpFromCancelableQueue(
  _Inout_  PLIST_ENTRY QueueHead,
  _In_     PKSPIN_LOCK SpinLock,
  _In_     KSLIST_ENTRY_LOCATION ListLocation,
  _In_     KSIRP_REMOVAL_OPERATION RemovalOperation
);

Parameters

QueueHead [in, out]

Points to the head of the queue from which to remove the IRP.

SpinLock [in]

Points to driver's spin lock for queue access.

ListLocation [in]

Indicates whether this IRP should come from the beginning or end of the queue.

RemovalOperation [in]

Specifies whether the IRP is removed from the list or just acquired by setting the cancel function to NULL. If it is only acquired, the IRP must be later released with KsReleaseIrpOnCancelableQueue or completely removed with KsRemoveSpecificIrpFromCancelableQueue.

Return value

The KsRemoveIrpFromCancelableQueue function returns the next noncanceled IRP on the list, or it returns NULL if none is found or if an IRP that has not already been acquired cannot be found.

Remarks

These enumerations are used in the previous parameters to control where the IRP is removed from and how.


typedef enum {
    KsListEntryTail,
    KsListEntryHead
} KSLIST_ENTRY_LOCATION;

typedef enum {
    KsAcquireOnly,
    KsAcquireAndRemove
} KSIRP_REMOVAL_OPERATION;
 

Requirements

Header

Ks.h (include Ks.h)

Library

Ks.lib

See also

KsReleaseIrpOnCancelableQueue
KsRemoveSpecificIrpFromCancelableQueue

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft