[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ExoFreeSelector()
 Cancels a protected mode segment descriptor created by ExoProtectedPtr(),
 ExoSegCSAlias(), or ExoSegDSAlias()
------------------------------------------------------------------------------
 C Prototype

     int ExoFreeSelector(unsigned int selector)

 Returns

     This function always returns 0.

 Description

     This function is a primitive function--it corresponds to the DPMI
     function that cancels a descriptor.

     ExoFreeSelector() must be passed only the selector part of a pointer
     created with ExoProtectedPtr(), ExoSegCSAlias(), or ExoSegDSAlias().

     Because selectors are a limited resource in protected mode (there are
     "usually" around 8000 available for code and data segments), you should
     free selectors you have created with ExoProtectedPtr(), ExoSegCSAlias(),
     or ExoSegDSAlias() as soon as you are done with them.

 Examples

     This code creates a protected mode pointer to video color memory, does
     some unknown operation with it and then frees the protected mode
     selector.

     void *rmvideo;
     void *pmvideo;

     /* set up pointer to point to real mode address 0xB800:0 which
        is the address of the color video card */
     FP_SEG(rmvideo) = 0xB800;
     FP_OFF(rmvideo) = 0;

     /* create protected mode pointer for use in protected mode */
     pmvideo = ExoProtectedPtr(rmvideo, 0x8000);

     ... more code using pmvideo pointer would normally be here ...

     /* free up selector used by pmpointer now that we are done
        with it */

     ExoFreeSelector(FP_SEG(pmvideo));

 Files   Library is EXOSPACE.LIB, header file is Exospace.api.


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