Bewerken

Delen via


ExTryToAcquireFastMutex function (wdm.h)

The ExTryToAcquireFastMutex routine acquires the given fast mutex, if possible, with APCs to the current thread disabled.

Syntax

BOOLEAN ExTryToAcquireFastMutex(
  PFAST_MUTEX FastMutex
);

Parameters

FastMutex

[in, out] A pointer to the fast mutex to be acquired if it is not currently owned by another thread.

Return value

ExTryToAcquireFastMutex returns TRUE if the current thread is given ownership of the fast mutex.

Remarks

If the given fast mutex is currently unowned, ExTryToAcquireFastMutex gives the caller ownership with APCs to the current thread disabled until it releases the fast mutex.

Use ExAcquireFastMutex if the current thread must wait for the acquisition of the given mutex before it can do useful work.

Any fast mutex that is acquired with ExTryToAcquireFastMutex or ExAcquireFastMutex must be released with ExReleaseFastMutex.

For more information about fast mutexes, see Fast Mutexes and Guarded Mutexes.

Callers of ExTryToAcquireFastMutex must be running at IRQL <= APC_LEVEL. ExTryToAcquireFastMutex sets the IRQL to APC_LEVEL if the mutex is acquired, and the caller continues to run at APC_LEVEL after ExTryToAcquireFastMutex returns. ExTryToAcquireFastMutex saves the caller's previous IRQL in the mutex if successful, however, and that IRQL is restored when the caller calls ExReleaseFastMutex.

Requirements

Requirement Value
Minimum supported client Windows 2000
Header wdm.h
IRQL <= APC_LEVEL
DDI compliance rules HwStorPortProhibitedDDIs(storport), IrqlExApcLte1(wdm)

See also

FAST_MUTEX

ExAcquireFastMutex

ExInitializeFastMutex

ExReleaseFastMutex