Previous Next

ExAcquireFastMutexUnsafe

The ExAcquireFastMutexUnsafe routine acquires the given fast mutex for the current thread.

VOID 
  ExAcquireFastMutexUnsafe(
  IN PFAST_MUTEX  FastMutex
    );

Parameters

FastMutex
Pointer to an initialized fast mutex for which the caller provides the storage.

Return Value

None

Headers

Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.

Comments

ExAcquireFastMutexUnsafe puts the caller into a wait state if the given fast mutex cannot be acquired immediately. Otherwise, the caller is given ownership of the fast mutex and exclusive access to the resource it protects until it releases the fast mutex.

Any fast mutex that is acquired using ExAcquireFastMutexUnsafe must be released with ExReleaseFastMutexUnsafe.

Callers of ExAcquireFastMutexUnsafe must ensure that APCs are not delivered to the current thread while the fast mutex is held. This can be accomplished in one of two ways:

  1. Callers can set the IRQL = APC_LEVEL before calling ExAcquireFastMutexUnsafe.
  2. Callers can invoke ExAcquireFastMutexUnsafe from within a critical section by calling KeEnterCriticalRegion prior to calling ExAcquireFastMutexUnsafe.

If the caller chooses to invoke ExAcquireFastMutexUnsafe from within a critical section, the caller must be running at IRQL < DISPATCH_LEVEL.

See Also

ExAcquireFastMutex, ExInitializeFastMutex, ExReleaseFastMutexUnsafe, KeEnterCriticalRegion, KeLeaveCriticalRegion