ExTryAcquirePushLockShared - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdm.h

BOOLEAN ExTryAcquirePushLockShared(
   Lock
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdm-extryacquirepushlockshared)

Description

Try to acquire the given push lock for shared access by the calling thread.

Parameters

Lock

Opaque push lock pointer. This pointer must have been initialized by a previous call to ExInitializePushLock.

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

Push locks are similar to ERESOURCE structures (also called resources) in that they can be acquired for shared or exclusive access. For more information about push locks, see the reference entry for ExInitializePushLock.

Unlike ERESOURCE structures, push locks cannot be acquired recursively. If the caller already has acquired the push lock for exclusive access, the system will hang. If the caller already has acquired the push lock for shared access, it can receive shared access again.

To release the push lock after it is acquired, call ExReleasePushLockShared. Each call to ExAcquirePushLockShared must be matched by a subsequent call to ExReleasePushLockShared.

When the caller will be given shared access to the given push lock depends on the following:

Before calling this routine, the driver must disable normal kernel APC delivery by calling KeEnterCriticalRegion. Reenable delivery after the push lock is released by calling KeLeaveCriticalRegion. For more information, see Disabling APCs.

To acquire a push lock for exclusive access, call ExAcquirePushLockExclusive.

See also

ExTryAcquirePushLockExclusive

ExInitializePushLock

KeEnterCriticalRegion

ExReleasePushLockExclusive

ExAcquirePushLockShared

Syntax

BOOLEAN ExTryAcquirePushLockShared(
   Lock
);