Go to Home Page

Acquires a fat read/write for shared access, optionally waiting until access can be granted.


BOOLEAN WINAPI RtlAcquireResourceShared (
    BOOLEAN bWaitForAccess


A pointer to the resource object to acquire for shared access
Boolean value specifying whether the function can wait for access to be granted

Return Value

Nonzero if shared access was granted, zero if not


Each call to this function must be balanced by a call to RtlReleaseResource.

If the calling thread already has the lock for either type of access, access is granted trivially. If there is an exclusive owner and bWaitForAccess is nonzero, the thread will be stuck for three times the timeout period before the function raises a STATUS_POSSIBLE_DEADLOCK exception.

The default timeout period is the value of Peb->CriticalSectionTimeout unless pRes->flags & 1 is nonzero, in which case the timeout is infinite.