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.

81 lines
2.2 KiB

  1. #ifndef _Multi_Level_Zone_Debug_H_
  2. #define _Multi_Level_Zone_Debug_H_
  3. #include <confdbg.h>
  4. #include <debspew.h>
  5. #define ZONE_FLAG(z) (1 << (z))
  6. #if defined(_DEBUG) && defined(MULTI_LEVEL_ZONES)
  7. #define DEFAULT_ZONES "Warning", "Trace", "Function",
  8. #define BASE_ZONE_INDEX (ZONE_FUNCTION + 1)
  9. #undef TRACE_OUT
  10. #define TRACE_OUT(s) MLZ_TraceZoneEnabled(MLZ_FILE_ZONE) ? (MLZ_TraceOut s) : 0
  11. #undef WARNING_OUT
  12. #define WARNING_OUT(s) MLZ_WarningOut s
  13. #undef DebugEntry
  14. #define DebugEntry(fn) MLZ_EntryOut(MLZ_FILE_ZONE, #fn)
  15. #undef DebugExitVOID
  16. #define DebugExitVOID(fn) MLZ_ExitOut(MLZ_FILE_ZONE, #fn, RCTYPE_VOID, (DWORD) 0)
  17. #undef DebugExitBOOL
  18. #define DebugExitBOOL(fn,f) MLZ_ExitOut(MLZ_FILE_ZONE, #fn, RCTYPE_BOOL, (DWORD) f)
  19. #undef DebugExitDWORD
  20. #define DebugExitDWORD(fn,dw) MLZ_ExitOut(MLZ_FILE_ZONE, #fn, RCTYPE_DWORD, (DWORD) dw)
  21. #undef DebugExitHRESULT
  22. #define DebugExitHRESULT(fn,hr) MLZ_ExitOut(MLZ_FILE_ZONE, #fn, RCTYPE_HRESULT, (DWORD) hr)
  23. #undef DebugExitINT
  24. #define DebugExitINT(fn,n) MLZ_ExitOut(MLZ_FILE_ZONE, #fn, RCTYPE_INT, (DWORD) n)
  25. #undef DebugExitULONG
  26. #define DebugExitULONG(fn,ul) MLZ_ExitOut(MLZ_FILE_ZONE, #fn, RCTYPE_ULONG, (DWORD) ul)
  27. #undef DebugExitPTR
  28. #define DebugExitPTR(fn,lp) MLZ_ExitOut(MLZ_FILE_ZONE, #fn, RCTYPE_PTR, (DWORD_PTR) lp)
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif // __cplusplus
  32. typedef enum
  33. {
  34. RCTYPE_VOID = 0,
  35. RCTYPE_BOOL = 1,
  36. RCTYPE_DWORD = 2,
  37. RCTYPE_HRESULT = 3,
  38. RCTYPE_INT = 4,
  39. RCTYPE_ULONG = 5,
  40. RCTYPE_PTR = 6
  41. }
  42. RCTYPE;
  43. void WINAPI MLZ_DbgInit(PSTR *apszZones, UINT cZones);
  44. void WINAPI MLZ_DbgDeInit(void);
  45. void WINAPIV MLZ_WarningOut(PSTR pszFormat, ...);
  46. BOOL WINAPI MLZ_TraceZoneEnabled(int iZone);
  47. void WINAPIV MLZ_TraceOut(PSTR pszFormat, ...);
  48. void WINAPI MLZ_EntryOut(int iZone, PSTR pszFunName);
  49. void WINAPI MLZ_ExitOut(int iZone, PSTR pszFunName, RCTYPE eRetCodeType, DWORD_PTR dwRetCode);
  50. #ifdef __cplusplus
  51. }
  52. #endif // __cplusplus
  53. #else
  54. #define DebugExitPTR(fn,lp)
  55. #endif // _DEBUG && MULTI_ZONE_OUT
  56. #endif // _Multi_Level_Zone_Debug_H_
  57.