Writing a Wrapper
The pointer checker is not supported on
You can write your own wrappers for run-time library functions. Typically, you would use one or more of the pointer checker intrinsics.
Example: Allocation Wrapping with __chkp_make_bounds
The next example shows a wrapper that checks the validity of the pointer passed by performing writes to the first and last addresses that the C run-time routine will write. This will cause out of bounds events if necessary, while still allowing optimized handling of the C run-time library call.
Example: Checking without using Pointer Checker Intrinsics
Alternatively, you can perform the checking directly by comparing to the bounds associated with the pointer. In this case, you must first make sure that the bounds are meaningful. You can use the
__chkp_lower_boundintrinsics for this purpose.
Example: Upper and Lower Bound Intrinsics