ReactOS  0.4.15-dev-1397-g19779b3
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 
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
HRESULT hr
Definition: shlfolder.c:183
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
#define EXCEPTION_NONCONTINUABLE
Definition: rtltypes.h:154
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: rosdlgs.h:5
LONG HRESULT
Definition: typedefs.h:79
void AtlThrowImp(HRESULT hr)
Definition: atlexcept.h:18
VOID WINAPI RaiseException(IN DWORD dwExceptionCode, IN DWORD dwExceptionFlags, IN DWORD nNumberOfArguments, IN CONST ULONG_PTR *lpArguments OPTIONAL)
Definition: except.c:693
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define NULL
Definition: types.h:112
#define EXCEPTION_ILLEGAL_INSTRUCTION
Definition: winbase.h:324