HOWTO: How to Use the StartService API Within a Service |
Q133756
In the Win32 API Help file, it mentions that you cannot call the
StartService API from within a service. This statement is not totally
correct. It should say that you cannot call the StartService API from
within a service while it is initializing.
An initializing service is a service which has not yet reported to the
Service Control Manager a status of SERVICE_RUNNING. Once the service is
running, you can use the StartService API within the service.
If your service is initializing due to a dependency or the SERVICE_AUTO_START flag, and your service attempts to start another service, a deadlock state in the Service Control Manager may occur. The reason this occurs is because the call to StartService API blocks because the Service Control Manager has a lock on the service control database from the original initializing service.
Additional query words:
Keywords : kbKernBase kbOSWin2000 kbService kbDSupport kbGrpDSKernBase
Issue type : kbhowto
Technology : kbAudDeveloper kbWin32sSearch kbWin32API
|
Last Reviewed: October 23, 2000 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |