services: Remove service_terminate function.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5137bfd4ba
commit
cafcf6448f
|
@ -1137,7 +1137,8 @@ DWORD __cdecl svcctl_ControlService(
|
||||||
if (result == ERROR_SUCCESS && service->service_entry->force_shutdown)
|
if (result == ERROR_SUCCESS && service->service_entry->force_shutdown)
|
||||||
{
|
{
|
||||||
result = ERROR_SERVICE_CANNOT_ACCEPT_CTRL;
|
result = ERROR_SERVICE_CANNOT_ACCEPT_CTRL;
|
||||||
service_terminate(service->service_entry);
|
if ((process = service->service_entry->process))
|
||||||
|
process_terminate(process);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != ERROR_SUCCESS)
|
if (result != ERROR_SUCCESS)
|
||||||
|
|
|
@ -787,7 +787,7 @@ static DWORD service_start_process(struct service_entry *service_entry, struct p
|
||||||
if (!r)
|
if (!r)
|
||||||
{
|
{
|
||||||
err = GetLastError();
|
err = GetLastError();
|
||||||
service_terminate(service_entry);
|
process_terminate(process);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -915,7 +915,7 @@ DWORD service_start(struct service_entry *service, DWORD service_argc, LPCWSTR *
|
||||||
if (err == ERROR_SUCCESS)
|
if (err == ERROR_SUCCESS)
|
||||||
ReleaseMutex(process->control_mutex);
|
ReleaseMutex(process->control_mutex);
|
||||||
else
|
else
|
||||||
service_terminate(service);
|
process_terminate(process);
|
||||||
}
|
}
|
||||||
|
|
||||||
scmdatabase_unlock_startup(service->db);
|
scmdatabase_unlock_startup(service->db);
|
||||||
|
@ -925,21 +925,6 @@ DWORD service_start(struct service_entry *service, DWORD service_argc, LPCWSTR *
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
void service_terminate(struct service_entry *service)
|
|
||||||
{
|
|
||||||
struct process_entry *process;
|
|
||||||
|
|
||||||
service_lock(service);
|
|
||||||
if ((process = service->process))
|
|
||||||
{
|
|
||||||
TerminateProcess(process->process, 0);
|
|
||||||
release_process(process);
|
|
||||||
service->process = NULL;
|
|
||||||
}
|
|
||||||
service->status.dwCurrentState = SERVICE_STOPPED;
|
|
||||||
service_unlock(service);
|
|
||||||
}
|
|
||||||
|
|
||||||
void process_terminate(struct process_entry *process)
|
void process_terminate(struct process_entry *process)
|
||||||
{
|
{
|
||||||
struct scmdatabase *db = process->db;
|
struct scmdatabase *db = process->db;
|
||||||
|
|
|
@ -88,7 +88,6 @@ void release_service(struct service_entry *service);
|
||||||
void service_lock(struct service_entry *service);
|
void service_lock(struct service_entry *service);
|
||||||
void service_unlock(struct service_entry *service);
|
void service_unlock(struct service_entry *service);
|
||||||
DWORD service_start(struct service_entry *service, DWORD service_argc, LPCWSTR *service_argv);
|
DWORD service_start(struct service_entry *service, DWORD service_argc, LPCWSTR *service_argv);
|
||||||
void service_terminate(struct service_entry *service);
|
|
||||||
|
|
||||||
/* Process functions */
|
/* Process functions */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue