Process_WINCE.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. //
  2. // Process_WINCE.h
  3. //
  4. // $Id: //poco/1.4/Foundation/include/Poco/Process_WINCE.h#4 $
  5. //
  6. // Library: Foundation
  7. // Package: Processes
  8. // Module: Process
  9. //
  10. // Definition of the ProcessImpl class for WIN32.
  11. //
  12. // Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH.
  13. // and Contributors.
  14. //
  15. // SPDX-License-Identifier: BSL-1.0
  16. //
  17. #ifndef Foundation_Process_WINCE_INCLUDED
  18. #define Foundation_Process_WINCE_INCLUDED
  19. #include "Poco/Foundation.h"
  20. #include "Poco/RefCountedObject.h"
  21. #include <vector>
  22. #include <map>
  23. #include "Poco/UnWindows.h"
  24. namespace Poco {
  25. class Pipe;
  26. class Foundation_API ProcessHandleImpl: public RefCountedObject
  27. {
  28. public:
  29. ProcessHandleImpl(HANDLE _hProcess, UInt32 pid);
  30. ~ProcessHandleImpl();
  31. UInt32 id() const;
  32. HANDLE process() const;
  33. int wait() const;
  34. void closeHandle();
  35. private:
  36. HANDLE _hProcess;
  37. UInt32 _pid;
  38. ProcessHandleImpl(const ProcessHandleImpl&);
  39. ProcessHandleImpl& operator = (const ProcessHandleImpl&);
  40. };
  41. class Foundation_API ProcessImpl
  42. {
  43. public:
  44. typedef UInt32 PIDImpl;
  45. typedef std::vector<std::string> ArgsImpl;
  46. typedef std::map<std::string, std::string> EnvImpl;
  47. static PIDImpl idImpl();
  48. static void timesImpl(long& userTime, long& kernelTime);
  49. static ProcessHandleImpl* launchImpl(
  50. const std::string& command,
  51. const ArgsImpl& args,
  52. const std::string& initialDirectory,
  53. Pipe* inPipe,
  54. Pipe* outPipe,
  55. Pipe* errPipe,
  56. const EnvImpl& env);
  57. static void killImpl(ProcessHandleImpl& handle);
  58. static void killImpl(PIDImpl pid);
  59. static bool isRunningImpl(const ProcessHandleImpl& handle);
  60. static bool isRunningImpl(PIDImpl pid);
  61. static void requestTerminationImpl(PIDImpl pid);
  62. static std::string terminationEventName(PIDImpl pid);
  63. };
  64. } // namespace Poco
  65. #endif // Foundation_Process_WINCE_INCLUDED