RtOpenMutex

RtOpenMutex returns a handle to the named mutex.

Syntax

Copy
HANDLE RtOpenProcess(
    DWORD dwAccess,
    BOOL bInherit,
    DWORD dwProcessId
);

Parameters

DesiredAccess

Ignored.

bInheritHandle

Ignored.

lpName

A pointer to a null-terminated string that names the mutex to be opened. Name comparisons are case-sensitive.

Return Value

If the function succeeds, it returns a handle to the mutex object. If the function fails, it returns NULL.

To get extended error information, call GetLastError.

Remarks

RtOpenMutex enables multiple processes to open handles of the same mutex object. The function succeeds only if some process has already created the mutex with RtCreateMutex. The calling process can use the returned handle in any function that requires a handle of a mutex object, such as a wait function.

Use RtCloseHandle to close the handle. The system closes the handle automatically when the process terminates. The mutex object is destroyed when its last handle has been closed.

Requirements

Minimum supported version Header Library

eRTOS 1.0 SDK

Rtapi.h rtkrnl.lib

See Also: