KeAcquireGuardedMutex function (wdm.h)

The KeAcquireGuardedMutex routine acquires a guarded mutex.

Syntax

void KeAcquireGuardedMutex(
  PKGUARDED_MUTEX Mutex
);

Parameters

Mutex

[in, out] Pointer to the KGUARDED_MUTEX structure for the guarded mutex. This structure must have been initialized with KeInitializeGuardedMutex.

Return value

None

Remarks

Use KeReleaseGuardedMutex to release a mutex acquired with KeAcquireGuardedMutex.

If the mutex is available, KeAcquireGuardedMutex returns immediately. Otherwise, the calling thread is put in a wait state until the mutex becomes available. To avoid entering a wait state when the mutex is unavailable, use KeTryToAcquireGuardedMutex.

A thread that calls KeAcquireGuardedMutex implicitly enters a guarded region, where all APCs are disabled. They remain disabled until the thread releases the mutex with KeReleaseGuardedMutex.

A guarded mutex cannot be acquired recursively: if a thread is already holding the mutex when it calls KeAcquireGuardedMutex, the thread will deadlock.

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

Requirements

Requirement Value
Minimum supported server Windows Server 2003
Header wdm.h
IRQL <= APC_LEVEL
DDI compliance rules HwStorPortProhibitedDDIs(storport), IrqlKeApcLte1(wdm)

See also

KGUARDED_MUTEX

KeReleaseGuardedMutex