Skip navigation links
JNA API 5.6.0
com.sun.jna.platform.win32

Class W32ServiceManager

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable


    public class W32ServiceManager
    extends java.lang.Object
    implements java.io.Closeable
    Win32 Service Manager wrapper
    Author:
    EugineLev
    • Constructor Summary

      Constructors 
      Constructor and Description
      W32ServiceManager()
      Instantiate a W32ServiceManager for the local computer and the SERVICES_ACTIVE_DATABASE ("ServicesActive") database.
      W32ServiceManager(int permissions)
      Instantiate a W32ServiceManager for the local computer and the SERVICES_ACTIVE_DATABASE ("ServicesActive") database.
      W32ServiceManager(java.lang.String machineName, java.lang.String databaseName)
      Instantiate a W32ServiceManager.
      W32ServiceManager(java.lang.String machineName, java.lang.String databaseName, int permissions)
      Instantiate a W32ServiceManager.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void close()
      Closes the previously opened Service Manager.
      Winsvc.ENUM_SERVICE_STATUS_PROCESS[] enumServicesStatusExProcess(int dwServiceType, int dwServiceState, java.lang.String groupName)
      Enumerates services in the specified service control manager database.
      Winsvc.SC_HANDLE getHandle()
      Gets the service manager handle.
      void open(int permissions)
      (Re-)Opens the Service Manager with the supplied permissions.
      W32Service openService(java.lang.String serviceName, int permissions)
      Opens a Service.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • _machineName

        java.lang.String _machineName
      • _databaseName

        java.lang.String _databaseName
    • Constructor Detail

      • W32ServiceManager

        public W32ServiceManager()
        Instantiate a W32ServiceManager for the local computer and the SERVICES_ACTIVE_DATABASE ("ServicesActive") database.

        The connection is not established until open(int) is called.

      • W32ServiceManager

        public W32ServiceManager(int permissions)
        Instantiate a W32ServiceManager for the local computer and the SERVICES_ACTIVE_DATABASE ("ServicesActive") database.

        A connection is opened directly with the requested permissions.

        Parameters:
        permissions - requested permissions for access
      • W32ServiceManager

        public W32ServiceManager(java.lang.String machineName,
                                 java.lang.String databaseName)
        Instantiate a W32ServiceManager.
        Parameters:
        machineName - The name of the target computer. If the pointer is NULL or points to an empty string, the function connects to the service control manager on the local computer.
        databaseName - The name of the service control manager database. This parameter should be set to "ServicesActive". If it is NULL, the "ServicesActive" (SERVICES_ACTIVE_DATABASE) database is opened by default.

        The connection is not established until open(int) is called.

      • W32ServiceManager

        public W32ServiceManager(java.lang.String machineName,
                                 java.lang.String databaseName,
                                 int permissions)
        Instantiate a W32ServiceManager.

        A connection is opened directly with the requested permissions.

        Parameters:
        machineName - The name of the target computer. If the pointer is NULL or points to an empty string, the function connects to the service control manager on the local computer.
        databaseName - The name of the service control manager database. This parameter should be set to "ServicesActive". If it is NULL, the "ServicesActive" (SERVICES_ACTIVE_DATABASE) database is opened by default.
        permissions - requested permissions for access
JNA API 5.6.0

Copyright © 2007-2018 Timothy Wall. All Rights Reserved.