RtOpenSharedMemory
RtOpenSharedMemory opens a named physical-mapping memory object.
Syntax
HANDLE RtOpenSharedMemory(
DWORD dwDesiredAccess,
BOOL bInheritHandle,
LPCTSTR lpName,
VOID ** location
);
Parameters
dwDesiredAccess
The access mode. The Process environment always grants read and write access. This parameter can be one of the following values:
- SHM_MAP_READ gives read-only access to the committed region of pages. An attempt to write to or execute the committed region results in an access violation.
- SHM_MAP_WRITE gives read-write access to the committed region of pages.
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
If the function succeeds, it returns an open handle to the specified shared memory object. If the function fails, it returns NULL.
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 | Header | Library |
---|---|---|
eRTOS 1.0 SDK |
Rtapi.h | rtkrnl.lib |
See Also: