dos12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
DosGetShrSeg (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSMEMMGR
 
USHORT DosGetShrSeg(pszName, psel)
PSZ pszName;    /* pointer to memory-segment name   */
PSEL psel;      /* pointer to variable for selector */
 
The DosGetShrSeg function retrieves a selector to a shared-memory segment.
The shared segment must have been allocated previously by another process.
This function increments the shared segment's reference count to indicate
that the segment is in use. The process receiving the new selector can use
it to obtain access to the shared-memory segment.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
pszName    Points to the null-terminated string that identifies the
           shared-memory segment. This string must have the following form:
 
           \sharemem\name
 
           The segment name (name) must have the same format as an MS OS/2
           filename and must be unique. For example, the name
           \sharemem\public.dat is acceptable.
 
psel       Points to the variable that receives the new selector for the
           shared-memory segment.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be one of the following:
 
     ERROR_FILE_NOT_FOUND
     ERROR_INVALID_HANDLE
     ERROR_TOO_MANY_OPEN_FILES
 
Comments
 
DosGetShrSeg can be issued from ring 2, but the shared segment must be a
ring 3 segment.
 
See Also
 
DosAllocShrSeg, DosFreeSeg, DosGetSeg