From 03985084e42e262bac1b7c48a97c31db97348f1d Mon Sep 17 00:00:00 2001 From: Jan Kloetzke Date: Tue, 31 Jul 2012 21:08:31 +0200 Subject: erlsrv: gracefully stop emulator on Windows shutdown Windows will send the SERVICE_CONTROL_SHUTDOWN event to the service control handler when shutting down the system. Instead of ignoring the event, erlsrv will now invoke the stop action. Likewise, the Erlang emulator (and it's port drivers) must not quit upon reception of the CTRL_SHUTDOWN_EVENT event in the console control handler. --- erts/doc/src/erlsrv.xml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'erts/doc') 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 - to a control handler that returns - TRUE in answer to the . Other - applications just forward and - to the default window procedure. Here - is a brief example in C of how to set the console control + to register a control handler + that returns TRUE in answer to the + and events. Other applications + just forward and + to the default window procedure. + Here is a brief example in C of how to set the console control handler:

@@ -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; } -- cgit v1.2.3