The KeInitializeSpinLock routine initializes a variable of type KSPIN_LOCK.
VOID
KeInitializeSpinLock(
IN PKSPIN_LOCK SpinLock
);
None
Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.
This routine must be called before an initial call to KeAcquireSpinLock, KeAcquireInStackQueuedSpinLock, or to any other support routine that requires a spin lock as an argument.
Storage for a spin lock object must be resident: in the device extension of a driver-created device object, in the controller extension of a driver-created controller object, or in nonpaged pool allocated by the caller.
Callers of this routine can be running at any IRQL. Usually, a caller is running at IRQL = PASSIVE_LEVEL in an AddDevice routine.
KeAcquireInStackQueuedSpinLock, KeAcquireInStackQueuedSpinLockAtDpcLevel, KeAcquireSpinLock, KeAcquireSpinLockAtDpcLevel, KeReleaseInStackQueuedSpinLock, KeReleaseInStackQueuedSpinLockFromDpcLevel, KeReleaseSpinLock, KeReleaseSpinLockFromDpcLevel