xref: /reactos/sdk/lib/crt/include/internal/safecrt.h (revision 40462c92)
1 
2 #include <errno.h>
3 
4 extern void * __pInvalidArgHandler;
5 
6 void _invalid_parameter(
7    const wchar_t * expression,
8    const wchar_t * function,
9    const wchar_t * file,
10    unsigned int line,
11    uintptr_t pReserved);
12 
13 #ifndef _LIBCNT_
14 #define MSVCRT_INVALID_PMT(x,err)   (*_errno() = (err), _invalid_parameter(NULL, NULL, NULL, 0, 0))
15 #define MSVCRT_CHECK_PMT_ERR(x,err) ((x) || (MSVCRT_INVALID_PMT( 0, (err) ), 0))
16 #define MSVCRT_CHECK_PMT(x)         MSVCRT_CHECK_PMT_ERR((x), EINVAL)
17 #else
18 /* disable secure crt parameter checks */
19 #define MSVCRT_INVALID_PMT(x,err)
20 #define MSVCRT_CHECK_PMT_ERR(x,err)
21 #define MSVCRT_CHECK_PMT(x) (x)
22 #endif
23