RtlTryAcquireSRWLockShared - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTRTL_H

// winbase:TryAcquireSRWLockShared
_When_(return != 0, _Acquires_shared_lock_(*SRWLock))
NTSYSAPI
BOOLEAN
NTAPI
RtlTryAcquireSRWLockShared(
    _Inout_ PRTL_SRWLOCK SRWLock
    );

#endif

View code on GitHub
// synchapi.h

BOOLEAN TryAcquireSRWLockShared(
  [in, out] PSRWLOCK SRWLock
);
View the official Win32 API reference

NtDoc

No description available.

Win32 API reference (nf-synchapi-tryacquiresrwlockshared)

TryAcquireSRWLockShared function

Description

Attempts to acquire a slim reader/writer (SRW) lock in shared mode. If the call is successful, the calling thread takes ownership of the lock.

Parameters

SRWLock [in, out]

A pointer to the SRW lock.

Return value

If the lock is successfully acquired, the return value is nonzero.

if the current thread could not acquire the lock, the return value is zero.

-Remarks

Successful acquisition of an SRW lock in shared mode typically permits other threads to acquire the same lock in shared mode, but doesn't guarantee that such acquisitions always succeed. An SRW lock may limit its simultaneous shared mode acquisitions for performance reasons.

See also

AcquireSRWLockShared

Slim Reader/Writer (SRW) Locks

Synchronization Functions

TryAcquireSRWLockExclusive

Vertdll APIs available in VBS enclaves