| 995 | } |
| 996 | |
| 997 | static BOOL |
| 998 | CtrlHandler(DWORD ctrltype) |
| 999 | { |
| 1000 | switch (ctrltype) { |
| 1001 | /* case CTRL_C_EVENT: */ |
| 1002 | case CTRL_BREAK_EVENT: |
| 1003 | term_clear_screen(); |
| 1004 | FALLTHROUGH; |
| 1005 | /* FALLTHRU */ |
| 1006 | case CTRL_CLOSE_EVENT: |
| 1007 | case CTRL_LOGOFF_EVENT: |
| 1008 | case CTRL_SHUTDOWN_EVENT: |
| 1009 | getreturn_enabled = FALSE; |
| 1010 | #ifndef NOSAVEONHANGUP |
| 1011 | hangup(0); |
| 1012 | #endif |
| 1013 | #if defined(SAFERHANGUP) |
| 1014 | CloseHandle(console.hConIn); /* trigger WAIT_FAILED */ |
| 1015 | return TRUE; |
| 1016 | #endif |
| 1017 | default: |
| 1018 | return FALSE; |
| 1019 | } |
| 1020 | } |
| 1021 | |
| 1022 | /* called by pcmain() and process_options() */ |
| 1023 | void |
nothing calls this directly
no test coverage detected