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.2 KiB

  1. // Copyright (c) 1997-1999 Microsoft Corporation
  2. //
  3. // Service Control Manager wrapper class
  4. //
  5. // 10-6-98 sburns
  6. #ifndef SERVICE_HPP_INCLUDED
  7. #define SERVICE_HPP_INCLUDED
  8. // Simple NTService Control Manager wrapper
  9. class NTService
  10. {
  11. public:
  12. // Constructs a new instance that corresponds to the given service name on
  13. // the given computer.
  14. //
  15. // machine - name of the computer. Empty string corresponds to the local
  16. // computer.
  17. //
  18. // serviveName - name of the service.
  19. NTService(const String& machine, const String& serviceName);
  20. // Constructs a new instance that corresponds to the given service name on
  21. // the local computer (the machine on which this call is invoked).
  22. //
  23. // serviveName - name of the service.
  24. explicit
  25. NTService(const String& serviceName);
  26. ~NTService();
  27. bool
  28. IsInstalled();
  29. // Queries the SCM for the last reported state of the service.
  30. HRESULT
  31. GetCurrentState(DWORD& state);
  32. private:
  33. // not implemented: no copying allowed
  34. NTService(const NTService&);
  35. const NTService& operator=(const NTService&);
  36. String machine;
  37. String name;
  38. };
  39. #endif // SERVICE_HPP_INCLUDED