b81c65519ea5e83b8e8be0b0f343fbc2b8004af5
[reactos.git] / reactos / sdk / lib / atl / atlexcept.h
1
2 #ifndef __ATLEXCEPT_H__
3 #define __ATLEXCEPT_H__
4
5
6 //FIXME: Enable when RaiseException is marked as NORETURN
7 //DECLSPEC_NORETURN
8 inline void AtlThrowImp(HRESULT hr)
9 {
10 #ifdef ATLTRACE
11 ATLTRACE(hr);
12 #endif
13
14 #ifdef _ATL_NO_EXCEPTIONS
15
16 ATLASSERT(false);
17
18 RaiseException(
19 hr == E_OUTOFMEMORY ? STATUS_NO_MEMORY : EXCEPTION_ILLEGAL_INSTRUCTION,
20 EXCEPTION_NONCONTINUABLE, 0, NULL
21 );
22
23 #else
24
25 // FIXME: This is horribly wrong, we should implement CException!
26 throw;
27
28 #endif
29
30 }
31
32
33
34 #ifndef AtlThrow
35 #define AtlThrow(x) AtlThrowImp(x)
36 #endif
37
38 #endif