home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
CLIPPER
/
NFORX11
/
POKE.C
< prev
Wrap
C/C++ Source or Header
|
1993-08-17
|
2KB
|
64 lines
/*
* File......: POKE.C
* Author....: Ted Means
* Date......: $Date: 17 Aug 1993 19:42:24 $
* Revision..: $Revision: 1.1 $
* Log file..: $Logfile: C:/nanfor/src/exo/poke.c_v $
*
* This is an original work by Ted Means and is placed in the
* public domain.
*
* Modification history:
* ---------------------
*
* $Log: C:/nanfor/src/exo/poke.c_v $
*
* Rev 1.1 17 Aug 1993 19:42:24 GLENN
* Dieter Smode [CIS ID: 100034,243] noticed that the function creates a
* protected mode pointer but does not release the selector from the
* descriptor table. Due to successive calls to FT_POKE(), the descriptor
* table would overflow. Fixed.
*
*
* Rev 1.0 15 Jul 1993 22:46:50 GLENN
* Initial revision.
*
*/
/* Librarian's note:
*
* This source code is for a special version of ft_poke(), compatible
* with the ExoSpace (tm) DOS Extender from SofDesign, International.
* It is ExoSpace-specific and is maintained separately from the real
* mode version.
*
* The documentation can be found in the real-mode POKE.C as
* distributed with the regular Nanforum Toolkit.
*
*/
#include "extend.h"
void * ExoProtectedPtr(void *rmptr, unsigned int sizebytes);
int ExoFreeSelector(unsigned int);
CLIPPER FT_POKE(void)
{
auto unsigned char * byteptr;
auto unsigned char * pmptr;
if ( (PCOUNT >= 3) && (ISNUM(1)) && (ISNUM(2)) && (ISNUM(3)) )
{
* ((unsigned int *) &byteptr) = _parni(2);
* ((unsigned int *) &byteptr + 1) = _parni(1);
pmptr = ExoProtectedPtr(byteptr, 8);
*pmptr = ((unsigned char) _parni(3));
_retl( TRUE );
ExoFreeSelector(* ((unsigned int *) &pmptr + 1));
}
else
_retl( FALSE );
return;
}