Expand Minimize

IoAcquireCancelSpinLock routine

The IoAcquireCancelSpinLock routine synchronizes cancelable-state transitions for IRPs in a multiprocessor-safe way.

Syntax


VOID IoAcquireCancelSpinLock(
  _Out_  PKIRQL Irql
);

Parameters

Irql [out]

Pointer to a variable in which to save the current IRQL for a subsequent call to IoReleaseCancelSpinLock. Usually, the Irql is saved on the stack as a local variable.

Return value

None

Remarks

A driver that uses the I/O manager-supplied device queues in the device object must be holding the cancel spin lock whenever it changes the cancelable state of an IRP with IoSetCancelRoutine.

A driver that manages its own IRP queue does not need to hold the cancel spin lock when calling IoSetCancelRoutine.

The holder of the cancel spin lock should release it promptly by calling IoReleaseCancelSpinLock.

A driver-supplied Cancel routine is called with the cancel spin lock held. It must release the cancel spin lock when it has completed the IRP to be canceled.

Requirements

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

<=DISPATCH_LEVEL

DDI compliance rules

CancelSpinLock, CancelSpinlockRelease, SpinLockSafe, CancelSpinLock(storport), HwStorPortProhibitedDDIs, SpinLockSafe(storport)

See also

IoReleaseCancelSpinLock
IoSetCancelRoutine

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft