Partager via


3.1.4.34 RChangeServiceConfig2A (Opnum 36)

The RChangeServiceConfig2A method SHOULD<51> change the optional configuration parameters of a service.

 DWORD RChangeServiceConfig2A(
   [in] SC_RPC_HANDLE hService,
   [in] SC_RPC_CONFIG_INFOA Info
 );

hService: An SC_RPC_HANDLE (section 2.2.4) data type that defines the handle to the service record that MUST have been created previously, using one of the open methods specified in section 3.1.4. The SERVICE_CHANGE_CONFIG access right MUST have been granted to the caller when the RPC context handle to the service record was created.

Info: An SC_RPC_CONFIG_INFOA (section 2.2.21) structure that contains optional configuration information.

Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise it returns one of the following error codes.<52>

Return value/code

Description

5

ERROR_ACCESS_DENIED

The SERVICE_CHANGE_CONFIG access right had not been granted to the caller when the RPC context handle to the service record was created.

6

ERROR_INVALID_HANDLE

The handle is no longer valid.

87

ERROR_INVALID_PARAMETER

A parameter that was specified is invalid.

1072

ERROR_SERVICE_MARKED_FOR_DELETE

The RDeleteService has been called for the service record identified by the hService parameter.

1080

ERROR_CANNOT_DETECT_DRIVER_FAILURE

SERVICE_CONFIG_FAILURE_ACTIONS cannot be used as a dwInfoLevel in the Info parameter for service records with a Type value defined for drivers.

1115

ERROR_SHUTDOWN_IN_PROGRESS

The system is shutting down.

In response to this request from the client, for a successful operation the server MUST update the specific attributes of the service record identified by hService, using the information level and the corresponding values associated with that information level as specified in the Info parameter of the client request.

If the service has a PreferredNode setting and the client requested a change of a service record with a Type other than SERVICE_WIN32_OWN_PROCESS, the server MUST fail the call with ERROR_INVALID_PARAMETER (87).

If the service record ServiceGroup value is set and the client specifies a start type of delayed autostart (see section 2.2.33), the server MUST fail the call with ERROR_INVALID_PARAMETER (87).

The server MUST use the process described in Conversion Between ANSI and Unicode String Formats (section 3.1.7) to convert a string to the appropriate format.