/* INCLUDES ******************************************************************/
-#include <ndk/asm.h>
-.intel_syntax noprefix
+#include <asm.inc>
#define DISPOSITION_DISMISS 0
#define DISPOSITION_CONTINUE_SEARCH 1
#define DISPOSITION_COLLIDED_UNWIND 3
+#define EXCEPTION_EXIT_UNWIND 4
+#define EXCEPTION_UNWINDING 2
+
+
+EXTERN _RtlUnwind@16:PROC
+
/* GLOBALS *******************************************************************/
-.globl __global_unwind2
-.globl __local_unwind2
-.globl __abnormal_termination
-.globl __except_handler2
-.globl __except_handler3
+PUBLIC __global_unwind2
+PUBLIC __local_unwind2
+PUBLIC __abnormal_termination
+PUBLIC __except_handler2
+PUBLIC __except_handler3
/* FUNCTIONS *****************************************************************/
-.func unwind_handler
+.code
_unwind_handler:
/* Check if we were unwinding and continue search if not */
unwind_handler_return:
ret
-.endfunc
-.func _global_unwind2
+
__global_unwind2:
/* Create stack and save all registers */
mov esp, ebp
pop ebp
ret
-.endfunc
-.func _abnormal_termination
+
__abnormal_termination:
/* Assume false */
/* Return */
ab_return:
ret
-.endfunc
-.func _local_unwind2
+
__local_unwind2:
/* Save volatiles */
pop esi
pop ebx
ret
-.endfunc
-.func _except_handler2
+
__except_handler2:
/* Setup stack and save volatiles */
mov [ebx+12], eax
/* Call except handler */
- call [edi+ecx*4+8]
+ call dword ptr [edi+ecx*4+8]
except_continue2:
/* Reload try level and except again */
mov esp, ebp
pop ebp
ret
-.endfunc
-.func _except_handler3
+
__except_handler3:
/* Setup stack and save volatiles */
mov esp, ebp
pop ebp
ret
-.endfunc
+
+END