DosAllocShrSeg

DosAllocShrSeg

#define INCL_DOSMEMMGR

USHORT  rc = DosAllocShrSeg(Size, Name, Selector);

USHORT           Size;          /* Number of bytes requested */
PSZ              Name;          /* Name string */
PSEL             Selector;      /* Selector allocated (returned) */

USHORT           rc;            /* return code */

Example

This example requests a segment of memory with 27 bytes named "stock.dat".

#define INCL_DOSMEMMGR

#define NUMBER_OF_BYTES 27
#define NAME_SEG "\\SHAREMEM\\stock.dat"

SEL    Selector;
USHORT rc;

   rc = DosAllocShrSeg(NUMBER_OF_BYTES,   /* # of bytes requested */
                       NAME_SEG,          /* Name string */
                       &Selector);        /* Selector allocated */


[Back: DosAllocSeg]
[Next: DosBeep]