|
|
|
| 1 |
|
/*** |
| 2 |
|
*excpt.h - defines exception values, types and routines |
| 3 |
|
* |
| 4 |
|
* Copyright (c) Microsoft Corporation. All rights reserved. |
| 5 |
|
* |
| 6 |
|
*Purpose: |
| 7 |
|
* This file contains the definitions and prototypes for the compiler- |
| 8 |
|
* dependent intrinsics, support functions and keywords which implement |
| 9 |
|
* the structured exception handling extensions. |
| 10 |
|
* |
| 11 |
|
* [Public] |
| 12 |
|
* |
| 13 |
|
****/ |
| 14 |
|
|
| 15 |
|
#if _MSC_VER > 1000 |
| 16 |
|
#pragma once |
| 17 |
|
#endif |
| 18 |
|
|
| 19 |
|
#ifndef _INC_EXCPT |
| 20 |
|
#define _INC_EXCPT |
| 21 |
|
|
| 22 |
|
#include <crtdefs.h> |
| 23 |
|
|
| 24 |
|
#ifdef _MSC_VER |
| 25 |
|
/* |
| 26 |
|
* Currently, all MS C compilers for Win32 platforms default to 8 byte |
| 27 |
|
* alignment. |
| 28 |
|
*/ |
| 29 |
|
#pragma pack(push,_CRT_PACKING) |
| 30 |
|
#endif /* _MSC_VER */ |
| 31 |
|
|
| 32 |
|
#ifdef __cplusplus |
| 33 |
|
extern "C" { |
| 34 |
|
#endif |
| 35 |
|
|
| 36 |
|
/* |
| 37 |
|
* Exception disposition return values. |
| 38 |
|
*/ |
| 39 |
|
typedef enum _EXCEPTION_DISPOSITION { |
| 40 |
|
ExceptionContinueExecution, |
| 41 |
|
ExceptionContinueSearch, |
| 42 |
|
ExceptionNestedException, |
| 43 |
|
ExceptionCollidedUnwind |
| 44 |
|
} EXCEPTION_DISPOSITION; |
| 45 |
|
|
| 46 |
|
|
| 47 |
|
/* |
| 48 |
|
* Prototype for SEH support function. |
| 49 |
|
*/ |
| 50 |
|
|
| 51 |
|
#ifdef _M_IX86 |
| 52 |
|
|
| 53 |
|
/* |
| 54 |
|
* Declarations to keep MS C 8 (386/486) compiler happy |
| 55 |
|
*/ |
| 56 |
|
struct _EXCEPTION_RECORD; |
| 57 |
|
struct _CONTEXT; |
| 58 |
|
|
| 59 |
|
EXCEPTION_DISPOSITION __cdecl _except_handler ( |
| 60 |
|
_In_ struct _EXCEPTION_RECORD *_ExceptionRecord, |
| 61 |
|
_In_ void * _EstablisherFrame, |
| 62 |
|
_Inout_ struct _CONTEXT *_ContextRecord, |
| 63 |
|
_Inout_ void * _DispatcherContext |
| 64 |
|
); |
| 65 |
|
|
| 66 |
|
#elif defined(_M_IA64) |
| 67 |
|
|
| 68 |
|
/* |
| 69 |
|
* Declarations to keep IA64 compiler happy |
| 70 |
|
*/ |
| 71 |
|
typedef struct _EXCEPTION_POINTERS *Exception_info_ptr; |
| 72 |
|
struct _EXCEPTION_RECORD; |
| 73 |
|
struct _CONTEXT; |
| 74 |
|
struct _DISPATCHER_CONTEXT; |
| 75 |
|
|
| 76 |
|
|
| 77 |
|
_CRTIMP EXCEPTION_DISPOSITION __cdecl __C_specific_handler ( |
| 78 |
|
_In_ struct _EXCEPTION_RECORD *_ExceptionRecord, |
| 79 |
|
_In_ unsigned __int64 _MemoryStackFp, |
| 80 |
|
_In_ unsigned __int64 _BackingStoreFp, |
| 81 |
|
_Inout_ struct _CONTEXT *_ContextRecord, |
| 82 |
|
_Inout_ struct _DISPATCHER_CONTEXT *_DispatcherContext, |
| 83 |
|
_In_ unsigned __int64 _GlobalPointer |
| 84 |
|
); |
| 85 |
|
|
| 86 |
|
#elif defined(_M_AMD64) |
| 87 |
|
|
| 88 |
|
/* |
| 89 |
|
* Declarations to keep AMD64 compiler happy |
| 90 |
|
*/ |
| 91 |
|
struct _EXCEPTION_RECORD; |
| 92 |
|
struct _CONTEXT; |
| 93 |
|
|
| 94 |
|
#endif |
| 95 |
|
|
| 96 |
|
|
| 97 |
|
/* |
| 98 |
|
* Keywords and intrinsics for SEH |
| 99 |
|
*/ |
| 100 |
|
|
| 101 |
|
#ifdef _MSC_VER |
| 102 |
|
|
| 103 |
|
#define GetExceptionCode _exception_code |
| 104 |
|
#define exception_code _exception_code |
| 105 |
|
#define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info |
| 106 |
|
#define exception_info (struct _EXCEPTION_POINTERS *)_exception_info |
| 107 |
|
#define AbnormalTermination _abnormal_termination |
| 108 |
|
#define abnormal_termination _abnormal_termination |