ReactOS  0.4.14-dev-384-g5b37caa
rtcuserapi.c
Go to the documentation of this file.
1 /*
2  * PROJECT: MSVC runtime check support library
3  * LICENSE: BSD - See COPYING.ARM in the top level directory
4  * PURPOSE: Provides support functions for MSVC runtime checks
5  * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org)
6  */
7 
8 #include <rtcapi.h>
9 
11 
12 int
13 __cdecl
15  int errType,
16  const wchar_t *file,
17  int line,
18  const wchar_t *module,
19  const wchar_t *format,
20  ...);
21 
22 static
23 char*
25 {
26  "The stack pointer was wrong after returning from a function call.", /* _RTC_CHKSTK */
27  "Data was lost when a type was converted to a smaller type.", /* _RTC_CVRT_LOSS_INFO */
28  "The stack near a local variable was corrupted.", /* _RTC_CORRUPT_STACK */
29  "An uninitialized local variable was used.", /* _RTC_UNINIT_LOCAL_USE */
30  "The stack around an alloca was corrupted.", /* _RTC_CORRUPTED_ALLOCA */
31 };
32 
33 int
34 __cdecl
36 {
37  /* Not supported yet */
38  __debugbreak();
39  return 0;
40 }
41 
42 const char *
43 __cdecl
45  _RTC_ErrorNumber _Errnum)
46 {
47  if (_Errnum < (sizeof(_RTC_ErrorDescription) / sizeof(_RTC_ErrorDescription[0])))
48  {
49  return _RTC_ErrorDescription[_Errnum];
50  }
51 
52  return "Invalid/Unknown error.";
53 }
54 
55 int
56 __cdecl
58  _RTC_ErrorNumber _Errnum,
59  int _ErrType)
60 {
61  /* Not supported yet */
62  __debugbreak();
63  return 0;
64 }
65 
67 __cdecl
69  _RTC_error_fn new_fn)
70 {
71  /* Not supported yet */
72  __debugbreak();
73  return 0;
74 }
75 
77 __cdecl
79 {
80  _RTC_error_fnW old_fn;
81 
82  /* Get the current error func */
83  old_fn = _RTC_pErrorFuncW;
84 
85  /* Set the new function or reset when 0 was passed */
86  _RTC_pErrorFuncW = new_fn ? new_fn : _RTC_DefaultErrorFuncW;
87 
88  /* Return the old error func, or 0, if none was set */
89  return old_fn != _RTC_DefaultErrorFuncW ? old_fn : 0;
90 }
91 
_RTC_error_fn __cdecl _RTC_SetErrorFunc(_RTC_error_fn new_fn)
Definition: rtcuserapi.c:68
#define __cdecl
Definition: accygwin.h:79
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698
_RTC_ErrorNumber
Definition: rtcapi.h:19
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
_RTC_error_fnW _RTC_pErrorFuncW
Definition: rtcapi.c:49
int(__cdecl * _RTC_error_fn)(int, const char *, int, const char *, const char *,...)
Definition: rtcapi.h:26
Definition: parser.c:48
int __cdecl _RTC_NumErrors(void)
Definition: rtcuserapi.c:35
_RTC_error_fnW __cdecl _RTC_SetErrorFuncW(_RTC_error_fnW new_fn)
Definition: rtcuserapi.c:78
const char *__cdecl _RTC_GetErrDesc(_RTC_ErrorNumber _Errnum)
Definition: rtcuserapi.c:44
int(__cdecl * _RTC_error_fnW)(int, const wchar_t *, int, const wchar_t *, const wchar_t *,...)
Definition: rtcapi.h:27
int __cdecl _RTC_DefaultErrorFuncW(int errType, const wchar_t *file, int line, const wchar_t *module, const wchar_t *format,...)
Definition: rtcapi.c:36
int __cdecl _RTC_SetErrorType(_RTC_ErrorNumber _Errnum, int _ErrType)
Definition: rtcuserapi.c:57
static char * _RTC_ErrorDescription[]
Definition: rtcuserapi.c:24
Definition: fci.c:126