RtOpenSharedMemory

RtOpenSharedMemory opens a named physical-mapping object.

Syntax

HANDLE RtOpenSharedMemory(
    DWORD dwDesiredAccess,
    BOOL bInheritHandle,
    LPCTSTR lpName,
    VOID ** location
);

Parameters

dwDesiredAccess

The access mode. The RTSS environment always grants read and write access. This parameter can be one of the following values:

bInheritHandle

Ignored.

lpName

A pointer to a string that names the shared memory object to be opened. Name comparisons are case-sensitive.

location

A pointer to a location where the virtual address of the mapping will be stored.

Return Value

An open handle to the specified shared memory object if the function succeeds, NULL if the function fails

To get extended error information, call GetLastError.

Remarks

The handle that RtOpenSharedMemory returns can be used with RtCloseHandle to decrement the reference count to the shared memory object. When the reference count is zero, the object is removed from the system.

In the same process, different calls to RtOpenSharedMemory may return different locations because they are mapped into different virtual addresses.

Requirements

Minimum Supported Version RTX64 2013
Header Rtapi.h
Library RtApi.lib (Windows), Rtx_Rtss.lib (RTSS)

See Also:

RtCreateSharedMemory

RtCloseHandle