![]() |
Panoptes 1.0.0
Endpoint Detection and Response
|
#include "shutdown.h"#include "error_message.h"#include "mutex.hpp"#include "utils.h"#include <sddl.h>#include <iostream>#include <thread>Go to the source code of this file.
Macros | |
| #define | PANO_STOP_EVENT_NAME L"PanoptesStop" |
| #define | PANO_STOP_EXIT_WAIT_MS 15000 |
| #define | PANO_SHUTDOWN_WINDOW_CLASS L"PanoptesShutdownWindow" |
Functions | |
| ERRORCODE | InitializeShutdown () |
| Creates the stop event and installs the console handler and session-end window. The stop event can only be opened by SYSTEM and Administrators when the service runs elevated. Fails if another process already holds an object with the event's name. | |
| void | WaitForShutdownRequest () |
| Blocks until a shutdown is requested. | |
| void | NotifyShutdownComplete () |
| Tells console handlers and the session-end window that teardown has finished, so they can return and let Windows end the process. | |
| ERRORCODE | RequestServiceStop () |
| Implements –stop: sets a running service's stop event and waits for it to exit. | |
| #define PANO_SHUTDOWN_WINDOW_CLASS L"PanoptesShutdownWindow" |
Definition at line 18 of file shutdown.cpp.
| #define PANO_STOP_EVENT_NAME L"PanoptesStop" |
Definition at line 13 of file shutdown.cpp.
Referenced by InitializeShutdown(), and RequestServiceStop().
| #define PANO_STOP_EXIT_WAIT_MS 15000 |
Definition at line 16 of file shutdown.cpp.
Referenced by RequestServiceStop().
| ERRORCODE InitializeShutdown | ( | ) |
Creates the stop event and installs the console handler and session-end window. The stop event can only be opened by SYSTEM and Administrators when the service runs elevated. Fails if another process already holds an object with the event's name.
Definition at line 113 of file shutdown.cpp.
References ERRORCODE, IsRunningAsAdmin(), PANO_STOP_EVENT_NAME, PANO_SUCCESS, and WINDOWS_ERR.
Referenced by WinMain().
| void NotifyShutdownComplete | ( | ) |
Tells console handlers and the session-end window that teardown has finished, so they can return and let Windows end the process.
Definition at line 183 of file shutdown.cpp.
Referenced by CleanupWithError(), and WinMain().
| ERRORCODE RequestServiceStop | ( | ) |
Implements –stop: sets a running service's stop event and waits for it to exit.
Definition at line 191 of file shutdown.cpp.
References ERRORCODE, NOT_ADMIN, PANO_STOP_EVENT_NAME, PANO_STOP_EXIT_WAIT_MS, PANO_SUCCESS, SERVICE_MUTEX, and WINDOWS_ERR.
Referenced by WinMain().
| void WaitForShutdownRequest | ( | ) |
Blocks until a shutdown is requested.
Definition at line 178 of file shutdown.cpp.
Referenced by WinMain().