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.

219 lines
3.9 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. dbgmsgp.hxx
  6. Abstract:
  7. Debug Library
  8. Author:
  9. Steve Kiraly (SteveKi) 5-Dec-1995
  10. Revision History:
  11. --*/
  12. #ifndef _DBGMSGP_HXX_
  13. #define _DBGMSGP_HXX_
  14. DEBUG_NS_BEGIN
  15. /********************************************************************
  16. Debug message class.
  17. ********************************************************************/
  18. class TDebugMsg
  19. {
  20. public:
  21. union StringTrait
  22. {
  23. LPTSTR pszTChar;
  24. LPCWSTR pszWide;
  25. LPWSTR pszWideNc;
  26. LPCSTR pszNarrow;
  27. LPSTR pszNarrowNc;
  28. LPBYTE pszByte;
  29. };
  30. TDebugMsg::
  31. TDebugMsg(
  32. VOID
  33. );
  34. TDebugMsg::
  35. ~TDebugMsg(
  36. VOID
  37. );
  38. BOOL
  39. TDebugMsg::
  40. Valid(
  41. VOID
  42. ) const;
  43. VOID
  44. TDebugMsg::
  45. Initialize(
  46. IN LPCTSTR pszPrefix,
  47. IN UINT uDevice,
  48. IN INT eLevel,
  49. IN INT eBreak
  50. );
  51. VOID
  52. TDebugMsg::
  53. Destroy(
  54. VOID
  55. );
  56. VOID
  57. TDebugMsg::
  58. Msg(
  59. IN UINT eLevel,
  60. IN LPCTSTR pszFile,
  61. IN UINT uLine,
  62. IN LPCTSTR pszModulePrefix,
  63. IN LPSTR pszMessage
  64. ) const;
  65. VOID
  66. TDebugMsg::
  67. Msg(
  68. IN UINT eLevel,
  69. IN LPCTSTR pszFile,
  70. IN UINT uLine,
  71. IN LPCTSTR pszModulePrefix,
  72. IN LPWSTR pszMessage
  73. ) const;
  74. LPSTR
  75. WINAPIV
  76. TDebugMsg::
  77. Fmt(
  78. IN LPCSTR pszFmt
  79. IN ...
  80. ) const;
  81. LPWSTR
  82. WINAPIV
  83. TDebugMsg::
  84. Fmt(
  85. IN LPCWSTR pszFmt
  86. IN ...
  87. ) const;
  88. VOID
  89. TDebugMsg::
  90. Disable(
  91. VOID
  92. );
  93. VOID
  94. TDebugMsg::
  95. Enable(
  96. VOID
  97. );
  98. BOOL
  99. TDebugMsg::
  100. Attach(
  101. IN HANDLE *phDevice,
  102. IN UINT uDevice,
  103. IN LPCTSTR pszConfiguration,
  104. IN TDebugNodeDouble **ppDeviceRoot = NULL
  105. );
  106. VOID
  107. TDebugMsg::
  108. Detach(
  109. IN HANDLE *phDevice
  110. );
  111. VOID
  112. TDebugMsg::
  113. SetMessageFieldFormat(
  114. IN UINT Field,
  115. IN LPTSTR pszFormat
  116. );
  117. private:
  118. //
  119. // Copying and assignment are not defined.
  120. //
  121. TDebugMsg::
  122. TDebugMsg(
  123. const TDebugMsg &rhs
  124. );
  125. const TDebugMsg &
  126. TDebugMsg::
  127. operator=(
  128. const TDebugMsg &rhs
  129. );
  130. BOOL
  131. TDebugMsg::
  132. Type(
  133. IN EDebugLevel eLevel
  134. ) const;
  135. BOOL
  136. TDebugMsg::
  137. Break(
  138. IN EDebugLevel eLevel
  139. ) const;
  140. VOID
  141. TDebugMsg::
  142. Output(
  143. IN EDebugLevel eLevel,
  144. IN LPCTSTR pszFileName,
  145. IN UINT uLine,
  146. IN LPCTSTR pszModulePrefix,
  147. IN StringTrait &strMsg
  148. ) const;
  149. BOOL
  150. TDebugMsg::
  151. GetParameter(
  152. IN UINT eFlags,
  153. IN OUT TDebugString &strString,
  154. IN LPCTSTR pszFileName,
  155. IN UINT uLine
  156. ) const;
  157. BOOL
  158. TDebugMsg::
  159. BuildFinalString(
  160. IN TDebugString &strFinal,
  161. IN EDebugLevel eDebugLevel,
  162. IN LPCTSTR pszPrefix,
  163. IN LPCTSTR pszFileName,
  164. IN UINT uLine,
  165. IN StringTrait &StrMsg
  166. ) const;
  167. EDebugLevel m_eBreak;
  168. EDebugLevel m_eLevel;
  169. TDebugString *m_pstrPrefix;
  170. TDebugNodeDouble *m_pDeviceRoot;
  171. TDebugNodeDouble *m_pBuiltinDeviceRoot;
  172. TDebugString *m_pstrFileInfoFormat;
  173. TDebugString *m_pstrTimeStampFormatShort;
  174. TDebugString *m_pstrTimeStampFormatLong;
  175. TDebugString *m_pstrThreadIdFormat;
  176. };
  177. DEBUG_NS_END
  178. #endif // DBGMSG_HXX