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

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 the Windows' GetLastError function 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 RtCloseHandle. 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.

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/nt/include/iwin32x.h iwin32x.h iwin32x.lib


See Also

RtCloseHandle, iwin32x API, iwin32 Overview