Shutting down a Standalone Service

Use the DeregisterService function to shut down services that are run in a non-standalone mode. Because you cannot access a standalone service through the functions exposed by Services.exe, this approach will not work on standalone services.

A standalone service can terminate by notifying Services.exe that it is ready to shut down. To facilitate the termination process, on the startup of standalone services, Services.exe calls the service's XXX_IOControl function and passes the ServicesexeCallbackFunctions structure. This structure contains the pfnServiceShutdown callback functions.

When the service calls pfnServiceShutdown, Services.exe completes the same shutdown routine as it completes when DeregisterService is called on a service. After the service has completed the shutdown process, the host copy of Services.exe will terminate.

See Also

xxx_IOControl | ServicesexeCallbackFunctions | DeregisterService | Configuring Services.exe to Load a Standalone Service

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.