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.

321 lines
5.2 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. instaler.h
  5. Abstract:
  6. Main include file for the INSTALER application.
  7. Author:
  8. Steve Wood (stevewo) 09-Aug-1994
  9. Revision History:
  10. --*/
  11. #ifdef RC_INVOKED
  12. #include <windows.h>
  13. #else
  14. #include "nt.h"
  15. #include <ntrtl.h>
  16. #include <nturtl.h>
  17. #include <windows.h>
  18. #include <stddef.h>
  19. #include <dbghelp.h>
  20. #include <psapi.h>
  21. #include <stdio.h>
  22. #include <stdlib.h>
  23. #include <string.h>
  24. #include "errormsg.h"
  25. // Doubly-linked list manipulation routines. Implemented as macros
  26. // but logically these are procedures.
  27. //
  28. //
  29. // VOID
  30. // InitializeListHead(
  31. // PLIST_ENTRY ListHead
  32. // );
  33. //
  34. #define InitializeListHead(ListHead) (\
  35. (ListHead)->Flink = (ListHead)->Blink = (ListHead))
  36. //
  37. // BOOL
  38. // IsListEmpty(
  39. // PLIST_ENTRY ListHead
  40. // );
  41. //
  42. #define IsListEmpty(ListHead) \
  43. ((ListHead)->Flink == (ListHead))
  44. //
  45. // PLIST_ENTRY
  46. // RemoveHeadList(
  47. // PLIST_ENTRY ListHead
  48. // );
  49. //
  50. #define RemoveHeadList(ListHead) \
  51. (ListHead)->Flink;\
  52. {RemoveEntryList((ListHead)->Flink)}
  53. //
  54. // PLIST_ENTRY
  55. // RemoveTailList(
  56. // PLIST_ENTRY ListHead
  57. // );
  58. //
  59. #define RemoveTailList(ListHead) \
  60. (ListHead)->Blink;\
  61. {RemoveEntryList((ListHead)->Blink)}
  62. //
  63. // VOID
  64. // RemoveEntryList(
  65. // PLIST_ENTRY Entry
  66. // );
  67. //
  68. #define RemoveEntryList(Entry) {\
  69. PLIST_ENTRY _EX_Blink;\
  70. PLIST_ENTRY _EX_Flink;\
  71. _EX_Flink = (Entry)->Flink;\
  72. _EX_Blink = (Entry)->Blink;\
  73. _EX_Blink->Flink = _EX_Flink;\
  74. _EX_Flink->Blink = _EX_Blink;\
  75. }
  76. //
  77. // VOID
  78. // InsertTailList(
  79. // PLIST_ENTRY ListHead,
  80. // PLIST_ENTRY Entry
  81. // );
  82. //
  83. #define InsertTailList(ListHead,Entry) {\
  84. PLIST_ENTRY _EX_Blink;\
  85. PLIST_ENTRY _EX_ListHead;\
  86. _EX_ListHead = (ListHead);\
  87. _EX_Blink = _EX_ListHead->Blink;\
  88. (Entry)->Flink = _EX_ListHead;\
  89. (Entry)->Blink = _EX_Blink;\
  90. _EX_Blink->Flink = (Entry);\
  91. _EX_ListHead->Blink = (Entry);\
  92. }
  93. //
  94. // VOID
  95. // InsertHeadList(
  96. // PLIST_ENTRY ListHead,
  97. // PLIST_ENTRY Entry
  98. // );
  99. //
  100. #define InsertHeadList(ListHead,Entry) {\
  101. PLIST_ENTRY _EX_Flink;\
  102. PLIST_ENTRY _EX_ListHead;\
  103. _EX_ListHead = (ListHead);\
  104. _EX_Flink = _EX_ListHead->Flink;\
  105. (Entry)->Flink = _EX_Flink;\
  106. (Entry)->Blink = _EX_ListHead;\
  107. _EX_Flink->Blink = (Entry);\
  108. _EX_ListHead->Flink = (Entry);\
  109. }
  110. //
  111. // Data structures and entry points in init.c
  112. //
  113. DWORD TotalSoftFaults;
  114. DWORD TotalHardFaults;
  115. DWORD TotalCodeFaults;
  116. DWORD TotalDataFaults;
  117. DWORD TotalKernelFaults;
  118. DWORD TotalUserFaults;
  119. BOOL fCodeOnly;
  120. BOOL fHardOnly;
  121. ULONG_PTR SystemRangeStart;
  122. VOID
  123. ProcessPfMonData(
  124. VOID
  125. );
  126. //
  127. // Data structures and entry points in init.c
  128. //
  129. BOOL fVerbose;
  130. BOOL fLogOnly;
  131. BOOL fKernelOnly; //flag for displaying kernel pagefaults
  132. BOOL fKernel; //flag for displaying kernel pagefaults
  133. BOOL fDatabase; //flag for outputing information in a
  134. //tab-delimited database format
  135. FILE *LogFile;
  136. BOOL
  137. InitializePfmon(
  138. VOID
  139. );
  140. BOOL
  141. LoadApplicationForDebug(
  142. LPSTR CommandLine
  143. );
  144. BOOL
  145. AttachApplicationForDebug(
  146. DWORD Pid
  147. );
  148. HANDLE hProcess;
  149. //
  150. // Data structures and entry points in error.c
  151. //
  152. HANDLE PfmonModuleHandle;
  153. VOID
  154. __cdecl
  155. DeclareError(
  156. UINT ErrorCode,
  157. UINT SupplementalErrorCode,
  158. ...
  159. );
  160. //
  161. // Data structures and entry points in DEBUG.C
  162. //
  163. VOID
  164. DebugEventLoop( VOID );
  165. //
  166. // Data structures and entry points in process.c
  167. //
  168. typedef struct _PROCESS_INFO {
  169. LIST_ENTRY Entry;
  170. LIST_ENTRY ThreadListHead;
  171. DWORD Id;
  172. HANDLE Handle;
  173. } PROCESS_INFO, *PPROCESS_INFO;
  174. typedef struct _THREAD_INFO {
  175. LIST_ENTRY Entry;
  176. DWORD Id;
  177. HANDLE Handle;
  178. PVOID StartAddress;
  179. } THREAD_INFO, *PTHREAD_INFO;
  180. LIST_ENTRY ProcessListHead;
  181. BOOL
  182. AddProcess(
  183. LPDEBUG_EVENT DebugEvent,
  184. PPROCESS_INFO *ReturnedProcess
  185. );
  186. BOOL
  187. DeleteProcess(
  188. PPROCESS_INFO Process
  189. );
  190. BOOL
  191. AddThread(
  192. LPDEBUG_EVENT DebugEvent,
  193. PPROCESS_INFO Process,
  194. PTHREAD_INFO *ReturnedThread
  195. );
  196. BOOL
  197. DeleteThread(
  198. PPROCESS_INFO Process,
  199. PTHREAD_INFO Thread
  200. );
  201. PPROCESS_INFO
  202. FindProcessById(
  203. ULONG Id
  204. );
  205. BOOL
  206. FindProcessAndThreadForEvent(
  207. LPDEBUG_EVENT DebugEvent,
  208. PPROCESS_INFO *ReturnedProcess,
  209. PTHREAD_INFO *ReturnedThread
  210. );
  211. //
  212. // Data structures and entry points in module.c
  213. //
  214. typedef struct _MODULE_INFO {
  215. LIST_ENTRY Entry;
  216. LPVOID BaseAddress;
  217. DWORD VirtualSize;
  218. DWORD NumberFaultedSoftVas;
  219. DWORD NumberFaultedHardVas;
  220. DWORD NumberCausedFaults;
  221. HANDLE Handle;
  222. LPTSTR ModuleName;
  223. } MODULE_INFO, *PMODULE_INFO;
  224. LPSTR SymbolSearchPath;
  225. LIST_ENTRY ModuleListHead;
  226. BOOL
  227. LazyLoad(
  228. LPVOID Address
  229. );
  230. PRTL_PROCESS_MODULES LazyModuleInformation;
  231. BOOL
  232. AddModule(
  233. LPDEBUG_EVENT DebugEvent
  234. );
  235. BOOL
  236. DeleteModule(
  237. PMODULE_INFO Module
  238. );
  239. PMODULE_INFO
  240. FindModuleContainingAddress(
  241. LPVOID Address
  242. );
  243. VOID
  244. SetSymbolSearchPath( );
  245. LONG
  246. AddKernelDrivers( );
  247. #if defined(_ALPHA_) || defined(_AXP64_)
  248. #define BPSKIP 4
  249. #elif defined(_X86_)
  250. #define BPSKIP 1
  251. #elif defined(_AMD64_)
  252. #define BPSKIP 1
  253. #elif defined(_IA64_)
  254. #define BPSKIP 8
  255. #endif // _ALPHA_
  256. #endif // defined( RC_INVOKED )