RtkOpenMutex

RtkOpenMutex returns a handle to the named RTSS mutex.

Syntax

HANDLE RtOpenMutex(
    RTSSINST RtssInst,
    PULONG pErrorCode,
    DWORD DesiredAccess,
    BOOL bInheritHandle,
    PUNICODE_STRING lpName
);

Parameters

RtssInst

An RTSSINST value returned from a call to RtkRtssAttach.

pErrorCode

A pointer to a location where additional error information may be returned. This location need not be defined; the user may pass a NULL value. If defined, this location is set to NULL if no error occurred.

DesiredAccess (ignored)

The requested access to the mutex object.

bInheritHandle (ignored)

An indicator whether the returned handle is inheritable.

lpName

A pointer to a PUNICODE_STRING specifying the name of the mutex object. The name is limited to RTX_MAX_PATH characters and can contain any character except the backslash path-separator character (\). Name comparison is case-sensitive.

Return Values

A handle of the mutex object if the function succeeds, NULL if the function fails

Remarks

RtkOpenMutex enables multiple processes to open handles of the same mutex object. The function succeeds only if some process has already created the mutex with RtkCreateMutex. 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 RtkCloseHandle 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

Header Rtkapi.h
Library rtx_rtk.lib

See Also:

RtkCloseHandle

RtkCreateMutex

RtkReleaseMutex

IntervalZero.com | Support | Give Feedback