RtkCreateSharedMemory

RtkCreateSharedMemory creates a region of physical memory that can be mapped by any process or driver.

Syntax

NTSTATUS RtkCreateSharedMemory(
    RTSSINST RtssInst,
    PHANDLE SharedMemoryHandle,
    ULONG Protect,
    ULONG MaximumSizeHigh,
    ULONG MaximumSizeLow,
    PUNICODE_STRING Name,
    VOID ** Location
);

Parameters

RtssInst

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

SharedMemoryHandle

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

Protect

Ignored. The protection desired for the shared memory view.

MaximumSizeHigh

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

MaximumSizeLow

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

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.

Location

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

Return Value

RtkCreateSharedMemory returns STATUS_SUCCESS on success or on failure one of the following NTSTATUS error codes is possible:

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, an application must close the physical mapping object handle by calling RtkCloseHandle.

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 RTX64 2013 with Service Pack 1
Header RtkApi.h
Library RtkApi.lib
IRQL PASSIVE_LEVEL

See Also:

RtkCloseHandle

RtkOpenSharedMemory