Go to Home Page

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


BOOLEAN WINAPI RtlAcquireResourceExclusive (
    BOOLEAN bWaitForAccess


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

Return Value

Nonzero if exclusive 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 exclusive access to the resource, access is granted trivially. If the calling thread has shared access 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.