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(
  _In_  PNDIS_RW_LOCK_EX Lock,
  _In_  PLOCK_STATE_EX LockState
);

Parameters

Lock [in]

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 [in]

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

Version

Supported in NDIS 6.20 and later.

Header

Ndis.h (include Ndis.h)

IRQL

DISPATCH_LEVEL

See also

LOCK_STATE_EX
NDIS_RW_LOCK_EX
NdisAcquireRWLockRead
NdisAcquireRWLockWrite

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft