ReactOS 0.4.16-dev-319-g6cf4263
pseh3.h File Reference
#include <excpt.h>
Include dependency graph for pseh3.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _SEH3$_SCOPE_TABLE
 
struct  _SEH3$_EXCEPTION_POINTERS
 
struct  _SEH3$_REGISTRATION_FRAME
 
struct  __SEH3$FILTER_RESULT
 

Macros

#define _PSEH3_H_
 
#define _SEH3   $_AUTO_CLEANUP __attribute__((cleanup(_SEH3$_AutoCleanup)))
 
#define _SEH3   $_EnforceFramePointer() asm volatile ("#\n" : : "m"(*(char*)__builtin_alloca(0)) : "%esp", "memory")
 
#define _SEH3   $_ASM_GOTO(...) asm goto ("#\n" : : : "memory" : __VA_ARGS__)
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3   $_FINALLY(_Finally) (_Finally)
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3
 
#define _SEH3_TRY
 
#define _SEH3_EXCEPT(...)
 
#define _SEH3_FINALLY
 
#define _SEH3_END
 
#define _SEH3_LEAVE   goto _SEH3$_l_AfterTry
 
#define _SEH3_VOLATILE   volatile
 

Typedefs

typedef struct _SEH3$_SCOPE_TABLE SEH3$_SCOPE_TABLE
 
typedef struct _SEH3$_SCOPE_TABLEPSEH3$_SCOPE_TABLE
 
typedef struct _SEH3$_EXCEPTION_POINTERS SEH3$_EXCEPTION_POINTERS
 
typedef struct _SEH3$_EXCEPTION_POINTERSPSEH3$_EXCEPTION_POINTERS
 
typedef struct _SEH3$_REGISTRATION_FRAME SEH3$_REGISTRATION_FRAME
 
typedef struct _SEH3$_REGISTRATION_FRAMEPSEH3$_REGISTRATION_FRAME
 
typedef struct __SEH3$FILTER_RESULT _SEH3$FILTER_RESULT
 

Enumerations

enum  { _SEH3$_NESTED_HANDLER = 0 , _SEH3$_CPP_HANDLER = 1 , _SEH3$_CLANG_HANDLER = 2 , _SEH3$_HANDLER_TYPE = _SEH3$_NESTED_HANDLER }
 
enum  { _SEH3$_TryLevel = 0 }
 

Functions

static __attribute__ ((always_inline)) __attribute__((returns_twice)) void _SEH3$_PreventInlining()
 
 __attribute__ ((always_inline, gnu_inline)) void _SEH3$_UnregisterFrame(volatile SEH3$_REGISTRATION_FRAME *RegistrationFrame)
 
int __cdecl __attribute__ ((error("Can only be used inside a __finally block."))) _abnormal_termination(void)
 
unsigned long __cdecl __attribute__ ((error("Can only be used inside an exception filter or __except block."))) _exception_code(void)
 
void *__cdecl __attribute__ ((error("Can only be used inside an exception filter."))) _exception_info(void)
 
int __attribute__ ((regparm(3))) __attribute__((returns_twice)) _SEH3$_RegisterFrameWithNonVolatiles(volatile SEH3$_REGISTRATION_FRAME *RegistrationFrame
 

Variables

int const SEH3$_SCOPE_TABLEScopeTable
 
int const SEH3$_SCOPE_TABLE voidAllocaFrame
 

Macro Definition Documentation

◆ _PSEH3_H_

#define _PSEH3_H_

Definition at line 11 of file pseh3.h.

◆ _SEH3 [1/17]

#define _SEH3   $_AUTO_CLEANUP __attribute__((cleanup(_SEH3$_AutoCleanup)))

Definition at line 328 of file pseh3.h.

◆ _SEH3 [2/17]

#define _SEH3   $_EnforceFramePointer() asm volatile ("#\n" : : "m"(*(char*)__builtin_alloca(0)) : "%esp", "memory")

Definition at line 328 of file pseh3.h.

◆ _SEH3 [3/17]

#define _SEH3   $_ASM_GOTO(...) asm goto ("#\n" : : : "memory" : __VA_ARGS__)

Definition at line 328 of file pseh3.h.

◆ _SEH3 [4/17]

#define _SEH3
Value:
$_CALL_WRAPPER(_Function, _TrylevelFrame, _DataTable) \
asm goto ("leal %0, %%eax\n\t" \
"leal %1, %%edx\n\t" \
"call " #_Function \
: \
: "m" (*(_TrylevelFrame)), "m" (*(_DataTable)), "p" (_SEH3$_RegisterFrameWithNonVolatiles) \
: "eax", "edx", "ecx", "memory" \
: _SEH3$_l_BeforeTry, _SEH3$_l_HandlerTarget, _SEH3$_l_OnException, _SEH3$_l_BeforeFilterOrFinally, _SEH3$_l_FilterOrFinally)

Definition at line 328 of file pseh3.h.

◆ _SEH3 [5/17]

#define _SEH3
Value:
$_RegisterFrame_(_TrylevelFrame, _DataTable) \
_SEH3$_CALL_WRAPPER(__SEH3$_RegisterFrame, _TrylevelFrame, _DataTable)

Definition at line 328 of file pseh3.h.

◆ _SEH3 [6/17]

#define _SEH3
Value:
$_RegisterTryLevel_(_TrylevelFrame, _DataTable) \
_SEH3$_CALL_WRAPPER(__SEH3$_RegisterTryLevel, _TrylevelFrame, _DataTable)

Definition at line 328 of file pseh3.h.

◆ _SEH3 [7/17]

#define _SEH3
Value:
$_SCARE_GCC() \
void *plabel; \
_SEH3$_ASM_GOTO(_SEH3$_l_BeforeTry, _SEH3$_l_HandlerTarget, _SEH3$_l_OnException, _SEH3$_l_BeforeFilterOrFinally, _SEH3$_l_FilterOrFinally); \
asm volatile ("#" : "=a"(plabel) : "p"(&&_SEH3$_l_BeforeTry), "p"(&&_SEH3$_l_HandlerTarget), "p"(&&_SEH3$_l_OnException), "p"(&&_SEH3$_l_FilterOrFinally) \
: "ebx", "ecx", "edx", "esi", "edi", "flags", "memory" ); \
goto _SEH3$_l_OnException;

Definition at line 328 of file pseh3.h.

◆ _SEH3 [8/17]

#define _SEH3
Value:
$_DECLARE_EXCEPT_INTRINSICS() \
inline __attribute__((always_inline, gnu_inline)) \
unsigned long _exception_code() { return _SEH3$_TrylevelFrame.ExceptionCode; }
#define __attribute__(x)
Definition: wpp_private.h:207
#define _exception_code()
Definition: pseh2_64.h:178

Definition at line 328 of file pseh3.h.

◆ _SEH3 [9/17]

#define _SEH3
Value:
$_DECLARE_FILTER_FUNC(_Name) \
#define __fastcall
Definition: sync.c:38
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:510

Definition at line 328 of file pseh3.h.

◆ _SEH3 [10/17]

#define _SEH3
Value:
$_NESTED_FUNC_OPEN(_Name) \
{ \
/* This is a fancy way to get information about the frame layout */ \
if (Action == 0) { _SEH3$FILTER_RESULT seh3$result; seh3$result.Value = (int)&_SEH3$_TrylevelFrame; return seh3$result; }
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Definition at line 328 of file pseh3.h.

◆ _SEH3 [11/17]

#define _SEH3
Value:
$_DEFINE_FILTER_FUNC(_Name, expression) \
_SEH3$_NESTED_FUNC_OPEN(_Name) \
/* Declare the intrinsics for exception filters */ \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wshadow\"") \
inline __attribute__((always_inline, gnu_inline)) \
unsigned long _exception_code() { return _SEH3$_TrylevelFrame.ExceptionCode; } \
inline __attribute__((always_inline, gnu_inline)) \
void * _exception_info() { return _SEH3$_TrylevelFrame.ExceptionPointers; } \
_Pragma("GCC diagnostic pop") \
\
/* Now handle the actual filter expression */ \
{ _SEH3$FILTER_RESULT seh3$result; seh3$result.Value = (expression); return seh3$result; } \
}
#define _exception_info()
Definition: pseh2_64.h:177

Definition at line 328 of file pseh3.h.

◆ _SEH3 [12/17]

#define _SEH3
Value:
$_FINALLY_FUNC_OPEN(_Name) \
_SEH3$_NESTED_FUNC_OPEN(_Name) \
/* Declare the intrinsics for the finally function */ \
inline __attribute__((always_inline, gnu_inline)) \
int _abnormal_termination() { return (_SEH3$_TrylevelFrame.ExceptionPointers != 0); } \
\
/* This construct makes sure that the finally function returns */ \
/* a proper value at the end */ \
for (; ; (void)({ _SEH3$FILTER_RESULT seh3$result; seh3$result.Value = 0; return seh3$result; 0;}))
#define _abnormal_termination()
Definition: pseh2_64.h:179

Definition at line 328 of file pseh3.h.

◆ _SEH3 [13/17]

#define _SEH3
Value:
$_FILTER(_Filter, _FilterExpression) \
(__builtin_constant_p(_FilterExpression) ? (void*)(unsigned long)(unsigned char)(unsigned long)(_FilterExpression) : _Filter)
unsigned char
Definition: typeof.h:29

Definition at line 328 of file pseh3.h.

◆ _SEH3 [14/17]

#define _SEH3   $_FINALLY(_Finally) (_Finally)

Definition at line 328 of file pseh3.h.

◆ _SEH3 [15/17]

#define _SEH3
Value:
$_DEFINE_DUMMY_FINALLY(_Name) \
auto inline __attribute__((always_inline,gnu_inline)) int _Name(int Action) { (void)Action; return 0; }

Definition at line 328 of file pseh3.h.

◆ _SEH3 [16/17]

#define _SEH3
Value:
$_DECLARE_CLEANUP_FUNC(_Name) \
auto inline __attribute__((always_inline,gnu_inline)) void _Name(volatile SEH3$_REGISTRATION_FRAME *p)
GLfloat GLfloat p
Definition: glext.h:8902

Definition at line 328 of file pseh3.h.

◆ _SEH3 [17/17]

#define _SEH3
Value:
$_DEFINE_CLEANUP_FUNC(_Name) \
_SEH3$_DECLARE_CLEANUP_FUNC(_Name) \
{ \
(void)p; \
/* Unregister the frame */ \
if (_SEH3$_TryLevel == 1) _SEH3$_UnregisterFrame(&_SEH3$_TrylevelFrame); \
else _SEH3$_UnregisterTryLevel(&_SEH3$_TrylevelFrame); \
\
/* Invoke the finally function (an inline dummy in the __except case) */ \
_SEH3$_FinallyFunction(1); \
}
@ _SEH3$_TryLevel
Definition: pseh3.h:109
else
Definition: tritemp.h:161

Definition at line 328 of file pseh3.h.

◆ _SEH3_END

#define _SEH3_END
Value:
}; \
goto _SEH3$_l_EndTry; \
\
_SEH3$_l_OnException: (void)0; \
/* Force GCC to create proper code pathes */ \
_SEH3$_SCARE_GCC(); \
\
_SEH3$_l_EndTry:(void)0; \
_SEH3$_ASM_GOTO(_SEH3$_l_OnException); \
\
/* Implementation of the auto cleanup function */ \
_SEH3$_DEFINE_CLEANUP_FUNC(_SEH3$_AutoCleanup); \
\
/* Close the outer scope */ \
}

Definition at line 457 of file pseh3.h.

◆ _SEH3_EXCEPT

#define _SEH3_EXCEPT (   ...)

Definition at line 380 of file pseh3.h.

◆ _SEH3_FINALLY

#define _SEH3_FINALLY
Value:
/* End of the try block */ \
_SEH3$_l_AfterTry: (void)0; \
/* Set ExceptionPointers to 0, this is used by _abnormal_termination() */ \
_SEH3$_TrylevelFrame.ExceptionPointers = 0; \
\
goto _SEH3$_l_EndTry; \
\
_SEH3$_l_BeforeTry: (void)0; \
_SEH3$_ASM_GOTO(_SEH3$_l_OnException); \
\
/* Forward declaration of the finally function */ \
_SEH3$_DECLARE_FILTER_FUNC(_SEH3$_FinallyFunction); \
\
/* Create a static data table that contains the finally function */ \
static const SEH3$_SCOPE_TABLE _SEH3$_ScopeTable = { 0, _SEH3$_FINALLY(&_SEH3$_FinallyFunction), _SEH3$_TryLevel, _SEH3$_HANDLER_TYPE }; \
\
/* Register the registration record. */ \
if (_SEH3$_TryLevel == 1) _SEH3$_RegisterFrame_(&_SEH3$_TrylevelFrame, &_SEH3$_ScopeTable); \
else _SEH3$_RegisterTryLevel_(&_SEH3$_TrylevelFrame, &_SEH3$_ScopeTable); \
_SEH3$_TrylevelFrame.ExceptionPointers = (PSEH3$_EXCEPTION_POINTERS)1; \
\
goto _SEH3$_l_DoTry; \
\
_SEH3$_l_HandlerTarget: (void)0; \
_SEH3$_EnforceFramePointer(); \
\
_SEH3$_l_BeforeFilterOrFinally: (void)0; \
_SEH3$_EnforceFramePointer(); \
_SEH3$_l_FilterOrFinally: (void)0; \
_SEH3$_FINALLY_FUNC_OPEN(_SEH3$_FinallyFunction)
@ _SEH3$_HANDLER_TYPE
Definition: pseh3.h:34

Definition at line 424 of file pseh3.h.

◆ _SEH3_LEAVE

#define _SEH3_LEAVE   goto _SEH3$_l_AfterTry

Definition at line 474 of file pseh3.h.

◆ _SEH3_TRY

#define _SEH3_TRY

Definition at line 344 of file pseh3.h.

◆ _SEH3_VOLATILE

#define _SEH3_VOLATILE   volatile

Definition at line 476 of file pseh3.h.

Typedef Documentation

◆ _SEH3$FILTER_RESULT

◆ PSEH3$_EXCEPTION_POINTERS

◆ PSEH3$_REGISTRATION_FRAME

◆ PSEH3$_SCOPE_TABLE

◆ SEH3$_EXCEPTION_POINTERS

◆ SEH3$_REGISTRATION_FRAME

◆ SEH3$_SCOPE_TABLE

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
_SEH3$_NESTED_HANDLER 
_SEH3$_CPP_HANDLER 
_SEH3$_CLANG_HANDLER 
_SEH3$_HANDLER_TYPE 

Definition at line 24 of file pseh3.h.

25{
29#ifdef __clang__
31#elif defined(__cplusplus)
33#else
35#endif
36};
@ _SEH3$_CLANG_HANDLER
Definition: pseh3.h:28
@ _SEH3$_CPP_HANDLER
Definition: pseh3.h:27
@ _SEH3$_NESTED_HANDLER
Definition: pseh3.h:26

◆ anonymous enum

anonymous enum
Enumerator
_SEH3$_TryLevel 

Definition at line 107 of file pseh3.h.

108{
109 _SEH3$_TryLevel = 0,
110};

Function Documentation

◆ __attribute__() [1/6]

static __attribute__ ( (always_inline)  )
inlinestatic

Definition at line 86 of file pseh3.h.

86{}

◆ __attribute__() [2/6]

__attribute__ ( (always_inline, gnu_inline)  ) volatile
inline

Definition at line 89 of file pseh3.h.

91{
92 asm volatile ("movl %k[NewHead], %%fs:0"
93 : : [NewHead] "ir" (RegistrationFrame->Next) : "memory");
94}

◆ __attribute__() [3/6]

int __cdecl __attribute__ ( (error("Can only be used inside a __finally block."))  )

◆ __attribute__() [4/6]

unsigned long __cdecl __attribute__ ( (error("Can only be used inside an exception filter or __except block."))  )

◆ __attribute__() [5/6]

void *__cdecl __attribute__ ( (error("Can only be used inside an exception filter."))  )

◆ __attribute__() [6/6]

int __attribute__ ( (regparm(3))  ) volatile

Variable Documentation

◆ AllocaFrame

Definition at line 128 of file pseh3.h.

◆ ScopeTable

int const SEH3$_SCOPE_TABLE * ScopeTable

Definition at line 127 of file pseh3.h.

Referenced by __C_specific_handler().