3.1.4 Message Processing Events and Sequencing Rules
All Service Control Manager Remote Protocol operations begin with the client connection to the remote SCM and the client request to open the SCM database. After this database is opened, an RPC context handle is associated with this opened database, and this handle is returned to the client. The client can then perform operations on this database; for example, enumerate a list of existing services, open existing services, or install new services using this handle.
To operate on a service, the client MUST first request that the service be opened. After this service is opened, an RPC context handle is associated with this opened service and this handle is returned to the client. The client can then perform operations on the service; for example, change configuration, start, or stop.
When opening the database or a service, the server MUST open it with the access rights requested by the client if the client has sufficient permissions for the requested operation.
Note that the server SHOULD not open if the client does not have sufficient access rights for the requested operation. Similarly, the server MUST fail specific operations if the database or the service was not opened with sufficient access rights.
The access rights are represented as a bit field, and in addition to the standard access rights, as specified in ACCESS_MASK of [MS-DTYP], the Service Control Manager Remote Protocol MUST support the following access rights.
Value |
Meaning |
---|---|
SERVICE_ALL_ACCESS 0x000F01FF |
In addition to all access rights in this table, SERVICE_ALL_ACCESS includes Delete (DE), Read Control (RC), Write DACL (WD), and Write Owner (WO) access, as specified in ACCESS_MASK (section 2.4.3) of [MS-DTYP]. |
SERVICE_CHANGE_CONFIG 0x00000002 |
Required to change the configuration of a service. |
SERVICE_ENUMERATE_DEPENDENTS 0x00000008 |
Required to enumerate the services installed on the server. |
SERVICE_INTERROGATE 0x00000080 |
Required to request immediate status from the service. |
SERVICE_PAUSE_CONTINUE 0x00000040 |
Required to pause or continue the service. |
SERVICE_QUERY_CONFIG 0x00000001 |
Required to query the service configuration. |
SERVICE_QUERY_STATUS 0x00000004 |
Required to request the service status. |
SERVICE_START 0x00000010 |
Required to start the service. |
SERVICE_STOP 0x00000020 |
Required to stop the service. |
SERVICE_USER_DEFINED_CONTROL 0x00000100 |
Required to specify a user-defined control code. |
SERVICE_SET_STATUS 0x00008000 |
Required for a service to set its status. |
Specific access types for Service Control Manager object:
Value |
Meaning |
---|---|
SC_MANAGER_LOCK 0x00000008 |
Required to lock the SCM database. |
SC_MANAGER_CREATE_SERVICE 0x00000002 |
Required for a service to be created. |
SC_MANAGER_ENUMERATE_SERVICE 0x00000004 |
Required to enumerate a service. |
SC_MANAGER_CONNECT 0x00000001 |
Required to connect to the SCM. |
SC_MANAGER_QUERY_LOCK_STATUS 0x00000010 |
Required to query the lock status of the SCM database. |
SC_MANAGER_MODIFY_BOOT_CONFIG 0x0020 |
Required to call the RNotifyBootConfigStatus method. |
The remainder of this section describes the server behavior for the RPC methods supported by the Service Control Manager Remote Protocol. The protocol clients can invoke the RPC methods specified in this section in any order after a Service Control Manager Remote Protocol session is established with the server. The outcome of the calls depends on the parameters passed to each of those calls. Clients and servers SHOULD<32> support multiplexed connections, as specified in [MS-RPCE] section 3.3.1.5.8.
Methods in RPC Opnum Order
Method |
Description |
---|---|
Closes handles to the SCM and any other associated services. Opnum: 0 |
|
Receives a control code for a specific service handle, as specified by the client. Opnum: 1 |
|
Marks the specified service for deletion from the SCM database. Opnum: 2 |
|
Acquires a lock on a service database. Opnum: 3 |
|
Returns a copy of the security descriptor associated with a service. Opnum: 4 |
|
Sets the security descriptor associated with a service. Opnum: 5 |
|
Returns the current status of the specified service. Opnum: 6 |
|
Updates the SCM status information for the calling service. Opnum: 7 |
|
Releases a lock on a service database. Opnum: 8 |
|
RNotifyBootConfigStatus |
Reports the boot status to the SCM. Opnum: 9 |
Opnum10NotUsedOnWire |
Reserved for local use. Opnum: 10 |
Changes the configuration parameters of a service. Opnum: 11 |
|
Creates a service and adds it to the specified SCM database. Opnum: 12 |
|
Returns the name and status of each service that depends on the specified service. Opnum: 13 |
|
Enumerates services in the specified SCM database. Opnum: 14 |
|
Establishes a connection to the SCM on the specified computer and opens the specified SCM database. Opnum: 15 |
|
Opens a handle to an existing service. Opnum: 16 |
|
Returns the configuration parameters of the specified service. Opnum: 17 |
|
Returns the lock status of the specified SCM database. Opnum: 18 |
|
Starts a specified service. Opnum: 19 |
|
Returns the display name of the specified service. Opnum: 20 |
|
Returns the key name of the specified service. Opnum: 21 |
|
Opnum22NotUsedOnWire |
Reserved for local use. Opnum: 22 |
Changes the configuration parameters of a service. Opnum: 23 |
|
Creates a service object and adds it to the specified SCM database. Opnum: 24 |
|
Returns the name and status of each service that depends on the specified service. Opnum: 25 |
|
Enumerates services in the specified SCM database. Opnum: 26 |
|
Opens a connection to the SCM from the client and opens the specified SCM database. Opnum: 27 |
|
Opens a handle to an existing service. Opnum: 28 |
|
Returns the configuration parameters of the specified service. Opnum: 29 |
|
Returns the lock status of the specified SCM database. Opnum: 30 |
|
Starts a specified service. Opnum: 31 |
|
Returns the display name of the specified service. Opnum: 32 |
|
Returns the key name of the specified service. Opnum: 33 |
|
Opnum34NotUsedOnWire |
Reserved for local use. Opnum: 34 |
Returns the members of a service group. Opnum: 35 |
|
Changes the optional configuration parameters of a service. Opnum: 36 |
|
Changes the optional configuration parameters of a service. Opnum: 37 |
|
Returns the optional configuration parameters of the specified service. Opnum: 38 |
|
Returns the optional configuration parameters of the specified service. Opnum: 39 |
|
Returns the current status of the specified service, based on the specified information level. Opnum: 40 |
|
Enumerates services in the specified SCM database, based on the specified information level. Opnum: 41 |
|
Enumerates services in the specified SCM database, based on the specified information level. Opnum: 42 |
|
Opnum43NotUsedOnWire |
Reserved for local use. Opnum: 43 |
Creates a 32-bit service in a 64-bit memory frame with the path to the file image automatically adjusted to point to the "%windir%\syswow64" area of the system drive. This method accepts ANSI strings, converting them to Unicode strings where required. Opnum: 44 |
|
Creates a 32-bit service in a 64-bit memory frame with the path to the file image automatically adjusted to point to the "%windir%\syswow64" area of the system drive. This method directly supports Unicode string values. Opnum: 45 |
|
Opnum46NotUsedOnWire |
Reserved for local use. Opnum: 46 |
Allows the client to receive a notification when the specified service is created or deleted or when its status changes. Opnum: 47 |
|
Returns notification information whenever the specified status change occurs on a specified service. Opnum: 48 |
|
Unregisters the client from receiving future notifications from the server for specified status changes on a specified service. Opnum: 49 |
|
Receives a control code for a specific service. Opnum: 50 |
|
Receives a control code for a specific service. Opnum: 51 |
|
Opnum52NotUsedOnWire |
Reserved for local use. Opnum: 52 |
Opnum53NotUsedOnWire |
Reserved for local use. Opnum: 53 |
Opnum54NotUsedOnWire |
Reserved for local use. Opnum: 54 |
Opnum55NotUsedOnWire |
Reserved for local use. Opnum: 55 |
Returns the optional configuration parameters of the specified service.<33> Opnum: 56 |
|
Opnum57NotUsedOnWire |
Reserved for local use. Opnum: 57 |
Opnum58NotUsedOnWire |
Reserved for local use. Opnum: 58 |
Opnum59NotUsedOnWire |
Reserved for local use. Opnum: 59 |
The RCreateWowService method creates a service whose binary is compiled for a specified computer architecture. The path to the file image is automatically adjusted to point to the correct WoW-redirected location. This method directly supports Unicode string values. Opnum: 60 |
|
Opnum61NotUsedOnWire |
Reserved for local use. Opnum: 61 |
Opnum62NotUsedOnWire |
Reserved for local use. Opnum: 62 |
Opnum63NotUsedOnWire |
Reserved for local use. Opnum: 63 |
Establishes a connection to the SCM on the specified computer and opens the specified SCM database. Opnum: 64 |
All methods MUST NOT throw exceptions.
Note that gaps in the opnum numbering sequence represent opnums that MUST NOT<34> be used over the wire.