Share via


NdisDprAcquireSpinLock (Windows Embedded CE 6.0)

1/6/2010

NdisDprAcquireSpinLock acquires a spin lock so the caller can synchronize access to resources shared among non-ISR driver functions.

However, because Windows Embedded CE does not support DPC IRQL, all NdisDprXXX functions perform identically to the non-DPR equivalent.

Syntax

VOID NdisDprAcquireSpinLock(
  PNDIS_SPIN_LOCK SpinLock
);

Parameters

  • SpinLock
    [in]Pointer to an opaque spin lock, already initialized by the caller.

Return Value

None.

Remarks

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

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

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 MiniportISR and/or MiniportDisableInterrupt functions

Note

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

Requirements

Header ndis.h
Library ndis.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

NDIS Library Functions
MiniportDisableInterrupt
MiniportISR
MiniportSynchronizeISR
NdisAcquireSpinLock
NdisAllocateSpinLock
NdisDprReleaseSpinLock
NdisMSynchronizeWithInterrupt
NdisReleaseSpinLock