Microsoft Windows CE 3.0  

NdisDprAcquireSpinLock

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This function acquires a spin lock so that the caller can synchronize access to resources shared among driver functions not related to interrupts in a multiprocessor-safe way.

VOID NdisDprAcquireSpinLock(
IN PNDIS_SPIN_LOCK
SpinLock
);

Parameters

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

Remarks

In Windows CE, NDIS spinlocks are implemented using critical sections.

The network adapter driver must initialize a variable of type NDIS_SPIN_LOCK with the NdisAllocateSpinLockfunction before it calls any other Ndis XXXSpinLockfunction. The driver must provide resident storage for the spin lock(s) it uses.

After acquiring a spin lock with this function, the caller must release that lock with a call to the NdisDprReleaseSpinLockfunction. An network adapter driver must call NdisDprReleaseSpinLockfollowing each call to this function. Otherwise, a deadlock occurs, causing the driver to stop responding.

A spin lock acquired with this function must be released with NdisDprReleaseSpinLock. A spin lock acquired with NdisAcquireSpinLockmust 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.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Ndis.h   Ndislib.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

NdisAcquireSpinLock, NdisAllocateSpinLock, NdisDprReleaseSpinLock, NdisMSynchronizeWithInterrupt, NdisReleaseSpinLock