KeTryToAcquireSpinLockAtDpcLevel - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdm.h

BOOLEAN KeTryToAcquireSpinLockAtDpcLevel(
  [in, out] PKSPIN_LOCK SpinLock
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdm-ketrytoacquirespinlockatdpclevel)

KeTryToAcquireSpinLockAtDpcLevel function

Description

The KeTryToAcquireSpinLockAtDpcLevel routine attempts to acquire a spin lock at DISPATCH_LEVEL.

Parameters

SpinLock [in, out]

Specifies the spin lock to acquire. The spin lock must have already been initialized by KeInitializeSpinLock.

Return value

KeTryToAcquireSpinLockAtDpcLevel returns TRUE if the spin lock has been acquired, and FALSE if the spin lock is already being held and cannot be acquired.

Remarks

If the specified spin lock is not busy, the KeTryToAcquireSpinLockAtDpcLevel routine acquires the spin lock (see KeAcquireSpinLock for details) and returns TRUE. If the spin lock has already been acquired, the routine immediately returns FALSE.

If the spin lock is acquired, the caller can release it by using the KeReleaseSpinLock routine.

If you want the driver to block when it is unable to acquire the spin lock, use KeAcquireSpinLockAtDpcLevel instead.

For more information about spin locks, see Spin Locks.

See also

KeAcquireSpinLock

KeAcquireSpinLockAtDpcLevel

KeInitializeSpinLock

KeReleaseSpinLock