Skip to content
Commit 70c97d70 authored by Evgeny Kotkov's avatar Evgeny Kotkov
Browse files

mpm_winnt: Advertise support for preshutdown notifications in the service,

and perform shutdown in respond to SERVICE_CONTROL_PRESHUTDOWN.

The pure shutdown notification leaves a small amount of time for the service
to finish (and the allowed amount of time has been shrinking with every new
version of Windows), and handling only it increases the chance of the process
being killed by SCM, instead of gracefully shutting down.  Handling the
preshutdown control code extends this period, and increases the chances of
finishing everything properly when the machine is rebooted or shut down.

(See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683241)

Please note that although the preshutdown notifications are available only
starting from Windows Vista, the code is compatible with the previous versions
of Windows, since the SCM ignores unknown SERVICE_ACCEPT codes, and will
still send an ordinary SERVICE_CONTROL_SHUTDOWN under old Windows
versions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1801659 13f79535-47bb-0310-9956-ffa450edef68
parent 7fd5b58c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment