Expand Minimize

KeInitializeSpinLock routine

The KeInitializeSpinLock routine initializes a variable of type KSPIN_LOCK.

Syntax


VOID KeInitializeSpinLock(
  _Out_  PKSPIN_LOCK SpinLock
);

Parameters

SpinLock [out]

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

Return value

None

Remarks

This routine must be called before an initial call to KeAcquireSpinLock, to 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.

For more information about spin locks, see Spin Locks.

Callers of this routine can be running at any IRQL. Usually, a caller is running at IRQL = PASSIVE_LEVEL in an AddDevice routine.

Requirements

Version

Available starting with Windows 2000.

Header

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

Library

Ntoskrnl.lib

IRQL

Any level (see Remarks section)

DDI compliance rules

HwStorPortProhibitedDDIs

See also

KeAcquireInStackQueuedSpinLock
KeAcquireInStackQueuedSpinLockAtDpcLevel
KeAcquireSpinLock
KeAcquireSpinLockAtDpcLevel
KeReleaseInStackQueuedSpinLock
KeReleaseInStackQueuedSpinLockFromDpcLevel
KeReleaseSpinLock
KeReleaseSpinLockFromDpcLevel

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft