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.

61 lines
1.7 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1994.
  5. //
  6. // File: process.hxx
  7. //
  8. // Contents: CProcess class
  9. // CServiceProcess class
  10. //
  11. // History: 07-Jun-94 DwightKr Created
  12. //
  13. //--------------------------------------------------------------------------
  14. #pragma once
  15. #include <ciintf.h>
  16. //+-------------------------------------------------------------------------
  17. //
  18. // Class: CProcess
  19. //
  20. // Purpose: Abstraction of the Win32 CreateProcess call, and allows the
  21. // Dacl bits to be set.
  22. //
  23. // History: 06-Jun-94 DwightKr Created
  24. //
  25. //--------------------------------------------------------------------------
  26. class CProcess
  27. {
  28. public:
  29. CProcess( const WCHAR *wcsImageName,
  30. const WCHAR *wcsCommandLine,
  31. BOOL fCreateSuspended,
  32. const SECURITY_ATTRIBUTES & saProcess,
  33. BOOL fServiceChild = TRUE,
  34. ICiCAdviseStatus * pAdviseStatus = 0 );
  35. ~CProcess();
  36. void Resume();
  37. void Terminate() { TerminateProcess( _piProcessInfo.hProcess, 0 ); }
  38. const PROCESS_INFORMATION & GetProcessInformation() { return _piProcessInfo; }
  39. void WaitForDeath( DWORD dwTimeout=INFINITE );
  40. void AddDacl( DWORD dwAccessMask );
  41. HANDLE GetHandle() const
  42. {
  43. return _piProcessInfo.hProcess;
  44. }
  45. private:
  46. HANDLE GetProcessToken();
  47. PROCESS_INFORMATION _piProcessInfo;
  48. ICiCAdviseStatus * _pAdviseStatus;
  49. };