1 | // Licensed to the .NET Foundation under one or more agreements. |
2 | // The .NET Foundation licenses this file to you under the MIT license. |
3 | // See the LICENSE file in the project root for more information. |
4 | //----------------------------------------------------------------------------- |
5 | // Entrypoint markers |
6 | // Used to identify all external entrypoints into the CLR (via COM, exports, etc) |
7 | // and perform various tasks on all of them |
8 | //----------------------------------------------------------------------------- |
9 | |
10 | |
11 | #ifndef __ENTRYPOINTS_h__ |
12 | #define __ENTRYPOINTS_h__ |
13 | |
14 | #define BEGIN_ENTRYPOINT_THROWS \ |
15 | BEGIN_SO_INTOLERANT_CODE(GetThread()) \ |
16 | |
17 | |
18 | #define END_ENTRYPOINT_THROWS \ |
19 | END_SO_INTOLERANT_CODE; |
20 | |
21 | #define BEGIN_ENTRYPOINT_THROWS_WITH_THREAD(____thread) \ |
22 | BEGIN_SO_INTOLERANT_CODE(____thread) \ |
23 | |
24 | #define END_ENTRYPOINT_THROWS_WITH_THREAD \ |
25 | END_SO_INTOLERANT_CODE; |
26 | |
27 | #define BEGIN_ENTRYPOINT_NOTHROW_WITH_THREAD(___thread) \ |
28 | BEGIN_SO_INTOLERANT_CODE_NO_THROW_CHECK_THREAD(return COR_E_STACKOVERFLOW) |
29 | |
30 | #define END_ENTRYPOINT_NOTHROW_WITH_THREAD \ |
31 | END_SO_INTOLERANT_CODE; |
32 | |
33 | #define BEGIN_ENTRYPOINT_NOTHROW \ |
34 | BEGIN_SO_INTOLERANT_CODE_NO_THROW_CHECK_THREAD(return COR_E_STACKOVERFLOW) |
35 | |
36 | #define END_ENTRYPOINT_NOTHROW \ |
37 | END_SO_INTOLERANT_CODE; |
38 | |
39 | extern void (*g_fpHandleSoftStackOverflow)(BOOL fSkipDebugger); |
40 | inline void FailedVoidEntryPoint() |
41 | { |
42 | if (g_fpHandleSoftStackOverflow) |
43 | { |
44 | g_fpHandleSoftStackOverflow(FALSE); |
45 | } |
46 | } |
47 | #define BEGIN_ENTRYPOINT_VOIDRET \ |
48 | BEGIN_SO_INTOLERANT_CODE_NO_THROW_CHECK_THREAD(FailedVoidEntryPoint();) |
49 | |
50 | #define END_ENTRYPOINT_VOIDRET \ |
51 | END_SO_INTOLERANT_CODE; |
52 | |
53 | #define BEGIN_CLEANUP_ENTRYPOINT \ |
54 | VALIDATE_BACKOUT_STACK_CONSUMPTION; |
55 | |
56 | #define END_CLEANUP_ENTRYPOINT |
57 | |
58 | #endif // __ENTRYPOINTS_h__ |
59 | |
60 | |
61 | |