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.

160 lines
4.9 KiB

  1. /*******************************************************************************
  2. Copyright (c) 1995-96 Microsoft Corporation
  3. Abstract:
  4. hfdebug.h
  5. Debugging stuff for use in Hyperfine. See core/debug/hfdebug.txt for more
  6. information.
  7. *******************************************************************************/
  8. #ifndef _HFDEBUG_H_
  9. #define _HFDEBUG_H_
  10. #include "crtdbg.h"
  11. #include <stdio.h>
  12. //+-------------------------------------------------------------------------
  13. //
  14. // VC 5 compiler requires these templates to be outside of extern C
  15. //
  16. //--------------------------------------------------------------------------
  17. #if _DEBUG
  18. template <class t> inline t
  19. TraceFail(t errExpr, int errTest, BOOL fIgnore, LPSTR pstrExpr, LPSTR pstrFile, int line)
  20. {
  21. return (t) TraceFailL((long) errExpr, errTest, fIgnore, pstrExpr, pstrFile, line);
  22. }
  23. template <class t, class v> inline t
  24. TraceWin32(t errExpr, v errTest, BOOL fIgnore, LPSTR pstrExpr, LPSTR pstrFile, int line)
  25. {
  26. return (t) TraceWin32L((long) errExpr, (long)errTest, fIgnore, pstrExpr, pstrFile, line);
  27. }
  28. #endif
  29. #ifdef __cplusplus
  30. extern "C"
  31. {
  32. #endif
  33. //--------------------------------------------------------------------------
  34. // Assert & Verify
  35. //--------------------------------------------------------------------------
  36. #define Assert(x)
  37. #define Verify(x) x
  38. #define StartupAssert(x)
  39. //--------------------------------------------------------------------------
  40. // Trace Tags
  41. //--------------------------------------------------------------------------
  42. typedef int TAG;
  43. #define TraceTag(x)
  44. #define TraceTagEx(x)
  45. #define TraceCallers(tag, iStart, cTotal)
  46. #define DeclareTag(tag, szOwner, szDescription)
  47. #define DeclareTagOther(tag, szOwner, szDescription)
  48. //--------------------------------------------------------------------------
  49. // Memory Allocation
  50. //--------------------------------------------------------------------------
  51. #define BEGIN_LEAK
  52. #define END_LEAK
  53. #define SET_ALLOC_HOOK
  54. #define DUMPMEMORYLEAKS
  55. #define DbgPreAlloc(cb) cb
  56. #define DbgPostAlloc(pv) pv
  57. #define DbgPreFree(pv) pv
  58. #define DbgPostFree()
  59. #define DbgPreRealloc(pv, cb, ppv) cb
  60. #define DbgPostRealloc(pv) pv
  61. #define DbgPreGetSize(pv) pv
  62. #define DbgPostGetSize(cb) cb
  63. #define DbgPreDidAlloc(pv) pv
  64. #define DbgPostDidAlloc(pv, fAct) fAct
  65. #define DbgRegisterMallocSpy()
  66. #define DbgRevokeMallocSpy()
  67. #define DbgMemoryTrackDisable(fb)
  68. //+---------------------------------------------------------------------
  69. // Interface tracing.
  70. //----------------------------------------------------------------------
  71. #define WATCHINTERFACE(iid, p, pstr) (p)
  72. //--------------------------------------------------------------------------
  73. // Miscelleanous
  74. //--------------------------------------------------------------------------
  75. #define RESTOREDEFAULTDEBUGSTATE
  76. #define DebugCode(block) // Nothing
  77. //--------------------------------------------------------------------------
  78. // Failure testing
  79. //--------------------------------------------------------------------------
  80. #define TFAIL(x, e) (x)
  81. #define TW32(x, e) (x)
  82. #define THR(x) (x)
  83. #define TFAIL_NOTRACE(e, x) (x)
  84. #define TW32_NOTRACE(e, x) (x)
  85. #define THR_NOTRACE(x) (x)
  86. #define IGNORE_FAIL(e, x) (x)
  87. #define IGNORE_W32(e,x) (x)
  88. #define IGNORE_HR(x) (x)
  89. //+-------------------------------------------------------------------------
  90. // Return tracing
  91. //--------------------------------------------------------------------------
  92. #define SRETURN(hr) return (hr)
  93. #define RRETURN(hr) return (hr)
  94. #define RRETURN1(hr, s1) return (hr)
  95. #define RRETURN2(hr, s1, s2) return (hr)
  96. #define RRETURN3(hr, s1, s2, s3) return (hr)
  97. #define SRETURN_NOTRACE(hr) return (hr)
  98. #define RRETURN_NOTRACE(hr) return (hr)
  99. #define RRETURN1_NOTRACE(hr, s1) return (hr)
  100. #define RRETURN2_NOTRACE(hr, s1, s2) return (hr)
  101. #define RRETURN3_NOTRACE(hr, s1, s2, s3) return (hr)
  102. //+-------------------------------------------------------------------------
  103. // Debug view
  104. //--------------------------------------------------------------------------
  105. void DebugView(HWND hwndOwner, IUnknown *pUnk);
  106. #ifdef __cplusplus
  107. }
  108. #endif
  109. //+-------------------------------------------------------------------------
  110. // Object Tracker stuff
  111. //--------------------------------------------------------------------------
  112. #define DUMPTRACKEDOBJECTS
  113. #define DECLARE_TRACKED_OBJECT
  114. #define TRACK_OBJECT(_x_)
  115. /* class __declspec( dllexport) CObjectCheck
  116. {
  117. CObjectCheck(void) {};
  118. ~CObjectCheck(void) {};
  119. void Append(void * pv) {};
  120. };*/
  121. #endif // _HFDEBUG_H_