BOOL ServiceStart(const wchar_t *wcsServiceName)
{
SC_HANDLE hSCManager;
SC_HANDLE hService;
BOOL result=FALSE;
hSCManager=OpenSCManagerW(NULL,NULL,SC_MANAGER_CONNECT);
if(hSCManager!=NULL)
{
hService=OpenServiceW(hSCManager,wcsServiceName,SERVICE_START);
if(hService!=NULL)
{
result=StartService(hService,0,NULL);
CloseServiceHandle(hService);
}
CloseServiceHandle(hSCManager);
}
return(result);
}