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.

248 lines
4.7 KiB

  1. /*++
  2. Copyright (C) 1992-2001 Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. rasdiag.h
  5. Abstract:
  6. Header containing rasdiag forward defintions, etc
  7. Author:
  8. Anthony Leibovitz (tonyle) 02-01-2001
  9. Revision History:
  10. --*/
  11. #ifndef _RASDIAG_H_
  12. #define _RASDIAG_H_
  13. /* Forward definitions */
  14. #include "diagcommon.h"
  15. #include "capture.h"
  16. #ifdef BUILD_RSNIFF
  17. #include "rsniffclnt.h"
  18. #endif
  19. typedef struct _RDGHDR {
  20. DWORD dwVer;
  21. DWORD dwRDGMajVer;
  22. DWORD dwRDGMinVer;
  23. SYSTEMTIME CreationTime;
  24. } *PRDGHDR, RDGHDR;
  25. typedef struct _RDGHDR_VER5 {
  26. DWORD dwVer;
  27. SYSTEMTIME CreationTime;
  28. } *PRDGHDR_VER5, RDGHDR_VER5;
  29. typedef struct _RDGFILEHDR {
  30. DWORD dwVer;
  31. WCHAR szFilename[MAX_PATH+1];
  32. DWORD dwFileSize;
  33. } *PRDGFILEHDR, RDGFILEHDR;
  34. typedef struct _RDGFILEHDR_VER5 {
  35. DWORD dwVer;
  36. CHAR szFilename[MAX_PATH+1];
  37. DWORD dwFileSize;
  38. } *PRDGFILEHDR_VER5, RDGFILEHDR_VER5;
  39. typedef struct _tagCMINFO {
  40. DWORD fStatus;
  41. WCHAR *pwcRegKey;
  42. WCHAR *pwcCurUserRegKey;
  43. WCHAR *pszCmsFileName;
  44. WCHAR *pwcLogFileName;
  45. WCHAR *pwcServiceName;
  46. DWORD dwPrevLogState; // save off current state (put back when done)
  47. struct _tagCMINFO *pNext;
  48. } *PCMINFO, CMINFO;
  49. typedef struct _tagRASDIAGCONFIG {
  50. DWORD dwUserOptions;
  51. WCHAR szTempDir[MAX_PATH+1];
  52. WCHAR szRasDiagDir[MAX_PATH+1];
  53. WCHAR szWindowsDirectory[MAX_PATH+1];
  54. WCHAR szTracingDir[MAX_PATH+1];
  55. WCHAR szSysPbk[MAX_PATH+1];
  56. WCHAR szUserPbk[MAX_PATH+1];
  57. SYSTEMTIME DiagTime;
  58. PRASDIAGCAPTURE pNetInterfaces;
  59. DWORD dwNetCount;
  60. #ifdef BUILD_RSNIFF
  61. PSOCKCB pSockCb;
  62. #endif
  63. WCHAR **pCmFileName;
  64. DWORD dwCmLogs;
  65. PCMINFO pCmInfo;
  66. } *PRASDIAGCONFIG, RASDIAGCONFIG;
  67. #ifndef _RASDIAG_P_H_
  68. #include "rasdiag_p.h"
  69. #endif //_RASDIAG_P_H_
  70. typedef void (*LPFNNetCfgDiagFromCommandArgs)(DIAG_OPTIONS *);
  71. #define CMINFO_STATUS_ALLUSER 0x00000001
  72. #define CMINFO_STATUS_CURUSER 0x00000002
  73. BOOL
  74. DoCMLogSetup(PCMINFO *ppCmInfo);
  75. void
  76. DeleteCMLogs(PCMINFO pCmInfo);
  77. BOOL
  78. SetCmLogState(PCMINFO pCmInfo, BOOL bEnabled);
  79. void
  80. FindCmLog(WCHAR *pszSource, PCMINFO *ppCmInfo, DWORD dwOpt);
  81. BOOL
  82. GetCmLogInfo(PCMINFO pCmInfo);
  83. void
  84. FreeCmInfoResources(PCMINFO pCmInfo);
  85. BOOL
  86. AddLog(HANDLE hWrite, WCHAR *pszSrcFileName, BOOL bSrcUnicode, WCHAR *pszLogTitle);
  87. BOOL
  88. AddModemLogs(HANDLE hWrite);
  89. void
  90. SetModemTracing(BOOL bState);
  91. void
  92. DeleteModemLogs(WCHAR *szWindowsDirectory);
  93. void
  94. DeviceDump(HANDLE hWrite);
  95. BOOL
  96. SetTracing(BOOL bState);
  97. void
  98. DeleteTracingLogs(WCHAR *pszTracingDir);
  99. void
  100. OpenLogFileWithEditor(WCHAR *pszTracingDirectory, WCHAR *szWindowsDirectory);
  101. void
  102. AddHeader(HANDLE hFile, PRASDIAGCONFIG);
  103. BOOL
  104. BuildRasDiagLog(PRASDIAGCONFIG pRdc);
  105. BOOL
  106. CheckFileAccess(WCHAR *pszTracingDir);
  107. BOOL
  108. GetPbkPaths(WCHAR *szSysPbk, WCHAR *szUserPbk);
  109. BOOL
  110. EnableOakleyLogging(BOOL bEnable);
  111. BOOL
  112. AddOakleyLog(HANDLE hWrite);
  113. BOOL
  114. AddNetworkLog(HANDLE hWrite);
  115. BOOL
  116. DeleteOakleyLog(void);
  117. BOOL
  118. CreateRasdiagDirectory(WCHAR *pszRasdiagDirectory);
  119. void
  120. RaiseFolderUI(WCHAR *pszDir);
  121. BOOL
  122. ProcessArgs(int argc, WCHAR **argv, DWORD *pdwUserOptions);
  123. ///// Service
  124. void
  125. MonitorState(SC_HANDLE hService, WCHAR *pServiceName, DWORD dwStateToEnforce);
  126. BOOL
  127. MyStartService(SC_HANDLE hService, WCHAR *pServiceName);
  128. BOOL
  129. StopService(SC_HANDLE hService, WCHAR *pServiceName);
  130. BOOL
  131. StopStartService(WCHAR *pServiceName, BOOL bStart);
  132. ///// CM
  133. BOOL
  134. EnableCMLogging(BOOL bEnable, WCHAR ***ppPathArray, DWORD *pdwCount, WCHAR *szTempDir);
  135. void
  136. CleanupCMLogFiles(WCHAR **pFileAry, DWORD dwCount);
  137. void
  138. DeleteCMLogFiles(WCHAR **pFileAry, DWORD dwCount);
  139. ///// Package
  140. BOOL
  141. UnpackFile(HANDLE hSrcFile, PRDGFILEHDR pHdr, OPTIONAL IN WCHAR *pszDestinationPath);
  142. BOOL
  143. ClosePackage(HANDLE hFile);
  144. BOOL
  145. CreatePackage(HANDLE *phFile, SYSTEMTIME *pDiagTime, WCHAR *szRasDiagDir);
  146. BOOL
  147. AddFileToPackage(HANDLE hPkgFile, WCHAR *pszFileName);
  148. BOOL
  149. BuildPackage(PRASDIAGCAPTURE pCaptures, DWORD dwCaptureCount, WCHAR *pszRasDiagDir, SYSTEMTIME *pDiagTime);
  150. BOOL
  151. PrintUserMsg(int iMsgID,...);
  152. void
  153. ExecNetUtils(void);
  154. BOOL
  155. DoNetTests(void);
  156. BOOL
  157. DumpProcessInfo(HANDLE hWrite);
  158. BOOL
  159. ResolveProcessServices(LPENUM_SERVICE_STATUS_PROCESS pServices, DWORD dwServiceCount, HANDLE hWrite);
  160. void
  161. PrintHelp(void);
  162. void
  163. PrintUserInstructions(void);
  164. BOOL
  165. RegisterRdgFileAssociation(WCHAR *pszPath);
  166. BOOL
  167. WINAPI
  168. HandlerRoutine(
  169. DWORD dwCtrlType // control signal type
  170. );
  171. #endif // _RASDIAG_H_