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.

89 lines
2.0 KiB

  1. #ifndef __DBG_HXX__
  2. #define __DBG_HXX__
  3. #define DEBUG_OUT(x)
  4. #define DECLARE_HEAPCHECKING
  5. #define DEBUGCHECK
  6. #define TRACE(ClassName,MethodName)
  7. #define TRACE_FUNCTION(FunctionName)
  8. #define CHECK_HRESULT(hr)
  9. #define CHECK_LASTERROR(lr)
  10. #define VERIFY(x) x
  11. #define DEBUG_OUT_LASTERROR
  12. #define DEBUG_ASSERT(e)
  13. #if DBG==1
  14. DECLARE_DEBUG(Job)
  15. #undef DEBUG_OUT
  16. #define DEBUG_OUT(x) JobInlineDebugOut x
  17. extern DWORD dwHeapChecking;
  18. #undef DECLARE_HEAPCHECKING
  19. #define DECLARE_HEAPCHECKING DWORD dwHeapChecking = 0
  20. #undef DEBUGCHECK
  21. #define DEBUGCHECK \
  22. if ( (dwHeapChecking & 0x1) == 0x1 ) \
  23. HeapValidate(GetProcessHeap(),0,NULL)
  24. #undef TRACE
  25. #define TRACE(ClassName,MethodName) \
  26. DEBUGCHECK; \
  27. DEBUG_OUT((DEB_TRACE, #ClassName"::"#MethodName"(%x)\n", this));
  28. #undef TRACE_FUNCTION
  29. #define TRACE_FUNCTION(FunctionName) \
  30. DEBUGCHECK; \
  31. DEBUG_OUT((DEB_TRACE, #FunctionName"\n"));
  32. #undef CHECK_HRESULT
  33. #define CHECK_HRESULT(hr) \
  34. if ( FAILED(hr) ) \
  35. { \
  36. DEBUG_OUT((DEB_ERROR, \
  37. "**** ERROR RETURN <%s @line %d> -> %08lx\n", \
  38. __FILE__, \
  39. __LINE__, \
  40. hr)); \
  41. }
  42. #undef CHECK_LASTERROR
  43. #define CHECK_LASTERROR(lr) \
  44. if ( lr != ERROR_SUCCESS ) \
  45. { \
  46. DEBUG_OUT((DEB_ERROR, \
  47. "**** ERROR RETURN <%s @line %d> -> %dL\n", \
  48. __FILE__, \
  49. __LINE__, \
  50. lr)); \
  51. }
  52. #undef VERIFY
  53. #define VERIFY(x) Win4Assert(x)
  54. #undef DEBUG_OUT_LASTERROR
  55. #define DEBUG_OUT_LASTERROR \
  56. DEBUG_OUT((DEB_ERROR, \
  57. "**** ERROR RETURN <%s @line %d> -> %dL\n", \
  58. __FILE__, \
  59. __LINE__, \
  60. GetLastError()));
  61. #undef DEBUG_ASSERT
  62. #define DEBUG_ASSERT(e) \
  63. if ((e) == FALSE) \
  64. { \
  65. DEBUG_OUT((DEB_ERROR, \
  66. "**** ASSERTION <%s> FAILED <%s @line %d>\n", \
  67. #e, \
  68. __FILE__, \
  69. __LINE__)); \
  70. }
  71. #endif // DBG==1
  72. #endif // __DBG_HXX__