lib/daemon-windows.c
/* This function is registered with the Windows services manager through
 * a call to RegisterServiceCtrlHandler() and will be called by the Windows
 * services manager asynchronously to stop the service. */
This function is registered with the Windows services manager through
a call to RegisterServiceCtrlHandler() and will be called by the Windows
services manager asynchronously to stop the service.
This function is registered with the Windows services manager through a call to RegisterServiceCtrlHandler () and will be called by the Windows services manager asynchronously to stop the service .
void
control_handler(DWORD request)
{
    switch (request) {
    case SERVICE_CONTROL_STOP:
    case SERVICE_CONTROL_SHUTDOWN:
        service_status.dwCurrentState = SERVICE_STOPPED;
        service_status.dwWin32ExitCode = NO_ERROR;
        SetEvent(wevent);
        SetServiceStatus(hstatus, &service_status);
        break;
    default:
        break;
    }
}
void control_handler ( DWORD request ) { switch ( request ) { case SERVICE_CONTROL_STOP : case SERVICE_CONTROL_SHUTDOWN : service_status . dwCurrentState = SERVICE_STOPPED ; service_status . dwWin32ExitCode = NO_ERROR ; SetEvent ( wevent ) ; SetServiceStatus ( hstatus , & service_status ) ; break ; default : break ; } }
This function is registered with the Windows services manager through
 a call to RegisterServiceCtrlHandler() and will be called by the Windows
 services manager asynchronously to stop the service.
This function is registered with the Windows services manager through a call to RegisterServiceCtrlHandler () and will be called by the Windows services manager asynchronously to stop the service .