RtkOpenSharedMemory

RtkOpenSharedMemory opens an existing named physical-mapping object.

Syntax

Copy
NTSTATUS RtkOpenSharedMemory(
    [in]        RTSSINST RtssInst,
    [out]       PHANDLE SharedMemoryHandle,
    [in]        ULONG DesiredAccess,
    [ignored]   BOOLEAN InheritHandle,
    [in]        PUNICODE_STRING Name,
    [out]       VOID ** location
);

Parameters

[in] RtssInst

An RTSSINST value returned from a call to RtkRtssAttach or RtkRtssAttachEx. Pass a valid RTSSINST value or the call will fail with STATUS_INVALID_PARAMETER.

[out] SharedMemoryHandle

A pointer to a handle that will receive a handle to the existing shared memory object. Pass a valid pointer to a handle or the call will fail with STATUS_INVALID_PARAMETER.

[in] DesiredAccess

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

[ignored] InheritHandle

If this value is TRUE, processes created by this process will inherit the handle. Otherwise, the process does not inherit this handle.

[in] Name

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

[out] location

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

Return Value

If the function succeeds, it returns STATUS_SUCCESS. If the function fails, it returns one of the following NTSTATUS error codes:

Remarks

Use RtkUnMapSharedMemory then RtkCloseHandle to close the handle, and decrement the reference count to the shared memory object. The system closes the handle automatically when the process terminates. The shared memory object is destroyed when its last handle has been closed.

Requirements

Minimum supported version Header Library

IRQL

wRTOS 1.0 SDK

RtkApi.h

RtkApi_W64.lib

PASSIVE_LEVEL

See Also: