How to Gracefully Fail at Service StartLast reviewed: December 16, 1996Article ID: Q115829 |
The information in this article applies to:
SUMMARYIf an error occurs while your service is running or initializing (SERVICE_START_PENDING) and you need to stop the service process, do the following:
MORE INFORMATIONWhen the last service in the process has terminated (you may have multiple services in the service process), the StartServiceCtrlDispatcher() call in the main thread returns. The main routine should call ExitProcess() because all of the services have terminated.
REFERENCESThere is a termination sample in the "Win32 Programmer's Reference," in the "Services" overview section, "Writing a ServiceMain Function." This is a simple situation where the service process only consists of one thread. This thread returns when it is ready to terminate, instead of calling ExitThread().
|
Additional reference words: 3.50 3.51 4.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |