Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (R)
Guardian Procedure Calls Reference Manual522629-013
13-44
REFPARAM_BOUNDSCHECK_ Procedure
REFPARAM_BOUNDSCHECK_ Procedure
Summary
Syntax for C Programmers
Syntax for TAL Programmers
Parameters
Considerations
Example
Summary
The REFPARAM_BOUNDSCHECK_ procedure checks the validity of parameter
addresses passed to the procedure that calls it. Bounds checking performed by the
system is enough for most applications. This procedure, however, provides additional
checks for those few applications that might need it.
Primarily, REFPARAM_BOUNDSCHECK_ verifies that a specified memory area is
valid for a specified type of access (read only or read/write). Optionally, it also verifies
that the specified memory area does not overlap the part of the process stack occupied
by the calling procedure and any of the procedures it calls.
Syntax for C Programmers
CEXTDECS (via the included file TNSINTH) defines 32-bit values as the typedef
__int32_t which for TNS and TNS/R compiles is defined as
long and for TNS/E
compiles is defined as
int.
To exclude the stack area from the area that REFPARAM_BOUNDSCHECK_ accepts
as valid in a C or C++ program, you pass the
_frame_edge(first,last) function
as the
frame-start parameter to REFPARAM_BOUNDSCHECK_. The first and
last parameters are the names of the first and last parameters to the calling function.
For example:
#include <cextdecs(REFPARAM_BOUNDSCHECK_)>
short tstbnd (short *alpha, long long omega)
{
if ( REFPARAM_BOUNDSCHECK_( alpha,2,
_frame_edge(alpha,omega),0))
return -1;
Note. This procedure is declared only in the EXTDECS0 file.
#include <cextdecs(REFPARAM_BOUNDSCHECK_)>
short REFPARAM_BOUNDSCHECK_ ( void _far *start-address
,__int32_t area-len
,void _far *framestart
,short flags )