Expand Minimize

KeAcquireInStackQueuedSpinLock routine

The KeAcquireInStackQueuedSpinLock routine acquires a queued spin lock.

Syntax


VOID KeAcquireInStackQueuedSpinLock(
  _Inout_  PKSPIN_LOCK SpinLock,
  _Out_    PKLOCK_QUEUE_HANDLE LockHandle
);

Parameters

SpinLock [in, out]

Specifies the spin lock to acquire. This parameter must have been initialized with KeInitializeSpinLock.

LockHandle [out]

A pointer to a caller-supplied KLOCK_QUEUE_HANDLE variable that the routine can use to return the spin lock queue handle. The caller passes this value to KeReleaseInStackQueuedSpinLock when releasing the lock.

Return value

None

Remarks

KeAcquireInStackQueuedSpinLock acquires a spin lock as a queued spin lock. For more information, see Queued Spin Locks. The caller releases the spin lock by calling the KeReleaseInStackQueuedSpinLock routine.

Like ordinary spin locks, queued spin locks must only be used in very special circumstances. For a description of when to use spin locks, see KeAcquireSpinLock.

This routine raises the IRQL level to DISPATCH_LEVEL when acquiring the spin lock. If the caller is guaranteed to already be running at DISPATCH_LEVEL, it is more efficient to call KeAcquireInStackQueuedSpinLockAtDpcLevel.

The call to KeReleaseInStackQueuedSpinLock that releases the spin lock must occur at IRQL = DISPATCH_LEVEL. This call restores the original IRQL that the operating system saved at the beginning of the KeAcquireInStackQueuedSpinLock call.

Drivers must not combine calls to KeAcquireSpinLock and KeAcquireInStackQueuedSpinLock on the same spin lock. A spin lock must always be acquired or released as either a queued spin lock, or as an ordinary spin lock.

Requirements

Version

Available starting with Windows XP.

Header

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

Library

Ntoskrnl.lib;
Ntdll.lib

DLL

Ntoskrnl.exe;
Ntdll.dll

IRQL

<= DISPATCH_LEVEL (see Remarks section)

DDI compliance rules

MarkingQueuedIrps, QueuedSpinLock, QueuedSpinLockRelease, HwStorPortProhibitedDDIs, QueuedSpinLock(storport), QueuedSpinLockRelease(storport)

See also

KLOCK_QUEUE_HANDLE
KeAcquireSpinLock
KeAcquireInStackQueuedSpinLockAtDpcLevel
KeInitializeSpinLock
KeReleaseInStackQueuedSpinLock

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft