process.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef PROCESS_H
  2. #define PROCESS_H
  3. #include <psapi.h>
  4. #include <tlhelp32.h>
  5. typedef struct {
  6. TCHAR *name;
  7. HANDLE process_handle;
  8. unsigned long depth;
  9. unsigned long pid;
  10. unsigned long exitcode;
  11. unsigned long stop_method;
  12. unsigned long kill_console_delay;
  13. unsigned long kill_window_delay;
  14. unsigned long kill_threads_delay;
  15. SERVICE_STATUS_HANDLE status_handle;
  16. SERVICE_STATUS *status;
  17. FILETIME creation_time;
  18. FILETIME exit_time;
  19. int signalled;
  20. } kill_t;
  21. typedef int (*walk_function_t)(nssm_service_t *, kill_t *);
  22. HANDLE get_debug_token();
  23. void service_kill_t(nssm_service_t *, kill_t *);
  24. int get_process_creation_time(HANDLE, FILETIME *);
  25. int get_process_exit_time(HANDLE, FILETIME *);
  26. int check_parent(kill_t *, PROCESSENTRY32 *, unsigned long);
  27. int CALLBACK kill_window(HWND, LPARAM);
  28. int kill_threads(nssm_service_t *, kill_t *);
  29. int kill_threads(kill_t *);
  30. int kill_console(nssm_service_t *, kill_t *);
  31. int kill_console(kill_t *);
  32. int kill_process(nssm_service_t *, kill_t *);
  33. int kill_process(kill_t *);
  34. int print_process(nssm_service_t *, kill_t *);
  35. int print_process(kill_t *);
  36. void walk_process_tree(nssm_service_t *, walk_function_t, kill_t *, unsigned long);
  37. void kill_process_tree(kill_t *, unsigned long);
  38. #endif