Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.3 . Technical Reference - <b>exoprotectedptr()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ExoProtectedPtr()
 Creates a protected mode pointer from a real mode pointer
------------------------------------------------------------------------------
 C Prototype

     void *ExoProtectedPtr(void *rm_ptr, unsigned int size)

 Returns

     This function returns the protected mode pointer (pm_ptr), or NULL if
     the pointer cannot be allocated.  A new descriptor is allocated.

 Description

     The protected mode data pointer created by this function points to a
     segment of size bytes.  Since a value of 64KB is too large for an
     unsigned variable, use 0 to specify 64KB for size.  The offset of pm_ptr
     is always 0.  The base physical address of pm_ptr's segment is the
     absolute address of rm_ptr, which is segment(rm_ptr) * 16 +
     offset(rm_ptr).  Because ExoProtectedPtr() is run with interrupts
     enabled, realtime applications should not call it from an external
     interrupt handler.

     The offset of the pointer returned by ExoProtectedPtr() will ALWAYS be
     0.

     ExoFreeSelector() must be called to free the selector allocated with
     ExoProtectedPtr().  Selectors are a limited resource and repeated calls
     to ExoProtectedPtr() as well as ExoSegCSAlias() and ExoSegDSAlias()
     could use up all the available selectors causing the program to crash.
     Once you are done with a pointer created with ExoProtectedPtr(), free
     the selector unless you will be using the pointer throughout the
     program..

 Examples

     See example for ExoFreeSelector().

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


See Also: ExoRealPtr() ExoFreeSelector()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson