IoAcquireCancelSpinLock function (wdm.h)
The IoAcquireCancelSpinLock routine synchronizes cancelable-state transitions for IRPs in a multiprocessor-safe way.
Syntax
void IoAcquireCancelSpinLock(
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
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 |
Header | wdm.h |
IRQL | <=DISPATCH_LEVEL |
DDI compliance rules | CancelSpinLock(storport), CancelSpinLock(wdm), CancelSpinlockRelease(wdm), HwStorPortProhibitedDDIs(storport), SpinLockSafe(storport), SpinLockSafe(wdm) |