BOOLEAN
ExAcquireSharedWaitForExclusive(
IN PERESOURCE Resource,
IN BOOLEAN Wait
);
ExAcquireSharedWaitForExclusive acquires the given resource for shared access immediately if shared access can be granted. Optionally, the caller can wait for other thread(s) to acquire and release exclusive ownership of the resource.
ExAcquireSharedWaitForExclusive returns TRUE if the requested access is granted or an exclusive owner releases the resource. This routine returns FALSE if the input Wait is FALSE and shared access cannot be granted immediately.
Whether or when the caller is given shared access to the given resource depends on the following:
When the current thread waits to acquire the resource until after a pending exclusive ownership has been released, ExAcquireSharedWaitForExclusive returns TRUE when the current thread is granted shared access to the resource and resumes execution.
Callers of ExAcquireSharedWaitForExclusive must be running at IRQL < DISPATCH_LEVEL.
ExAcquireResourceSharedLite, ExAcquireSharedStarveExclusive, ExConvertExclusiveToSharedLite, ExGetExclusiveWaiterCount, ExIsResourceAcquiredExclusiveLite, ExIsResourceAcquiredSharedLite, ExTryToAcquireResourceExclusiveLite