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.

111 lines
3.7 KiB

  1. //////////////////////////////////////////////////////////////////
  2. // File : dbg.h
  3. // Purpose : MACRO definition for showing debug message
  4. //
  5. //
  6. // Copyright(c) 1991-1997, Microsoft Corp. All rights reserved
  7. //
  8. //////////////////////////////////////////////////////////////////
  9. #ifndef _DBG_H_
  10. #define _DBG_H_
  11. //-------------------------------------------------------
  12. //dbgmgr.h is ../common/dbgmgr.h IME98's common debuging api header.
  13. //In IMEPAD, only for MemAlloc(), MemFree() function.
  14. //because, we had to send allocate data to ImeIPoint and Freed in
  15. //it.
  16. //-------------------------------------------------------
  17. //-------------------------------------------------------
  18. //MACRO function(?) prototype declare
  19. //-------------------------------------------------------
  20. ////////////////////////////////////////////////////////
  21. // Function : DBG
  22. // Type : VOID
  23. // Purpose : Printing ANSI debug message with same usage as printf()
  24. // :
  25. // Args :
  26. // : LPSTR lpstrFuncName
  27. // : ...
  28. // CAUTION : Must use DOUBLE Blaket to remove in Release version!!!
  29. /////////////////////////////////////////////////////////
  30. //VOID DBG((LPSTR lpstrFuncName, ...));
  31. ////////////////////////////////////////////////////////
  32. // Function: DBGW
  33. // Type : VOID
  34. // Purpose : Printing Unicode debug message with same usage as printf()
  35. // Args :
  36. // : LPWSTR lpstrFuncName
  37. // : ...
  38. // CAUTION: Please use DOUBLE Blaket!!!
  39. /////////////////////////////////////////////////////////
  40. //VOID DBGW((LPWSTR lpstrFuncName, ...));
  41. ////////////////////////////////////////////////////////
  42. // Function : DBGMB
  43. // Type : VOID
  44. // Purpose : Show Messagebox for ANSI debug message
  45. // : Same usage as printf()
  46. // Args :
  47. // : LPSTR lpstrFuncName
  48. // : ...
  49. // CAUTION : Must use DOUBLE Blaket to remove in Release version!!!
  50. /////////////////////////////////////////////////////////
  51. //VOID DBGMB((LPSTR lpstrFuncName, ...));
  52. ////////////////////////////////////////////////////////
  53. // Function : DBGShowWindow
  54. // Type : VOID
  55. // Purpose : Invoke debug message window.
  56. // : DBG(), DBGW()'s message is shown here.
  57. // Args : HINSTANCE hInst
  58. // : HWND hwndOwner
  59. /////////////////////////////////////////////////////////
  60. //VOID DBGShowWindow(HINSTANCE hInst, HWND hwndOwner);
  61. #ifdef _DEBUG
  62. extern VOID _exbtnInit(VOID);
  63. #ifndef UNICODE_ONLY
  64. extern VOID _exbtnA (LPSTR lpstrFile, INT lineNo, LPSTR lpstrMsg);
  65. extern VOID _exbtnPrintA (LPSTR lpstrMsg, ...);
  66. extern LPSTR _exbtnVaStrA (LPSTR lpstrFmt, ...);
  67. extern LPWSTR _exbtnMulti2Wide(LPSTR lpstr);
  68. extern VOID _exbtnMBA(LPSTR lpstrFile, INT lineNo, LPSTR lpstrMsg);
  69. extern VOID _exbtnMBW(LPWSTR lpstrFile, INT lineNo, LPWSTR lpstrMsg);
  70. #endif
  71. #ifndef ANSI_ONLY
  72. extern VOID _exbtnW(LPWSTR lpstrFile, INT lineNo, LPWSTR lpstrMsg);
  73. extern VOID _exbtnPrintW(LPWSTR lpstrMsg, ...);
  74. extern LPWSTR _exbtnVaStrW(LPWSTR lpstrFmt, ...);
  75. #endif
  76. #endif
  77. #if defined(_DEBUG) || (defined(_NDEBUG) && defined(_RELDEBUG))
  78. # define DBG_INIT() _exbtnInit()
  79. # define DBGW(a) _exbtnW( _exbtnMulti2Wide(__FILE__), __LINE__, _exbtnVaStrW a)
  80. # define DBGA(a) _exbtnA(__FILE__, __LINE__, _exbtnVaStrA a)
  81. # define Dbg(a) _exbtnA(__FILE__, __LINE__, _exbtnVaStrA a)
  82. # define DBGMB(a) _exbtnMBA(__FILE__, __LINE__, _exbtnVaStrA a)
  83. # define DBGMBA(a) _exbtnMBA(__FILE__, __LINE__, _exbtnVaStrA a)
  84. # define DBGMBW(a) _exbtnMBW(_exbtnMulti2Wide(__FILE__), __LINE__, _exbtnVaStrW a)
  85. #else //!_DEBUG //in Release version, these are disapear...
  86. # define DBG_INIT()
  87. # define DBGW(a)
  88. # define DBGA(a)
  89. # define Dbg(a)
  90. # define DBGMB(a)
  91. # define DBGMBA(a)
  92. # define DBGMBW(a)
  93. #endif //_DEBUG
  94. #endif //_DBG_H_