/* INCLUDES ******************************************************************/\r
\r
#include <ndk/asm.h>\r
-#include <ndk/i386/segment.h>\r
.intel_syntax noprefix\r
\r
#define EXCEPTION_NONCONTINUABLE 1\r
#define EXCEPTION_UNWINDING 2\r
#define EXCEPTION_EXIT_UNWIND 4\r
-#define EXCEPTION_UNWIND (EXCEPTION_UNWINDING | EXCEPTION_EXIT_UNWIND)\r
+#define EXCEPTION_UNWIND (EXCEPTION_UNWINDING + EXCEPTION_EXIT_UNWIND)\r
\r
#define STATUS_CALLBACK_POP_STACK 0xC0000423\r
\r
sub esp, SIZEOF_EXCEPTION_RECORD\r
\r
/* Fill out the record */\r
- mov eax, [fs:TEB_SELECTOR]\r
+ mov eax, [fs:KPCR_TEB]\r
mov eax, [eax+TEB_EXCEPTION_CODE]\r
mov [esp+EXCEPTION_RECORD_EXCEPTION_CODE], eax\r
mov dword ptr [esp+EXCEPTION_RECORD_EXCEPTION_FLAGS], 0\r
mov ecx, [esp+4]\r
mov ebx, [esp]\r
\r
- /* Dispatch the exception */\r
+ /* Call the vectored exception handler */\r
push ecx\r
push ebx\r
+ call _RtlpExecuteVectoredExceptionHandlers@8\r
+\r
+ /* Check for success */\r
+ or al, al\r
+ jnz ContinueExecution\r
+\r
+ /* Dispatch the exception */\r
+ sub esp, 8\r
call _RtlDispatchException@8\r
\r
/* Check for success */\r
or al, al\r
jz RaiseException\r
\r
+ContinueExecution:\r
/* Pop off the records */\r
pop ebx\r
pop ecx\r