Shared Memory Functions

RTSS shared memory objects allow you to share blocks of data among multiple processes, including RTSS processes and Windows processes. To do this, a thread in each process must have its own process-relative handle to a single RTSS shared memory object and its own process-relative pointer to a location where the virtual address of the mapping will be stored. These handles and pointers can be obtained by calling either RtCreateSharedMemory or RtOpenSharedMemory.

Using RtCreateSharedMemory

In order for several processes to use a shared memory object, the object must be first created using RtCreateSharedMemory. Other processes can then use the shared memory object's given name to map the shared memory object. RtCreateSharedMemory returns a handle and sets a location to the base address of the shared memory. A process can then write directly to that base address to share information with other processes accessing the shared memory.

NOTE: If you use RtCreateSharedMemory with the same name but a different size to create shared memory that already exists, the behavior differs between RTX64 and Windows.

Using RtOpenSharedMemory

When a process is finished with the shared memory it should close the handle to the shared memory object.