KeInitializeMutex

VOID
    KeInitializeMutex(

        IN PKMUTEX  Mutex,
        IN ULONG  Level
        );

KeInitializeMutex initializes a mutex object at a given level number, setting it to the Signaled state.

Parameters

Mutex
Points to a mutex object, for which the caller provides the storage.
Level
Specifies the level number to be assigned to the mutex.

Comments

For better performance, use the Ex..FastMutex routines instead of the Ke..Mutex. However, a fast mutex cannot be acquired recursively, as a kernel mutex can.

The mutex object is initialized with the specified Level and an initial state of Signaled.

A driver cannot wait at raised IRQL nor in an arbitrary thread context for a nonzero interval on a mutex object.

Storage for a mutex object must be resident: in the device extension of a driver-created device object, in the controller extension of a driver-created controller object, or in nonpaged pool allocated by the caller.

Callers of this routine must be running at IRQL PASSIVE_LEVEL.

See Also

ExInitializeFastMutex, KeReadStateMutex, KeReleaseMutex, KeWaitForMultipleObjects, KeWaitForMutexObject, KeWaitForSingleObject