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.

89 lines
2.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: Debug.h
  7. //
  8. // Contents: Debug Routines
  9. //
  10. // Classes:
  11. //
  12. // Notes:
  13. //
  14. // History: 05-Nov-97 rogerg Created.
  15. //
  16. //--------------------------------------------------------------------------
  17. #ifndef _ONESTOPDEBUG_
  18. #define _ONESTOPDEBUG_
  19. #define _SENS 1
  20. #if (DBG == 1)
  21. #undef DEBUG
  22. #undef _DEBUG
  23. #define DEBUG 1
  24. #define _DEBUG 1
  25. #endif // DGB
  26. #define ErrJmp(label, errval, var) \
  27. {\
  28. var = errval;\
  29. goto label;\
  30. }
  31. #define smBoolChk(e) if (!(e)) {return FALSE;} else 1
  32. #define smErr(l, e) ErrJmp(l, e, sc)
  33. #define smChkTo(l, e) if (ERROR_SUCCESS != (sc = (e))) smErr(l, sc) else 1
  34. #define smChk(e) smChkTo(EH_Err, e)
  35. #define smHChk(e) smHChkTo(EH_Err, e)
  36. #define smMemTo(l, e) \
  37. if ((e) == NULL) smErr(l, E_OUTOFMEMORY) else 1
  38. #define smMem(e) smMemTo(EH_Err, e)
  39. #define _ZAWTRACK 0 // current ZAW Trackingis off, set this to 1 to turn on
  40. #if _ZAWTRACK
  41. // definitions for ZAW tracking.
  42. typedef BOOL (STDAPICALLTYPE *PFNONESTOPTRK)(DWORD dwFlags);
  43. void InitZawTrack();
  44. void UninitZawTrack();
  45. void LogZawTrack(DWORD dwFlags);
  46. #endif // _ZAWTRACK
  47. #if DEBUG
  48. STDAPI_(void) InitDebugFlags(void);
  49. STDAPI FnAssert( LPSTR lpstrExpr, LPSTR lpstrMsg, LPSTR lpstrFileName, UINT iLine );
  50. STDAPI FnTrace(LPSTR lpstrMsg, LPSTR lpstrFileName, UINT iLine );
  51. #undef Assert
  52. #undef AssertSz
  53. #undef Puts
  54. #define Assert(a) { if (!(a)) FnAssert(#a, NULL, __FILE__, __LINE__); }
  55. #define AssertSz(a, b) { if (!(a)) FnAssert(#a, b, __FILE__, __LINE__); }
  56. #define Puts(s) OutputDebugStringA(s)
  57. #undef TRACE
  58. #define TRACE(s) /* FnTrace(s,__FILE__,__LINE__) */ // tracing isn't turned on by default
  59. #define DEBUG_OUT_LASTERROR /* OutputDebugStringA(s) */ // debug out isn't turned on by default
  60. #else // !DEBUG
  61. #define Assert(a)
  62. #define AssertSz(a, b)
  63. #define Puts(s)
  64. #define TRACE(s)
  65. #define DEBUG_OUT_LASTERROR
  66. #endif // DEBUG
  67. #endif // _ONESTOPDEBUG_