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.

117 lines
2.6 KiB

  1. /*++
  2. Copyright (c) 1990-1995 Microsoft Corporation
  3. Module Name:
  4. debug.h
  5. Abstract:
  6. This module contains all debugger definitions
  7. Author:
  8. 30-Aug-1995 Wed 19:02:36 created -by- Daniel Chou (danielc)
  9. [Environment:]
  10. NT Windows - Common Printer Driver UI DLL.
  11. [Notes:]
  12. Revision History:
  13. --*/
  14. #if DBG
  15. VOID
  16. cdecl
  17. CPSUIDbgPrint(
  18. LPSTR pszFormat,
  19. ...
  20. );
  21. VOID
  22. CPSUIDbgType(
  23. INT Type
  24. );
  25. VOID
  26. _CPSUIAssert(
  27. LPSTR pMsg,
  28. LPSTR pFalseExp,
  29. LPSTR pFilename,
  30. UINT LineNo,
  31. LPVOID Exp,
  32. BOOL Stop
  33. );
  34. VOID
  35. CPSUIDbgShowItem(
  36. PTVWND pTVWnd,
  37. LPSTR pTitle,
  38. UINT Level,
  39. POPTITEM pItem
  40. );
  41. extern BOOL DoCPSUIWarn;
  42. extern BOOL DoDbgMsg;
  43. extern BOOL DoIntMsg;
  44. #define _ISDBG(x) (((DoIntMsg) && (!(x))) || \
  45. ((DoDbgMsg) && ((x)&DBG_CPSUIFILENAME)))
  46. #define _DBGP(x) (CPSUIDbgPrint x)
  47. #define DBGP(x) if (DoDbgMsg) { _DBGP(x); }
  48. #if 1
  49. #define DEFINE_DBGVAR(x) DWORD DBG_CPSUIFILENAME=(x)
  50. #else
  51. #define DEFINE_DBGVAR(x)
  52. #endif // if 1
  53. #define CPSUIDBG(x,y) if ((DoDbgMsg)&&((x)&DBG_CPSUIFILENAME)){ \
  54. CPSUIDbgType(0);_DBGP(y);}
  55. #define CPSUIDBGBLK(x) x;
  56. #define CPSUIRECT(x,ps,prc,i,j) \
  57. if (_ISDBG(x)) { CPSUIDbgType(0); \
  58. _DBGP(("RECT *%hs* [%ld:%ld]: (%ld, %ld) - (%ld, %ld) = %ld x %ld", \
  59. (ps), (LONG)(i),(LONG)(j), (prc)->left, (prc)->top, \
  60. (prc)->right, (prc)->bottom, (prc)->right - (prc)->left, \
  61. (prc)->bottom - (prc)->top)); }
  62. #define CPSUIOPTITEM(x,p,t,l,i) if(_ISDBG(x)) {CPSUIDbgShowItem(p,t,l,i);}
  63. #define CPSUIWARN(x) if(DoCPSUIWarn) { CPSUIDbgType(1);_DBGP(x); }
  64. #define CPSUIINT(x) if(DoIntMsg){ CPSUIDbgType(0);_DBGP(x); }
  65. #define CPSUIERR(x) CPSUIDbgType(-1);_DBGP(x)
  66. #define CPSUIRIP(x) CPSUIERR(x); DebugBreak()
  67. #define CPSUIASSERT(b,x,e,i) \
  68. if (!(e)) { _CPSUIAssert(x,#e,__FILE__,(UINT)__LINE__,(LPVOID)(i),b); }
  69. #else // DBG
  70. #define CPSUIDBGBLK(x)
  71. #define DEFINE_DBGVAR(x)
  72. #define CPSUIDBG(x,y)
  73. #define CPSUIRECT(x,ps,prc,i,j)
  74. #define CPSUIOPTITEM(x,p,l,t,i)
  75. #define CPSUIWARN(x)
  76. #define CPSUIINT(x)
  77. #define CPSUIERR(x)
  78. #define CPSUIRIP(x)
  79. #define CPSUIASSERT(b,x,e,i)
  80. #endif // DBG