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.

130 lines
2.4 KiB

  1. #pragma once
  2. #if defined(__cplusplus)
  3. extern "C" {
  4. #endif
  5. #define MAX_TASKS 1024
  6. #define TITLE_SIZE 128
  7. #define PROCESS_SIZE 16
  8. #define SERVICENAMES_SIZE 1024
  9. #define MTS_PACKAGE_NAMES_SIZE 1024
  10. typedef struct _THREAD_INFO {
  11. ULONG ThreadState;
  12. HANDLE UniqueThread;
  13. } THREAD_INFO, *PTHREAD_INFO;
  14. typedef struct _FIND_MODULE_INFO {
  15. LPSTR szModuleToFind;
  16. LPSTR szMatchingModuleName;
  17. BOOL fFound;
  18. } FIND_MODULE_INFO, *PFIND_MODULE_INFO;
  19. //
  20. // task list structure
  21. //
  22. typedef struct _TASK_LIST {
  23. DWORD dwProcessId;
  24. DWORD dwInheritedFromProcessId;
  25. ULARGE_INTEGER CreateTime;
  26. BOOL flags;
  27. HANDLE hwnd;
  28. LPSTR lpWinsta;
  29. LPSTR lpDesk;
  30. CHAR ProcessName[PROCESS_SIZE];
  31. CHAR WindowTitle[TITLE_SIZE];
  32. SIZE_T PeakVirtualSize;
  33. SIZE_T VirtualSize;
  34. ULONG PageFaultCount;
  35. SIZE_T PeakWorkingSetSize;
  36. SIZE_T WorkingSetSize;
  37. ULONG NumberOfThreads;
  38. PTHREAD_INFO pThreadInfo;
  39. CHAR ServiceNames[SERVICENAMES_SIZE];
  40. CHAR MtsPackageNames[MTS_PACKAGE_NAMES_SIZE];
  41. } TASK_LIST, *PTASK_LIST;
  42. typedef struct _TASK_LIST_ENUM {
  43. PTASK_LIST tlist;
  44. DWORD numtasks;
  45. LPSTR lpWinsta;
  46. LPSTR lpDesk;
  47. BOOL bFirstLoop;
  48. } TASK_LIST_ENUM, *PTASK_LIST_ENUM;
  49. DWORD
  50. GetServiceProcessInfo(
  51. LPENUM_SERVICE_STATUS_PROCESS* ppSvcInfo
  52. );
  53. DWORD
  54. GetTaskList(
  55. PTASK_LIST pTask,
  56. DWORD dwNumTasks
  57. );
  58. DWORD
  59. GetTaskListEx(
  60. PTASK_LIST pTask,
  61. DWORD dwNumTasks,
  62. BOOL fThreadInfo,
  63. DWORD dwNumServices,
  64. const ENUM_SERVICE_STATUS_PROCESS* pServiceInfo
  65. );
  66. void
  67. AddMtsPackageNames(
  68. PTASK_LIST Tasks,
  69. DWORD NumTasks
  70. );
  71. void
  72. PrintTasksUsingModule(
  73. LPTSTR szModuleName
  74. );
  75. BOOL
  76. DetectOrphans(
  77. PTASK_LIST pTask,
  78. DWORD dwNumTasks
  79. );
  80. BOOL
  81. EnableDebugPriv(
  82. VOID
  83. );
  84. BOOL
  85. KillProcess(
  86. PTASK_LIST tlist,
  87. BOOL fForce
  88. );
  89. VOID
  90. GetWindowTitles(
  91. PTASK_LIST_ENUM te
  92. );
  93. BOOL
  94. MatchPattern(
  95. PUCHAR String,
  96. PUCHAR Pattern
  97. );
  98. BOOL
  99. EmptyProcessWorkingSet(
  100. DWORD pid
  101. );
  102. BOOL
  103. EmptySystemWorkingSet(
  104. VOID
  105. );
  106. #if defined(__cplusplus)
  107. }
  108. #endif