Panoptes 1.0.0
Endpoint Detection and Response
Loading...
Searching...
No Matches
shutdown.h
Go to the documentation of this file.
1#pragma once
2#include <Windows.h>
3#include "service_constants.h"
4
5// Shutdown requests reach the service in three ways, all of which set the same stop event:
6// - Ctrl+C, Ctrl+Break or closing the console (Debug builds run as a console program)
7// - The user logging off or Windows shutting down, delivered to a hidden top-level window as
8// WM_ENDSESSION
9// - "PanoptesService.exe --stop", which sets the named stop event from another process
10//
11// Windows ends the process as soon as a console control handler or WM_ENDSESSION returns, so
12// those wait (up to PANO_SHUTDOWN_WAIT_MS) for the main thread to report that it has finished
13// tearing the service down.
14
15#define PANO_SHUTDOWN_WAIT_MS 10000
16
22
25
29
#define ERRORCODE
ERRORCODE InitializeShutdown()
Creates the stop event and installs the console handler and session-end window. The stop event can on...
Definition shutdown.cpp:113
void WaitForShutdownRequest()
Blocks until a shutdown is requested.
Definition shutdown.cpp:178
ERRORCODE RequestServiceStop()
Implements –stop: sets a running service's stop event and waits for it to exit.
Definition shutdown.cpp:191
void NotifyShutdownComplete()
Tells console handlers and the session-end window that teardown has finished, so they can return and ...
Definition shutdown.cpp:183