/* INCLUDES ******************************************************************/
-#include <ndk/asm.h>
-.intel_syntax noprefix
+#include <asm.inc>
+#include <ks386.inc>
+
+EXTERN _LdrpInit@12:PROC
+EXTERN _NtTestAlert@0:PROC
+EXTERN _RtlDispatchException@8:PROC
+EXTERN _RtlRaiseException@4:PROC
+EXTERN _RtlRaiseStatus@4:PROC
+EXTERN _ZwCallbackReturn@12:PROC
+EXTERN _ZwContinue@8:PROC
+EXTERN _ZwRaiseException@12:PROC
/* FUNCTIONS ****************************************************************/
+.code
-.func LdrInitializeThunk@16
-.globl _LdrInitializeThunk@16
+PUBLIC _LdrInitializeThunk@16
_LdrInitializeThunk@16:
/* Get the APC Context */
/* Jump into the C initialization routine */
jmp _LdrpInit@12
-.endfunc
-.func KiUserApcExceptionHandler
+
_KiUserApcExceptionHandler:
/* Put the exception record in ECX and check the Flags */
/* We'll execute handler */
mov eax, EXCEPTION_EXECUTE_HANDLER
ret 16
-.endfunc
-.func KiUserApcDispatcher@16
-.globl _KiUserApcDispatcher@16
+
+PUBLIC _KiUserApcDispatcher@16
_KiUserApcDispatcher@16:
/* Setup SEH stack */
call _RtlRaiseStatus@4
jmp StatusRaiseApc
ret 16
-.endfunc
-.func KiUserCallbackExceptionHandler
+
_KiUserCallbackExceptionHandler:
/* Put the exception record in ECX and check the Flags */
/* We'll execute the handler */
mov eax, EXCEPTION_EXECUTE_HANDLER
ret 16
-.endfunc
-.func KiUserCallbackDispatcher@12
-.globl _KiUserCallbackDispatcher@12
+
+PUBLIC _KiUserCallbackDispatcher@12
_KiUserCallbackDispatcher@12:
/* Setup SEH stack */
mov eax, [eax+PEB_KERNEL_CALLBACK_TABLE]
/* Call the routine */
- call [eax+edx*4]
+ call dword ptr [eax+edx*4]
/* Return from callback */
push eax
call _RtlRaiseStatus@4
jmp StatusRaise
ret 12
-.endfunc
-.func KiRaiseUserExceptionDispatcher@0
-.globl _KiRaiseUserExceptionDispatcher@0
+
+PUBLIC _KiRaiseUserExceptionDispatcher@0
_KiRaiseUserExceptionDispatcher@0:
/* Setup stack for EXCEPTION_RECORD */
mov esp, ebp
pop ebp
ret
-.endfunc
-.func KiUserExceptionDispatcher@8
-.globl _KiUserExceptionDispatcher@8
-_KiUserExceptionDispatcher@8:
+
+PUBLIC _KiUserExceptionDispatcher@8
+.PROC KiUserExceptionDispatcher@8
+ FPO 0, 0, 0, 0, 0, FRAME_FPO
/* Clear direction flag */
cld
push esp
call _RtlRaiseException@4
ret 8
-.endfunc
-.func KiIntSystemCall@0
-.globl _KiIntSystemCall@0
-_KiIntSystemCall@0:
+.ENDP KiUserExceptionDispatcher@8
+
+PUBLIC _KiIntSystemCall@0
+.PROC KiIntSystemCall@0
+ FPO 0, 0, 0, 0, 0, FRAME_FPO
/* Set stack in EDX and do the interrupt */
lea edx, [esp+8]
- int 0x2E
+ int HEX(2E)
/* Return to caller */
ret
-.endfunc
-.func KiFastSystemCall@0
-.globl _KiFastSystemCall@0
-_KiFastSystemCall@0:
+.ENDP KiIntSystemCall@0
+
+PUBLIC _KiFastSystemCall@0
+.PROC KiFastSystemCall@0
+ FPO 0, 0, 0, 0, 0, FRAME_FPO
/* Put ESP in EDX and do the SYSENTER */
mov edx, esp
sysenter
-.endfunc
-.func KiFastSystemCallRet@0
-.globl _KiFastSystemCallRet@0
-_KiFastSystemCallRet@0:
+.ENDP KiFastSystemCall@0
+
+PUBLIC _KiFastSystemCallRet@0
+.PROC KiFastSystemCallRet@0
+ FPO 0, 0, 0, 0, 0, FRAME_FPO
/* Just return to caller */
ret
-.endfunc
-.func RtlpGetStackLimits@8
-.globl _RtlpGetStackLimits@8
+.ENDP KiFastSystemCallRet@0
+
+PUBLIC _RtlpGetStackLimits@8
_RtlpGetStackLimits@8:
/* Get the stack limits */
/* return */
ret 8
-.endfunc
+
+END