DosCreateCSAlias

DosCreateCSAlias

#define INCL_DOSMEMMGR

USHORT  rc = DosCreateCSAlias(DataSelector, CodeSelector);

SEL              DataSelector;  /* Data segment selector */
PSEL             CodeSelector;  /* Code segment selector (returned) */

USHORT           rc;            /* return code */

Example

This example requests a block of memory (data segment) then requests a descriptor of the segment marking it as a code segment.

#define INCL_DOSMEMMGR

#define NUMBER_OF_BYTES 120
#define ALLOC_FLAG SEG_GETTABLE

SEL    CodeSel;
SEL    Selector;
USHORT rc;

   if(!DosAllocSeg(NUMBER_OF_BYTES,         /* # of bytes requested */
                   &Selector,               /* Selector allocated */
                   ALLOC_FLAG))             /* Allocation flags */
      rc = DosCreateCSAlias(Selector,       /* Data segment selector */
                            &CodeSel);      /* Code segment selector */


[Back: DosCopy]
[Next: DosCreateQueue]