EN
Este contenido no se encuentra disponible en su idioma, pero aquí tiene la versión en inglés.

NdisDprAcquireSpinLock function

The NdisDprAcquireSpinLock function acquires a spin lock so the caller can synchronize access to resources shared among non-ISR driver functions in a multiprocessor-safe way.

Syntax


VOID NdisDprAcquireSpinLock(
  _In_  PNDIS_SPIN_LOCK SpinLock
);

Parameters

SpinLock [in]

Pointer to an opaque spin lock, already initialized by the caller.

Return value

None

Remarks

The miniport driver must initialize a variable of type NDIS_SPIN_LOCK with NdisAllocateSpinLock before it calls any other Ndis..SpinLock function. The driver must provide resident storage for the spin lock(s) it uses.

NdisDprAcquireSpinLock is an optimized version of NdisAcquireSpinLock that a miniport driver can call only while running at IRQL = DISPATCH_LEVEL.

After acquiring a spin lock with NdisDprAcquireSpinLock, the caller must release that lock with a call to NdisDprReleaseSpinLock. A miniport driver must call NdisDprReleaseSpinLock following each call to NdisDprAcquireSpinLock. Otherwise, a deadlock occurs, hanging the driver.

A spin lock acquired with NdisDprAcquireSpinLock must be released with NdisDprReleaseSpinLock. A spin lock acquired with NdisAcquireSpinLock must be released with NdisReleaseSpinLock.

A driver should never hold a spin lock for an extended period (more than a few instructions). Holding a spin lock for longer than 25 microseconds degrades both system and driver performance.

A miniport driver cannot use a spin lock to protect resources that its other functions share with the MiniportInterrupt and/or MiniportDisableInterruptEx functions. Instead, a miniport driver must call NdisMSynchronizeWithInterruptEx so that its MiniportSynchronizeInterrupt function accesses such shared resources at the same DIRQL at which its MiniportInterrupt and/or MiniportDisableInterruptEx functions do.

For more information about acquiring and releasing NDIS spin locks, see Synchronization and Notification in Network Drivers.

Requirements

Version

Supported for NDIS 6.0 and NDIS 5.1 drivers (see NdisDprAcquireSpinLock (NDIS 5.1)) in Windows Vista. Supported for NDIS 5.1 drivers (see NdisDprAcquireSpinLock (NDIS 5.1)) in Windows XP.

Header

Ndis.h (include Ndis.h)

IRQL

DISPATCH_LEVEL

DDI compliance rules

Irql_Synch_Function, SpinLock, SpinLockBalanced, SpinLockDpr, SpinLockDprRelease, SpinlockRelease

See also

MiniportDisableInterruptEx
MiniportInterrupt
MiniportSynchronizeInterrupt
NetTimerCallback
NdisAcquireSpinLock
NdisAllocateSpinLock
NdisDprReleaseSpinLock
NdisMSynchronizeWithInterruptEx

 

 

Send comments about this topic to Microsoft

Mostrar:
© 2014 Microsoft