memex
Loading...
Searching...
No Matches
error.hpp
Go to the documentation of this file.
1
#pragma once
2
#include <string_view>
3
4
namespace
memex
5
{
10
enum class
Error
11
{
12
AlreadyAttached
,
13
InvalidPID
,
14
AccessDenied
,
15
OpenFailed
,
16
TerminateFailed
,
17
InvalidHandle
,
18
ProcessNotFound
,
19
ProcFirstFailed
,
20
SnapshotFailed
,
21
ModFirstFailed
,
22
ModuleNotFound
23
};
24
31
constexpr
std::string_view
parseError
(
Error
error)
32
{
33
switch
(error)
34
{
35
case
Error::AlreadyAttached
:
36
return
"Already attached"
;
37
case
Error::InvalidPID
:
38
return
"Invalid Process Id"
;
39
case
Error::AccessDenied
:
40
return
"Access denied"
;
41
case
Error::OpenFailed
:
42
return
"Failed to open process"
;
43
case
Error::TerminateFailed
:
44
return
"Failed to terminate process"
;
45
case
Error::InvalidHandle
:
46
return
"Invalid handle"
;
47
case
Error::ProcessNotFound
:
48
return
"Process not found"
;
49
case
Error::ProcFirstFailed
:
50
return
"Process32First failed"
;
51
case
Error::SnapshotFailed
:
52
return
"Failed to create Toolhelp snapshot"
;
53
case
Error::ModFirstFailed
:
54
return
"Module32First failed"
;
55
case
Error::ModuleNotFound
:
56
return
"Module not found"
;
57
default
:
58
return
"Unknown error"
;
59
}
60
}
61
}
memex
Definition
access_mask.hpp:5
memex::Error
Error
An enumeration of error codes that can be returned by the library.
Definition
error.hpp:11
memex::Error::ProcFirstFailed
@ ProcFirstFailed
memex::Error::InvalidHandle
@ InvalidHandle
memex::Error::ModFirstFailed
@ ModFirstFailed
memex::Error::TerminateFailed
@ TerminateFailed
memex::Error::AlreadyAttached
@ AlreadyAttached
memex::Error::SnapshotFailed
@ SnapshotFailed
memex::Error::InvalidPID
@ InvalidPID
memex::Error::ModuleNotFound
@ ModuleNotFound
memex::Error::OpenFailed
@ OpenFailed
memex::Error::AccessDenied
@ AccessDenied
memex::Error::ProcessNotFound
@ ProcessNotFound
memex::parseError
constexpr std::string_view parseError(Error error)
Converts an error code to its string representation.
Definition
error.hpp:31
include
memex
error.hpp
Generated by
1.12.0