Share via


NdisDprAcquireSpinLock (Windows CE 5.0)

Send Feedback

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

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

VOIDNdisDprAcquireSpinLock(PNDIS_SPIN_LOCK SpinLock);

Parameters

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

Return Values

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

OS Versions: Windows CE .NET 4.0 and later.
Header: Ndis.h.
Link Library: Ndis.lib

See Also

MiniportDisableInterrupt | MiniportISR | MiniportSynchronizeISR | NdisAcquireSpinLock | NdisAllocateSpinLock | NdisDprReleaseSpinLock | NdisMSynchronizeWithInterrupt | NdisReleaseSpinLock

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.