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.

327 lines
6.4 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. diagrprt.h
  5. Abstract:
  6. This file contains all defines for the RAS Diag Report.
  7. Author:
  8. Jeff Sigman (JeffSi) September 13, 2001
  9. Environment:
  10. User Mode
  11. Revision History:
  12. JeffSi 09/13/01 Created
  13. --*/
  14. #ifndef _DIAGRPRT_H_
  15. #define _DIAGRPRT_H_
  16. #define ALL_USERS_PROF 0x00000001
  17. #define CURRENT_USER 0x00000002
  18. #define GET_FOR_CM 0x00000004
  19. #define GET_FOR_RAS 0x00000008
  20. #define GET_FOR_MSINFO 0x00000010
  21. #define SHOW_LOGS 0x00000001
  22. #define SHOW_INSTALL 0x00000002
  23. #define SHOW_CONFIG 0x00000004
  24. #define SHOW_ALL 0x0000ffff
  25. #define TIMESIZE 8
  26. #define TIMEDATESTR 80
  27. #define MAX_MSG_LENGTH 5120
  28. #define BUF_WRITE_SIZE 4096
  29. #define TITLE_SIZE 128
  30. #define RPRT_ITM 14
  31. #define RPRT_ITM_VERBOSE 1
  32. //
  33. // Macro to determine the percentage complete
  34. //
  35. #define ADD_PERCENT_DONE(x) \
  36. ((DWORD)(100 / (x ? (RPRT_ITM + RPRT_ITM_VERBOSE) : RPRT_ITM)))
  37. typedef
  38. LPBYTE
  39. (*RAS_PRINTFILE_FUNC_CB)(
  40. IN LPBYTE pBuff,
  41. IN DWORD dwSize,
  42. IN DWORD dwHours);
  43. typedef struct _BUFFER_WRITE_FILE
  44. {
  45. DWORD dwPosition;
  46. HANDLE hFile;
  47. LPBYTE lpBuff;
  48. } BUFFER_WRITE_FILE;
  49. typedef struct _REPORT_INFO
  50. {
  51. BOOL fDisplay;
  52. BOOL fVerbose;
  53. DWORD dwHours;
  54. BUFFER_WRITE_FILE* pBuff;
  55. DiagGetReportCb pCallback;
  56. GET_REPORT_STRING_CB* pCbInfo;
  57. } REPORT_INFO;
  58. typedef struct _CMD_LINE_UTILS
  59. {
  60. PWCHAR pwszCmdLine;
  61. PWCHAR pwszAnchor;
  62. } CMD_LINE_UTILS;
  63. //
  64. // task list structure
  65. //
  66. typedef struct _TASK_LIST
  67. {
  68. DWORD dwProcessId;
  69. HANDLE hwnd;
  70. LPTSTR lpszWinSta;
  71. LPTSTR lpszDesk;
  72. WCHAR szWindowTitle[TITLE_SIZE];
  73. } TASK_LIST, *PTASK_LIST;
  74. typedef struct _TASK_LIST_ENUM
  75. {
  76. PTASK_LIST tlist;
  77. DWORD dwNumTasks;
  78. LPTSTR lpszWinSta;
  79. LPTSTR lpszDesk;
  80. BOOL bFirstLoop;
  81. } TASK_LIST_ENUM, *PTASK_LIST_ENUM;
  82. extern CONST WCHAR g_pwszLBracket;
  83. extern CONST WCHAR g_pwszRBracket;
  84. extern CONST WCHAR g_pwszBackSlash;
  85. extern CONST WCHAR g_pwszNull;
  86. extern CONST WCHAR g_pwszEmpty[];
  87. extern CONST WCHAR g_pwszSpace[];
  88. extern CONST WCHAR g_pwszLogSrchStr[];
  89. extern CONST WCHAR g_pwszLogging[];
  90. extern CONST WCHAR g_pwszDispNewLine[];
  91. extern CONST WCHAR g_pwszNewLineHtml[];
  92. extern CONST WCHAR g_pwszPreStart[];
  93. extern CONST WCHAR g_pwszPreEnd[];
  94. extern CONST WCHAR g_pwszAnNameStart[];
  95. extern CONST WCHAR g_pwszAnNameMiddle[];
  96. extern CONST WCHAR g_pwszAnNameEnd[];
  97. extern CONST WCHAR g_pwszAnStart[];
  98. extern CONST WCHAR g_pwszAnMiddle[];
  99. extern CONST WCHAR g_pwszAnEnd[];
  100. extern CONST WCHAR g_pwszLiStart[];
  101. extern CONST WCHAR g_pwszLiEnd[];
  102. extern CONST WCHAR g_pwszTableOfContents[];
  103. extern CONST WCHAR g_pwszTraceCollectTracingLogs[];
  104. extern CONST WCHAR g_pwszTraceCollectCmLogs[];
  105. extern CONST WCHAR g_pwszTraceCollectModemLogs[];
  106. extern CONST WCHAR g_pwszTraceCollectIpsecLogs[];
  107. extern CONST WCHAR g_pwszPrintRasEventLogs[];
  108. extern CONST WCHAR g_pwszPrintSecurityEventLogs[];
  109. extern CONST WCHAR g_pwszPrintRasInfData[];
  110. extern CONST WCHAR g_pwszHrValidateRas[];
  111. extern CONST WCHAR g_pwszHrShowNetComponentsAll[];
  112. extern CONST WCHAR g_pwszCheckRasRegistryKeys[];
  113. extern CONST WCHAR g_pwszPrintRasEnumDevices[];
  114. extern CONST WCHAR g_pwszPrintProcessInfo[];
  115. extern CONST WCHAR g_pwszPrintConsoleUtils[];
  116. extern CONST WCHAR g_pwszPrintWinMsdReport[];
  117. extern CONST WCHAR g_pwszPrintAllRasPbks[];
  118. VOID
  119. WriteLinkBackToToc(
  120. IN BUFFER_WRITE_FILE* pBuff);
  121. VOID
  122. WriteHtmlSection(
  123. IN BUFFER_WRITE_FILE* pBuff,
  124. IN LPCWSTR pwszAnchor,
  125. IN DWORD dwMsgId);
  126. VOID
  127. WriteHeaderSep(
  128. IN BUFFER_WRITE_FILE* pBuff,
  129. IN LPCWSTR pwszTitle);
  130. DWORD
  131. BufferWriteFileStrW(
  132. IN BUFFER_WRITE_FILE* pBuff,
  133. IN LPCWSTR pwszString);
  134. DWORD
  135. PrintFile(
  136. IN REPORT_INFO* pInfo,
  137. IN LPCWSTR pwszFile,
  138. IN BOOL fWritePath,
  139. IN RAS_PRINTFILE_FUNC_CB pCallback);
  140. PWCHAR
  141. GetTracingDir();
  142. BOOL
  143. GetCMLoggingSearchPath(
  144. IN HANDLE hKey,
  145. IN LPCWSTR pwszName,
  146. IN LPCWSTR* ppwszLogPath,
  147. IN LPCWSTR* ppwszSeach);
  148. PWCHAR
  149. FormatMessageFromMod(
  150. IN HANDLE hModule,
  151. IN DWORD dwId);
  152. VOID
  153. FreeFormatMessageFromMod(
  154. IN LPCWSTR pwszMessage);
  155. PWCHAR
  156. LoadStringFromHinst(
  157. IN HINSTANCE hInst,
  158. IN DWORD dwId);
  159. VOID
  160. FreeStringFromHinst(
  161. IN LPCWSTR pwszMessage);
  162. DWORD
  163. CopyAndCallCB(
  164. IN REPORT_INFO* pInfo,
  165. IN DWORD dwId);
  166. PWCHAR
  167. CreateErrorString(
  168. IN WORD wNumStrs,
  169. IN LPCWSTR pswzStrings,
  170. IN LPCWSTR pswzErrorMsg);
  171. VOID
  172. WriteEventLogEntry(
  173. IN BUFFER_WRITE_FILE* pBuff,
  174. IN PEVENTLOGRECORD pevlr,
  175. IN LPCWSTR pwszDescr,
  176. IN LPCWSTR pwszCategory);
  177. DWORD
  178. BufferWriteMessage(
  179. IN BUFFER_WRITE_FILE* pBuff,
  180. IN HANDLE hModule,
  181. IN DWORD dwMsgId,
  182. ...);
  183. DWORD
  184. WriteNewLine(
  185. IN BUFFER_WRITE_FILE* pBuff);
  186. DWORD
  187. BufferWriteFileCharW(
  188. IN BUFFER_WRITE_FILE* pBuff,
  189. IN CONST WCHAR wszChar);
  190. DWORD
  191. DiagGetReport(
  192. IN DWORD dwFlags,
  193. IN OUT LPCWSTR pwszString,
  194. IN OPTIONAL DiagGetReportCb pCallback,
  195. IN OPTIONAL PVOID pContext);
  196. VOID
  197. PrintTableOfContents(
  198. IN REPORT_INFO* pInfo,
  199. IN DWORD dwFlag);
  200. DWORD
  201. RasDiagShowAll(
  202. IN REPORT_INFO* pInfo);
  203. DWORD
  204. RasDiagShowInstallation(
  205. IN REPORT_INFO* pInfo);
  206. DWORD
  207. RasDiagShowConfiguration(
  208. IN REPORT_INFO* pInfo);
  209. DWORD
  210. CopyTempFileName(
  211. OUT LPCWSTR pwszTempFileName);
  212. PWCHAR
  213. CreateHtmFileName(
  214. IN LPCWSTR pwszFile);
  215. DWORD
  216. CreateReportFile(
  217. IN BUFFER_WRITE_FILE* pBuff,
  218. IN LPCWSTR pwszReport);
  219. VOID
  220. CloseReportFile(
  221. IN BUFFER_WRITE_FILE* pBuff);
  222. VOID
  223. PrintHtmlHeader(
  224. IN BUFFER_WRITE_FILE* pBuff);
  225. VOID
  226. PrintHtmlFooter(
  227. IN BUFFER_WRITE_FILE* pBuff);
  228. PWCHAR
  229. CabCompressFile(
  230. IN LPCWSTR pwszFile);
  231. DWORD
  232. MapiSendMail(
  233. IN LPCWSTR pwszEmailAdr,
  234. IN LPCWSTR pwszTempFile);
  235. LPBYTE
  236. ParseRasLogForTime(
  237. IN LPBYTE pBuff,
  238. IN DWORD dwSize,
  239. IN DWORD dwHours);
  240. LPBYTE
  241. ParseModemLogForTime(
  242. IN LPBYTE pBuff,
  243. IN DWORD dwSize,
  244. IN DWORD dwHours);
  245. LPBYTE
  246. ParseCmLogForTime(
  247. IN LPBYTE pBuff,
  248. IN DWORD dwSize,
  249. IN DWORD dwHours);
  250. LPBYTE
  251. ParseIpsecLogForTime(
  252. IN LPBYTE pBuff,
  253. IN DWORD dwSize,
  254. IN DWORD dwHours);
  255. #endif // _DIAGRPRT_H_