DosGiveSeg
Bindings: C, MASM
This call allows another process to access shared memory allocated by a
DosAllocSeg or DosAllocHuge call.
DosGiveSeg (CallerSegSelector, ProcessID, RecipientSegSelector)
CallerSegSelector (SEL) - input
Segment selector of the shared memory segment.
ProcessID (PID) - input
Process ID of the process to receive access to the shared memory
segment.
RecipientSegSelector (PSEL) - output
Address of the recipient's segment selector.
rc (USHORT) - return
Return code descriptions are:
0 NO_ERROR
5 ERROR_ACCESS_DENIED
8 ERROR_NOT_ENOUGH_MEMORY
Remarks
DosGiveSeg returns a selector that can be given to another process to
access shared memory the giver has allocated by a DosAllocSeg or
DosAllocHuge call. The giving process passes the recipient's selector to
the intended sharer by some means of interprocess communication. If the
recipient has created a queue with DosCreateQueue, the giver can issue
DosWriteQueue, specifying the queue name, and pass the selector in this
manner.
If the memory being given was allocated by a DosAllocHuge request, the
CallerSegSelector must be the base selector returned by DosAllocHuge.
When the caller passes the selector returned in RecipientSegSelector to
the intended sharer, this selector has addressability only to the first
segment in the sharer's address space of the huge allocation. However,
the recipient can call DosGetHugeShift and use the shift count returned
to calculate the selectors for the remaining segments.
Created using Inf-PHP v.2 (c) 2003 Yuri Prokushev
Created using Inf-HTML v.0.9b (c) 1995 Peter Childs