KeAcquireGuardedMutex routine
The KeAcquireGuardedMutex routine acquires a guarded mutex.
Syntax
VOID KeAcquireGuardedMutex(
_Inout_ 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
Target platform |
Universal |
Version |
Available in Windows Server 2003 and later versions of Windows. |
Header |
Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h) |
Library |
NtosKrnl.lib |
DLL |
NtosKrnl.exe |
IRQL |
<= APC_LEVEL |
DDI compliance rules |
IrqlKeApcLte1, HwStorPortProhibitedDDIs |
See also