DosAllocShrSeg
Bindings: C, MASM
This call allocates a named shared memory segment to a process.
DosAllocShrSeg (Size, Name, Selector)
Size (USHORT) - input
Number of bytes requested. The value specified must be less than or
equal to 65535. A value of 0 indicates 65536 bytes.
Name (PSZ) - input
Address of the name string associated with the shared memory segment
to be allocated. Name specifies the symbolic name for the shared
memory segment. The name string is an ASCIIZ string in the format of
an OS/2 file name in a subdirectory called \SHAREMEM\. The name string
must include the prefix \SHAREMEM\. For example \SHAREMEM\name.
Selector (PSEL) - output
Address where the selector of the allocated segment is returned.
rc (USHORT) - return
Return code descriptions are:
0 NO_ERROR
8 ERROR_NOT_ENOUGH_MEMORY
123 ERROR_INVALID_NAME
183 ERROR_ALREADY_EXISTS
Remarks
DosAllocShrSeg allocates a named segment of up to 64KB in size, which is
movable and swappable. The segment can be shared by any process that
knows the name of the segment.
To access the shared segment, another process issues DosGetShrSeg,
specifying the segment name. The selector returned by DosGetShrSeg is the
same as the one returned by DosAllocShrSeg.
The maximum number of segments a process can define with DosAllocShrSeg
or access with DosGetShrSeg is 256.
Note: This request may be issued from privilege level 2. However, the
segment is allocated as a privilege level 3 segment.
Created using Inf-PHP v.2 (c) 2003 Yuri Prokushev
Created using Inf-HTML v.0.9b (c) 1995 Peter Childs