A SCManager object represents a database of installed services maintained by the Service Control Manager.
There is always one SCManager object known as “ServicesActive” which is the active database managed by the Service Control Manager. The second SCManager object only exists if a modified “ServicesActive” fails to boot. When this happens, the system is automatically rebooted with “ ServicesActive” set to a copy of the last-known-good configuration, and the configuration which failed to boot becomes the second SCManager object known as “ServicesFailed”. The old “ServicesFailed ” object is deleted, if it exists, whenever there is a new failed configuration to be saved. No other SCManager object can be created, and the existing ones cannot be destroyed.
A SCManager object is a container object which holds all Service objects.
The SCManager object controls accesses to a Service Control Manager database in the following manner:
All users have GENERIC_READ and SC_MANAGER_CONNECT access.
Administrators have GENERIC_ALL access.
The SCManager object has the following access types:
Type | Description |
SC_MANAGER_CONNECT | ||
This access type is needed to connect to the Service Control Manager. | ||
SC_MANAGER_CREATE_SERVICE | ||
This access type is needed to create a service object and add it to the database. | ||
SC_MANAGER_ENUMERATE_SERVICES | ||
This access type is needed to list the services that are in the Service Control Manager database. | ||
SC_MANAGER_LOCK | ||
This access type is needed to acquire a lock on the database. | ||
SC_MANAGER_QUERY_LOCK_STATUS | ||
This access type is needed to get the lock status information. | ||
SC_MANAGER_UPDATE_LASTKNOWNGOOD | ||
This access type is needed to replace the last-known-good configuration. |
The SCManager object publishes the following mappings from generic access types to non-generic access types:
Generic Access | Non-Generic Access |
GENERIC_READ | STANDARD_RIGHTS_READ | SC_MANAGER_ENUMERATE_SERVICES | SC_MANAGER_QUERY_LOCK_STATUS |
GENERIC_WRITE | STANDARD_RIGHTS_WRITE | SC_MANAGER_CREATE_SERVICE | SC_MANAGER_UPDATE_LASTKNOWNGOOD |
GENERIC_EXECUTE | STANDARD_RIGHTS_EXECUTE | SC_MANAGER_CONNECT | SC_MANAGER_LOCK |
This object type does not support the (optional) SYNCHRONIZE standard access type. All required access types are supported.
The mask of all supported access types for this object type is:
SC_MANAGER_ALL_ACCESS
STANDARD_RIGHTS_REQUIRED |
SC_MANAGER_CONNECT |
SC_MANAGER_CREATE_SERVICE |
SC_MANAGER_UPDATE_LASTKNOWNGOOD |
SC_MANAGER_ENUMERATE_SERVICES |
SC_MANAGER_LOCK |
SC_MANAGER_QUERY_LOCK_STATUS
This object type does not define any privileges.
The EnumServicesStatus function returns the following data types: