services: Refuse to start disabled services.

This commit is contained in:
Francois Gouget 2011-08-29 19:53:04 +02:00 committed by Alexandre Julliard
parent 9183a171f1
commit eafb44d4e1
2 changed files with 4 additions and 1 deletions

View File

@ -2151,7 +2151,7 @@ static void test_start_stop(void)
goto cleanup;
}
le = try_start_stop(svc_handle, displayname, is_nt4);
todo_wine ok(le == ERROR_SERVICE_DISABLED, "%d != ERROR_SERVICE_DISABLED\n", le);
ok(le == ERROR_SERVICE_DISABLED, "%d != ERROR_SERVICE_DISABLED\n", le);
/* Then one with a bad path */
displayname = "Winetest Bad Path";

View File

@ -961,6 +961,9 @@ DWORD __cdecl svcctl_StartServiceW(
if ((err = validate_service_handle(hService, SERVICE_START, &service)) != 0)
return err;
if (service->service_entry->config.dwStartType == SERVICE_DISABLED)
return ERROR_SERVICE_DISABLED;
err = service_start(service->service_entry, dwNumServiceArgs, lpServiceArgVectors);
return err;