process.h 1.1 KB

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