KeTestSpinLock function (wdm.h)

The KeTestSpinLock routine tests for the availability of a spin lock.

Syntax

BOOLEAN KeTestSpinLock(
  [in] PKSPIN_LOCK SpinLock
);

Parameters

[in] SpinLock

A pointer to a spin lock. The spin lock must have been initialized by calling KeInitializeSpinLock.

Return value

KeTestSpinLock returns FALSE if the spin lock is currently being held. Otherwise, it returns TRUE.

Remarks

This routine enables the caller that is running at a low IRQL to test the spin lock. If KeTestSpinLock returns TRUE, the caller can try to acquire the spin lock with a high probability of immediate success.

This routine neither raises nor lowers the IRQL, and it never acquires the spin lock.

For more information about spin locks, see Spin Locks.

Requirements

Requirement Value
Minimum supported client Available in Windows Server 2003 and later versions of Windows.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL See Remarks section.
DDI compliance rules HwStorPortProhibitedDDIs(storport)

See also

KeAcquireSpinLock

KeInitializeSpinLock

KeReleaseSpinLock