Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
2.6 KiB

  1. /***
  2. *rtcapi.h - declarations and definitions for RTC use
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Contains the declarations and definitions for all RunTime Check
  8. * support.
  9. *
  10. ****/
  11. #ifndef _INC_RTCAPI
  12. #define _INC_RTCAPI
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. // General User API
  17. typedef enum _RTC_ErrorNumber {
  18. _RTC_CHKSTK = 0,
  19. _RTC_CVRT_LOSS_INFO,
  20. _RTC_CORRUPT_STACK,
  21. _RTC_UNINIT_LOCAL_USE,
  22. _RTC_ILLEGAL
  23. } _RTC_ErrorNumber;
  24. # define _RTC_ERRTYPE_IGNORE -1
  25. # define _RTC_ERRTYPE_ASK -2
  26. typedef int (__cdecl *_RTC_error_fn)(int, const char *, int, const char *, const char *, ...);
  27. // User API
  28. int __cdecl _RTC_NumErrors(void);
  29. const char * __cdecl _RTC_GetErrDesc(_RTC_ErrorNumber errnum);
  30. int __cdecl _RTC_SetErrorType(_RTC_ErrorNumber errnum, int ErrType);
  31. _RTC_error_fn __cdecl _RTC_SetErrorFunc(_RTC_error_fn);
  32. // Power User/library API
  33. /* Init functions */
  34. // These functions all call _CRT_RTC_INIT
  35. void __cdecl _RTC_Initialize(void);
  36. void __cdecl _RTC_Terminate(void);
  37. // If you're not using the CRT, you have to implement _CRT_RTC_INIT
  38. // Just return either null, or your error reporting function
  39. // *** Don't mess with res0/res1/res2/res3/res4 - YOU'VE BEEN WARNED! ***
  40. _RTC_error_fn _CRT_RTC_INIT(void *res0, void **res1, int res2, int res3, int res4);
  41. // Compiler generated calls (unlikely to be used, even by power users...)
  42. /* Types */
  43. typedef struct _RTC_vardesc {
  44. int addr;
  45. int size;
  46. char *name;
  47. } _RTC_vardesc;
  48. typedef struct _RTC_framedesc {
  49. int varCount;
  50. _RTC_vardesc *variables;
  51. } _RTC_framedesc;
  52. /* Shortening convert checks - name indicates src bytes to target bytes */
  53. /* Signedness is NOT checked */
  54. char __fastcall _RTC_Check_2_to_1(short src);
  55. char __fastcall _RTC_Check_4_to_1(int src);
  56. char __fastcall _RTC_Check_8_to_1(__int64 src);
  57. short __fastcall _RTC_Check_4_to_2(int src);
  58. short __fastcall _RTC_Check_8_to_2(__int64 src);
  59. int __fastcall _RTC_Check_8_to_4(__int64 src);
  60. /* Stack Checking Calls */
  61. void __cdecl _RTC_CheckEsp();
  62. void __fastcall _RTC_CheckStackVars(void *esp, _RTC_framedesc *fd);
  63. /* Unintialized Local call */
  64. void __cdecl _RTC_UninitUse(const char *varname);
  65. /* Subsystem initialization stuff */
  66. void __cdecl _RTC_Shutdown(void);
  67. void __cdecl _RTC_InitBase(void);
  68. #ifdef __cplusplus
  69. void* _ReturnAddress();
  70. }
  71. #endif
  72. #endif // _INC_RTCAPI