Expand Minimize

ExTryToAcquireFastMutex routine

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

Syntax


BOOLEAN ExTryToAcquireFastMutex(
  _Inout_  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

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

<= APC_LEVEL (see Remarks section)

DDI compliance rules

IrqlExApcLte1, HwStorPortProhibitedDDIs

See also

FAST_MUTEX
ExAcquireFastMutex
ExInitializeFastMutex
ExReleaseFastMutex

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft