STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
rtcapi.h
Go to the documentation of this file.
1 /***
2 *rtcapi.h - declarations and definitions for RTC use
3 *
4 * Copyright (c) Microsoft Corporation. All rights reserved.
5 *
6 *Purpose:
7 * Contains the declarations and definitions for all RunTime Check
8 * support.
9 *
10 ****/
11 
12 #ifndef _INC_RTCAPI
13 #define _INC_RTCAPI
14 
15 #if defined _RTC || !defined _VCRT_BUILD
16 
17 #include <vcruntime.h>
18 
19 #pragma pack(push,_CRT_PACKING)
20 
21 /*
22 Previous versions of this header included declarations of functions used by RTC but
23 not intended for use by end-users. These functions are now declared deprecated by default
24 and may be removed in a future version.
25 */
26 #ifndef _CRT_ENABLE_RTC_INTERNALS
27 #define _RTCINTERNAL_DEPRECATED _CRT_DEPRECATE_TEXT("These internal RTC functions are obsolete and should not be used")
28 #else /* _CRT_ENABLE_RTC_INTERNALS */
29 #define _RTCINTERNAL_DEPRECATED
30 #endif /* _CRT_ENABLE_RTC_INTERNALS */
31 
32 
33 
34 #ifdef __cplusplus
35 
36 extern "C" {
37 
38 #endif /* __cplusplus */
39 
40  /* General User API */
41 
42 typedef enum _RTC_ErrorNumber {
50 
51 # define _RTC_ERRTYPE_IGNORE -1
52 # define _RTC_ERRTYPE_ASK -2
53 
54  typedef int (__cdecl *_RTC_error_fn)(int, const char *, int, const char *, const char *, ...);
55  typedef int (__cdecl *_RTC_error_fnW)(int, const wchar_t *, int, const wchar_t *, const wchar_t *, ...);
56 
57  /* User API */
58  int __cdecl _RTC_NumErrors(void);
59  const char * __cdecl _RTC_GetErrDesc(_RTC_ErrorNumber _Errnum);
60  int __cdecl _RTC_SetErrorType(_RTC_ErrorNumber _Errnum, int _ErrType);
63 
64  /* Power User/library API */
65 
66 
67  /* Init functions */
68 
69  /* These functions all call _CRT_RTC_INIT */
70  void __cdecl _RTC_Initialize(void);
71  void __cdecl _RTC_Terminate(void);
72 
73  /*
74  * If you're not using the CRT, you have to implement _CRT_RTC_INIT
75  * Just return either null, or your error reporting function
76  * *** Don't mess with res0/res1/res2/res3/res4 - YOU'VE BEEN WARNED! ***
77  */
78  _RTC_error_fn __cdecl _CRT_RTC_INIT(void *_Res0, void **_Res1, int _Res2, int _Res3, int _Res4);
79  _RTC_error_fnW __cdecl _CRT_RTC_INITW(void *_Res0, void **_Res1, int _Res2, int _Res3, int _Res4);
80 
81  /* Compiler generated calls (unlikely to be used, even by power users) */
82  /* Types */
83  typedef struct _RTC_vardesc {
84  int addr;
85  int size;
86  char *name;
87  } _RTC_vardesc;
88 
89  typedef struct _RTC_framedesc {
90  int varCount;
93 
94  /* NOTE:
95  Changing this structure requires a matching compiler backend
96  update, because the offsets are hardcoded inside there.
97  */
98 #pragma pack(push, 1)
99  /* Structure padded under 32-bit x86, to get consistent
100  execution between 32/64 targets.
101  */
102  typedef struct _RTC_ALLOCA_NODE {
103  __int32 guard1;
105 #if defined (_M_IX86) || defined (_M_ARM)
106  __int32 dummypad;
107 #endif /* defined (_M_IX86) || defined (_M_ARM) */
108  size_t allocaSize;
109 #if defined (_M_IX86) || defined (_M_ARM)
110  __int32 dummypad2;
111 #endif /* defined (_M_IX86) || defined (_M_ARM) */
112  __int32 guard2[3];
114 #pragma pack(pop)
115 
116 #if !defined (_M_CEE) && !defined (_M_CEE_PURE)
117  /* These unsupported functions are deprecated in native mode and not supported at all in /clr mode */
118 
119  /* Shortening convert checks - name indicates src bytes to target bytes */
120  /* Signedness is NOT checked */
121  _RTCINTERNAL_DEPRECATED char __fastcall _RTC_Check_2_to_1(short _Src);
122  _RTCINTERNAL_DEPRECATED char __fastcall _RTC_Check_4_to_1(int _Src);
123  _RTCINTERNAL_DEPRECATED char __fastcall _RTC_Check_8_to_1(__int64 _Src);
124  _RTCINTERNAL_DEPRECATED short __fastcall _RTC_Check_4_to_2(int _Src);
125  _RTCINTERNAL_DEPRECATED short __fastcall _RTC_Check_8_to_2(__int64 _Src);
126  _RTCINTERNAL_DEPRECATED int __fastcall _RTC_Check_8_to_4(__int64 _Src);
127 #endif /* !defined (_M_CEE) && !defined (_M_CEE_PURE) */
128 
129 
130  /* Stack Checking Calls */
131 #if defined (_M_IX86)
132  void __cdecl _RTC_CheckEsp();
133 #endif /* defined (_M_IX86) */
134 
135 #if !defined (_M_CEE) && !defined (_M_CEE_PURE)
136  /* These unsupported functions are deprecated in native mode and not supported at all in /clr mode */
137 
138  _RTCINTERNAL_DEPRECATED void __fastcall _RTC_CheckStackVars(void *_Esp, _RTC_framedesc *_Fd);
139  _RTCINTERNAL_DEPRECATED void __fastcall _RTC_CheckStackVars2(void *_Esp, _RTC_framedesc *_Fd, _RTC_ALLOCA_NODE *_AllocaList);
140  _RTCINTERNAL_DEPRECATED void __fastcall _RTC_AllocaHelper(_RTC_ALLOCA_NODE *_PAllocaBase, size_t _CbSize, _RTC_ALLOCA_NODE **_PAllocaInfoList);
141 #endif /* !defined (_M_CEE) && !defined (_M_CEE_PURE) */
142 
143  /* Unintialized Local call */
144  void __cdecl _RTC_UninitUse(const char *_Varname);
145 
146  /* Subsystem initialization stuff */
147  void __cdecl _RTC_Shutdown(void);
148  void __cdecl _RTC_InitBase(void);
149 
150 
151 #ifdef __cplusplus
152 
153  void* _ReturnAddress();
154 }
155 
156 #endif /* __cplusplus */
157 
158 #pragma pack(pop)
159 
160 #endif /* defined(_RTC) || !defined(_CRTBLD) */
161 
162 #endif /* _INC_RTCAPI */
struct _RTC_vardesc _RTC_vardesc
int __cdecl _RTC_SetErrorType(_RTC_ErrorNumber _Errnum, int _ErrType)
_RTCINTERNAL_DEPRECATED short __fastcall _RTC_Check_4_to_2(int _Src)
Definition: rtcapi.h:102
_RTC_error_fn __cdecl _RTC_SetErrorFunc(_RTC_error_fn)
void __cdecl _RTC_UninitUse(const char *_Varname)
int size
Definition: rtcapi.h:85
struct _RTC_framedesc _RTC_framedesc
_RTCINTERNAL_DEPRECATED int __fastcall _RTC_Check_8_to_4(__int64 _Src)
__int32 guard2[3]
Definition: rtcapi.h:112
int varCount
Definition: rtcapi.h:90
void __cdecl _RTC_Shutdown(void)
#define _RTCINTERNAL_DEPRECATED
Definition: rtcapi.h:27
Definition: rtcapi.h:47
size_t allocaSize
Definition: rtcapi.h:108
_RTC_ErrorNumber
Definition: rtcapi.h:42
struct _RTC_ALLOCA_NODE _RTC_ALLOCA_NODE
_RTCINTERNAL_DEPRECATED void __fastcall _RTC_AllocaHelper(_RTC_ALLOCA_NODE *_PAllocaBase, size_t _CbSize, _RTC_ALLOCA_NODE **_PAllocaInfoList)
unsigned int
Definition: vccorlib.h:2468
int(__cdecl * _RTC_error_fn)(int, const char *, int, const char *, const char *,...)
Definition: rtcapi.h:54
_RTC_error_fnW __cdecl _RTC_SetErrorFuncW(_RTC_error_fnW)
_RTCINTERNAL_DEPRECATED char __fastcall _RTC_Check_8_to_1(__int64 _Src)
Definition: rtcapi.h:46
Definition: rtcapi.h:44
Definition: rtcapi.h:43
_RTCINTERNAL_DEPRECATED short __fastcall _RTC_Check_8_to_2(__int64 _Src)
_RTCINTERNAL_DEPRECATED void __fastcall _RTC_CheckStackVars(void *_Esp, _RTC_framedesc *_Fd)
Definition: rtcapi.h:89
void __cdecl _RTC_Initialize(void)
_RTCINTERNAL_DEPRECATED char __fastcall _RTC_Check_4_to_1(int _Src)
int __cdecl _RTC_NumErrors(void)
Definition: rtcapi.h:45
void __cdecl _RTC_InitBase(void)
Definition: rtcapi.h:48
int addr
Definition: rtcapi.h:84
char * name
Definition: rtcapi.h:86
__int32 guard1
Definition: rtcapi.h:103
_RTC_vardesc * variables
Definition: rtcapi.h:91
_RTC_error_fn __cdecl _CRT_RTC_INIT(void *_Res0, void **_Res1, int _Res2, int _Res3, int _Res4)
Definition: rtcapi.h:83
int(__cdecl * _RTC_error_fnW)(int, const wchar_t *, int, const wchar_t *, const wchar_t *,...)
Definition: rtcapi.h:55
void __cdecl _RTC_Terminate(void)
_RTCINTERNAL_DEPRECATED void __fastcall _RTC_CheckStackVars2(void *_Esp, _RTC_framedesc *_Fd, _RTC_ALLOCA_NODE *_AllocaList)
struct _RTC_ALLOCA_NODE * next
Definition: rtcapi.h:104
const char *__cdecl _RTC_GetErrDesc(_RTC_ErrorNumber _Errnum)
_RTCINTERNAL_DEPRECATED char __fastcall _RTC_Check_2_to_1(short _Src)
_RTC_error_fnW __cdecl _CRT_RTC_INITW(void *_Res0, void **_Res1, int _Res2, int _Res3, int _Res4)