Platform SDK: Exchange Server |
The following handles to events are created by WINWRAP when the corresponding Pause, Continue, or Stop events are detected.
These events are automatically controlled through the service control manager of Windows NT Server. Call HrServiceProcessControl periodically to allow the user to pause, continue or stop your service from the service control manager. HrServiceProcessControl will return EDK_E_SHUTDOWN_SERVICE if the service has been stopped.
When the hServiceStopEvent signal becomes TRUE, your application should exit. Remember to call HrServiceConfirmStop before exiting ServiceMain to notify WINWRAP that HrServiceShutdown can safely be called. The return value of HrServiceShutdown is used as the WinMain exit code.
If it is ever necessary to force the shutdown of the service, use ServiceStop rather than manually signaling hServiceStopEvent. An example would be if the service encounters an unrecoverable error and cannot continue.