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.

107 lines
1.9 KiB

  1. /*++
  2. *
  3. * Component: hidserv.dll
  4. * File: dbg.h
  5. * Purpose: Ascii char debug macros.
  6. *
  7. * Copyright (C) Microsoft Corporation 1997,1998. All rights reserved.
  8. *
  9. * WGJ
  10. --*/
  11. #ifndef _DBG_H_
  12. #define _DBG_H_
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif /* __cplusplus */
  16. #define DBG_NAME "HidServ"
  17. #ifdef DBG
  18. #define TL_ALL 0
  19. #define TL_DUMP 1
  20. #define TL_TRACE 2
  21. #define TL_INFO 3
  22. #define TL_WARN 4
  23. #define TL_ERROR 5
  24. GLOBALS DWORD G_TraceLevel EQU TL_WARN;
  25. static void _dprint( IN PCHAR format, IN ... )
  26. {
  27. char buf[1024];
  28. va_list ap;
  29. va_start(ap, format);
  30. wvsprintfA( buf, format, ap );
  31. OutputDebugStringA(buf);
  32. va_end(ap);
  33. }
  34. #define DPRINTF _dprint
  35. #define HPRINTF _dprint
  36. #define VPRINTF _dprint
  37. #define DUMP(strings) { \
  38. if(TL_DUMP >= G_TraceLevel){ \
  39. VPRINTF(DBG_NAME " DUMP: "); \
  40. VPRINTF##strings; \
  41. VPRINTF("\n"); \
  42. } \
  43. }
  44. #define TRACE(strings) { \
  45. if(TL_TRACE >= G_TraceLevel){ \
  46. VPRINTF(DBG_NAME " TRACE: "); \
  47. VPRINTF##strings; \
  48. VPRINTF("\n"); \
  49. } \
  50. }
  51. #define INFO(strings) { \
  52. if(TL_INFO >= G_TraceLevel){ \
  53. HPRINTF(DBG_NAME " INFO: "); \
  54. HPRINTF##strings; \
  55. HPRINTF("\n"); \
  56. } \
  57. }
  58. #define WARN(strings) {\
  59. if(TL_WARN >= G_TraceLevel){ \
  60. HPRINTF(DBG_NAME " WARNS: "); \
  61. HPRINTF##strings; \
  62. HPRINTF("\n"); \
  63. } \
  64. }
  65. #define TERROR(strings)
  66. #else //DBG
  67. #define DPRINTF
  68. #define HPRINTF
  69. #define VPRINTF
  70. #define DUMP(strings)
  71. #define TRACE(strings)
  72. #define INFO(strings)
  73. #define WARN(strings)
  74. #define TERROR(strings)
  75. #define ASSERT(exp)
  76. #endif //DBG
  77. #ifdef __cplusplus
  78. }
  79. #endif /* __cplusplus */
  80. #endif //_DBG_H_