Panoptes 1.0.0
Endpoint Detection and Response
Loading...
Searching...
No Matches
mutex.cpp
Go to the documentation of this file.
1#include "mutex.hpp"
2
3HANDLE g_mutex;
4
6 g_mutex = CreateMutexA(
7 NULL,
8 FALSE,
10 );
11 if (g_mutex == NULL)
12 {
13 return INVALID_INPUT;
14 }
15
16 return PANO_SUCCESS;
17}
18
20 g_mutex = OpenMutexA(
21 SYNCHRONIZE, // Request full access
22 FALSE, // Do not inherit handle
23 SERVICE_MUTEX // Name of the mutex
24 );
25 if (g_mutex == NULL)
26 {
27 return MUTEX_NOT_SET;
28 }
29
30 return PANO_SUCCESS;
31}
32
34 if (!ReleaseMutex(g_mutex))
35 return CLEAN_HANDLE;
36
37 return PANO_SUCCESS;
38}
#define PANO_SUCCESS
#define INVALID_INPUT
#define CLEAN_HANDLE
#define MUTEX_NOT_SET
ERRORCODE DestroyMutex()
Definition mutex.cpp:33
HANDLE g_mutex
Definition mutex.cpp:3
ERRORCODE SetEnvironmentMutex()
Definition mutex.cpp:5
ERRORCODE MutexExist()
Definition mutex.cpp:19
#define ERRORCODE
#define SERVICE_MUTEX