This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS
Note: This is legacy API call. It is recommended to use 32-bit equivalent
This call accesses a shared memory segment previously allocated by another process.
DosGetShrSeg (Name, Selector)
rc (USHORT) - return: Return code
DosGetShrSeg provides access to a named shared segment allocated by another process with DosAllocShrSeg. The selector returned by DosGetShrSeg is the same as the one returned by the DosAllocShrSeg call.
A usage count is maintained for a named shared segment. Issuing DosGetShrSeg increments the count, and issuing DosFreeSeg decrements the count. When the usage count equals zero, the named shared segment is deallocated. Once the segment has been deallocated, it must be reinitialized by a call to DosAllocShrSeg.
To access shared memory that is allocated by another process with DosAllocSeg and DosAllocHuge requests, a process issues DosGetSeg.
#define INCL_DOSMEMMGR USHORT rc = DosGetShrSeg(Name, Selector); PSZ Name; /* Name string */ PSEL Selector; /* Selector of shared segment */ USHORT rc; /* return code /*
EXTRN DosGetShrSeg:FAR INCL_DOSMEMMGR EQU 1 PUSH@ ASCIIZ Name ;Name string PUSH@ WORD Selector ;Selector of shared segment (returned) CALL DosGetShrSeg Returns WORD