RtkCreateSharedMemory

RtkCreateSharedMemory creates a region of physical memory that any process or driver can map.

Syntax

Copy
NTSTATUS RtkCreateSharedMemory(
    [in]        RTSSINST RtssInst,
    [out]       PHANDLE SharedMemoryHandle,
    [ignored]   ULONG Protect,
    [in]        ULONG MaximumSizeHigh,
    [in]        ULONG MaximumSizeLow,
    [in]        PUNICODE_STRING Name,
    [out]       VOID ** Location
);

Parameters

[in] RtssInst

An RTSSINST value returned from a call to RtkRtssAttach or RtkRtssAttachEx.

[out] SharedMemoryHandle

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

[ignored] Protect

Ignored. The protection desired for the shared memory view.

[in] MaximumSizeHigh

The high-order 32 bits of the size of the shared memory object. This value can only be zero (0).

[in] MaximumSizeLow

The low-order 32 bits of the size of the shared memory object.

[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.

If Name matches the name of an existing named shared memory object, the function requests access to the shared memory object with the protection specified by Protect.

If Name matches the name of another kind of object in the same namespace (such as an existing mutex or event), the function fails and the function returns STATUS_INVALID_HANDLE. This occurs because these objects share the same namespace.

If Name is NULL, the shared memory object is created without a name.

[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

The handle that RtkCreateSharedMemory returns has read and write access to the new shared memory object. Shared memory objects can be shared by name. For information on opening a shared memory object by name, see RtkOpenSharedMemory.

To fully close a shared memory object, call RtkCloseHandle to close the physical mapping object handle.

When all handles to the shared memory object representing the physical memory are closed, the object is destroyed, and physical memory is returned to the system.

Requirements

Minimum supported version Header Library

IRQL

wRTOS 1.0 SDK

RtkApi.h

RtkApi_W64.lib

PASSIVE_LEVEL

See Also: