aboutsummaryrefslogtreecommitdiffstats
path: root/erts/doc
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2012-08-27 15:03:54 +0200
committerFredrik Gustafsson <[email protected]>2012-08-27 15:03:54 +0200
commite6b62480201b744bbac2d7b07618202c40e2912c (patch)
treedddd5d0e4e670bc120d709737eeb53e90acca5e8 /erts/doc
parentc6fc61ffab426cc7b391eb903e7942bda809a230 (diff)
parent03985084e42e262bac1b7c48a97c31db97348f1d (diff)
downloadotp-e6b62480201b744bbac2d7b07618202c40e2912c.tar.gz
otp-e6b62480201b744bbac2d7b07618202c40e2912c.tar.bz2
otp-e6b62480201b744bbac2d7b07618202c40e2912c.zip
Merge branch 'jkl/erlsrv-graceful-shutdown/OTP-10228' into maint
* jkl/erlsrv-graceful-shutdown/OTP-10228: erlsrv: gracefully stop emulator on Windows shutdown
Diffstat (limited to 'erts/doc')
-rw-r--r--erts/doc/src/erlsrv.xml13
1 files changed, 8 insertions, 5 deletions
diff --git a/erts/doc/src/erlsrv.xml b/erts/doc/src/erlsrv.xml
index c1ecbc7b77..b2f34ed247 100644
--- a/erts/doc/src/erlsrv.xml
+++ b/erts/doc/src/erlsrv.xml
@@ -357,11 +357,12 @@ The environment of an Erlang machine started
the console subsystem and programs running as window
applications. An application which runs in the console subsystem
(normal for port programs) uses the win32 function
- <c><![CDATA[SetConsoleCtrlHandler]]></c> to a control handler that returns
- TRUE in answer to the <c><![CDATA[CTRL_LOGOFF_EVENT]]></c>. Other
- applications just forward <c><![CDATA[WM_ENDSESSION]]></c> and
- <c><![CDATA[WM_QUERYENDSESSION]]></c> to the default window procedure. Here
- is a brief example in C of how to set the console control
+ <c><![CDATA[SetConsoleCtrlHandler]]></c> to register a control handler
+ that returns TRUE in answer to the <c><![CDATA[CTRL_LOGOFF_EVENT]]></c>
+ and <c><![CDATA[CTRL_SHUTDOWN_EVENT]]></c> events. Other applications
+ just forward <c><![CDATA[WM_ENDSESSION]]></c> and
+ <c><![CDATA[WM_QUERYENDSESSION]]></c> to the default window procedure.
+ Here is a brief example in C of how to set the console control
handler:</p>
<code type="none"><![CDATA[
#include <windows.h>
@@ -372,6 +373,8 @@ The environment of an Erlang machine started
BOOL WINAPI service_aware_handler(DWORD ctrl){
if(ctrl == CTRL_LOGOFF_EVENT)
return TRUE;
+ if(ctrl == CTRL_SHUTDOWN_EVENT)
+ return TRUE;
return FALSE;
}