Leaked source code of windows server 2003
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.

47 lines
1.0 KiB

  1. #ifndef __PROC_KILLER_COMPILED__
  2. #define __PROC_KILLER_COMPILED__
  3. #include "KillTimer.h"
  4. // only need one of these laying around
  5. class CProcKillerTimer;
  6. extern CProcKillerTimer g_procKillerTimer;
  7. // specialized to kill processes
  8. class CProcKillerTimer : public CKillerTimer
  9. {
  10. public:
  11. // who to kill & when
  12. HRESULT ScheduleAssassination(HANDLE hVictim, FILETIME lastMeal);
  13. };
  14. /* CLASS CProcKiller DEFINITION */
  15. // hold process that needs to be killed
  16. // owner of process handle, responsible for closing it
  17. class CProcKiller : public CKiller
  18. {
  19. public:
  20. CProcKiller(HANDLE hProc, FILETIME deathDate, CLifeControl* pControl) :
  21. CKiller(deathDate, pControl), m_hProc(hProc)
  22. {
  23. }
  24. virtual ~CProcKiller()
  25. {
  26. // we don't kill off the process if we're shutdown prematurely
  27. if (m_hProc)
  28. CloseHandle(m_hProc);
  29. }
  30. // terminate process,
  31. virtual void Die();
  32. protected:
  33. private:
  34. HANDLE m_hProc;
  35. };
  36. #endif //__PROC_KILLER_COMPILED__