Fix service startup handling

This commit is contained in:
Ron Pedde
2007-03-16 14:04:11 +00:00
parent cf8b867165
commit 0e17b153a3
2 changed files with 17 additions and 2 deletions

View File

@@ -226,8 +226,11 @@ DWORD Service::GetStartup() const
bool Service::ConfigureStartup(DWORD startup) {
if(startup != GetStartup()) { // don't boost privs if we don't need to
if (!::ChangeServiceConfig(m_sc_service, SERVICE_NO_CHANGE, startup, SERVICE_NO_CHANGE, NULL, NULL, NULL, NULL, NULL, NULL, NULL))
return false;
if(startup == SERVICE_AUTO_START) {
return ExecHelper(_T("auto"));
} else {
return ExecHelper(_T("manual"));
}
}
return true;
}