1
0

WmiSchema.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. 
  2. namespace WMI
  3. {
  4. public enum ServiceType
  5. {
  6. KernalDriver = 1,
  7. FileSystemDriver = 2,
  8. Adapter = 4,
  9. RecognizerDriver = 8,
  10. OwnProcess = 16,
  11. ShareProcess = 32,
  12. InteractiveProcess = 256,
  13. }
  14. public enum ErrorControl
  15. {
  16. UserNotNotified = 0,
  17. UserNotified = 1,
  18. SystemRestartedWithLastKnownGoodConfiguration = 2,
  19. SystemAttemptsToStartWithAGoodConfiguration = 3
  20. }
  21. public enum StartMode
  22. {
  23. /// <summary>
  24. /// Device driver started by the operating system loader. This value is valid only for driver services.
  25. /// </summary>
  26. Boot,
  27. /// <summary>
  28. /// Device driver started by the operating system initialization process. This value is valid only for driver services.
  29. /// </summary>
  30. System,
  31. /// <summary>
  32. /// Service to be started automatically by the Service Control Manager during system startup.
  33. /// </summary>
  34. Automatic,
  35. /// <summary>
  36. /// Service to be started by the Service Control Manager when a process calls the StartService method.
  37. /// </summary>
  38. Manual,
  39. /// <summary>
  40. /// Service that can no longer be started.
  41. /// </summary>
  42. Disabled,
  43. }
  44. [WmiClassName("Win32_Service")]
  45. public interface Win32Services : IWmiCollection
  46. {
  47. // ReturnValue Create(bool desktopInteract, string displayName, int errorControl, string loadOrderGroup, string loadOrderGroupDependencies, string name, string pathName, string serviceDependencies, string serviceType, string startMode, string startName, string startPassword);
  48. void Create(string name, string displayName, string pathName, ServiceType serviceType, ErrorControl errorControl, StartMode startMode, bool desktopInteract, string[] serviceDependencies);
  49. Win32Service Select(string name);
  50. }
  51. public interface Win32Service : IWmiObject
  52. {
  53. string Description { get; set; }
  54. bool Started { get; }
  55. void Delete();
  56. void StartService();
  57. void StopService();
  58. }
  59. }