ReactOS
0.4.16-dev-334-g4d9f67c
atlexcept.h
Go to the documentation of this file.
1
2
#ifndef __ATLEXCEPT_H__
3
#define __ATLEXCEPT_H__
4
5
6
#ifdef _ATL_NO_EXCEPTIONS
7
#if !defined(STATUS_NO_MEMORY) && defined(WIN32_NO_STATUS)
8
#define STATUS_NO_MEMORY ((DWORD)0xC0000017)
9
#endif
10
#endif
11
12
namespace
ATL
13
{
14
15
16
//FIXME: Enable when RaiseException is marked as NORETURN
17
//DECLSPEC_NORETURN
18
inline
void
AtlThrowImp
(
HRESULT
hr
)
19
{
20
#ifdef ATLTRACE
21
ATLTRACE
(
hr
);
22
#endif
23
24
#ifdef _ATL_NO_EXCEPTIONS
25
26
ATLASSERT
(
false
);
27
28
RaiseException
(
29
hr
==
E_OUTOFMEMORY
?
STATUS_NO_MEMORY
:
EXCEPTION_ILLEGAL_INSTRUCTION
,
30
EXCEPTION_NONCONTINUABLE
, 0,
NULL
31
);
32
33
#else
34
35
// FIXME: This is horribly wrong, we should implement CException!
36
throw
;
37
38
#endif
39
40
}
41
42
43
#ifndef AtlThrow
44
#define AtlThrow(x) AtlThrowImp(x)
45
#endif
46
47
48
};
// namespace ATL
49
50
#endif
ATLASSERT
#define ATLASSERT(x)
Definition:
CComVariant.cpp:10
ATLTRACE
#define ATLTRACE(format,...)
Definition:
atltrace.h:269
STATUS_NO_MEMORY
#define STATUS_NO_MEMORY
Definition:
d3dkmdt.h:51
E_OUTOFMEMORY
#define E_OUTOFMEMORY
Definition:
ddrawi.h:100
NULL
#define NULL
Definition:
types.h:112
RaiseException
VOID WINAPI RaiseException(_In_ DWORD dwExceptionCode, _In_ DWORD dwExceptionFlags, _In_ DWORD nNumberOfArguments, _In_opt_ const ULONG_PTR *lpArguments)
Definition:
except.c:700
HRESULT
Definition:
mshtmhst.idl:286
ATL
Definition:
rosdlgs.h:6
ATL::AtlThrowImp
void AtlThrowImp(HRESULT hr)
Definition:
atlexcept.h:18
hr
HRESULT hr
Definition:
shlfolder.c:183
EXCEPTION_NONCONTINUABLE
#define EXCEPTION_NONCONTINUABLE
Definition:
stubs.h:23
EXCEPTION_ILLEGAL_INSTRUCTION
#define EXCEPTION_ILLEGAL_INSTRUCTION
Definition:
winbase.h:353
sdk
lib
atl
atlexcept.h
Generated on Mon Dec 9 2024 06:13:18 for ReactOS by
1.9.6