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.

111 lines
6.6 KiB

  1. /**INC+**********************************************************************/
  2. /* Header: wtrcapi.h */
  3. /* */
  4. /* Purpose: Tracing API header - Windows specific */
  5. /* */
  6. /* Copyright(C) Microsoft Corporation 1997 */
  7. /* */
  8. /****************************************************************************/
  9. /** Changes:
  10. * $Log: Y:/logs/h/dcl/wtrcapi.h_v $
  11. *
  12. * Rev 1.3 29 Aug 1997 09:23:14 ENH
  13. * SFR1259: Changed SystemError
  14. *
  15. * Rev 1.2 09 Jul 1997 18:08:08 AK
  16. * SFR1016: Initial changes to support Unicode
  17. **/
  18. /**INC-**********************************************************************/
  19. #ifndef _H_WTRCAPI
  20. #define _H_WTRCAPI
  21. /****************************************************************************/
  22. /* */
  23. /* CONSTANTS */
  24. /* */
  25. /****************************************************************************/
  26. /****************************************************************************/
  27. /* The return code passed from ExitThread after an assert. */
  28. /****************************************************************************/
  29. #define TRC_THREAD_EXIT 10
  30. /****************************************************************************/
  31. /* The size of buffer maintained for kernel mode tracing. */
  32. /****************************************************************************/
  33. #define TRC_KRNL_BUFFER_SIZE 0x8000
  34. /****************************************************************************/
  35. /* */
  36. /* MACROS */
  37. /* */
  38. /****************************************************************************/
  39. /* A macro to get the last system error and trace it out as an alert level */
  40. /* trace. */
  41. /****************************************************************************/
  42. #ifdef TRC_ENABLE_ALT
  43. #define TRC_SYSTEM_ERROR(string) \
  44. { \
  45. if (TRC_LEVEL_ALT >= TRC_GetTraceLevel()) \
  46. { \
  47. TRC_SystemError(TRC_GROUP, \
  48. __LINE__, \
  49. trc_fn, \
  50. trc_file, \
  51. _T(string)); \
  52. } \
  53. }
  54. #else
  55. #define TRC_SYSTEM_ERROR(string)
  56. #endif
  57. /****************************************************************************/
  58. /* */
  59. /* FUNCTION PROTOTYPES */
  60. /* */
  61. /****************************************************************************/
  62. /* */
  63. /* TRC_SystemError */
  64. /* */
  65. /****************************************************************************/
  66. /****************************************************************************/
  67. /* API FUNCTION: TRC_SystemError(...) */
  68. /* */
  69. /* DESCRIPTION: */
  70. /* ============ */
  71. /* This function traces out the last system error as an alert level trace. */
  72. /* */
  73. /* PARAMETERS: */
  74. /* =========== */
  75. /* traceComponent : trace component name. */
  76. /* lineNumber : line number. */
  77. /* funcName : function name. */
  78. /* fileName : file name. */
  79. /* string : name of failed function */
  80. /* */
  81. /* RETURNS: */
  82. /* ======== */
  83. /* Nothing. */
  84. /* */
  85. /****************************************************************************/
  86. DCVOID DCAPI TRC_SystemError(DCUINT traceComponent,
  87. DCUINT lineNumber,
  88. PDCTCHAR funcName,
  89. PDCTCHAR fileName,
  90. PDCTCHAR string);
  91. #if defined(TRC_CONVERTOANSI)
  92. /****************************************************************************/
  93. /* See wtrcapi.c for details. */
  94. /****************************************************************************/
  95. DCVOID DCAPI TRC_ConvertAndSprintf(PDCTCHAR, const PDCACHAR, ...);
  96. #endif
  97. /****************************************************************************/
  98. /* Get the platform specific definitions */
  99. /****************************************************************************/
  100. #ifdef OS_WIN32
  101. #include <ntrcapi.h>
  102. #endif
  103. #endif /* _H_WTRCAPI */