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.

111 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. debug.h
  5. Abstract:
  6. Contains data definitions for debug code.
  7. Author:
  8. Madan Appiah (madana) 15-Nov-1994
  9. Environment:
  10. User Mode - Win32
  11. Revision History:
  12. --*/
  13. #ifndef _DEBUG_
  14. #define _DEBUG_
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. //
  19. // LOW WORD bit mask (0x0000FFFF) for low frequency debug output.
  20. //
  21. #define DEBUG_ERRORS 0x00000001 // hard errors.
  22. #define DEBUG_REGISTRY 0x00000002 // debug registry calls
  23. #define DEBUG_MISC 0x00000004 // misc info.
  24. #define DEBUG_SCAVENGER 0x00000008 // scavenger debug info.
  25. #define DEBUG_SORT 0x00000010 // debug B-TREE functions
  26. #define DEBUG_CONTAINER 0x00000020 // debug container
  27. #define DEBUG_APIS 0x00000040 // debug tcpsvcs apis
  28. #define DEBUG_FILE_VALIDATE 0x00000080 // validate file map file
  29. #define DEBUG_SVCLOC_MESSAGE 0x00000100 // discovery messages
  30. //
  31. // HIGH WORD bit mask (0x0000FFFF) for high frequency debug output.
  32. // ie more verbose.
  33. //
  34. #define DEBUG_TIMESTAMP 0x00010000 // print time stamps
  35. #define DEBUG_MEM_ALLOC 0x00020000 // memory alloc
  36. #define DEBUG_STARTUP_BRK 0x40000000 // breakin debugger during startup.
  37. #if DBG
  38. #define DEBUG_PRINT OutputDebugString
  39. //
  40. // debug functions.
  41. //
  42. extern DWORD GlobalDebugFlag;
  43. extern CRITICAL_SECTION GlobalDebugCritSect;
  44. #define IF_DEBUG(flag) if (GlobalDebugFlag & (DEBUG_ ## flag))
  45. #define TcpsvcsDbgPrint(_x_) TcpsvcsDbgPrintRoutine _x_
  46. VOID
  47. TcpsvcsDbgPrintRoutine(
  48. IN DWORD DebugFlag,
  49. IN LPSTR Format,
  50. ...
  51. );
  52. VOID
  53. TcpsvcsDbgAssertFailed(
  54. LPSTR FailedAssertion,
  55. LPSTR FileName,
  56. DWORD LineNumber,
  57. LPSTR Message
  58. );
  59. #define TcpsvcsDbgAssert(Predicate) \
  60. { \
  61. if (!(Predicate)) \
  62. TcpsvcsDbgAssertFailed( #Predicate, __FILE__, __LINE__, NULL ); \
  63. }
  64. #else
  65. #define IF_DEBUG(flag) if (FALSE)
  66. #define TcpsvcsDbgPrint(_x_)
  67. #define TcpsvcsDbgAssert(_x_)
  68. #endif // DBG
  69. #if DBG
  70. #define INLINE
  71. #else
  72. #define INLINE inline
  73. #endif
  74. #ifdef __cplusplus
  75. }
  76. #endif
  77. #endif // _DEBUG_
  78.