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.

71 lines
1.6 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 smMemTo(l, e) \
  36. if ((e) == NULL) smErr(l, E_OUTOFMEMORY) else 1
  37. #define smMem(e) smMemTo(EH_Err, e)
  38. #if DEBUG
  39. STDAPI_(void) InitDebugFlags(void);
  40. STDAPI FnAssert( LPSTR lpstrExpr, LPSTR lpstrMsg, LPSTR lpstrFileName, UINT iLine );
  41. STDAPI FnTrace(LPSTR lpstrMsg, LPSTR lpstrFileName, UINT iLine );
  42. #undef Assert
  43. #undef AssertSz
  44. #define Assert(a) { if (!(a)) FnAssert(#a, NULL, __FILE__, __LINE__); }
  45. #define AssertSz(a, b) { if (!(a)) FnAssert(#a, b, __FILE__, __LINE__); }
  46. #undef TRACE
  47. #define TRACE(s) /* FnTrace(s,__FILE__,__LINE__) */ // tracing isn't turned on by default
  48. #else // !DEBUG
  49. #define Assert(a)
  50. #define AssertSz(a, b)
  51. #define TRACE(s)
  52. #endif // DEBUG
  53. #endif // _ONESTOPDEBUG_