184.108.40.206 RStartServiceW (Opnum 19)
The RStartServiceW method starts a specified service.
DWORD RStartServiceW( [in] SC_RPC_HANDLE hService, [in, range(0, SC_MAX_ARGUMENTS)] DWORD argc, [in, unique, size_is(argc)] LPSTRING_PTRSW argv );
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_START access right MUST have been granted to the caller when the RPC context handle to the service record was created.
argc: The number of argument strings in the argv array. If argv is NULL, this parameter MAY be 0.
argv: A pointer to a buffer that contains an array of pointers to null-terminated UNICODE strings that are passed as arguments to the service.
Return Values: The method returns 0x00000000 (ERROR_SUCCESS) on success; otherwise, it returns one of the following error codes.<41>
The system cannot find the file specified.
The system cannot find the path specified.
The SERVICE_START access right had not been granted to the caller when the RPC context handle to the service record was created.
The handle is no longer valid.
A parameter that was specified is invalid.
The process for the service was started, but it did not respond within an implementation-specific time-out.<42>
A thread could not be created for the service.
The service database is locked by the call to the BlockServiceDatabase method.<43>
The ServiceStatus.dwCurrentState in the service record is not set to SERVICE_STOPPED.
The service cannot be started because the Start field in the service record is set to SERVICE_DISABLED.
The specified service depends on another service that has failed to start.
The service did not start due to a logon failure.
The RDeleteService method has been called for the service record identified by the hService parameter.
The specified service depends on a service that does not exist or has been marked for deletion.
The system is shutting down.
In response to this request from the client, for a successful operation the server MUST start the service using the information from the service record identified by the hService parameter and pass the arguments specified in the argv parameter as part of the service launch command.
If argv is not NULL, the client SHOULD set the first element in argv to the name of the service.
The server MUST ignore argv for service records with Type equal to SERVICE_KERNEL_DRIVER or SERVICE_FILE_SYSTEM_DRIVER.
The server MUST set the ServiceStatus.dwCurrentState in the service record, as specified in SERVICE_STATUS (section 2.2.47), to SERVICE_START_PENDING.
The server MUST set the ServiceStatus.dwControlsAccepted in the service record, as specified in SERVICE_STATUS, to none (zero).
The server MUST set the ServiceStatus.dwCheckPoint in the service record, as specified in SERVICE_STATUS, to zero.
The server MUST set the ServiceStatus.dwWaitHint in the service record, as specified in SERVICE_STATUS, to 2 seconds.
The server MUST return ERROR_SERVICE_NO_THREAD if it is unable to create a new thread for the service process.
If argv does not contain as many non-NULL pointers as indicated by argc, the server MUST fail the call with ERROR_INVALID_PARAMETER (87).