23int WINAPI
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
int nCmdShow)
27 if (IsDebuggerPresent()) {
37#pragma region Admin Check
45#pragma region Mutex Check
60#pragma region Panoptes Configuration
64 std::string configPath =
"C:\\ProgramData\\Panoptes\\Panoptes.config";
69 configuration->
Parse();
72 catch (
const int& err) {
77#pragma region Database
79 ERRORCODE errCode = dbTmp.InitializeDatabase();
85#pragma region GRPC Server
86 HANDLE grpcThread = CreateThread(
101#pragma region Container Start
108#pragma region ETW Trace
109 HANDLE etwThread = CreateThread(
124#pragma region Driver Check
149 HANDLE proc = GetCurrentProcess();
151 WaitForSingleObject(proc, INFINITE);
#define PANO_SERVICE_STOPPED
#define PANO_SERVICE_RUNNING
#define GRPC_SERVER_ERROR
std::vector< Configuration::ContainerType > m_extensibility
The extensibility selected from the configuration file.
void Parse()
Parse the configuration file.
bool m_ignoreDriver
The ignore driver from the configuration file.
ERRORCODE StartContainers(std::vector< Configuration::ContainerType > selectedExtensibility)
ERRORCODE StartWindowsDriver()
ERRORCODE GetKernelServiceStatus()
ERRORCODE StopWindowsDriver()
std::string GetErrorMessage(UINT resourceID)
void DisplayErrorMessage(std::string errorMessage)
ULONG StartPanoptesTrace(LPVOID lpParam)
PanoptesContext * serviceContext
VOID RunServiceServer(LPVOID lpParam)
ERRORCODE SetEnvironmentMutex()
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
ERRORCODE CleanupWithError(ERRORCODE err)
std::atomic< bool > threadError
std::atomic< PanoptesDatabase > database
std::string GetCurrentPath()