INtime SDK Help
RtCreateSharedMemory (iwin32)
INtime SDK v7 > About INtime > Alternate APIs > iwin32 API > iwin32 API > RtCreateSharedMemory (iwin32)

Creates a shared memory object.

HANDLE RtCreateSharedMemory(
    DWORD flProtect,
    DWORD MaximumSizeHigh,
    DWORD MaximumSizeLow,
    LPCTSTR lpName,
    VOID ** location


Must be zero.
The number of bytes to allocate.
Pointer to a null-terminated string that specifies the shared memory object name. The name is limited to MAX_PATH characters and can contain any character except the backslash path-separator character (\). Name comparison is case sensitive. Values include:
The shared memory object is created without a name.
Matches an existing named shared memory object
Ignores the MaximumSizeLow parameter because it was already set by the creation process.
Matches the name of an existing event, mutex, or semaphore object
The function fails and GetLastError returns ERROR_INVALID_HANDLE. This occurs because these objects share the same name space.
Pointer to a pointer where the virtual address of the shared memory object is stored.


Multiple processes can have handles of the same shared memory object, enabling use of the object for data sharing. To share an object, a process can specify the name of a shared memory object in a call to RtCreateSharedMemory.

To close the handle, use CloseHandle. When the process terminates, the system automatically closes the handle. When its last handle closes, the shared memory object is destroyed.

RtSharedMemory can also be used from a Windows application to create an iwin32 shared memory object.

Space for shared memory objects comes from an iwin32 virtual memory pool; the maximum size of that pool is configurable in the INtime Node Manager, advanced tab, iwin32 section, SegSize in multiples of 4 Mbytes.

Return Values

Handle to shared memory object
Handle to existing object and ERROR_ALREADY_EXISTS
The shared memory object existed before the function call.


Versions Defined in Include Link to
INtime 3.0 intime/rt/include/iwin32.h iwin32.h iwin32.lib


See Also

CloseHandle, iwin32 API, iwin32 Overview