Advertisement

05.17.2008 at 03:53PM PDT, ID: 23411209 | Points: 500
[x]
Attachment Details

Service not starting once installed

Asked by mcordi in C++ Programming Language

Tags: C++

Hello. I am using this code:

The service installs fine and the path to the executable to start is perfect.

The StartService function fails to start it and when I try and start it manually, I get this error:
Service Control Manager: "Error 1053: The service did not respond to the start or control request in a timely fashion."
Netbios: "The service is not responding to the control function."

I've seen normal PE's become services, so what am I doing wrong?

thanksStart Free Trial
1:
2:
3:
4:
5:
6:
7:
SC_HANDLE schSCManager;
SC_HANDLE schSCService;
	schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE);
	schSCService = CreateService(schSCManager, "RegeditTestSvc", "RegeditTestSvc", SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, "c:\\windows\regedit.exe", NULL, NULL, NULL, NULL, NULL);
	StartService(schSCService, NULL, NULL);
CloseServiceHandle(schSCService);
CloseServiceHandle(schSCManager);
 
 
[+][-]05.17.2008 at 04:41PM PDT, ID: 21591117

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.17.2008 at 04:55PM PDT, ID: 21591134

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.17.2008 at 05:43PM PDT, ID: 21591213

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.18.2008 at 08:31AM PDT, ID: 21593010

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628