Skip to content

Latest commit

 

History

History
134 lines (93 loc) · 5.02 KB

nf-ndis-ndisacquirespinlock.md

File metadata and controls

134 lines (93 loc) · 5.02 KB
UID title description old-location tech.root ms.date keywords ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames f1_keywords topic_type api_type api_location api_name
NF:ndis.NdisAcquireSpinLock
NdisAcquireSpinLock macro (ndis.h)
The NdisAcquireSpinLock function acquires a spin lock so the caller gains exclusive access to the resources, shared among driver functions, that the spin lock protects.
netvista\ndisacquirespinlock.htm
netvista
05/02/2018
NdisAcquireSpinLock macro
NdisAcquireSpinLock, NdisAcquireSpinLock macro [Network Drivers Starting with Windows Vista], ndis/NdisAcquireSpinLock, ndis_spin_lock_ref_54c55d32-a190-4454-ad0d-670427754b8b.xml, netvista.ndisacquirespinlock
ndis.h
Ndis.h
Universal
Supported for NDIS 6.0 and NDIS 5.1 drivers (see NdisAcquireSpinLock (NDIS 5.1)) in Windows Vista. Supported for NDIS 5.1 drivers (see NdisAcquireSpinLock (NDIS 5.1)) in Windows XP.
Irql_Synch_Function, SpinLock, SpinLockBalanced, SpinLockDpr, SpinLockDprRelease, SpinlockRelease
Ndis.lib
<= DISPATCH_LEVEL
Windows
NdisAcquireSpinLock
ndis/NdisAcquireSpinLock
APIRef
kbSyntax
LibDef
ndis.lib
ndis.dll
NdisAcquireSpinLock

NdisAcquireSpinLock macro

-description

The NdisAcquireSpinLock function acquires a spin lock so the caller gains exclusive access to the resources, shared among driver functions, that the spin lock protects.

-parameters

-param _SpinLock [in]

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

-remarks

The 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 NdisAcquireSpinLock, the caller must release that lock with a call to NdisReleaseSpinLock. A driver must call NdisReleaseSpinLock following each call to NdisAcquireSpinLock. Otherwise, a deadlock occurs, hanging the driver.

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

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.

-see-also

MiniportDisableInterruptEx

MiniportHaltEx

MiniportInitializeEx

MiniportInterrupt

MiniportSynchronizeInterrupt

NdisAllocateSpinLock

NdisDprAcquireSpinLock

NdisMSynchronizeWithInterruptEx

NdisReleaseSpinLock