RtOpenSharedMemory

RtOpenSharedMemory opens a named physical-mapping object.

Syntax

Copy
HANDLE RtOpenSharedMemory(
    [in]       DWORD dwDesiredAccess,
    [ignored]  BOOL bInheritHandle,
    [in]       LPCTSTR lpName,
    [out]      VOID ** location
);

Parameters

[in] dwDesiredAccess

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

[ignored] bInheritHandle

Ignored.

[in] lpName

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

[out] location

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

Return Value

If the function succeeds, it returns an open handle to the specified shared memory object. If the function fails, it returns NULL. Call GetLastError to obtain an error code.

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 Header Library

wRTOS 1.0 SDK

RtApi.h

RtApi.lib (Windows), Startup.lib (RTSS)

See Also: