#ifndef _NTRTL_H
/**
* The RtlTryEnterCriticalSection routine attempts to enter a critical section without blocking the calling thread.
*
* \param CriticalSection A pointer to the critical section object.
* \return A nonzero value if the critical section was successfully entered, otherwise zero.
* \remarks Acquisition by the owning thread increments recursion. Each successful enter/try-enter needs one leave on that thread. Try-enter FALSE does not acquire a level. A successful status or unlocked snapshot is not a lifetime guarantee for the lock storage.
*/
_When_(return != 0, _Acquires_exclusive_lock_(*CriticalSection))
NTSYSAPI
LOGICAL
NTAPI
RtlTryEnterCriticalSection(
_Inout_ PRTL_CRITICAL_SECTION CriticalSection
);
View code on GitHubAttempts to enter the specified critical section object without blocking.
TryEnterCriticalSection maps directly to this function.