[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DosFreeSelector()             Free selector allocated with DosMapRealSeg(), DosCreateCSAlias() or DosCreateDSAlias()
------------------------------------------------------------------------------

 Function : Free a selector allocated with DosMapRealSeg(),
            DosCreateCSAlias() or DosCreateDSAlias()

 Syntax   : USHORT BLXAPI DosFreeSelector(SEL selector);

 selector   Selector allocated through DosMapRealSeg(), DosCreateCSAlias() or
            DosCreateDSAlias().

 Return   : None

 This function is used to free alias selectors (created with
 DosCreateDSAlias() or DosCreateCSAlias()) or selectors created using
 DosMapRealSeg(), and should not be used to free any other type of selector.

 Example:

    #include <stdlib.h>
    #include <stdio.h>
    #include <string.h>
    #include <blx286.h>
    
    #define VID_BUF 0xB800
    #define VID_SIZE 0x8000l
    
    unsigned char far *VideoBuffer;
    void main (void)
    {
    SEL         selector;
    ULONG       screen_address;
    /* Get a selector that corresponds to the screen buffer */
    if (DosMapRealSeg(VID_BUF,VID_SIZE,&selector) != 0)
       {
       printf("Unable to map screen segment\n");
       exit(255);
       }
    VideoBuffer = MK_FP(selector,0);
    *VideoBuffer[0] = "X";        /* Write to screen */
    if (DosFreeSelector(selector)==0)
       printf("Video buffer selector now invalid\n");
    }

See Also: DosFreeRealSeg() DosFreeSeg()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson