1#define RESOURCES_EXPORTS
4#include <unordered_map>
7static const std::unordered_map<std::string, int> errorCodeMap = {
38static const std::unordered_map<int, const char*> errorStringMap = {
45 {
MUTEX_SET,
"Could not set service mutex"},
52 {
EVENT_CREATE,
"An error occured when attempting to create an event"},
54 {
KERNEL_PIPE,
"An error occured when attempting to connect to kernel pipe."},
55 {
NOT_INSTALLED,
"The Panoptes driver is not installed. Reinstall Panoptes."},
58 {
PANO_SERVICE_STOPPED,
"The Panoptes driver is not running and could not be started. Check that test signing is on (bcdedit /set testsigning on, then reboot)."},
61 {
CLEAN_HANDLE,
"An error occured when attempting to clean up handles"},
62 {
NOT_ADMIN,
"The program is not running as administrator"},
63 {
NO_CONFIG,
"Not config file was provided"},
65 {
EXT_INVALID,
"An invalid extensibility was selected"},
72 auto it = errorCodeMap.find(errorName);
73 return (it != errorCodeMap.end()) ? it->second :
NOT_SET;
77 auto it = errorStringMap.find(errorCode);
78 return (it != errorStringMap.end()) ? it->second :
"Unknown error code";
RESOURCES_API int GetResourceErrorCode(const char *errorName)
RESOURCES_API const char * GetResourceErrorString(int errorCode)
#define ERROR_STARTING_SERVICE
#define PANO_SERVICE_STOPPED
#define PANO_SERVICE_RUNNING
#define ERROR_STOPPING_SERVICE
#define PERMISSION_DENIED
#define DB_INITIALIZATION
#define GRPC_SERVER_ERROR
#define NAMED_PIPE_CREATE