ReactOS
0.4.16-dev-1946-g52006dd
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
#define STATUS_ILLEGAL_INSTRUCTION ((DWORD)0xC000001D)
10
#endif
11
#endif
12
13
namespace
ATL
14
{
15
16
17
//FIXME: Enable when RaiseException is marked as NORETURN
18
//DECLSPEC_NORETURN
19
inline
void
AtlThrowImp
(
HRESULT
hr
)
20
{
21
#ifdef ATLTRACE
22
ATLTRACE
(
hr
);
23
#endif
24
25
#ifdef _ATL_NO_EXCEPTIONS
26
27
ATLASSERT
(
false
);
28
29
RaiseException
(
30
hr
==
E_OUTOFMEMORY
?
STATUS_NO_MEMORY
:
EXCEPTION_ILLEGAL_INSTRUCTION
,
31
EXCEPTION_NONCONTINUABLE
, 0,
NULL
32
);
33
34
#else
35
36
// FIXME: This is horribly wrong, we should implement CException!
37
throw
;
38
39
#endif
40
41
}
42
43
44
#ifndef AtlThrow
45
#define AtlThrow(x) AtlThrowImp(x)
46
#endif
47
48
49
};
// namespace ATL
50
51
#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
EXCEPTION_ILLEGAL_INSTRUCTION
#define EXCEPTION_ILLEGAL_INSTRUCTION
Definition:
minwinbase.h:60
ATL
Definition:
rosdlgs.h:6
ATL::AtlThrowImp
void AtlThrowImp(HRESULT hr)
Definition:
atlexcept.h:19
hr
HRESULT hr
Definition:
shlfolder.c:183
EXCEPTION_NONCONTINUABLE
#define EXCEPTION_NONCONTINUABLE
Definition:
stubs.h:23
sdk
lib
atl
atlexcept.h
Generated on Thu Dec 4 2025 06:15:17 for ReactOS by
1.9.6