summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-03-14 15:20:47 +0000
committermidipix <writeonce@midipix.org>2019-03-24 19:24:27 -0400
commitfb30a92d3dcbe8ea868ae4f3fe88d632e395b67e (patch)
treefa64e7ce3f85f93655e3b400d018afce6f73d438 /include
parent08ce77a1f5afd459c4092b887e1d60af7728faa7 (diff)
downloadntapi-fb30a92d3dcbe8ea868ae4f3fe88d632e395b67e.tar.bz2
ntapi-fb30a92d3dcbe8ea868ae4f3fe88d632e395b67e.tar.xz
nt_exception.h: added SEH-oriented definitions.
Diffstat (limited to 'include')
-rw-r--r--include/ntapi/nt_exception.h47
1 files changed, 46 insertions, 1 deletions
diff --git a/include/ntapi/nt_exception.h b/include/ntapi/nt_exception.h
index 8465d7c..75bf361 100644
--- a/include/ntapi/nt_exception.h
+++ b/include/ntapi/nt_exception.h
@@ -5,9 +5,27 @@
#include "nt_object.h"
#include "nt_thread.h"
-/* limits */
+/* exception limits */
#define NT_EXCEPTION_MAX_PARAMS (0x0F)
+/* exception flags */
+#define NT_EXCEPTION_FLAG_NONCONTINUABLE (1 << 0)
+#define NT_EXCEPTION_FLAG_UNWINDING (1 << 1)
+#define NT_EXCEPTION_FLAG_EXIT_UNWIND (1 << 2)
+#define NT_EXCEPTION_FLAG_STACK_INVALID (1 << 3)
+#define NT_EXCEPTION_FLAG_NESTED_CALL (1 << 4)
+#define NT_EXCEPTION_FLAG_TARGET_UNWIND (1 << 5)
+#define NT_EXCEPTION_FLAG_COLLIDED_UNWIND (1 << 6)
+#define NT_EXCEPTION_FLAG_UNWIND ( NT_EXCEPTION_UNWINDING \
+ || NT_EXCEPTION_EXIT_UNWIND \
+ || NT_EXCEPTION_TARGET_UNWIND \
+ || NT_EXCEPTION_COLLIDED_UNWIND )
+
+/* exception definitions */
+typedef struct _nt_exception_record nt_exception_record;
+typedef struct _nt_dispatcher_context nt_dispatcher_context;
+typedef struct _nt_unwind_history_table nt_unwind_history_table;
+
typedef enum _nt_exception_disposition {
NT_EXCEPTION_CONTINUE_EXECUTION,
NT_EXCEPTION_CONTINUE_SEARCH,
@@ -24,6 +42,33 @@ typedef struct _nt_exception_record {
uintptr_t exception_information[NT_EXCEPTION_MAX_PARAMS];
} nt_exception_record;
+typedef struct _nt_runtime_function {
+ uint32_t raddr_fn_start;
+ uint32_t raddr_fn_end;
+ uint32_t raddr_uw_info;
+} nt_runtime_function;
+
+typedef nt_exception_disposition (*nt_exception_routine)(
+ nt_exception_record *,
+ uintptr_t,
+ nt_thread_context *,
+ nt_dispatcher_context *);
+
+typedef struct _nt_dispatcher_context {
+ uintptr_t control_pc;
+ uintptr_t image_base;
+ nt_runtime_function * fn_entry;
+ uintptr_t establisher_frame;
+ uintptr_t target_ip;
+ nt_thread_context * tctx;
+ nt_exception_routine language_handler;
+ void * handler_data;
+ nt_unwind_history_table * history_table;
+ uint32_t scope_index;
+ uint32_t __pad;
+} nt_dispatcher_context;
+
+/* exception interfaces */
typedef int32_t __stdcall ntapi_zw_raise_exception(
__in nt_exception_record * exception_record,
__in nt_thread_context * context,