Leaked source code of windows server 2003
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.

103 lines
2.7 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. /*
  38. * If you're not using the CRT, you have to implement _CRT_RTC_INIT
  39. * Just return either null, or your error reporting function
  40. * *** Don't mess with res0/res1/res2/res3/res4 - YOU'VE BEEN WARNED! ***
  41. */
  42. _RTC_error_fn _CRT_RTC_INIT(void *res0, void **res1, int res2, int res3, int res4);
  43. /* Compiler generated calls (unlikely to be used, even by power users) */
  44. /* Types */
  45. typedef struct _RTC_vardesc {
  46. int addr;
  47. int size;
  48. char *name;
  49. } _RTC_vardesc;
  50. typedef struct _RTC_framedesc {
  51. int varCount;
  52. _RTC_vardesc *variables;
  53. } _RTC_framedesc;
  54. /* Shortening convert checks - name indicates src bytes to target bytes */
  55. /* Signedness is NOT checked */
  56. char __fastcall _RTC_Check_2_to_1(short src);
  57. char __fastcall _RTC_Check_4_to_1(int src);
  58. char __fastcall _RTC_Check_8_to_1(__int64 src);
  59. short __fastcall _RTC_Check_4_to_2(int src);
  60. short __fastcall _RTC_Check_8_to_2(__int64 src);
  61. int __fastcall _RTC_Check_8_to_4(__int64 src);
  62. /* Stack Checking Calls */
  63. void __cdecl _RTC_CheckEsp();
  64. void __fastcall _RTC_CheckStackVars(void *esp, _RTC_framedesc *fd);
  65. /* Unintialized Local call */
  66. void __cdecl _RTC_UninitUse(const char *varname);
  67. /* Subsystem initialization stuff */
  68. void __cdecl _RTC_Shutdown(void);
  69. void __cdecl _RTC_InitBase(void);
  70. #ifdef __cplusplus
  71. void* _ReturnAddress();
  72. }
  73. #endif
  74. #endif /* _INC_RTCAPI */