HydraHook
Direct3D and Core Audio hooking library for Windows
Toggle main menu visibility
Loading...
Searching...
No Matches
Exceptions.hpp
Go to the documentation of this file.
1
6
7
#pragma once
8
9
#include <Windows.h>
10
#include <stdexcept>
11
12
namespace
HydraHook
13
{
14
namespace
Core
15
{
16
namespace
Exceptions
17
{
18
class
RuntimeException
:
public
std::runtime_error
19
{
20
public
:
21
explicit
RuntimeException
(
const
std::string &msg) :
22
std::runtime_error(msg.c_str())
23
{ }
24
25
explicit
RuntimeException
(
const
char
*msg) :
26
std::runtime_error(msg)
27
{ }
28
};
29
30
class
DetourException
:
public
RuntimeException
31
{
32
public
:
33
explicit
DetourException
(
const
std::string &msg) :
34
RuntimeException
(msg.c_str())
35
{ }
36
37
explicit
DetourException
(
const
char
*msg) :
38
RuntimeException
(msg)
39
{ }
40
};
41
42
class
GenericWinAPIException
:
public
std::runtime_error
43
{
44
DWORD last_error_;
45
46
public
:
47
explicit
GenericWinAPIException
(
const
std::string &msg) :
48
std::runtime_error(msg.c_str()), last_error_(GetLastError())
49
{ }
50
51
explicit
GenericWinAPIException
(
const
char
*msg) :
52
std::runtime_error(msg), last_error_(GetLastError())
53
{ }
54
55
virtual
DWORD
get_last_error
()
const
56
{
57
return
last_error_;
58
}
59
};
60
61
class
ModuleNotFoundException
:
public
GenericWinAPIException
62
{
63
public
:
64
explicit
ModuleNotFoundException
(
const
std::string &msg) :
65
GenericWinAPIException
(msg)
66
{ }
67
68
explicit
ModuleNotFoundException
(
const
char
*msg) :
69
GenericWinAPIException
(msg)
70
{ }
71
};
72
73
class
ProcAddressNotFoundException
:
public
GenericWinAPIException
74
{
75
public
:
76
explicit
ProcAddressNotFoundException
(
const
std::string &msg) :
77
GenericWinAPIException
(msg)
78
{ }
79
80
explicit
ProcAddressNotFoundException
(
const
char
*msg) :
81
GenericWinAPIException
(msg)
82
{ }
83
};
84
85
class
COMInterfaceException
:
public
RuntimeException
86
{
87
HRESULT hresult_;
88
89
public
:
90
explicit
COMInterfaceException
(
const
std::string &msg, HRESULT result) :
91
RuntimeException
(msg), hresult_(result)
92
{ }
93
94
explicit
COMInterfaceException
(
const
char
*msg, HRESULT result) :
95
RuntimeException
(msg), hresult_(result)
96
{ }
97
98
HRESULT
hresult
()
const
99
{
100
return
hresult_;
101
}
102
};
103
104
class
DXAPIException
:
public
COMInterfaceException
105
{
106
public
:
107
explicit
DXAPIException
(
const
std::string &msg, HRESULT result) :
108
COMInterfaceException
(msg, result)
109
{ }
110
111
explicit
DXAPIException
(
const
char
*msg, HRESULT result) :
112
COMInterfaceException
(msg, result)
113
{ }
114
};
115
116
class
ARCException
:
public
COMInterfaceException
117
{
118
public
:
119
explicit
ARCException
(
const
std::string &msg, HRESULT result) :
120
COMInterfaceException
(msg, result)
121
{ }
122
123
explicit
ARCException
(
const
char
*msg, HRESULT result) :
124
COMInterfaceException
(msg, result)
125
{ }
126
};
127
128
class
SehException
:
public
RuntimeException
129
{
130
DWORD code_;
131
EXCEPTION_POINTERS* info_;
132
133
public
:
134
SehException
(DWORD
code
, EXCEPTION_POINTERS* info) :
135
RuntimeException
(
"Structured exception"
),
136
code_(
code
), info_(info)
137
{ }
138
139
DWORD
code
()
const
{
return
code_; }
140
EXCEPTION_POINTERS*
exception_pointers
()
const
{
return
info_; }
141
};
142
};
143
};
144
};
HydraHook::Core::Exceptions::ARCException::ARCException
ARCException(const std::string &msg, HRESULT result)
Definition
Exceptions.hpp:119
HydraHook::Core::Exceptions::ARCException::ARCException
ARCException(const char *msg, HRESULT result)
Definition
Exceptions.hpp:123
HydraHook::Core::Exceptions::COMInterfaceException::hresult
HRESULT hresult() const
Definition
Exceptions.hpp:98
HydraHook::Core::Exceptions::COMInterfaceException::COMInterfaceException
COMInterfaceException(const std::string &msg, HRESULT result)
Definition
Exceptions.hpp:90
HydraHook::Core::Exceptions::COMInterfaceException::COMInterfaceException
COMInterfaceException(const char *msg, HRESULT result)
Definition
Exceptions.hpp:94
HydraHook::Core::Exceptions::DXAPIException::DXAPIException
DXAPIException(const char *msg, HRESULT result)
Definition
Exceptions.hpp:111
HydraHook::Core::Exceptions::DXAPIException::DXAPIException
DXAPIException(const std::string &msg, HRESULT result)
Definition
Exceptions.hpp:107
HydraHook::Core::Exceptions::DetourException::DetourException
DetourException(const char *msg)
Definition
Exceptions.hpp:37
HydraHook::Core::Exceptions::DetourException::DetourException
DetourException(const std::string &msg)
Definition
Exceptions.hpp:33
HydraHook::Core::Exceptions::GenericWinAPIException::GenericWinAPIException
GenericWinAPIException(const char *msg)
Definition
Exceptions.hpp:51
HydraHook::Core::Exceptions::GenericWinAPIException::GenericWinAPIException
GenericWinAPIException(const std::string &msg)
Definition
Exceptions.hpp:47
HydraHook::Core::Exceptions::GenericWinAPIException::get_last_error
virtual DWORD get_last_error() const
Definition
Exceptions.hpp:55
HydraHook::Core::Exceptions::ModuleNotFoundException::ModuleNotFoundException
ModuleNotFoundException(const char *msg)
Definition
Exceptions.hpp:68
HydraHook::Core::Exceptions::ModuleNotFoundException::ModuleNotFoundException
ModuleNotFoundException(const std::string &msg)
Definition
Exceptions.hpp:64
HydraHook::Core::Exceptions::ProcAddressNotFoundException::ProcAddressNotFoundException
ProcAddressNotFoundException(const char *msg)
Definition
Exceptions.hpp:80
HydraHook::Core::Exceptions::ProcAddressNotFoundException::ProcAddressNotFoundException
ProcAddressNotFoundException(const std::string &msg)
Definition
Exceptions.hpp:76
HydraHook::Core::Exceptions::RuntimeException::RuntimeException
RuntimeException(const char *msg)
Definition
Exceptions.hpp:25
HydraHook::Core::Exceptions::RuntimeException::RuntimeException
RuntimeException(const std::string &msg)
Definition
Exceptions.hpp:21
HydraHook::Core::Exceptions::SehException::exception_pointers
EXCEPTION_POINTERS * exception_pointers() const
Definition
Exceptions.hpp:140
HydraHook::Core::Exceptions::SehException::SehException
SehException(DWORD code, EXCEPTION_POINTERS *info)
Definition
Exceptions.hpp:134
HydraHook::Core::Exceptions::SehException::code
DWORD code() const
Definition
Exceptions.hpp:139
HydraHook::Core::Exceptions
Definition
Exceptions.hpp:17
HydraHook::Core
Definition
Exceptions.hpp:15
HydraHook
Definition
Exceptions.hpp:13
src
HydraHook
Exceptions.hpp
Generated by
1.18.0