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.

113 lines
2.3 KiB

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