Previous Next

KeInitializeSpinLock

The KeInitializeSpinLock routine initializes a variable of type KSPIN_LOCK.

VOID 
  KeInitializeSpinLock(
    IN PKSPIN_LOCK  SpinLock
    );

Parameters

SpinLock
Pointer to a spin lock, for which the caller must provide the storage.

Return Value

None

Headers

Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.

Comments

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.

See Also

KeAcquireInStackQueuedSpinLock, KeAcquireInStackQueuedSpinLockAtDpcLevel, KeAcquireSpinLock, KeAcquireSpinLockAtDpcLevel, KeReleaseInStackQueuedSpinLock, KeReleaseInStackQueuedSpinLockFromDpcLevel, KeReleaseSpinLock, KeReleaseSpinLockFromDpcLevel