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.

107 lines
2.0 KiB

  1. /******************************************************************************\
  2. * This is a part of the Microsoft Source Code Samples.
  3. * Copyright (C) 1994-1998 Microsoft Corporation.
  4. * All rights reserved.
  5. * This source code is only intended as a supplement to
  6. * Microsoft Development Tools and/or WinHelp documentation.
  7. * See these sources for detailed information regarding the
  8. * Microsoft samples programs.
  9. \******************************************************************************/
  10. #define TITLE_SIZE 64
  11. #define PROCESS_SIZE MAX_PATH
  12. #if defined(__cplusplus)
  13. extern "C" {
  14. #endif
  15. //
  16. // task list structure
  17. //
  18. typedef struct _TASK_LIST {
  19. DWORD dwProcessId;
  20. DWORD dwInheritedFromProcessId;
  21. BOOL flags;
  22. HANDLE hwnd;
  23. TCHAR ProcessName[PROCESS_SIZE];
  24. TCHAR WindowTitle[TITLE_SIZE];
  25. } TASK_LIST, *PTASK_LIST;
  26. typedef struct _TASK_LIST_ENUM {
  27. PTASK_LIST tlist;
  28. DWORD numtasks;
  29. } TASK_LIST_ENUM, *PTASK_LIST_ENUM;
  30. //
  31. // Function pointer types for accessing platform-specific functions
  32. //
  33. typedef HRESULT (*LPGetTaskList)(PTASK_LIST, DWORD, LPTSTR, LPDWORD, BOOL, LPSTR);
  34. typedef BOOL (*LPEnableDebugPriv)(VOID);
  35. //
  36. // Function prototypes
  37. //
  38. HRESULT
  39. GetTaskListNT(
  40. PTASK_LIST pTask,
  41. DWORD dwNumTasks,
  42. LPTSTR pName,
  43. LPDWORD pdwNumTasks,
  44. BOOL fKill,
  45. LPSTR pszMandatoryModule
  46. );
  47. BOOL
  48. EnableDebugPrivNT(
  49. VOID
  50. );
  51. HRESULT
  52. KillProcess(
  53. PTASK_LIST tlist,
  54. BOOL fForce
  55. );
  56. VOID
  57. GetPidFromTitle(
  58. LPDWORD pdwPid,
  59. HWND* phwnd,
  60. LPCTSTR pExeName
  61. );
  62. #if 0
  63. DWORD
  64. GetTaskList95(
  65. PTASK_LIST pTask,
  66. DWORD dwNumTasks,
  67. LPTSTR pName
  68. );
  69. BOOL
  70. EnableDebugPriv95(
  71. VOID
  72. );
  73. VOID
  74. GetWindowTitles(
  75. PTASK_LIST_ENUM te
  76. );
  77. BOOL
  78. MatchPattern(
  79. TCHAR* String,
  80. TCHAR* Pattern
  81. );
  82. #endif
  83. #if defined(__cplusplus)
  84. }
  85. #endif