NdisReleaseRWLock function

The NdisReleaseRWLock function releases a read/write lock that the caller uses to gain access to resources that are shared between driver threads.

Syntax

void NdisReleaseRWLock(
  PNDIS_RW_LOCK_EX Lock,
  PLOCK_STATE_EX   LockState
);

Parameters

Lock

A pointer to an opaque NDIS_RW_LOCK_EX variable that represents a lock. The caller can use this lock to gain write or read access to resources that are shared between non-ISR driver threads.

LockState

A pointer to an opaque LOCK_STATE_EX variable that tracks the state of the lock. This variable exists in the interval between the times that the caller obtains and releases the lock. The caller must use a different variable of type LOCK_STATE_EX for each attempt that it makes to obtain the lock from the same non-ISR driver thread.

Return Value

None

Remarks

NDIS drivers call the NdisReleaseRWLock function to release a read/write lock that was previously obtained by calling the
NdisAcquireRWLockRead or NdisAcquireRWLockWrite function.

A driver must obtain a read/write lock before the driver can call NdisReleaseRWLock. Each call to obtain a lock requires a reciprocal call to NdisReleaseRWLock.

The acquisition of an NDIS_RW_LOCK_EX is affinitized to the current processor. Drivers must call NdisReleaseRWLock on the same processor that made the corresponding call to NdisAcquireRWLockRead or NdisAcquireRWLockWrite.

NdisReleaseRWLock restores the original IRQL that was used by its caller before the lock was obtained.

Requirements

   
Minimum supported client Supported in NDIS 6.20 and later.
Target Platform Universal
Header ndis.h (include Ndis.h)
Library Ndis.lib
IRQL DISPATCH_LEVEL

See Also

LOCK_STATE_EX

NDIS_RW_LOCK_EX

NdisAcquireRWLockRead

NdisAcquireRWLockWrite